• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Gauge Switch-On Delay

Messages
2
Country
italy
Good morning everyone,

I am actually trying to add a delay on a simple gauge (a digital clock):

deags1.png


This gauge is activated by the following variable on the visibility:

(A:ELECTRICAL MASTER BATTERY, bool) 1 ==

Now, when I activate the master switch, this gauge turns on immediately but I would like a delay of half a second or so, to make it more realistic. I am not able to do it so I ask your help, please.

Alex
 
This "should" work although not tested. To adjust the delay time change the number "13". 18 = 1 second.

Code:
<Gauge Name="my gauge" Version="1.0">
<Image Name="my background image.bmp"/>

<Macro Name="BATT">(A:ELECTRICAL MASTER BATTERY, bool)</Macro>
<Macro Name="G1">G:Var1</Macro>

<Update>
@BATT ! (@G1) 0 != and if{ 0 (>@G1) }
@BATT (@G1) 0 == and if{ 13 (>@G1) }
@BATT (@G1) 1 &gt; and if{ (@G1) -- (>@G1) }
</Update>

<Element Name="my display elements">
<Visible>@BATT (@G1) 1 == and</Visible>
<Element Name="isolated string element(s)"> 

... my display code ..

</Element>
</Element>

... more element(s) if there ...

</Gauge>
 
Last edited:
Something like this:

Code:
  (A:ELECTRICAL MASTER BATTERY, bool)  (L:PreviousMasterBattery,bool) ! &amp;&amp;
  if{ (P:ABSOLUTE TIME,seconds) (&gt;L:Timer,number) }
  (A:ELECTRICAL MASTER BATTERY, bool)  (&gt;L:PreviousMasterBattery,bool)
  (P:ABSOLUTE TIME,seconds) (L:Timer,number) 0.5 &gt; (A:ELECTRICAL MASTER BATTERY, bool) &amp;&amp;
  if{ ...........

So:
- When the battery switch goes from Off to On, L:Timer var is set to the current time
- When time become 0.5 higher then L:Timer and master battery still on, the combined condition becomes true.

Rob

Edit: Roman just beat me ..LoL
 
I tried to put your code as a visibility variable but it doesn't seem to work. I am doing something wrong for sure...
Of course, when used as Visibility tag, you should leave out the if...... line.

Anyway, maybe the code is usefull for something else.
Romans solution works fine too.

Rob
 
Back
Top