spokes2112 Posted November 19, 2019 Report Share Posted November 19, 2019 Hello Pete and / or John. This is an idea, maybe for the future? ( too late now for FSX) This seems it would be very helpful for those working on a sim cockpit. An optional passing 3rd parameter on "event.Lvar". Have been working on a project for a friend where ~226 l:vars needed to be assigned to offsets so that mobiflight/arduino can use them for the cockpit. Mainly these are indicator lamps and the like - not updated/changed repetitively. All done with it and seen there was quite a bit of repetition. (~215 semi-repetitive functions) Thinking this would save (big time) on lua memory usage, writing of the script, and possibly quicker loading of the lua. Would something like this work? If it could work, any downsides? Of course tested it with grand hopes, but alas..... ---------------------------------------------------------------------------------------- local poll_spd = 300 function write2ub (varname, value, offset) ipc.writeUB(offset, value) end function write2uw (varname, value, offset) ipc.writeUW(offset, value) end -- etc... event.Lvar("lvar#1", poll_spd, "write2ub", 0x####) event.Lvar("lvar#2", poll_spd, "write2ub", 0x####) -- thru event.Lvar("lvar#225", poll_spd, "write2uw", 0x####) event.Lvar("lvar#226", poll_spd, "write2uw", 0x####) ---------------------------------------------------------------------------------------- Again, just an idea. Regards, Roman Link to comment Share on other sites More sharing options...
Pete Dowson Posted November 19, 2019 Report Share Posted November 19, 2019 36 minutes ago, spokes2112 said: This is an idea, maybe for the future? ( too late now for FSX) This seems it would be very helpful for those working on a sim cockpit. An optional passing 3rd parameter on "event.Lvar". At first reading it seems a pretty easy option to add, yes. I'll take a look at the code. John's away at present but I'm sure he would also be favourable towards this, possibly for the next release of FSUIPC5 (for which we can't currently give a date). Pete Link to comment Share on other sites More sharing options...
John Dowson Posted November 20, 2019 Report Share Posted November 20, 2019 Hi Ramon, Yep, looks useful and pretty simple to add so I'll schedule for the next release. I'll post you a dll to test when done. Cheers, John Link to comment Share on other sites More sharing options...
Pete Dowson Posted November 21, 2019 Report Share Posted November 21, 2019 17 hours ago, John Dowson said: Yep, looks useful and pretty simple to add so I'll schedule for the next release. I'll post you a dll to test when done. Hi Roman, Please see the PM I've just sent. Pete 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now