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

Battery Trigger

Messages
114
Hi, I am no good at hand writing XML gauges, so I have been using the ACES tool to create some. It is great, and suits my needs, but i am still learning, and need some tips

First, I have created a small Enging gauge, but I need to make it turn off with the battery.

this is how it looks

<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">
<Descr>AceXML Document</Descr>
<Filename>eng.xml</Filename>
<SimGauge.Gauge id="Gauge">
<FloatPosition>0.000,0.000</FloatPosition>
<Size>512,512</Size>
<Image id="eng.bmp" Name="c:\test\eng.bmp">
<Transparent>True</Transparent>
</Image>
<Element id="Flow">
<FloatPosition>40.000,240.000</FloatPosition>
<GaugeText id="flow">
<Bold>True</Bold>
<FontColor>white</FontColor>
<FontFace>courier</FontFace>
<FontHeight>90</FontHeight>
<GaugeString>%( (A:TURB ENG1 FUEL FLOW PPH,pound per hour) 100 / )%!03d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>158,96</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
<Element id="Element">
<FloatPosition>300.000,240.000</FloatPosition>
<GaugeText id="GaugeText">
<FontColor>white</FontColor>
<FontFace>courier</FontFace>
<FontHeight>100</FontHeight>
<GaugeString>%( (A:TURB ENG N1:1, percent) )%!03d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>190,90</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
<Element id="Element">
<FloatPosition>300.000,410.000</FloatPosition>
<GaugeText id="GaugeText">
<FontFace>courier</FontFace>
<FontHeight>97</FontHeight>
<GaugeString>%((A:Eng1 N2 RPM,PERCENT) )%!03d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>196,88</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
<Element id="Element">
<FloatPosition>20.000,410.000</FloatPosition>
<GaugeText id="GaugeText">
<FontFace>courier</FontFace>
<FontHeight>97</FontHeight>
<GaugeString>%((A:TURB ENG BLEED AIR:1,Psi) )%!03d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>196,88</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
<Element id="Element">
<FloatPosition>20.000,60.000</FloatPosition>
<GaugeText id="GaugeText">
<FontFace>courier</FontFace>
<FontHeight>97</FontHeight>
<GaugeString>%((A:TURB ENG ITT:1,Pounds) )%!05d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>196,88</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
<Element id="Element">
<FloatPosition>300.000,60.000</FloatPosition>
<GaugeText id="GaugeText">
<FontFace>courier</FontFace>
<FontHeight>97</FontHeight>
<GaugeString>%((A:GENERAL ENG OIL TEMPERATURE:1,Rankine) )%!03d!</GaugeString>
<HorizontalAlign>RIGHT</HorizontalAlign>
<Size>196,88</Size>
<Transparent>True</Transparent>
</GaugeText>
</Element>
</SimGauge.Gauge>
</SimBase.Document>

now, where,and how do I either add manually, or even using ACES tool, an entry for it to be triggered with the battery?
 
You need to put in visibility tags for each of the elements. It's often easier to have one element that encompasses everything you need to disappear or reappear. The visibility tag should evaluate to true if the thing should appear, false if it should disappear, obviously in your case linked to the battery.
 
Thanks, I appreciate the message about one main element, but as I say, I used ACES tool, and the tutorials, which tell you to place each item as separate elements.

anyway, I tried adding this after each emelent tag, and it just turned off the gauge, and it would not show? is there a better tag for the battery?


<Visible>(A:Circuit general panel on, bool)</Visible>
 
Well, the tutorials are not the be-all and end all. Trust me, putting things under sub elements is a lot easier. I don't mean put all the stuff under a single element, I mean put all the elements under a single parent element.

The tag is not <Visible>, it's <Visibility>.
 
Absolutely, you want to nest your elements. There are many reasons for this. As mentioned, the visabily flag can make things "turn off". In your case, anything that isn't visible when the gauge is off could be nested into one element, and continued that way.

Nesting also makes your gauge easier to read while developing.

With the complexity of my glass gauges, I often have elements next dozens deep.
 
I learned this! I would be glad to help out.

You know that you can 'nest' (I think this is what Daniel means) a group of <Element>'s by an 'outer' Element that is linked with the 'visible' string, which would be linked to the battery flag.

Thus, you have a group of Elements, and you form a 'outer shell' Element that has the visibility. This would have a <Element> in the top of the group, and a closing </Element> at the bottom. Now, this will cause 'all' sub element 'in' that large Element to be 'visible' (operate) when the battery flag is true (on).


Now, if you only have sub sections that operate on the battery, that too is easily done. You can group only those in batter <Element> sections, or for each one, have a <Visible> with the battery flag.


Note also, with Battery, you might also want Avionics, if the system also turns off with Avionics, so you would have two flags in one string (if you wanted Avionics also).


Here is one for just the battery, a Visible string;
<Visible>(A:Electrical master battery,bool)</Visible>

One with 'two' Conditions;
<Visible>(A:LIGHT PANEL,bool) (A:Electrical master battery,bool) &amp;&amp;</Visible>

Note, you add the &amp;&amp; to a 'dual' Condition Visible string.



Macros...

If you start doing gauge code, and you are doing sophisticated systems, get into Macros. They are quite easy. Make a legend of the Macros at the top of the gauge, and then use the code links to the Mac's later in the gauge code.

Here is a cool Macro that will turn on/off your Elements that use the 'power on' Macro code. (Its faster to write into tons of Elements if you were doing a big PFD screen, for instance). You place the Macro legend at the top, and then use its code in the <Visible> strings later down the road, below.

Top end (top of the list in the gauge)

<Macro Name="POWER_ON">(A:Electrical Master Battery,bool) (A:Avionics master switch,bool) &amp;&amp;</Macro>

Use this in the <Visible> strings

<Visible>@POWER_ON</Visible>


Pretty easy as you start to work with these.



Bill
LHC
 
Back
Top