Jump to content
The simFlight Network Forums

Secondary condition


Recommended Posts

Hello.

I use a separate computer to either modify or design gauges for the FS. To reduce mouse and

keyboard control (carpel tunnel syndrome), I use a set of rotary encoders and push buttons. For

example, I don't have to use the mouse or keyboard to control the default GPS. Then I

made an "Item Selector" gauge to display the settings.

I was trying to set up a secondary Compound/(condition)/(check). The reason is not use a lua or

macro and have the ability to inc/dec.

attempted but a NO GO:
n=B66C3=1 B66C5=0 P1,0,C65638,0
also:
n=B66C3=1&B66C5=0 P1,0,C65638,0
also:
n=B66C3=1, B66C5=0 P1,0,C65638,0

also tried this to remove C1004's but NO GO (FSUIPC only accepted the first Control):
200=B66C3=0 CP(F+15,3)1,0,C1004,3843,C65638,0

So, below worked beautifully but too verbose. This set up is so that operations
are independent with limited rotary encoders. Any ideas? Thanks.

FSUIPC.ini, in part:

4=P1,8,Cx610066C5,x00050001 ;secondary condition dec
5=P1,9,Cx510066C5,x00050001 ;secondary condition inc
!1=;    gauge control
16=B66C5=1 P1,8,C1004,3840 ;panel clr
17=B66C5=1 P1,8,C1003,3841 ;gauge set
18=B66C5=1 P1,8,C1004,3842 ;button clr
19=B66C5=1 P1,8,C1004,3843 ;avionics clr
20=B66C5=1 P1,8,C1004,3844 ;atc clr
!1=;
21=B66C5=1 P1,9,C1004,3840 ;panel clr
22=B66C5=1 P1,9,C1003,3841 ;gauge set
23=B66C5=1 P1,9,C1004,3842 ;button clr
24=B66C5=1 P1,9,C1004,3843 ;avionics clr
25=B66C5=1 P1,9,C1004,3844 ;atc clr
!1=;   avionics control
36=B66C5=3 P1,8,C1004,3840 ;panel clr
37=B66C5=3 P1,8,C1004,3841 ;gauge clr
38=B66C5=3 P1,8,C1004,3842 ;button clr
39=B66C5=3 P1,8,C1003,3843 ;avionics set
40=B66C5=3 P1,8,C1004,3844 ;atc clr
!1=;
41=B66C5=3 P1,9,C1004,3840 ;panel clr
42=B66C5=3 P1,9,C1004,3841 ;gauge clr
43=B66C5=3 P1,9,C1004,3842 ;button clr
44=B66C5=3 P1,9,C1003,3843 ;avionics set
45=B66C5=3 P1,9,C1004,3844 ;atc clr
!1=;------- other counters ----------
122=P1,11,Cx510066C1,x00120001 ; gauge selector
123=P1,10,Cx610066C1,x00120001
124=P1,11,Cx510066C2,x00120001 ; button selector
125=P1,10,Cx610066C2,x00120001
126=P1,11,Cx510066C3,x00060001 ; avionics selector
127=P1,10,Cx610066C3,x00060001
128=P1,4,Cx610066C6,x000B0001 ; counter dec
129=P1,5,Cx510066C6,x000B0001 ; counter inc
!1-;
!1=; Avionics Control
200=B66C3=0 CP(F+15,3)1,0,C65638,0 ; COM1 frac dec
201=B66C3=0 CP(F+15,3)1,1,C65639,0 ; COM1 frac inc
202=B66C3=0 CP(F+15,3)1,2,C65636,0 ; COM1 whole dec
203=B66C3=0 CP(F+15,3)1,3,C65637,0 ; COM1 whole inc
204=B66C3=0 CP(F+15,3)1,16,C66372,0 ; COM1 swap
!1=;
206=B66C3=0 CP(F+15,3)1,4,C66438,0 ; COM2 frac dec
207=B66C3=0 CP(F+15,3)1,5,C66440,0 ; COM2 frac inc
208=B66C3=0 CP(F+15,3)1,6,C66436,0 ; COM2 whole dec
209=B66C3=0 CP(F+15,3)1,7,C66437,0 ; COM2 whole inc
210=B66C3=0 CP(F+15,3)1,17,C66444,0 ;COM2 swap
!1=;  etc.
!1=; Gauge control
250=B66C1=1 CP(F+15,1)1,0,C66299,0 ; autobrake dec
251=B66C1=1 CP(F+15,1)1,1,C66298,0 ; autobrake inc
252=B66C1=2 CP(F+15,1)1,0,C66322,0 ; DH dec
253=B66C1=2 CP(F+15,1)1,1,C66321,0 ; DH inc
254=B66C1=3 CP(F+15,1)1,0,C65662,0 ; OBS 1 dec
255=B66C1=3 CP(F+15,1)1,1,C65663,0 ; OBS 1 inc
256=B66C1=3 CP(F+15,1)1,2,C1026,0 ; OBS 1 dec fast
257=B66C1=3 CP(F+15,1)1,3,C1027,0 ; OBS 1 inc fast
!1=; etc.
!1=;Note that many controls are "self inc/dec"
!1=;
327=B66C3=2 CP(F+15,3)1,0,C66628,0 ;GPS PAGE DEC
328=B66C3=2 CP(F+15,3)1,1,C66627,0 ;GPS PAGE INC
329=B66C3=2 CP(F+15,3)1,2,C66626,0 ;GPS GROUP DEC
330=B66C3=2 CP(F+15,3)1,3,C66625,0 ;GPS GROUP INC
331=B66C3=2 CP(F+15,3)1,16,C66624,0 ;GPS CURSOR
!1=; just a bit faster rotary switch
332=B66C3=2 CP(F+15,3)1,13,C66628,0 ;GPS PAGE DEC
333=B66C3=2 CP(F+15,3)1,12,C66627,0 ;GPS PAGE INC
334=B66C3=2 CP(F+15,3)1,4,Cx610066C6,x000B0001 ;GPS/Audio SEL dec
335=B66C3=2 CP(F+15,3)1,5,Cx510066C6,x000B0001 ;GPS/Audio SEL inc
!1=;
!1=;these controls are toggle PB
!1=;
336=B66C6=0 CP(F+15,3)1,17,C66604,0 ;[NRST]
337=B66C6=1 CP(F+15,3)1,17,C66605,0 ;[OBS]
338=B66C6=2 CP(F+15,3)1,17,C66606,0 ;[MSG]
339=B66C6=3 CP(F+15,3)1,17,C66609,0 ;[FPL]
340=B66C6=4 CP(F+15,3)1,17,C66611,0 ;[TERR]
341=B66C6=5 CP(F+15,3)1,17,C66612,0 ;[PROC]
342=B66C6=6 CP(F+15,3)1,17,C66616,0 ;[ZOOMOUT]
343=B66C6=7 CP(F+15,3)1,17,C66615,0 ;[ZOOMIN]
344=B66C6=8 CP(F+15,3)1,17,C66617,0 ;[DTO]
345=B66C6=9 CP(F+15,3)1,17,C66618,0 ;[MSG]
346=B66C6=10 CP(F+15,3)1,17,C66619,0 ;[CLR]
347=B66C6=11 CP(F+15,3)1,17,C66623,0 ;[ENT]
!1=;
!1=; Gauge control
350=B66C1=1 CP(F+15,1)1,0,C66299,0 ; autobrake dec
351=B66C1=1 CP(F+15,1)1,1,C66298,0 ; autobrake inc
352=B66C1=2 CP(F+15,1)1,0,C66322,0 ; DH dec
353=B66C1=2 CP(F+15,1)1,1,C66321,0 ; DH inc
354=B66C1=3 CP(F+15,1)1,0,C65662,0 ; OBS 1 dec
355=B66C1=3 CP(F+15,1)1,1,C65663,0 ; OBS 1 inc
356=B66C1=3 CP(F+15,1)1,2,C1026,0 ; OBS 1 dec fast
357=B66C1=3 CP(F+15,1)1,3,C1027,0 ; OBS 1 inc fast
etc.
!1=;
430=B66C6=0 CP(F+15,3)1,18,C66463,0 ;Com1 Xmit
431=B66C6=1 CP(F+15,3)1,18,C66464,0 ;Com2 Xmit
432=B66C6=2 CP(F+15,3)1,18,C66465,0 ;Com1/2 Recv tog
433=B66C6=3 CP(F+15,3)1,18,C65842,0 ;Nav1 ID
434=B66C6=4 CP(F+15,3)1,18,C65843,0 ;Nav2 ID
435=B66C6=5 CP(F+15,3)1,18,C66477,0 ;MKR ID
436=B66C6=6 CP(F+15,3)1,18,C65844,0 ;Dme1 ID
437=B66C6=7 CP(F+15,3)1,18,C65845,0 ;Dme2 ID
438=B66C6=8 CP(F+15,3)1,18,C65846,0 ;Adf1 ID
439=B66C6=9 CP(F+15,3)1,18,C66559,0 ;Adf2 ID

A picture of the item selector gauge is attached. Wherever the blue light is (66C5), those are the parameters that are controlled.

 

FS9_rotary_encoders.PNG

Link to comment
Share on other sites

I've moved your SUPPORT message out of "User Contributions" subforum (which is a reference place) to here, the support forum. Please alsways post questions here, NOT to the references sub-forums where they may be missed.

10 hours ago, gr8guitar said:

attempted but a NO GO:
n=B66C3=1 B66C5=0 P1,0,C65638,0
also:
n=B66C3=1&B66C5=0 P1,0,C65638,0
also:
n=B66C3=1, B66C5=0 P1,0,C65638,0

Only one Offset condition is possible. You could combine them into on Word by using 66C3 and 66C4 instead, then W66C3=1 would work.

10 hours ago, gr8guitar said:

also tried this to remove C1004's but NO GO (FSUIPC only accepted the first Control):
200=B66C3=0 CP(F+15,3)1,0,C1004,3843,C65638,0

One control per line! Just split that into two lines, both with the same conditions.

10 hours ago, gr8guitar said:

below worked beautifully but too verbose.

Too verbose for what? You or the computer? The computer doesn't care, so why do you?

If you want a neater approach to programming things for FSUIPC, use a Lua plug-in. That's what they are for, to enable you to do things not possible or not easy with rather arcane parmeter lists.

Pete

 

Link to comment
Share on other sites

Hello. Thank you for your reply and putting this inquiry in the proper place. You stated:

Only one Offset condition is possible. You could combine them into on Word by using 66C3 and 66C4 instead, then W66C3=1 would work.

How does one do that?

And you stated:

Too verbose for what? You or the computer? The computer doesn't care, so why do you? And... If you want a neater approach to programming things for FSUIPC, use a Lua plug-in. That's what they are for, to enable you to do things not possible or not easy with rather arcane parmeter lists.

1) Yes, too verbose for me. I care to reduce typing (wrist issues, etc.) and have a cleaner code, if it's possible. 2) I am using lua's and macros as well but I really try to use FSUIPC.ini as much as possible to keep "things" in one place. The main reason, and as  you can see I do a lot of comments, is when I go back several weeks, months, even years, I can recall the mind-set/logic of what I was attempting to do. If I can have the code in one place, I don't have to go to two more files to re-think.

As for response to your other answers, thank you. I can at least know what is allowed, or not allowed.

Link to comment
Share on other sites

59 minutes ago, gr8guitar said:

Hello. Thank you for your reply and putting this inquiry in the proper place. You stated:

Only one Offset condition is possible. You could combine them into on Word by using 66C3 and 66C4 instead, then W66C3=1 would work.

How does one do that?

A "Word" is 16 bits, so occupying two bytes. "W66C3" covers 66C3 and 66C4. The byte in 66C3 represents untis (0-255) whilst the next byte is 'worth' 256 times that, so a 1 in 66C4 would have to be represented as 256 which you would add to the value you want in 66C3. But in your examples you are only testing for 66C5 = 0, so just changing your use of 66C5 to 66C4 and the 'B' to a 'W' would work fine.

Quote

Yes, too verbose for me. I care to reduce typing (wrist issues, etc.)

But you seem to have already done it, so why throw it away? After all, you did say it worked well.

Quote

I am using lua's and macros as well but I really try to use FSUIPC.ini as much as possible to keep "things" in one place.

Lua plug-ins ARE processed by FSUIPC and are in the same place as your Macros.

Quote

The main reason, and as  you can see I do a lot of comments, is when I go back several weeks, months, even years, I can recall the mind-set/logic of what I was attempting to do.

Lua programming can be almost self-explanatory with careful naming of variables and functions, so less commenting is needed.

Quite honestly I wouldn't have implemented anything but simple conditional programming for button assignments if I'd thought of implementing the plug-in facilities first. Most things above a certain level of complexity make much more sense in a proper script. The sort of button programming you are doing needs commenting mainly because the formatting is so strict and the notations arcane.

Pete

Link to comment
Share on other sites

Hello. You wrote:

A "Word" is 16 bits, so occupying two bytes. "W66C3" covers 66C3 and 66C4.

So... if I am understanding this correctly, instead of stating B66C3 and B66C4, I can use W66C3 that covers 66C3 and 66C4; if correct, great to know, thank you. As I mentioned above, I do use lua's and macros - but only if I don't have a choice. I thank you that you did implement conditional programming in FSUIPC. I'm not sure why but I'm still not comfortable with lua's, even though I do see its advantages. Again, thank you for your time and information.

Link to comment
Share on other sites

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.