March 20, 200620 yr 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)
March 20, 200620 yr 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
March 20, 200620 yr 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
March 20, 200620 yr 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
March 20, 200620 yr >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
Create an account or sign in to comment