Jump to content
Sign in to follow this  
Guest HC001ST - Stick

Extending Variable duration with a timer ????

Recommended Posts

Guest Skymed

Here is the problem:I have an L:var,enum used to drive a digital readout but it is presenting the information too fast.In other words, on a digital gauge it takes about 5 seconds to display the L:var,enum from 0-15, and I want it to take at least 12-15 seconds to display the same information. Any hints??Steve

Share this post


Link to post
Share on other sites
Guest HC001ST - Stick

Skymed,In an early version of one XML gauge, I used this technique:

  <Element>	<Position X="49" Y="48.875"/>	<Image Name="oil_pressure_needle.bmp" PointsTo="South">	  <Axis X="4" Y="15.875"/>	</Image>	<Rotate>	  <Value Minimum="0" Maximum="120">(A:Eng1 oil pressure,PSI)</Value>	  <Failures>		 <SYSTEM_ENGINE Action="0"/>	  </Failures>	  <Nonlinearity>		 <Item Value="0" X="27" Y="70"/>		 <Item Value="20" X="17" Y="49"/>		 <Item Value="40" X="27" Y="28"/>		 <Item Value="60" X="48" Y="18"/>		 <Item Value="80" X="70" Y="27"/>		 <Item Value="100" X="79" Y="49"/>		 <Item Value="120" X="70" Y="70"/>	  </Nonlinearity>	  <Delay DegreesPerSecond="180"/>	</Rotate>  </Element>

would make the above no longer "instantly responsive to change", but only allow the "needle" to move a maximum of 2 degrees per second. Having said this, you must still realize that the underlying value has changed. This is why simulating a complete system is so much more complex then this, if you want to create 100% realism.

Share this post


Link to post
Share on other sites
Guest Skymed

StickExcellent pointsDrawback is I need a digital readout, therefore the degrees delay is a non starter. I was thinking of using a time constant to adjust the speed of the readout......in other words, make the readout unchanged, just make it slower according to a pre-set time constant. I.E. if the present time to show full value is 5 seconds, multiply that by a factor of time to increase it to 12 seconds??I cannot simply half the value and allow a longer time as the value then remains half of what it should be regardless of the time.Steve

Share this post


Link to post
Share on other sites
Guest ghost84

Hi Steve,You could try following:First, make a little Timer in a seperate gauge, e.g.: (L:Timer,bool) ! (>L:Timer,bool) With the variable "Update Freuqency" you can control the time interrval, in which the variable L:Timer will change its state.Now you can use this code in your gauge (where L:Output is the displayed value, and A:Input is the value you want to delay):(L:Output,number) (A:Input,number) < (L:Timer,bool) 1 == && (G:Var1) 0 == && if{ 1 (>G:Var1) (L:Output,number) 1 + (>L:Output,number) } (L:Timer,bool) 0 == if{ 0 (>G:Var1) } Try it, i think it will work, although it is untested.... :-)regards,Franz

Share this post


Link to post
Share on other sites
Guest HC001ST - Stick

Yeah, sorry, forgot not a needle.Well, the speed is relate to the underlying var. Create your own var, and use that rather than the FS var to control the readout.Alternatively, control the var in the .air file, by modifing the relevant table that is controling it.

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