• 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 Engine fire test lights

Messages
1,468
Country
italy
I have the coding for the lights to come on for a few seconds and then extinguish. However, how do have the stwitch on one panel and the lights on another. For example the switch on the O'head and the lights on the main.
Both visible at the same time.


I have more or less resolved the above. However How can I control two light from one switch?
I have a different L var for each light but I want both lights to be operated by one switch
voliberista
 
Last edited:
Hi
use a custom L:var ...for example
The test switch, can be located anywhere
Code:
<Gauge Name="Test" Version="1.0">
<Element>
<Select>
<Value>(L:TEST,bool)</Value>
<Case Value="0">
<Image Name="switchoff.bmp" />
</Case>
<Case Value="1">
<Image Name="switchon.bmp"/>
</Case>
</Select>
</Element>
<mouse>
<Tooltip>Caution Lights Test</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:TEST,bool) }
(M:Event) 'Leave' scmp 0 == if{ 0 (&gt;L:TEST,bool) } </Click>
</mouse>
</Gauge>

And the separate warning panel
Code:
<Gauge Name="Annunciator panel" Version="1.0">
<Image Name="antback.bmp" ImageSizes="128,106" Luminous="Yes"/>
	<Element>
<Position X="2" Y="2" />
      <Select>
		<Value>(A:GENERAL ENG1 OIL PRESSURE, psi) 15 &lt;  (L:TEST,bool) || </Value>
      <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
      </Failures>  
         <Case Value="1">
            <Image Name="anoil.bmp" Bright="Yes"/>
         </Case>
      </Select>
	</Element>		
</Gauge>
Ive used the OR (||)for the test bool <Value>(A:GENERAL ENG1 OIL PRESSURE, psi) 15 &lt; (L:TEST,bool) || </Value>
so in the example above..engine oil pressure less than 15psi OR test.bool then show
Wozza
 
Thanksk for that. I'll try out your suggestions. In the mean time these are the codes that I'm trying to modify.

The first does nothing except moving the switch to "on and "off".
Code:
 <Element>
      <Select>
         <Value>(G:Var1)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp" ImageSizes="33,58"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp" ImageSizes="33,58"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Compass Light</Tooltip>
      <Cursor Type="Hand"/>
	<Click>(G:Var1) 0 != if{ 0 (&gt;G:Var1) } els{ 1 (&gt;G:Var1) }</Click>
   </Mouse>
</Gauge>

The second is an engine fire test switch which rings a bell for a short period. This I have modified to show lights on for said period.

Code:
<Gauge Name="Engine 1 Fire Test" Version="1.0">
   <Element>
      <Select>
         <Value>(L:ENG 1 FIRE TEST,number)</Value>
         <Case Value="0">
            <Image Name="SWITCH_111_A_ON.bmp" ImageSizes="30,38"/>
         </Case>
         <Case Value="1">
            <Image Name="SWITCH_111_A_OFF.bmp" ImageSizes="30,38"/>
         </Case>
      </Select>
   </Element>
//--------------
   <Element>
      <Select>
         <Value>(G:Var1) 0 &gt; if{ (G:Var1) 1 - (&gt;G:Var1) (G:Var1) 0 == if{ 0 (&gt;L:ENG 1 FIRE TEST,number) } }</Value>
      </Select>
   </Element>
//--------------
   <Mouse>
      <Tooltip>Engine 1 Fire Test</Tooltip>
      <Cursor Type="Hand"/>
      <Click Repeat="Yes">1 (&gt;L:ENG 1 FIRE TEST,number) 15 (&gt;G:Var1)   1 (>L:Sound_Fire,enum)</Click>
   </Mouse>
</Gauge>

You can see that the switch turns itself on or off. The coding below is for the two test warning lights. What I really want is to operate both of those lights with a single switch that stays in the on position. The lights coming on briefly only when the switch is turned on.

Code:
<Gauge Name="Horizon Comparator" Version="1.0">
   <Element>
      <Select>
         <Value>(L:ENG 5 FIRE TEST,number)</Value>
         <Case Value="0">
            <Image Name="AMBER_OFF.bmp"  Bright="Yes" ImageSizes="30,38"/>
         </Case>
         <Case Value="1">
            <Image Name="AMBER_ON.bmp" ImageSizes="30,38"/>
         </Case>
      </Select>
   </Element>
//--------------
   <Element>
      <Select>
         <Value>(G:Var1) 0 &gt; if{ (G:Var1) 1 - (&gt;G:Var1) (G:Var1) 0 == if{ 0 (&gt;L:ENG 5 FIRE TEST,number) } }</Value>
      </Select>
   </Element>
//--------------
   <Mouse>
      <Tooltip>Comparator Warning</Tooltip>
      <Cursor Type="Hand"/>
      <Click Repeat="Yes">1 (&gt;L:ENG 5 FIRE TEST,number) 25 (&gt;G:Var1)</Click>
   </Mouse>
</Gauge>

Code:
<Gauge Name="Compass Comparator" Version="1.0">
   <Element>
      <Select>
         <Value>(L:ENG 6 FIRE TEST,number)</Value>
         <Case Value="0">
            <Image Name="AMBER_OFF.bmp"  Bright="Yes" ImageSizes="30,38"/>
         </Case>
         <Case Value="1">
            <Image Name="AMBER_ON.bmp" ImageSizes="30,38"/>
         </Case>
      </Select>
   </Element>
//--------------
   <Element>
      <Select>
         <Value>(G:Var1) 0 &gt; if{ (G:Var1) 1 - (&gt;G:Var1) (G:Var1) 0 == if{ 0 (&gt;L:ENG 6 FIRE TEST,number) } }</Value>
      </Select>
   </Element>
//--------------
   <Mouse>
      <Tooltip>Comparator Warning</Tooltip>
      <Cursor Type="Hand"/>
      <Click Repeat="Yes">1 (&gt;L:ENG 6 FIRE TEST,number) 45 (&gt;G:Var1)</Click>
   </Mouse>
</Gauge>

The lights work when individually and separately clicked. It is this that I want to change for a single switch for both.

vololiberista
 
Hi
It because your using G:vars, they only communicate between elements in a single gauge and will not communicate their state between separate gauges,where as L:vars will
 
That is correct...

In general terms, do not use "G:vars" at all unless there is some compelling reason to do so.
 
Thanks for your advice but simply replacing the G:vars with L:vars doesn't seem to work!!!
I'm getting strange responses (probably due to incorrect coding!!)

e.g.
1.Clicking the switch does nothing
2.But clicking the lights instead makes them come on together and go off together and makes the switch move up and down or disappear.
The lights seem to control the switch and not vice versa

This is the sequence of events I want to happen:-
1. the switch is in the off position / The two comparator lights (separate gauges) are always unlit
2. The switch is clicked into the on position (remaining in that position until clicked again to go off / When the switch is clicked to the on position both lights are briefly lit. (the time lit is different for each light).

You further help would be much appreciated.
vololiberista
 
Did you remember to add "units" to your L:vars?

(L:variable,unit) is the prototype...

(L:SwitchPosition,enum) is acceptable

(L:SwitchPosition) is not acceptable!
 
Did you remember to add "units" to your L:vars?

(L:variable,unit) is the prototype...

(L:SwitchPosition,enum) is acceptable

(L:SwitchPosition) is not acceptable!


This is the code for the switch but now it doesn't appear on the panel :-(
yet it looks ok?
vololiberista



Code:
<Gauge Name="Comparator" Version="1.0">
<<Element>
      <Select>
         <Value>(L:COMPARATOR TEST,number)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp" ImageSizes="33,58"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp" ImageSizes="33,58"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Compass Check</Tooltip>
      <Cursor Type="Hand"/>
	<Click>(L:COMPARATOR TEST,number) 0 != if{ 0 (&gt;L:COMPARATOR TEST,number) } els{ 1 (&gt;L:COMPARATOR TEST,number) }</Click>
   </Mouse>
</Gauge>
 
This is the code for the switch but now it doesn't appear on the panel :-(
yet it looks ok?
vololiberista

<<Element>

Remove the extraneous "<" from the <Element> tag...
...XML is not very forgiving! :D

Code:
<Gauge Name="Comparator" Version="1.0">
<Element>
      <Select>
         <Value>(L:COMPARATOR TEST,number)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp" ImageSizes="33,58"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp" ImageSizes="33,58"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Compass Check</Tooltip>
         <Cursor Type="Hand"/>
	<Click>(L:COMPARATOR TEST,number) 0 != if{ 0 (&gt;L:COMPARATOR TEST,number) } els{ 1 (&gt;L:COMPARATOR TEST,number) }</Click>
   </Mouse>
</Gauge>

You can save yourself a LOT of extra work by simplifying the <Click> routine to this formula (works only will boolean true/false though):

Code:
<Click>(L:COMPARATOR TEST,number) ! (&gt;L:COMPARATOR TEST,number)</Click>

Also, you haven't needed the ImageSizes= stuff since FS2002. You can simply leave it out entirely. ;)
 
Last edited:
Thanks for your tips. One final point. When the switch is in the "on" position both gauge lights come on and stay on until the switch is "off". But what I want is for each gauge light to extinguish itself after a few seconds even though the switch remains in the "on" position. Here is my code so far (you can see the numbers 25 and 45 (representing the time on) which clearly I have put in the wrong position) If you could explain to me how to resolve that I would be most grateful:-
vololiberista
Code:
<Element>
      <Select>
         <Value>(L:ENG 5 FIRE TEST,number) [COLOR="Red"]25[/COLOR] &lt;  (L:COMPARATOR TEST,number)</Value>
         <Case Value="0">
            <Image Name="AMBER_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="AMBER_ON.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element> 
</Gauge>

<Gauge Name="Compass Comparator" Version="1.0">
   <Element>
      <Select>
         <Value>(L:ENG 6 FIRE TEST,number) [COLOR="Red"]45[/COLOR] &lt;  (L:COMPARATOR TEST,number)</Value>
         <Case Value="0">
            <Image Name="AMBER_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="AMBER_ON.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element> 
</Gauge>
 
That won't do anything at all. Where are you setting and changing the value of (L:ENG 5 FIRE TEST,number) or (L:ENG 6 FIRE TEST,number)?

You will need to initialize a timer value in the mouse click area for both variables when the switch is turned on:
Code:
<Click>
     (L:COMPARATOR TEST,number) ! (&gt;L:COMPARATOR TEST,number)
     (L:COMPARATOR TEST,number) 1 ==
     if{
            (P:local time, seconds) 25 + (>L:ENG 5 FIRE TEST,number)
            (P:local time, seconds) 45 + (>L:ENG 6 FIRE TEST,number)
       }
</Click>

Then for each of your two <Elements> add the conditional script to test the two timer L:variables.
Code:
<Value>
     (L:ENG 5 FIRE TEST,number) (P:local time, seconds) &gt;
     (L:COMPARATOR TEST,number)
     and
</Value>

<Value>
     (L:ENG 6 FIRE TEST,number) (P:local time, seconds) &gt;
     (L:COMPARATOR TEST,number)
     and
</Value>

The way this works is that when the switch is turned on, each timer is set to the current (P:local time,seconds) + xx number of seconds.

Each <Element>'s <Value> expression compares the L:variable against the current (P:local time,seconds). As long as it is greater than the comparison, it will return a "TRUE" (1) value, which is *ANDed* with the "TRUE" value of the L:COMPARATOR TEST variable....

Clear enough? :D
 
Many many thanks for your help " as always!! :-) "
My goal is to have a fully functioning cockpit for the VC10 that mirrors as much as possible the actual BOAC/British Airways checklist (which is extensive). I've learnt a lot through your help.
Many thanks
vololiberista
 
Back
Top