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

This *should* work--but doesn't

SmB

Messages
17
Country
unitedstates
I've been trying to teach myself XML for making gauges. I've successfully altered some of the default MS gauges for my own purpose; I've looked at lots of examples; and learned a lot from reading past discussions here. (Thanks!)

Below is a simple light gauge that will turn on when the flaps are deployed any amount. It's adapted from the MS Grumman Goose annunciator panel gauge that has lights like this. Right now the "Flaps_UP.bmp" displays just fine but the "Flaps_DN.bmp" does not replace it when flaps are deployed.

I'm stumped! Help please. :confused:

Steve

Code:
<Gauge Name="FlapLight" version="1.2">
   <Element id="Flaps Light">
   <FloatPosition>0.000,0.000</FloatPosition>
      <Select>
         <Expression>
            <Script>(A:FLAPS HANDLE INDEX, Number) 0 &gt;</Script>
         </Expression>
         
         <!-- Not equal zero therefore zero b/c flaps up -->
         <Case id="False">
            <ExpressionResult>0</ExpressionResult>
            <Image Name="Flaps_UP.bmp">
               <Transparent>True</Transparent>
            </Image>
         </Case>
         
         <!-- Greater than zero so flaps down any amount-->
         <Case id="True">
            <ExpressionResult>1</ExpressionResult>
            <Image Name="Flaps_DN.bmp">
               <Transparent>True</Transparent>
               <Bright>True</Bright>
            </Image>
         </Case>
      </Select>
   </Element>
</Gauge>
 
Hi,
Don't know if this will help, but this is what I use for a couple of annunciators in my cockpit. Both in FS9 Schema.

Flaps extended (illuminates when flaps are not zero)
Code:
<Gauge Name="annunciator_Flaps_Extended" Version="1.0">
   <Size X="118" Y="59"/>
   <Element>
      <Select>
         <Value>(A:Trailing edge flaps0 right angle, degrees) 1 &gt;</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="0">
            <Image Name="Flaps_Extended_annun_off.bmp" UseTransparency="Yes"/>
         </Case>
         <Case Value="1">
            <Image Name="Flaps_Extended_annun_on.bmp" Bright="Yes" UseTransparency="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>

Flaps in transit (Illuminates when flaps are in motion)
Code:
<Gauge Name="annunciator_Flaps_Transit" Version="1.0">
   <Size X="118" Y="59"/>
   <Element>
      <Select>
         <Value>(A:Trailing edge flaps left percent, percent) d (G:Var1) - r (&gt;G:Var1) 0 != 4 * (G:Var2) max -- 0 max d (&gt;G:Var2) 0 != ||</Value>
         <Case Value="0">
            <Image Name="Flaps_Transit_annun_off.bmp" UseTransparency="Yes"/>
         </Case>
         <Case Value="1">
            <Image Name="Flaps_Transit_annun_on.bmp" Bright="Yes" UseTransparency="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>

Hope this helps
Greg
 
Steve

Try this ,
HTML:
 <!--Flap UP condition--> 
<Element>
      <Select>
         <Value>(A:Trailing Edge Flaps0 Left Percent,percent) 5 &lt; </Value>
         <Case Value="0">
            <Image Name="Flaps_Extended_annun_off.bmp"/>
         </Case>
      </Select>
   </Element>
<!--Flap DOWN condition-->
 <Element>
      <Select>
         <Value>(A:Trailing Edge Flaps0 Left Percent,percent) 5 &gt; (P:Local time,seconds) 1.2 % 0.25 &lt; * </Value>
         <Case Value="1">
            <Image Name="Flaps_Extended_annun_on.bmp"/>
         </Case>
      </Select>
   </Element>

Remove the ;
"P:Local time" portion if you do not want the DOWN light to flash.

Cheers
Karol
 
Thanks to you both for your help! The code below works (finally). I'm working in FSXA, by the way.

I wish I knew why the MS code above with this structure does not work since it is taken directly from one of the default gauges.

Code:
<Select>
    <Expression>
         <Script>
            <Case>
                <ExpressionResult>

Anyway, the code below works fine and I'm slowly making progress in XML now. :)

Code:
<Gauge Name="FlapLight" version="3.0">
<Size X="30" Y="30"/>
   <Element id="Flaps Light">
      <Select>
         <Value>(A:FLAPS HANDLE INDEX, Number) 0 == </Value>
         <Case Value="1">
            <Image Name="Flaps_UP.bmp" UseTransparency="Yes"/>
         </Case>
         <Case Value="0">
            <Image Name="Flaps_DN.bmp" Bright="Yes" UseTransparency="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>

All the best,
Steve
 
You originally used a combination of FS9 and FSX xml syntax,
only use one or the other,
Also nominate the size of your instrument.

Try the following ,
but first change the size and the image section at the beginning.

Cheers
Karol

HTML:
<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="FlapLight">
    <Descr>AceXML Document</Descr>
    <Filename>FlapLight.xml</Filename>
    <SimGauge.Gauge id="Gauge" ArtDirectory=".">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>405,405</Size>
        <Image id="RDR_Background_1.bmp" Name="RDR_Background_1.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
        </Image>
 <!-- ADJUST SIZE above to suit your instrument -->
 <!-- IMAGE above should be your background Bitmap if one exists -->

        <Element id="Flaps Light_1">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Select id="Select">
                <Expression id="Expression">
                    <Script>(A:FLAPS HANDLE INDEX, Number) 0 == </Script>
                </Expression>
				 <Case id="Case">
                    <ExpressionResult>1</ExpressionResult>
					<Image id="Image" Name="Flaps_UP.bmp">
						<Transparent>True</Transparent>
						<Bright>True</Bright>
                    </Image>
                </Case>
				 <Case id="Case">
                    <ExpressionResult>0</ExpressionResult>
					<Image id="Image" Name="Flaps_DN.bmp">
						<Transparent>True</Transparent>
						<Bright>True</Bright>
                    </Image>
                </Case>				
            </Select>
        </Element>

    </SimGauge.Gauge>
</SimBase.Document>
 
My advice is to stick with FS9 schema. FSX schema is needlessly verbose and difficult to get right...

...unless you use the really unwieldy and clumsy ACES tool. :banghead:
 
Aha! That explains a lot. :idea:

I didn't know there were different XML schemata.

Many thanks all.

Steve

(Karol, in earlier versions I had <Size> entry [probably FS9 version] and FSX complained about a bad size attribute. Now I know why.)
 
I totally agree , stick with the FS9 schema !

Due to circumstances and some of the 'odd' instruments that I have created I started to use the FSX schema a few years back.
It is too verbose and long winded , I have never attempted to use the Aces tool , I manually create instruments using the freeware " Notepad ++ " xml editor.
Most of my instruments are in FS9 schema , with a small number in FSX schema , as you can imagine , using 2 different schema is a recipe for trouble , and requires a lot of care.
It is to be avoided if possible.

Both schema use the same common Variables , BUT the structure of the Element groups is different in each schema , mixing the two schema in one
instrument DOES NOT work .
The differences might appear to be subtle , but they are critical .

As far as I am concerned the best tutorials available for the FS9 schema are those available free at the " FS2x website ".
Go to >> FS2x
Select >> Tutorials
You will see >> Tutorial 1
then download and retain >> Chapters 1 to 4
( those 4 chapters are a must have resource )

At the same site you will find a Tutorial on " Formatted text " download that also.

Cheers
Karol
PS: In my view , it is important to get copies of the FS9 SDK's , as I feel that the FSX SDK's are slanted towards the FSX schema , and that
in my opinion is a recipe for trouble and confusion for beginners in xml work.
The SDK's are both confusing and difficult to understand , however they are important reference documents.
I have both sets of SDK's .
 
Last edited:
Again, many thanks for the help. I will follow all your suggestions above.

I did go through the FSXA "Aces" tutorial but I think using a text editor is easier for code like this.

All the best,

Steve
 
One of the "tricks" I developed years ago was to use my XML editor (in my case Visual Studio) to create and save some basic "template" files. Then when starting a new gauge project I only needed to load the desired "template" into VS, copy/paste the "template", add the bits to make it work, then finally save as a new "gauge" file.
 
Back
Top