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

FS2004 Stall warn test light missing!

Messages
1,468
Country
italy
I have two gauges. The first clicks on-plays the stall warning claxon-clicks off. The second is a stall warning light that is intended to come on for the duration of the test.
As usual I have it wrong. I can't get the logic to work. Your corrections most appreciated. The stall light L variable (L:STALL WARN TEST LIGHT,number) is not shown in the first gauge. Only the second. Help much appreciated.
vololiberista
Code:
<Gauge Name="Stall Warning Test" Version="1.0">
   <Element>
      <Select>
         <Value>(L:STALL WARN,number)</Value>
         <Case Value="0">
            <Image Name="STALL_WARN_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="STALL_WARN_ON.bmp"/>
         </Case>
      </Select>
   </Element>
//--------------
<Element>
      <Select>
         <Value>(G:Var1) 0 &gt; if{ (G:Var1) 1 - (&gt;G:Var1) (G:Var1) 0 == if{ 0 (&gt;L:STALL WARN,number) } }</Value>
      </Select>
   </Element>
//--------------
 <Mouse>
      <Tooltip>Stall Warn Test</Tooltip>
      <Cursor Type="Hand"/>
      <Click Repeat="Yes">1 (&gt;L:STALL WARN,number) 85 (&gt;G:Var1)   1 (>L:Sound_stall2,enum)</Click>
   </Mouse>
</Gauge>
Code:
<Gauge Name="stall warn light" Version="1.0">
   <Element>
      <Select>
         <Value>
     (L:STALL WARN TEST LIGHT,number) &gt;
     (L:STALL WARN,number)
     and
</Value>
         <Case Value="0">
            <Image Name="AMBER_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="AMBER_ON.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element> 
</Gauge>
 
(L:STALL WARN TEST LIGHT,number) n &gt; <=== needs a number to compare

If (L:STALL WARN TEST LIGHT,number) is not set anywhere then it will always be zero so the and will not give any output.

If the lamp is on only when the switch is on then the code is the same as for the switch.

Regards, Ted.
 
Hi,

Code:
         <Value>
     (L:STALL WARN TEST LIGHT,number) &gt;
     (L:STALL WARN,number)
     and
</Value>

What did you have in mind for the function of this piece of code?
As Ted already mentioned, you have a greater than function there but there is no comparative value.
Also i'm not sure what the "and" is supposed to do.

Here's a trick i use most of the time:
Just try to write down in pseudo code what you are trying to achieve and then translate that to XML, it is all really very logical... :banghead:

For instance some (practically not very usefull but fun as an excersise) code in pseudo code:
if (L:Var1) is greater than (L:Var2) then stuff a value of 10 into (L:Var 3) and also reset (L:Var1) to 0, else add 1 to (L:Var1).

In essence it will keep adding 1 to L:Var1 until it is bigger than L:Var2, after which L:Var3 will get a value of 10 and L:Var1 is reset to 0.

In XML this would be:
Code:
(L:Var1,enum) (L:Var2,enum) &gt; 
if{ 10 (&gt;LVar3,enum) 0 (&gt;L:Var1,enum) } 
els{ (L:Var1,enum) 1+ (&gt;L:Var1,enum) }

Just to give you an idea what i meant by pseudo code vs real code. :stirthepo

Hope this helps a bit.
grt
Willem
 
Last edited:
If I don't have the "and" the light stays on. Whereas the light is timed to go out by the control gauge. The problem seems to be in the control gauge in that the switch which I want to self cancel when the sound finishes doesn't do that.
I'm trying to combine the effects of two existing gauges. One: that I turn on-it plays a sound-then it turns itself off. Two: a switch that illuminates a light (another gauge) for a specified period of time (however this switch stays in the on position-I can't get it to change to off). So in other words what I'm trying for is a gauge that I click to "on"-it plays a sound/at the same time sends to a second gauge a command to light for a specified period of time-when the sound is finished the first gauge is to turn itself off (i.e. I don't click it off).
vololiberista
 
Back
Top