Jump to content
Sign in to follow this  
Guest pwdodds

Fake Magneto Gauge

Recommended Posts

Guest pwdodds

I am helping build an Autogyro, but becuase FS cannot make a powerless rotor, we are having to fake it by using a jet engine with no controls - driven by invisible XML gauges. However, the thrust engine has to be a jet engine also because FS will not allow mixed engine types. But it is in fact a recip engine, so we have magnetos. In the following code, I can get the mags to switch (they don't actually do anything) but I want to pass out the parameter L:MagnetoStatus,enum, so that the starter switch will read this value and not start the engine if that variable is set to zero (both mags off). I have a temporay test gauge to rwad the values and display them, and the (L:LeftMag, bool) and (L:RightMag, bool) values are toggling correctly, but the resultant value of 0, 1, 2 or 3 in L:MagnetoStatus,enum (depending on which mags are switched) is not being passed out of the statement. the line is aonly a test line at the moment to check the value of L:MagnetoStatus,enum.Can someone help, please - I have spent several nights reading up on RPN and trying things out.PeterThis gauge is used on turbine engines which are pretending to be reciprocating engines(L:MagnetoStatus,enum) (L:RightMag,bool) 2 * + (L:LeftMag,bool) + %((L:MagnetoStatus,enum))%!1d! (L:LeftMag,bool) ! (>L:LeftMag,bool)(L:RightMag,bool) ! (>L:RightMag,bool)

Share this post


Link to post
Share on other sites

Hi,This should work:(L:RightMag,bool) 2 * (L:LeftMag,bool) + d (>L:MagnetoStatus,enum)Also there is no need to use Minimum and Maximum flags because you are controlling the range by code.Tom

Share this post


Link to post
Share on other sites
Guest pwdodds

It does indeed. It's probably just as well that you are where you are, or I would hug you! :)It has also improved my knowledge of the use of d - existing documentation that I found didn't indicate that it pulls the value off the stack and makes it available for further operations. (I am assuming that's what it does) I don't understand though, why (L:RightMag,bool) 2 * (L:LeftMag,bool) + (>L:MagnetoStatus,enum), whilest putting the calculated value into L:MagnetoStatus correctly doesn't fulfil the criteria for the statements.Peter

Share this post


Link to post
Share on other sites

Peter,""It has also improved my knowledge of the use of d - existingdocumentation that I found didn't indicate that it pulls thevalue off the stack and makes it available for furtheroperations. (I am assuming that's what it does)""Actually what d does is duplicate the last value on the stack.""I don't understand though, why (L:RightMag,bool) 2 * (L:LeftMag,bool) + (>L:MagnetoStatus,enum), whilest putting the calculated value into L:MagnetoStatus correctly doesn'tfulfil the criteria for the statements.""Did you check whether those bitmaps are really present in the gauge's .cab or folder in use by the panel?Tom

Share this post


Link to post
Share on other sites
Guest pwdodds

>Did you check whether those bitmaps are really present in the>gauge's .cab or folder in use by the panel?Oh yes. I created the bitmaps (simple switches side by side) and could get them to switch properly on clicking if I set the condition as (L:Rightmag,bool) 2 * (L:LeftMag,bool) + but that didn't pass out the MagnetoStatus value for my starter button gauge to find and use.Peter

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