• 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 whats missing here

Messages
13
Country
us-texas
Hi, I've downloaded this gauge which is supposed to simulate a davtron M3 clock/timer and I can't get the flight timer to work. The elapsed time works.

<Gauge Name="Davtron 803" Version="1.0">
<Image Name="M803.bmp" Luminous="Yes"/>

<Element>
<Position X="48" Y="93" />
<Visible>(A:Circuit General Panel on,bool)</Visible>
<Image Name="DD.bmp" Bright="Yes" />

<Element>
<Position X="40" Y="-2" />
<Visible>(A:Circuit General Panel on,bool)</Visible>
<Text X="225" Y="87" Length="7" Font="arial" Color="#0D0E0C" Bold="Yes" Italic="Yes" >
<String>%((G:Var9) 1 == )%{if}T %((A:Ambient Temperature, celsius) 1.8 * 32 + )%!2d!°F
%{else}%((G:Var9) 2 == )%{if}T %((A:Ambient Temperature, celsius))%!2d!°C
%{else}%((A:Electrical main bus voltage, volts))%!3.1f! V%{end}</String>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
</Text>
</Element>


<Element>
<Position X="93" Y="74" />
<Text X="300" Y="90" Length="6" Font="arial" Color="#0D0E0C" >
<String>%((G:Var1) 0 == )%{if}%((P:Local time,hours) flr 24 % )%!02d!:%((P:Zulu time,minutes) flr 60 %)%!02d!

%{else}%((G:Var1) 3 == )%{if}%((P:Zulu time,hours) flr 24 % )%!02d!:%((P:Zulu time,minutes) flr 60 %)%!02d!

%{else}%((G:Var1) 1 == )%{if}%(
(G:Var7) 0 &lt; if{ (G:Var7) 24 + (&gt;G:Var7) }
(G:Var8) 0 &lt; if{ (G:Var8) 60 + (&gt;G:Var8) }
(G:Var7))%!02d!:%((G:Var8))%!02d!

%{else}%( (P:Absolute time,seconds) (&gt;G:Var6)
(G:Var2) 0 == if{ (G:Var6) (&gt;G:Var4) (G:Var6) (&gt;G:Var5) }
(G:Var2) 1 == if{ (G:Var6) (&gt;G:Var5) }
(G:Var2) 2 == if{ }
(G:Var5) (G:Var4) - 3600 &lt; )%{if}%((G:Var5) (G:Var4) - 60 / flr 60 % )%!02d!:%( (G:Var5) (G:Var4) - flr 60 % )%!02d!%{else}%((G:Var5) (G:Var4) - 3600 / flr int)%!02d!:%((G:Var5) (G:Var4) - 60 / flr 60 % )%!02d!%{end}

%{end </String>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
</Text>
</Element>

<Element>
<Position X="0" Y="0" />
<Visible>(G:Var1) 1 != (G:Var7) 60 * (G:Var8) + 0 &gt; &amp;&amp; </Visible>
<Select>
<Value>(P:Zulu time,hours) 60 * (G:Var7) 60 * (G:Var8) + &gt; if{ (P:Absolute time,seconds) 1 % } </Value>
<Case Value="1">
<Image Name="DZ.bmp" Bright="Yes" />
</Case>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
</Select>
</Element>

<Element>
<Position X="0" Y="73" />
<Visible>(A:Circuit General Panel on,bool)</Visible>
<Select>
<Value>(G:Var1, enum)</Value>
<Case Value="0">
<Image Name="DL.bmp" Bright="Yes" />
</Case>
<Case Value="1">
<Image Name="DF.bmp" Bright="Yes" />
</Case>
<Case Value="2">
<Image Name="DE.bmp" Bright="Yes" />
</Case>
<Case Value="3">
<Image Name="DU.bmp" Bright="Yes" />
</Case>
</Select>
</Element>

</Element>

<Mouse>

<Area Left="168" Top ="18" Right="208" Bottom="58" >
<Tooltip ID="">OAT - V</Tooltip>
<Cursor Type="Hand" />
<Click>(G:Var9) 1 + 3 % (&gt;G:Var9)</Click>
</Area>

<Area Left="100" Top ="293" Right="150" Bottom="346" >
<Tooltip ID="">Select</Tooltip>
<Cursor Type="Hand" />
<Click>(G:Var1) 1 + 4 % (&gt;G:Var1)</Click>
</Area>

<Area Left="225" Top ="293" Right="275" Bottom="346" >
<Tooltip ID="">Control</Tooltip>
<Cursor Type="Hand" />
<Click>(G:Var1) 1 == if{ 0 (&gt;G:Var7) 0 (&gt;G:Var8) } (G:Var1) 2 == if{ (G:Var2) 1 + 3 % (&gt;G:Var2) } </Click>
</Area>


<Area Left="134" Top ="180" Right="178" Bottom="240" >
<Cursor Type="DownArrow" />
<Click>(G:Var1) 1 == if{ (G:Var7) 1 - 24 % (&gt;G:Var7) } </Click>
</Area>

<Area Left="178" Top ="180" Right="219" Bottom="240" >
<Cursor Type="UpArrow" />
<Click>(G:Var1) 1 == if{ (G:Var7) 1 + 24 % (&gt;G:Var7) } </Click>
</Area>

<Area Left="219" Top ="180" Right="275" Bottom="240" >
<Cursor Type="DownArrow" />
<Click>(G:Var1) 1 == if{ (G:Var8) 1 - 60 % (&gt;G:Var8) } </Click>
</Area>

<Area Left="275" Top ="180" Right="319" Bottom="240" >
<Cursor Type="UpArrow" />
<Click>(G:Var1) 1 == if{ (G:Var8) 1 + 60 % (&gt;G:Var8) } </Click>
</Area>

</Mouse>

</Gauge>


What I was wanting was a timer the would start automatically and I found one that starts when GS gets above 35 knots. I tried to copy and paste the following into this gauge but I couldn't get it to work.

<Value>(E:ZULU TIME, seconds) 60 / (>L:TNOW, minutes)
(A:AIRSPEED INDICATED, knots) 35 &lt; if{ (L:TNOW, minutes) (>L:TONG, minutes) }

(A:AIRSPEED INDICATED, knots) 35 &gt; if{ (L:TNOW, minutes) (L:TTHEN, minutes) - abs 10 &gt; if{ (L:TNOW, minutes) (L:TTHEN, minutes) - (L:TONG, minutes) + (>L:TONG, minutes) } }
(A:AIRSPEED INDICATED, knots) 35 &gt; if{ (L:TNOW, minutes) (L:TONG, minutes) - (>L:TDISP, minutes) }
(L:TNOW, minutes) (>L:TTHEN, minutes)

Does anyone have any ideas what I'm doing wrong?
Mark
 
Last edited:
Where did you paste the new code into the existing gauge?

I don't see any connection between the existing code and the new code.
The existing code uses a set of G:vars while the new code uses some L:vars.

Code:
01 (E:ZULU TIME, seconds) 60 / (>L:TNOW, minutes)
02 (A:AIRSPEED INDICATED, knots) 35 &lt; if{ (L:TNOW, minutes) (>L:TONG, minutes) }
03 
04 (A:AIRSPEED INDICATED, knots) 35 &gt; if{ (L:TNOW, minutes) (L:TTHEN, minutes) - abs 10 &gt; if{ (L:TNOW, minutes) (L:TTHEN, minutes) - (L:TONG, minutes) + (>L:TONG, minutes) } }
05 (A:AIRSPEED INDICATED, knots) 35 &gt; if{ (L:TNOW, minutes) (L:TONG, minutes) - (>L:TDISP, minutes) }
06 (L:TNOW, minutes) (>L:TTHEN, minutes)

Lines 01 and 06 are clear, you get the current time and at the end save it to the previous time.
What does the L:TONG, minutes var do?
It looks like you use it to log the last time that IAS was below 35 knots.
Line 05 then stores the period between L:TONG and L:TNOW in L:TDISP.
I assume that L:TDISP will be used in a display element?

But you also use L:TONG on line 04 to store the sum of all consecutive differences between L:TNOW and L:TTHEN.
But the second if{} on line 04 will only run if the difference between the current and the previous time is more than 10 minutes.
But your gauge will be re-evaluated many times per second so the diference will never be more than 10 minutes. So it will never run.



I would try this:

Code:
[COLOR="Blue"]<Element>[/COLOR]
[COLOR="SeaGreen"]<!-- variables
L:M803_TimeAccum, seconds
L:M803_TimeRef, seconds
L:M803_Prev, bool
L:M803_Cur, bool
-->[/COLOR]
[COLOR="Blue"]<Visible>[/COLOR](L:M803_ModeFT, bool)[COLOR="Blue"]</Visible>[/COLOR]
[COLOR="SeaGreen"]<!-- display this -->[/COLOR]
[COLOR="Blue"]<Value>[/COLOR]
(L:M803_Cur, bool) (>L:M803_Prev, bool)
(A:AIRSPEED INDICATED, knots) 34 &gt; (>L:M803_Cur, bool)

[COLOR="SeaGreen"]<!-- condition became false -->[/COLOR]
(L:M803_Prev, bool)   (L:M803_Cur, bool) ! &amp;&amp; if{ (P:ABSOLUTE TIME, seconds) (L:M803_TimeRef, seconds) - (L:M803_TimeAccum, seconds) + (>L:M803_TimeAccum, seconds) }
[COLOR="SeaGreen"]<!-- condition was and is false -->[/COLOR]
(L:M803_Prev, bool) ! (L:M803_Cur, bool) ! &amp;&amp; if{ (P:ABSOLUTE TIME, seconds) (>L:M803_TimeRef, seconds) }

(P:ABSOLUTE TIME, seconds) (L:M803_TimeRef, seconds) - (L:M803_TimeAccum, seconds) +
[COLOR="Blue"]</Value>[/COLOR]

[COLOR="SeaGreen"]<!-- the rest of the element here -->[/COLOR]

[COLOR="Blue"]</Element>[/COLOR]
 
Last edited:
Back
Top