Jump to content
The simFlight Network Forums

USER offset Value as Parameter for Control


Recommended Posts

Hi Pete,

Thanks for your wonderfull program.

I have a (maybe dumb) question.

In my FSUIPC.ini make use of the Cyclic Byte Increment and decrement functions to incr/decr. user offset, which i then use as conditions in Button assignments.

But is it not possible to send the Value of this offset directly in FSUIPC.ini as parameter to the control assigned to a button press instead of using it as a condition which would save a lot of lines in my .ini file because i make extensive use of it. Also I don't like using LUA scripts, seems to me that this is at the cost of Performance (one more thing to load and execute).
Fastest way is directly in the button assignment in my humble opinion.

As example:

350=CP(+64,4)(+Y,8)(+Y,16)Y,2,Cx510066C0,x00070001     -{offset byte cyclic inc, offset 66C0 (Incr=1, Limit=7)}-
351=CP(+64,4)(+Y,8)(+Y,16)Y,3,Cx610066C0,x00070001     -{offset byte cyclic dec, offset 66C0 (Decr=1, Limit=7)}-
352=B66C0=0 CP(+64,4)(+Y,8)(+Y,16)Y,2,C69993,0     -{Custom control: <69993>}-   ;EFIS ND Scale
353=B66C0=0 CP(+64,4)(+Y,8)(+Y,16)Y,2,C70049,0     -{Custom control: <70049>}-
.....
366=B66C0=7 CP(+64,4)(+Y,8)(+Y,16)Y,2,C69993,7     -{Custom control: <69993>}-
367=B66C0=7 CP(+64,4)(+Y,8)(+Y,16)Y,2,C70049,7     -{Custom control: <70049>}-
368=B66C0=0 CP(+64,4)(+Y,8)(+Y,16)Y,3,C69993,0     -{Custom control: <69993>}-
369=B66C0=0 CP(+64,4)(+Y,8)(+Y,16)Y,3,C70049,0     -{Custom control: <70049>}-
.......
382=B66C0=7 CP(+64,4)(+Y,8)(+Y,16)Y,3,C69993,7     -{Custom control: <69993>}-
383=B66C0=7 CP(+64,4)(+Y,8)(+Y,16)Y,3,C70049,7     -{Custom control: <70049>}-

Wouldn't it be nice to replace it with:
350=CP(+64,4)(+Y,8)(+Y,16)Y,2,Cx510066C0,x00070001     -{offset byte cyclic inc, offset 66C0 (Incr=1, Limit=7)}-
351=CP(+64,4)(+Y,8)(+Y,16)Y,3,Cx610066C0,x00070001     -{offset byte cyclic dec, offset 66C0 (Decr=1, Limit=7)}-
352=CP(+64,4)(+Y,8)(+Y,16)Y,2,C69993,<VALUE OF B66C0>     -{Custom control: <69993>}-   ;EFIS ND Scale
353=CP(+64,4)(+Y,8)(+Y,16)Y,3,C69993,<VALUE OF B66C0>     -{Custom control: <69993>}-

Hope you can help me out here.

Thanks anyway for your time and great program!

Edited by LeoSchoonbroodt
Link to comment
Share on other sites

1 hour ago, LeoSchoonbroodt said:

But is it not possible to send the Value of this offset directly in FSUIPC.ini as parameter to the control assigned to a button press

No: you are correct. No such facility exists.

1 hour ago, LeoSchoonbroodt said:

As example:

You are inrementing or decrementing 66C0 between 0 and 7 but only using value 0 and 7? Why not just have t toggline between 0 and 1?

1 hour ago, LeoSchoonbroodt said:

Wouldn't it be nice to replace it with:

No, not in my opinion. I wish I hadn't added any button programming features to the INI as it is, without making it even more complicated and arcane. I added the Lua plug-in facilities specifically to avoid all that complication. what you want to do would be far cleaner and easy to understand in a simple plug-in.

Pete

 

Link to comment
Share on other sites

Hi Pete,

 inrementing or decrementing 66C0 between 0 and 7 but only using value 0 and 7? Why not just have t toggline between 0 and 1?

No, i am using all the values for Incrementing and decrementing the Scale of the ND Display as you can see from the linenumbers, I just didn't want to clutter the post with all these lines.

Doesn't loading and executing a Lua plugin cost extra performance? The PMDG 737 eats already a lot of the performance of my system.

 

Anyway thanks for your time, maybe i will start experimenting with Lua.

Link to comment
Share on other sites

3 minutes ago, LeoSchoonbroodt said:

Doesn't loading and executing a Lua plugin cost extra performance?

No. If anything, because the plug-ins run in their own, separate, threads (not in the main thread like your Button programming), it would tend to be less. And you can have plug-ins loaded once (eg via an [Auto] entry in the INI, of using ipcReady.lua to load them), and just responding to events just like the button assignments. Of course it can be easier just to assign a Lua to a button so it loads and unloads then, but considering there's a limit on how quickly you can press buttons that's pretty neglibible too.

Pete

 

Link to comment
Share on other sites

26 minutes ago, LeoSchoonbroodt said:

But think many examples can be found on Internet.

For FSUIPC application mostly it's just library function calls, so the Lua package supplied in your FSUIPC Documents folder should be the biggest help -- there are a lot of examples there too. And check some of the threads in "User Contributions" subforum too.

Pete

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.