• 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 Select Expression

Messages
19
[SOLVED] XML Select Expression with KOHLSMAN SETTING

Hi all,

I'm having trouble to get a Select Expression working:

I have a macro Round2
Code:
<SimGauge.Macro id="Macro" Name="Round2">
    <MacroValue>d flr s0 - 100 * near 100 / l0 +</MacroValue>
</SimGauge.Macro>

What I want is check in a Select Expression if the Altimeter is set to Standard i.e. 29.92.

I tried different versions of this script, but can't get it to work:
Code:
<SimGauge.Expression id="Expression">
    <Script>(A:KOHLSMAN SETTING HG, inHg) @Round2 (29.92) ==</Script>
</SimGauge.Expression>

Any suggestions?
Thanks in advance!

Jacob.
 
Last edited:
I always put a space after the + and the == symbols, but I don't know if that's required.

Perhaps the standard atmosphere is not *exactly* equal to 29.92? Check if a test to see if it is *close* to 29.92 works instead.
 
I always put a space after the + and the == symbols, but I don't know if that's required.

Perhaps the standard atmosphere is not *exactly* equal to 29.92? Check if a test to see if it is *close* to 29.92 works instead.

Can't get it to work :confused:

The space after == symbol doesn't help.
I tried everything, also with the exact setting of 29.91765213 (and without the @Round2 macro), but nothing seems to work.
Simply entering
Code:
1 1 ==
works well, so it must be something stupid...
 
Try:

Code:
<Script>(A:KOHLSMAN SETTING HG, inHg) 29.92 ceil 30 ==</Script>
 
Try:

Code:
<Script>(A:KOHLSMAN SETTING HG, inHg) 29.92 ceil 30 ==</Script>

Hi Bill,

Thanks for your reply.
Unfortunately your solution doesn't work either.

What I try to resolve with the select statement is to show an image if the altimeter is set to Standard (29.92). See code below

Code:
<SimGauge.Element id="STA Button">
    <FloatPosition>120.000,31.000</FloatPosition>
    <SizeScale>0.600</SizeScale>
    <Select id="Select">
        <Expression id="Expression">
            <Script>(A:KOHLSMAN SETTING HG, inHg) 29.92 ceil 30 ==</Script>
        </Expression>
        <Case id="Case">
            <ExpressionResult>0.000</ExpressionResult>
            <Image id="STA_OFF.bmp" Name="STA_OFF.bmp">
                <Transparent>True</Transparent>
            </Image>
        </Case>
        <Case id="Case">
            <ExpressionResult>1.000</ExpressionResult>
            <Image id="STA_ON.bmp" Name="STA_ON.bmp">
                <Transparent>True</Transparent>
            </Image>
        </Case>
    </Select>
</SimGauge.Element>

Perhaps any other suggestions?
Thanks in advance.

Kindly regards,
Jacob.
 
Oh, I understood what you wanted from the first post... ;)

Try then one of the following:

Code:
<Script>(A:KOHLSMAN SETTING HG, inHg) 29.90 30 rng</Script>
The above should return TRUE if the setting is between 29.9 and 30.0...

Code:
<Script>(A:KOHLSMAN SETTING MB, Millibars) int 1013 ==</Script>
The above should return TRUE if the setting is the integer of the current setting is 1013, which is of course standard pressure expressed in Hectopascals (Millibars).
 
Hi Bill,

Many thanks, the second works best :)

I made a new macro @Round4:
Code:
<SimGauge.Macro id="Round4" Name="Round4">
    <MacroValue>d flr s0 - 10000 * near 10000 / l0 +</MacroValue>
</SimGauge.Macro>

Then the next code works even more precise:
Code:
<SimGauge.Expression id="Expression">
    <Script>(A:KOHLSMAN SETTING HG, inHg) @Round4 29.91765213 @Round4 == </Script>
</SimGauge.Expression>

Thanks again for your tip!

Kindly regards,
Jacob.
 
Back
Top