Jump to content
Sign in to follow this  
Guest ThurstonHowell

Cycling through gauge displays with single button

Recommended Posts

Guest ThurstonHowell

I am new to gauge programming and have a bit of a bonehead question. I am not sure what the best approach to cycling through the display of data when a gauge has only a single button. If it has a dial then it is pretty simple to put in left and right mouse areas that increase or decrease the (L: GAUGE_DISPLAY_MODE, enum), and then stop at the lowest or highest case setting.In this situation though I am having a bit of failure of imagination. With the single button, I want each button press to cycle through one of four cases/modes (0 through 3). And when it gets to the fourth case, clicking again should cycle back to the lowest case/mode.This is what I have so far:

<Click>(L:GAUGE MODE SELECT, enum) 1 + (>L:GAUGE MODE SELECT, enum) (L:GAUGE SELECT, enum) 3 > if{ 3 (>L:GAUGE MODE SELECT, enum) }</Click>

What else do I have to cram in there to get it to reset to Case 0 once it's hit Case 3?

Share this post


Link to post
Share on other sites
<Click>(L:GAUGE MODE SELECT, enum) 1 + (>L:GAUGE MODE SELECT, enum) (L:GAUGE SELECT, enum) 3 > if{ 3 (>L:GAUGE MODE SELECT, enum) }</Click>

What else do I have to cram in there to get it to reset to Case 0 once it's hit Case 3?

Hi,Just that...Now you have this function in place:
(L:GAUGE SELECT, enum) 3 > if{ 3 (>L:GAUGE MODE SELECT, enum) }

if you correct the first name to L:Gauge MODE Select, enum :( , this sets the gauge mode select to 3 if its value gets over 3.Maybe you should try setting it to zero or one, depending on how your display is dependant on the value of L:gauge mode select, enum.

(L:GAUGE MODE SELECT, enum) 3 > if{ 0 (>L:GAUGE MODE SELECT, enum) }

hope this helpsgrtWillem

Share this post


Link to post
Share on other sites
Guest ThurstonHowell

I guess it helps not to have syntax errors in there, too, eh? :( Thanks, this is terrific.

Share this post


Link to post
Share on other sites
I guess it helps not to have syntax errors in there, too, eh? :(
Ah well,you were very much on the right track! :( And sometimes it's the obvious you don't see....grtWillem.

Share this post


Link to post
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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...