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

FSX XML simple question

Messages
131
Country
unitedkingdom
I know it's basic but I can't find confirmation in anywhere. I'm unsuccessfully trying to "read" an animation with RPN and one of the things that I would like to confirm is how to read the following:

if{ (A:TRAILING EDGE FLAPS LEFT PERCENT, percent) } }

As it does not have any value, should I read it as 0% or 100%?

Thank you

Kano
 
Not that I've any expertise in this but if the A: variable has units in percent, shouldn't there be some test for a percent value to return a boolean result which the if { ... } can check for?
 
Well, that is why I'm lost here, that statement is the one that should give the value. It is embedded here:


} } } } els{ (A: pLANE ALT ABOVE GROUND, feet) 2500 < if{ (A:TRAILING EDGE FLAPS LEFT PERCENT, percent) } }

and it's the end of the code, so is the last option of the els operator...
 
You're reading it wrong, what it's saying is if the stuff before the IF is true, return the value in the final brackets.
i.e. if the plane is above 2500' it will return the left trailing edge flaps position. Obviously whether this happens depends on what the preceding code is checking for.
 
Skippy, thank you for the replay, but if I understood you correctly, this is the way I read it; the problem is that I do not know which "left trailing edge flap position" value will be returned.
 
I have a simple 2d gauge that I use to display the raw results of a variable. I use this when testing my 3d gauges. You can quickly edit in sim as needed. Your welcome to a copy of it if you think it can help.
 
This is easy to setup.
Make a BMP image 100 x 80 pixels fill with black RGB 1,1,1 and name it TestG1background.bmp
Create a new folder and name it PDTest
Copy the following code and save it as TestG1.xml.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="Fuel Pressure">
    <Descr>AceXML Document</Descr>
    <Filename>TestG1.xml</Filename>
    <SimGauge.Gauge id="Gauge" ArtDirectory="D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Gaugesl\PDTest">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Image id="TestG1background.bmp" Name="TestG1background.bmp">
            <Transparent>True</Transparent>
        </Image>
        <Element id="Fixed Text">
            <FloatPosition>5.000,10.000</FloatPosition>
            <GaugeText id="GaugeText">
                <FontColor>gold</FontColor>
                <FontFace>Arial</FontFace>
                <FontHeight>13</FontHeight>
                <GaugeString>FUEL TANK SELECTOR</GaugeString> <!-- Optional Label -->
                <Size>90,15</Size>
                <Transparent>True</Transparent>
            </GaugeText>
        </Element>
        <Element id="Output Box">
            <FloatPosition>5.000,40.000</FloatPosition>
            <Rectangle id="Rectangle">
                <LineWidth>1</LineWidth>
                <Width>90</Width>
                <Height>24</Height>
                <LineColor>darkslateblue</LineColor>
                <FillColor>black</FillColor>
            </Rectangle>
        </Element>
        <Element id="Display Text">
            <FloatPosition>10.000,44.000</FloatPosition>
            <GaugeText id="GaugeText">
                <FontColor>red</FontColor>
                <FontFace>Courier</FontFace>
                <FontHeight>16</FontHeight>
                <GaugeString>%((A:FUEL TANK SELECTOR:1, enum))%!03d!</GaugeString> <!-- Replace variable as needed between % signs. Additional code may be inserted for testing,
                      Example: ((A:Delta heading rate,rpm) 180 * 3.1459 / 18 +) -->
                <Size>90,16</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
<!--  Un-comment for duel variable display -->
<!--    <Element id="Display Text">
            <FloatPosition>50.000,44.000</FloatPosition>
            <GaugeText id="GaugeText">
                <FontColor>red</FontColor>
                <FontFace>Courier</FontFace>
                <FontHeight>16</FontHeight>
    <GaugeString>%((A:RECIP ENG RIGHT MAGNETO:1,bool))%!03d!</GaugeString>
                <Size>90,16</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
-->    </SimGauge.Gauge>
</SimBase.Document>
Place the xml and bmp files in the folder PDTest and place that folder in the panel folder of the aircraft you are testing. There are editing instruction comments in the xml code.

Add this gauge to your panel.cfg

[WindowXX]
file=TestG1background.bmp
file_1024=TestG1background.bmp
size_mm=102,62
window_size_ratio=1.000
position=0
visible=0
ident=40
window_size= 0.160, 0.130
window_pos= 0.780, 0.750
gauge00=PDTest!TestG1, 0,0,102,61

When you are in the sim pop open the gauge and it will display the data coming from the variable or variables being tested. You can edit your code while in sim and refresh to update it.
I find this very useful, hope you will to.
 
There is only one value for the left trailing edge flap position variable at a given moment - that is the current position of the flaps. If up, that value will be 0, if down all the way that value will be 100. If somewhere between full up and full down it will have a value between 0 and 100, proportionate to that flap position.
 
In the VC10 the flaps are locked up after retraction. So you can see here how I have used
(A:TRAILING EDGE FLAPS0 LEFT PERCENT, percent). The other variables are to control the flaps inhibit warning lights and switches.
Code:
<Click>
(L:flaps_isol_switch,bool) 0 == (A:TRAILING EDGE FLAPS0 LEFT PERCENT, percent) 1 &lt; and
if{
1 (&gt;L:flaps_isol_switch,bool)
1 (>L:Flaps_Inhibit,bool) (P:local time, seconds) 2.80 + (>L:flapss,number) (P:local time, seconds) 1.50 + (>L:slatss,number) (P:local time, seconds) 3.15 + (>L:flapwarn,number)
}
els{
0 (&gt;L:flaps_isol_switch,bool)
0 (>L:Flaps_Inhibit,bool)
1 (>L:Sound_button,enum)
}
1 (>L:Sound_button,enum) (P:local time, seconds) 2.80 + (>L:flapss,number) (P:local time, seconds) 1.50 + (>L:slatss,number)
</Click>
 
Back to your first question.

'A' represents Airframe Readout. Your flaps will read the percent 'position' that the plane is at. Up is 0 percent and full down is 100 percent. So if you have 4 notches of flaps at what ever angles, at the last available notch of flaps (full flaps) you are at 100%.

Your string is showing a 'readout' of the Airframe when the 'els' is met/happens. I think this is a fragment of something a lot bigger. it would be better if we saw the entire code block, not just a string of it.

So, again, this 'A' string is a readout, and its of percent, and will be based on where the flaps are at, not by the first string. The first string appears to be a 'show up when at 2500 feet or less' type of 'appearance command' trigger.

Is this perhaps for a font?


Bill
 
Back
Top