• 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 Element in another Element

Messages
181
Country
czechrepublic
Hi, again me...

As I read in some tutorial, I can place elements into one another element and it should work. So i tried it on this very simple pitot heat on/off light

Code:
<Gauge Name="EV-55_pitot_heat_I" Version="1.0">
<Image Name="pitotheatI_stdby.bmp"/>

[B]<Element>
<Visible>(A:ELECTRICAL MAIN BUS VOLTAGE,volt) 3 &gt</Visible>[/B]

	[COLOR="Red"]<Element>
	<Visible>(A:PITOT HEAT, bool) 1 ==</Visible>
		<Image Name="pitotheatI_on.bmp" Bright="Yes"/>
	</Element>[/COLOR]

	[COLOR="Blue"]<Element>
	<Visible>(A:PITOT HEAT, bool) 0 ==</Visible>
	<Image Name="pitotheatI_off.bmp" Bright="Yes"/>
	</Element>[/COLOR]

[B]</Element>[/B]


<Mouse>
      <Help ID="HELPID_GAUGE_PITOT_HEAT_SWITCH"/>
      <Cursor Type="Hand"/>
      <Click Event="PITOT_HEAT_TOGGLE"/>
</Mouse>

</Gauge>

And guess what? The gauge doesnt appear in FS, even if the voltage is high enough. There is also no clickspot (which sould be available despite of the image appearance, I guess).

So my question (I dont know where I read this) - is it really possible to handle with elements in this way?

Thanks for reply,
Pavel
 
Hello Pavel,

I think this might work better, if you just want it to appear when you have 3+ volts.

I havent tested this... :eek:


Code:
[COLOR="Blue"][B]<Gauge Name="EV-55_pitot_heat_I" Version="1.0">
<Image Name="pitotheatI_stdby.bmp"/>


<Element>           //MAIN OUTER ELEMENT
  <Element>
   <Select>
      <Value>
       (A:ELECTRICAL MAIN BUS VOLTAGE,volt) 3 &gt;
       1 (A:PITOT HEAT,bool)
       and
       if{ (A:ELECTRICAL MAIN BUS VOLTAGE,volt) 3 &gt;    //3+ VOLTS ON MAIN CIRCUIT
       1 (A:PITOT HEAT,bool)                 //PITOT CIRCUIT IS LIVE
       and
       (&gt;L:SHOT PITOT ON,bool) }           //TURN ON VISIBLE "ON" Element
       if{ (A:ELECTRICAL MAIN BUS VOLTAGE,volt) 2 &lt;   //2 OR LESS VOLTS
       1 (A:PITOT HEAT,bool) !    //IF PITOT POWER IS OFF
       and
       (&gt;L:SHOT PITOT OFF,bool)    //TURN ON THE 'OFF' Element
       0 (&gt;K:PITOT_HEAT_TOGGLE,bool) }       //SHUTS OFF PITOT SYSTEM WHEN UNDER 3 Volts
      </Value>
    </Select>
</Element>

<!--  TURN ON "ON" VISIBLE  -->
<Element>
    <Visible>(L:SHOT PITOT ON,bool) (A:PITOT HEAT,bool) |</Visible>
    <Image Name="pitotheatI_on.bmp" Bright="Yes"/>
</Element>

<!--  TURN ON "OFF" VISIBLE  -->
<Element>
    <Visible>(L:SHOT PITOT OFF,bool) (A:PITOT HEAT,bool) ! and</Visible>
    <Image Name="pitotheatI_off.bmp" Bright="Yes"/>
  </Element>
</Element>            //MAIN OUTER ELEMENT


<Mouse>
      <Help ID="HELPID_GAUGE_PITOT_HEAT_SWITCH"/>
      <Cursor Type="Hand"/>
      <Click Event="PITOT_HEAT_TOGGLE"/>
</Mouse>

</Gauge>[/B][/COLOR]


Same code without code wrap (easier to read on screen sometimes)

<Gauge Name="EV-55_pitot_heat_I" Version="1.0">
<Image Name="pitotheatI_stdby.bmp"/>


<Element> //MAIN OUTER ELEMENT
<Element>
<Select>
<Value>
(A:ELECTRICAL MAIN BUS VOLTAGE,volt) 3 &gt;
1 (A:PITOT HEAT,bool)
and
if{ (A:ELECTRICAL MAIN BUS VOLTAGE,volt) 3 &gt; //3+ VOLTS ON MAIN CIRCUIT
1 (A:PITOT HEAT,bool) //PITOT CIRCUIT IS LIVE
and
(&gt;L:SHOT PITOT ON,bool) } //TURN ON VISIBLE "ON" Element
if{ (A:ELECTRICAL MAIN BUS VOLTAGE,volt) 2 &lt; //2 OR LESS VOLTS
1 (A:PITOT HEAT,bool) ! //IF PITOT POWER IS OFF
and
(&gt;L:SHOT PITOT OFF,bool) //TURN ON THE 'OFF' Element
0 (&gt;K:PITOT_HEAT_TOGGLE,bool) } //SHUTS OFF PITOT SYSTEM WHEN UNDER 3 Volts
</Value>
</Select>
</Element>

<!-- TURN ON "ON" VISIBLE -->
<Element>
<Visible>(L:SHOT PITOT ON,bool) (A:PITOT HEAT,bool) |</Visible>
<Image Name="pitotheatI_on.bmp" Bright="Yes"/>
</Element>

<!-- TURN ON "OFF" VISIBLE -->
<Element>
<Visible>(L:SHOT PITOT OFF,bool) (A:PITOT HEAT,bool) ! and</Visible>
<Image Name="pitotheatI_off.bmp" Bright="Yes"/>
</Element>
</Element> //MAIN OUTER ELEMENT


<Mouse>
<Help ID="HELPID_GAUGE_PITOT_HEAT_SWITCH"/>
<Cursor Type="Hand"/>
<Click Event="PITOT_HEAT_TOGGLE"/>
</Mouse>

</Gauge>




See if that works.
 
Last edited:
1. &gt should be &gt;

2. There should be a space between the last element in a line and the end tag - i.e. 1 ==</Visible> should be 1 == </Visible> - there are numerous examples of this one (i.e. see #1, etc.).

Hope this helps,
 
I love you guys! Thank you. Bill, originally I wanted to use something like that you posted, but the problem is that I also need to use it for more complex gauges then only on/off light, and there it would be quite hard work to rewrite it all.

So, now it works, the problem was in missing ; - I dont know where I was looking! Thank you, tgibson!

Pavel
 
Back
Top