Sign in to follow this  
Guest

Inc or dec a value by 10 steps

Recommended Posts

Hi All,I'm still working on my TMS and have another problem with the mouseclicks. Is it possible to inc or dec a L: value with the mouse in 10 steps?(L:TMS_TGT_Set, percent) 900 > if{ quit } els{ (L:TMS_TGT_Set, percent) ++ (>L:TMS_TGT_Set, percent) }(L:TMS_TGT_Set, percent) 000 < if{ quit } els{ (L:TMS_TGT_Set, percent) -- (>L:TMS_TGT_Set, percent) }The above example works very good but it increases or decreases the value just step by step. This is very drudgingly and your finger doze off if you want to select a value of 480 or 650 for example. It's not necessary here to select values of 482 or 655. Would be great if I could inc or dec the value in 10 Steps (450, 460, 470.....). Hope you can tell me how to do this.Best RegardsMatthias

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Matthias,You could try :(L:TMS_TGT_Set, percent) 900 > if{ quit } els{ (L:TMS_TGT_Set, percent) 10 + (>L:TMS_TGT_Set, percent) }(L:TMS_TGT_Set, percent) 000 < if{ quit } els{ (L:TMS_TGT_Set, percent) 10 - (>L:TMS_TGT_Set, percent) }When the gauge is first loaded it will have a value of zero placed at (L:TMS_TGT_Set, percent) so using the buttons will always give you an even 10s.Another way to do this is using a Click drag function using the Y axis in the click spot to adjust the amount of increase or decrease with Min Max values. ( Very usefull for setting speed bugs ) The higher up on the click spot will give you inc/dec by 1s, the lower or as you drag lower on the click spot will give you inc/dec by 10s. You would just need a "Click spot" large enough so it can be done easily.(* Decrease *)(M:Y) 1 max 10 min s1 + (L:TMS_TGT_Set, percent) 000 < if{ quit } els{ (L:TMS_TGT_Set, percent) l1 - (>L:TMS_TGT_Set, percent) }(* Increase *)(M:Y) 1 max 10 min s1 + (L:TMS_TGT_Set, percent) 000 < if{ quit } els{ (L:TMS_TGT_Set, percent) l1 + (>L:TMS_TGT_Set, percent) }Hope this helps...Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Hi Eugen and Roman,Thank you very much for your help. Roman, the code you gave me works perfect. I'm sure the click spot is not large enough for the Click Drag funktion. However the code is very useful for some other Gauges I do.Something OT: At the moment I'm writing this answer my neighbour losts his first tiles from the roof and the first trees were root out by the storm. What a weather. Nevertheless I see some aircraft flying. Seems to be calmer in 30000 feet :-)Best RegardsMatthias

Share this post


Link to post
Share on other sites

I heard the weather forecast and we are getting the bad weather as well probably tomorrow, last week we actuallt had a lot of snow in the southern parts of Sweden, we are definitely heading for winter.BrgdsEugen

Share this post


Link to post
Share on other sites

I expected to see timers in use here from Roman, I think he was the one who put me onto that track in the first place :)I've seen Mattias's code, so I guess you are able to rewrite the following as needed just fine.So here are a couple of examples, exploiting timers.(P:Absolute Time,seconds) (L:Temp Timer,seconds) < if{ (A:NAV1 OBS,degrees) d 10.0 < if{ 350.0 + } els{ 10 - } (>K:VOR1_SET) (P:Absolute time,seconds) 0.1 + (>L:Temp Timer,seconds) } els{ 0 (>K:VOR1_OBI_DEC) (P:Absolute time,seconds) 0.1 + (>L:Temp Timer,seconds) }This one will "wrap around" an OBS setting, in tens if the clicks are "close enough" as during click repeats.(L:EHSI right knob,degrees) 2 + (>L:EHSI right knob,degrees) (P:Absolute Time,seconds) (L:Temp Timer,seconds) < if{ (L:Holdmode,enum) 0 == if{ (A:Autopilot heading lock dir, degrees) } els{ (L:Hold entry,degrees) } d 350.0 > if{ 350.0 - } els{ 10 + } (L:Holdmode,enum) 0 == if{ (>K:HEADING_BUG_SET) } els{ (>L:Hold entry,degrees) } (P:Absolute time,seconds) 0.1 + (>L:Temp Timer,seconds) } els{ (L:Holdmode,enum) 0 == if{ 0 (>K:HEADING_BUG_INC) } els{ (L:Hold entry,degrees) 1 + (>L:Hold entry,degrees) } (P:Absolute time,seconds) 0.1 + (>L:Temp Timer,seconds) }This one has the added feature of a mode selector (L:Holdmode,enum) determining what is supposed to be changed during the clicks. You'll have a knob that can do several things. Often quite useful.Works for me anyway.Edit: Huh, pasting in directly from notepad still wouldn't get me & g t and the like over > signs?...

Share this post


Link to post
Share on other sites

Karl, I posted something on this yesterday but had it removed due to the current news and such... But basically it stated...A timer ???? What is that ???? :-lol Thanks for the kind words, sarcastic or not... and ...Thanx for the snippets, goin to take a day or 2 to figure out what you're tryin to do.... :-lol But any snippet is a good one as long as you may get something out of it. Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Hehe, no sarcasm, at least not in a bad way :DWhat I'm doing is checking a knob on my EHSI if normal or hold calculator is supposed to show (L:Holdmode,enum). It has three modes:0 - Normal EHSI display (OBS, Heading info and so on).1 - Right hand hold patterns (Showing only relevant holding info)2 - Left hand hold patternsThe actual display checks with simple tags on the same parameter.With the code I check which mode is active; if mode 0 then the switch will increase one parameter, else it will increase another parameter. In addition, it uses timers to determine if the increase should be in ones or tens.

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