Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Extending Variable duration with a timer ????

Featured Replies

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

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.

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

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

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.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.