Jump to content
Sign in to follow this  
Guest Karl R Pettersen

Select, Case: insted of = to, something like < or > or ...

Recommended Posts

Hi every one:Is possible to use in the Select , Case clausules, insteed of Case="0" somethig in the middle, mi proyect is to recreate the LE device for the flaps son in the transits it is nesessary to show different background something like:(A:Trailing edge flaps0 left angle, degrees) (A:Trailing edge flaps0 right angle, degrees) (A:Trailing edge flaps1 left angle, degrees) (A:Trailing edge flaps1 right angle, degrees) max max maxThe problem is when the angle is >0.1 and <0.99 it has to show "Background_transit1.bmp".In Angle >=1 and <=5 show "Background_intermediate.bmp"If angle >5.01 <9.99 show "Background_transit2.bmp"finnaly if bigger than 10 show "Background_full.bmp"Thanks to all for the helpHelio Alberto Regalado Moreira

Share this post


Link to post
Share on other sites

Hi,You could take another value:FLAPS HANDLE INDEXFLAPS HANDLE PERCENTFLAPS NUM HANDLE POSITIONSAnd try the something like this, not tested!: (Flap value,...) 0 > (Flap value,...) 1 < && (Flap value,...) 1 > (Flap value,...) 5 < &&etc.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Sorry,This is probably better: (Flap handle index,number) 0 > (Flap handle index,number) 1 < &&etc.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi,Home again i see my code for leading and trailing edge flaps: (A:FLAPS HANDLE INDEX, number) 0 > (A:FLAPS HANDLE INDEX, number) 2 < &&LE FLAPS (A:FLAPS HANDLE INDEX, number) 0 > (A:FLAPS HANDLE INDEX, number) 2 < &&TRANSIT (A:FLAPS HANDLE INDEX, number) 2 >=LE FLAPS (A:FLAPS HANDLE INDEX, number) 2 >= EXT (A:FLAPS HANDLE INDEX, number) 1 > (A:FLAPS HANDLE INDEX, number) 3 < &&TE FLAPS (A:FLAPS HANDLE INDEX, number) 1 > (A:FLAPS HANDLE INDEX, number) 3 < && EXT (A:FLAPS HANDLE INDEX, number) 2 >TE FLAPS (A:FLAPS HANDLE INDEX, number) 2 > EXT Of course you can alter the numbers (depends of flap positions in the aircraft.cfg) and use bitmaps instead of text or an other variable.But these are working codes.Hope you can do something with it.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Karl R Pettersen

Without having a solution ready , I would suggest getting rid of vast amounts of visible checks and/or elements. I *think* the more checks you can do in a single line, trying to get to the "most common" situation as quickly as possible, is more friendly on the frames than setting up many many visible checks. Visible checks are easier to code, but I tend to merge them (if relevant of course), just commenting the visibles for later reference; when the value checks/setup gets too complex too follow they can come in handy.I.e. it is possible (and legal?) to use two boolean values to generate a uservariable of number type. Bool1 Bool2 2 * + would give a range between 0-3.But, as for solution; does the Baron's gear gauges do something similar?

Share this post


Link to post
Share on other sites

Karl,Can you give us an example of what you mean with "merging"?Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Karl R Pettersen

Here is a couple. The first one uses the the direct result on a transponder dimmed/nondimmed interrogation light, while the second prepares the register0 (s0 l0) for the actual checking:(A:PARTIAL PANEL TRANSPONDER1,bool) !(L:TRANSPONDER MODE, enum) 2 == (L:TRANSPONDER MODE, enum) 3 == || (P:Absolute time, seconds) sin 0.6 > (P:Absolute time, seconds) (L:Xpdrtimer,seconds) < || && (L:TRANSPONDER MODE, enum) 4 == (P:Absolute time, seconds) (L:Xpdrtimer,seconds) < && || (A:Light panel,bool) (L:local_sun_angle,number) 10.4 > || 2 * +Arggh, I couldn't find the other version, but here is a quick mockup of what I mean. Not tested though. Two versions, very similar. I don't like embedded quits though, since they can cause hard-to-find bugs if the code gets nasty. Also, I'm not sure if the stack needs to be cleared or if fs9 handles this automatically. In certain other programming languages this would have produced a stack overflow or similar error after a while.(A:Flaps handle index,number) d d0 == if{ 0 s0 }d 1 >= r 4 < && if{ 1 s0 }4 >= if{ 2 s0 }l0(A:Flaps handle index,number) d d0 == if{ 0 quit }d 1 >= r 4 < && if{ 1 quit }4 >= if{ 2 }Then the select tag after this.

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