Airbuspilot
-
Posts
128 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by Airbuspilot
-
-
Sorry, but i have to come back for a Solution of this Problem:
Tried the Workflow with your Advise for the Auto Section in the Fsuipc ini File. I did'nt get it to work correct. So, i try now with Macros. Everything went okay, except from the following Problem, i can't solve by myself. Would be very glad, if you have a Solution.
That is the Code in FlightLog.lua, that involves the B777PowerUp.lua
if ipc.get("B777PowerOn") == "N" then
ipc.macro("Lua:B777PowerUp")
endThe Code in the B777PowerUp.lua works fine, except for the last Function of the DualJetwaySwitch (Key) on the CDU.
Can someone please have a Look at it? Thank you.
-
That is the Problem. I have to do Compare OPs, to avoid LUA Errors on arithmetic OPs or dividing by Zero Errors.
So, when reading the Initial Fuel Data from the File, i got the calculated Fuel for the Flight and can do all further Calculations with this Value.
This Problem occurs only with the PMDG777. So i think, i had find a Solution, that i will try this Morning. Hope, it works.
Have a nice Sunday and thanks for your Answer.
-
I am back again with a Question.
Read and Assign of the Data from the File will work fine.
But, these are FuelData and have to be numerics, because i have to do further Calculations with them.
When i run the Lua, this Error occurs:112422 *** LUA Error: D:\Simulatoren\Fliegen\P3Dv32\Modules\FlightLog.lua:163: attempt to compare number with string
Is it possible, to read out the Data from the File as Numerics? And if so, how have i to do it.? Thanks in Advance for your Help.
-
Hope, i solved it by myself. There was a malformed Typing in Variablen.lua, which stopped the Module from running.
It seems, that after the Module had stopped, no one of the Variables were visible in other Modules, even if the Mistake was very late in the Module.
Now i will code all the needed Modules. If i encounter any further Problems, i would appreciate, if you could help again.
Again, special Thanks for your outstanding Support.
-
In Variablen.lua i set it with
ipc.set("KiloPoundFaktor", 0.453592)
In FlightLog.lua, i will receive it with
KPF = ipc.get("KiloPoundFaktor")
This also leads to the LUA-Error with a nil Value in KPF.
Seems, that i do something wrong, or that it is not possible, to make Variables outside the Modules visible.
If anybody had some further Ideas, i would highly appreciate them.
-
Thanks for your outstanding Support. I will try it out and see, if it will work.
-
Thanks for your outstanding Support. I will try it tomorrow and hope, it will work. Hope, i can find an Example, how to use it exactly.
-
i saw that Post, but did not understand the Lua-Code for decoding the String.
Are Frequencies not all in the same Length? My FuelFields could vary in their Length. Could this be handled with your Code?
-
Hmmm, that seems not to work. Or maybe i am doing it wrong.
I have build the Variablen.lua File, that holds all Variables, needed to operate my FlightLog.lua. In this File, there is an Entry declared global KiloPoundFaktor = 0.453592
Made the necessary Entry in FSUIPC.ini
[Auto.B772]
1=Lua Variablenand
[LuaFiles]
1=FlightLog
2=log lvars
3=record to csv
4=LvarsToTxt
5=VariablenBut it seems, that the declared Variables are not "visible" for other Modules. Because running the FlightLog.lua leeds to this Error
363672 *** LUA Error: D:\Simulatoren\Fliegen\P3Dv32\Modules\FlightLog.lua:174: attempt to perform arithmetic on global 'KiloPoundFaktor' (a nil value)
It makes also no Difference, if i declare that Variable as global or not. Everytime the same Error occurs. Any Idea to solve this?
-
Thanks for your Reply.
The Value comes from an external Program (MS Access) and will be saved in B777FuelQty.txt. It is the only Entry in this File.
Now i will read this with
file = io.open("B777FuelQty.txt","r")InitialFuelQty = file:read()
file:close()
Let's say, the FileEntry is 15000. Is the above Code enough to assign 15000 in the File to the Variable InitialFuelQty in LUA?
If so, how do i read more Entrys in a File, i.E. Line by Line or comma separated?
-
Hello together, ist's me again. :-)
With LUA we are able to write Data into a TextFile. But, is it also possible to read Data from a TextFile and assign the getted Value to a Variable? If it is possible, is there an Example, how to code it in LUA? Thanks in Avance again for your Answers.
Joachim
-
aaah, okay and thanks for your Response. I will try it out.
-
And i wondered, why the Search for the word keypress didn't show a Match.
Thank you very, very much for your Help.
-
Hi Thomas,
thanks for your Reply.
Yes, the ASCII Table works fine for Characters and Numerics. But the Special Keys are not listed.
In Petes Documents there is i.E. the ALT-Key described with the Numeric Code 16. Shift and Ctrl are listed with 1 and 2. These Codes doesn? t correspond with the ASCII Code Table. F-Keys are also not described in ASCII or Extended ASCII Tables. So, i asked for a Collection especially for LUA accepted Codes.
Joachim
-
First of all, thanks for your Reply.
If this works for me too, that was pretty easy.
If i understand that right, you have separate Lua Files created, they were named i.E. B777captain.lua?
But, what is the "Connector" between [Auto.B777] and the separate Files? Do i have to make special Entrys in each File?
-
Hello together,
is there a List, where all the LUA accepted KeyCodes are listed in one File? Especially the F-Keys, like F1, F2, etc..
Thanks in Advance for your Answers
Joachim
-
On 02.10.2016 at 8:34 PM, Pete Dowson said:
I did say you might need to research elsewhere to get the right parameters. I know that some of the controls use a sort of "mouse status mask" as a parameter -- one which indicates whether left, right or middle button has been clicked, usually. I'm afraid I don't know much more about that, but I'm sure others must have worked things out so best to ask around.
You could look further into that .h file too, to see if the answers are buried there.. The older 737NGX one I have contains these:
#define MOUSE_FLAG_RIGHTSINGLE 0x80000000
#define MOUSE_FLAG_MIDDLESINGLE 0x40000000
#define MOUSE_FLAG_LEFTSINGLE 0x20000000
#define MOUSE_FLAG_RIGHTDOUBLE 0x10000000
#define MOUSE_FLAG_MIDDLEDOUBLE 0x08000000
#define MOUSE_FLAG_LEFTDOUBLE 0x04000000
#define MOUSE_FLAG_RIGHTDRAG 0x02000000
#define MOUSE_FLAG_MIDDLEDRAG 0x01000000
#define MOUSE_FLAG_LEFTDRAG 0x00800000
#define MOUSE_FLAG_MOVE 0x00400000
#define MOUSE_FLAG_DOWN_REPEAT 0x00200000
#define MOUSE_FLAG_RIGHTRELEASE 0x00080000
#define MOUSE_FLAG_MIDDLERELEASE 0x00040000
#define MOUSE_FLAG_LEFTRELEASE 0x00020000
#define MOUSE_FLAG_WHEEL_FLIP 0x00010000 // invert direction of mouse wheel
#define MOUSE_FLAG_WHEEL_SKIP 0x00008000 // look at next 2 rect for mouse wheel commands
#define MOUSE_FLAG_WHEEL_UP 0x00004000
#define MOUSE_FLAG_WHEEL_DOWN 0x00002000
You can use those, as they stand, as parameters. e.g 0x20000000 for single left click.Look at the actual aircraft on screen. when you operate a switch is it one click for off, or left, and another for on or right? This might give you a clue.
Nothing wrong with asking, and I only close topics if folks start becoming offensive. Why are you regretting asking? I'm trying to help as much as I can with a product I don't know. Maybe the PMDG forum would be more suitable?
I don't think any such thing. You asked how to calculate the addition of two numbers, and I asked if in fact you really didn't know, because I did not believe you wouldn't know! Hence my surprise you asked!
You do read a lot which isn't there, don't you!? :-(
Pete
No, normally, i do not read somethings, that are'nt there. But please understand my Point of View. When i ask for a Solution of a Problem, i did all i can before asking. I was very angry, when reading your Comment, if i am unable to add two Numbers. Let's calm down and forget it.
Meanwhile, i solved this Problem. The Value to open a Door on the PMDG772 is 100. The Values, i tried, were much to small to make the Doors Movement visible.
Joachim
-
Hello together, again i have a Question. As we all know, have different Aircraft their different Needs. My actual Module blows up and grows bigger and bigger.
I think, it is Time, to outsource the Aircraft Specific Code in separate Lua-Files for each Plane.
So i want to build a Lua File as MainControl. This Module will call a Module, that holds all the needed global Variables in one Place and makes them visual for all following Steps.
Then the MainControl reads the Aircraft Data from the Sim and decicdes, which Module for the specific Aircraft has to be called.
For better understanding (i hope), i have made a WorkFlowSchema, that is attached.
My Question now is, if this is possible. Also i need to know, how to call them. Do i have to call or is it enough to call them with the function() Command?
Please keep in Mind, that i would create a separate for each Aircraft.
Thanks in Advance for your Answers.
Joachim
-
Don't need a Calculator to calculate it. Did it with my Brain and composed it to ipc.control(83656,1) The only Thing here is, that this did'nt have any Effect. Also trying with ,0 and ,2 and ,3 and ,4 and at least with ,5. Without any Success.
So, i thought, i had to calculate an other Way, i.E. by calculating in Hex or any other Prorammers Calculations. That's the Reason, why i asked.
Sorry for asking. I will try to find Solutions in other Forums. You can close this Topic.
Last but not least, i am not that dumb, that you maybe Think.
-
I know, how to use the ipc.control. With this one ipc.control(66695,1), i operate the Jetway, if there is one and the Aircraft is a Passenger Jet.
What i don't know, is how to compute the stated Number?
Maybe somebody could help me, to put this Information, token from the 777 SDK, together to a ipc.control Command?
#define THIRD_PARTY_EVENT_ID_MIN 0x00011000 // equals to 69632
and
#define EVT_DOOR_CARGO_MAIN (THIRD_PARTY_EVENT_ID_MIN + 14024)
Thanks in Advance to anybody, who will help.
Joachim
-
Yes, there is something similar in the 777X SDK Folder. Unfortunally, i don't know, how to put this in a LUA Code, similar to my above given Example. Do you have a Hint for me please, how to realize i.E. (THIRD_PARTY_EVENT_ID_MIN + 14005) in a LUA-Code Line?
Thanks in Advance
Joachim
-
Hello Pete,
thanks for your fast Reply. Afaik, yes. Only the Entry1L could be opened with the FS Door Toggle. Especially on the Freighter the Main Cargo Door could'nt be operated by FS Door Toggle Commands. Seems, this is only possible over the Menu key in the CDU.
Here is my Lua Code, that should open the Main Cargo Door.
DoorStateCM = ipc.readLvar("L:7X7XmaincargoDoor")
if DoorStateCM == 0 then
ipc.writeLvar("L:7X7XmaincargoDoor", 100)
end
If i execute this, the Door will flicker between open and Close. Do you have any Idea, what is wrong with that Code? Thanks again for your Help.Joachim
-
Hello there,
need a little Help or a Code Example for opening Doors on the PMDG 777X only by LUA-Script. I don't want to use Keys or Buttons to do that.
In Example, the MainEntry1L should be opened, at the Moment, the GSX Stairway Car is placed. Could anbody please help, solving this Issue? Only the Code for opening the Door is needed. I am familiar with the Readout of GSX LVARS.
Thanks in Advance
Joachim
-
Hello Folks,
again i will ask for a little Help.
With those Lines of Code
Monat, Tag = ipc.readStruct(0x0244, "2SB")
Jahr = ipc.readSW(0x024A)
Flugdatum = (string.format("%02d.%02d.%02d", Tag, Monat, Jahr))
Try to read out the Local Date Values. For Month and Year this works fine. But the Day doesn't fit the Day of the actual Date.
Tried some other ReadValues like "2UW", "2UB", "2SW". It leads all to the same Result. Month and Year are correct, Day is not.
I would be very glad, if someone could help. Thanks in Advance.
Joachim
Lua Files to call
in FSUIPC Support Pete Dowson Modules
Posted
okay, thanks for the fast Response. I will try it this Way and see, if it brings the Healing. :-)