Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Pete,

I remember reading in a post awhile ago that it is possible to write a Lua plug-in that would check the position of switches and send the correct values to the simulator. I am interested in doing just that; however I have no idea how to go about it. My set-up consists of FS9.1, FSUIPC 3.912, WideClient 6.7, the latest builds of pmSystems, GC, MCP, and CDU, and numerous GF modules which control pmSystesm 737 overhead. I am also using GFGisplay 1.24 to control displays on the GF modules. Would it be possible to have a Lua plugin read the switch positions on the GF modules and send the correct information to pmSystems? If so, were do I start?

Jim

Posted
Would it be possible to have a Lua plugin read the switch positions on the GF modules and send the correct information to pmSystems?

It's possible, of course, but why do you think it is needed? pmSystems has offsets for everything. You can program the switches and buttons directly in FSUIPC's Buttons tab using the Offset controls. Any systems programming can and should be done in pmSystems logic files.

Please explain why you want to do extra programming above what is done in pmSystems, and why this wouldn't be better off-loaded to pmSystems logics.

Now, if you were NOT using pmSystems, you could instead probably program most of the complex subsystems using Lua. That is another matter altogether, and requires more knowledge about the subsystems logics than is does about Lua. For Lua programming there are several very good books around, plus the stuff on their website. All FSUIPC does is add special libraries for interacting with FS, buttons, keys etc.

Regards

Pete

Posted

Pete,

Thanks for the prompt reply, as always. My thinking on this issue is that I want something that can detect my current switch positions and then relay this information to pmSystems.

You can program the switches and buttons directly in FSUIPC's Buttons tab using the Offset controls.

I already have done this successfully. What I want to happen is, say for example, I inadvertently forget to turn off a fuel pump, or some other switch, at the end of a flight. The next time I start up FS, I want this to get detected and sent to pmSystems. I believe that pmSystems has the ability to do this with phidgits hardware, however I do not think that it can be done through pmSystems with Go-Flight Hardware.

Jim

Posted

I already have done this successfully. What I want to happen is, say for example, I inadvertently forget to turn off a fuel pump, or some other switch, at the end of a flight. The next time I start up FS, I want this to get detected and sent to pmSystems. I believe that pmSystems has the ability to do this with phidgits hardware, however I do not think that it can be done through pmSystems with Go-Flight Hardware.

Ah. I think the problem here is more that, like many hardware implementations, there's no information about the switch position provided until it has changed. At least, I think that is the case. Certainly the Lua facilities don't have any more access to the switches than FSUIPC -- they are using it directly after all.

Looking at my code for GoFlight, it uses a call-back system from GFDev.dll (the GoFlight driver) to receive notifications of changes. I doubt that the GoFlight driver sends any "initial state" information, which is what you'd need.

There may be a polling method for the switches implemented in GFDev.dll which could be used to get the initial state. I don't know offhand. I'm not able to access any GoFlight dox at present (I can't find them on this PC -- I may have to re-download the SDK to find out). However, it would be a non-trivial task to add something to get this information even if it were possible.

I face the same problem with my PFC cockpit -- I can only read most of the overhead switches when they change. So, on my checklist, before anything else, I have a "run through switches, check all set correctly" item. I think this is pretty realistic in any case -- i.e. good practice.

I note that the 747 and most other modern Boeing cockpits use mostly push buttons, so toggle switch states are much less of as problem.

Regards

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.