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

Trouble with NoLinearity

Messages
73
Hi everybody,

I have a trouble with my gauge, my echelle.bmp doesn't display correctly when i change the cap of my airplane. We see just a little piece of my echelle.bmp at a certain cap but don't coincide with my graduation on my image.

Can u help me ?

Sorry for my english :s

Code:
<?xml version="1.0" encoding="UTF-16"?>

<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="horizon_artificielle">
    <Descr>AceXML Document</Descr>
    <Filename>horizon_artificielle.xml</Filename>
    <SimGauge.Gauge id="horizon_artificielle" ArtDirectory="C:\TestGauges">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>180,180</Size>
        <Image id="horizon.bmp" Name="horizon.bmp">
            <Transparent>True</Transparent>
        </Image>
        <Element id="zone_texte_IAS">
            <FloatPosition>5.000,2.000</FloatPosition>
            <GaugeText id="IAS">
                <Bold>True</Bold>
                <FontColor>green</FontColor>
                <FontHeight>20</FontHeight>
                <GaugeString>%( (A:AIRSPEED TRUE, knots) )%!0d!</GaugeString>
                <Length>4</Length>
                <Size>40,20</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
        <Element id="zone_texte_FL">
            <FloatPosition>120.000,2.000</FloatPosition>
            <GaugeText id="FL">
                <Bold>True</Bold>
                <FontColor>green</FontColor>
                <FontHeight>20</FontHeight>
                <GaugeString>%( (A:PLANE ALTITUDE, feet) )%!0d!</GaugeString>
                <Length>5</Length>
                <Size>110,20</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
        <Element id="zone_texte_QNH">
            <FloatPosition>140.000,155.000</FloatPosition>
            <GaugeText id="QNH">
                <Bold>True</Bold>
                <FontColor>green</FontColor>
                <FontHeight>16</FontHeight>
                <GaugeString>%( (A:KOHLSMAN SETTING MB, millibars) )%!0.2d!</GaugeString>
                <Size>75,16</Size>
                <Transparent>True</Transparent>
                <VerticalAlign>CENTER</VerticalAlign>
            </GaugeText>
        </Element>
        <Element id="Element">
            <FloatPosition>65.000,2.000</FloatPosition>
            <Image
                    id="echelle.bmp"
                    Alpha="True"
                    Name="echelle.bmp">
            </Image>
            <ClipRect id="ClipRect">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Size>50,15</Size>
            </ClipRect>
            <Shift id="Shift">
                <Expression id="(A:PLANE HEADING DEGREES GYRO, degrees) dnor">
                    <Minimum>-99999.000</Minimum>
                    <Maximum>-99999.000</Maximum>
                    <Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>
                </Expression>
                <NonlinearityTable id="NonlinearityTable">
                    <NonlinearityEntry id="NonlinearityEntry">
                        <ExpressionResult>0.000</ExpressionResult>
                        <FloatPosition>821.000,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="NonlinearityEntry">
                        <ExpressionResult>360.000</ExpressionResult>
                        <FloatPosition>10.000,0.000</FloatPosition>
                    </NonlinearityEntry>
                </NonlinearityTable>
            </Shift>
        </Element>
    </SimGauge.Gauge>
</SimBase.Document>
 
Your Maximum value tag has a negative value. That is certainly a problem.
Also, I believe the non-linearity table should describe the position of the upper left corner of the sliding bitmap. When the compass is reading 360° the 'x' component of the position should have a large, negative value.

Doug
 
Code:
<GaugeString>%( (A:KOHLSMAN SETTING MB, millibars) )%!0.2d!</GaugeString>

This is another problem. No extra spaces between ( ( and ) )...

...this should be:

Code:
<GaugeString>%((A:KOHLSMAN SETTING MB, millibars))%!0.2d!</GaugeString>
 
With the code below, the NoLinearity will be Ok but the value of the heading is read at the left side of the ClipRect and not at the center... I don't know how to place the current heading value at the center :-/

Code:
<Element id="Element">
            <FloatPosition>40.000,2.000</FloatPosition>
            <Image
                    id="echelle.bmp"
                    Alpha="True"
                    Name="echelle.bmp">
                <Transparent>True</Transparent>
            </Image>
            <ClipRect id="ClipRect">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Size>100,15</Size>
            </ClipRect>
            <Shift id="Shift">
                <Expression id="(A:PLANE HEADING DEGREES GYRO, degrees) dnor">
                    <Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>
                </Expression>
                <NonlinearityTable id="NonlinearityTable">
                    <NonlinearityEntry id="NonlinearityEntry1">
                        <ExpressionResult>0</ExpressionResult>
                        <FloatPosition>0.000,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="NonlinearityEntry2">
                        <ExpressionResult>180</ExpressionResult>
                        <FloatPosition>-405.000,0.000</FloatPosition>
                    </NonlinearityEntry>
					<NonlinearityEntry id="NonlinearityEntry3">
                        <ExpressionResult>360</ExpressionResult>
                        <FloatPosition>-810.000,0.000</FloatPosition>
                    </NonlinearityEntry>
                </NonlinearityTable>
            </Shift>
        </Element>
 
This is where you set the top left corner of your compass bitmap:

<FloatPosition>65.000,2.000</FloatPosition>
 
Last edited:
With Adraesh, We are totaly lost :(

Could you please test for us, here is the all code of the gauge :

And the "echelle.bmp" is here : echelle.bmp

Thanks in advance and... sorry for asking you that... :(

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

<SimBase.Document
        Type="AceXML"
        version="1,0"
        id="horizon_artificielle">
    <Descr>AceXML Document</Descr>
    <Filename>cap.xml</Filename>
    <SimGauge.Gauge id="cap" ArtDirectory="F:\Fsx\Gauges\JardY">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>180,25</Size>                
		<Element id="Element">
			<FloatPosition>0.000,0.000</FloatPosition>
			<Image id="echelle.bmp" Name="echelle.bmp">
				<Transparent>True</Transparent>
			</Image>			
			<Shift id="Shift">
				<Expression id="(A:PLANE HEADING DEGREES GYRO, degrees) dnor">
					<Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>
				</Expression>
				<NonlinearityTable id="NonlinearityTable">
					<NonlinearityEntry id="NonlinearityEntry1">
						<ExpressionResult>0</ExpressionResult>
						<FloatPosition>0,0</FloatPosition>
					</NonlinearityEntry>
					<NonlinearityEntry id="NonlinearityEntry2">
						<ExpressionResult>180</ExpressionResult>
						<FloatPosition>-360,0</FloatPosition>
					</NonlinearityEntry>
					<NonlinearityEntry id="NonlinearityEntry3">
						<ExpressionResult>360</ExpressionResult>
						<FloatPosition>-720,0</FloatPosition>
					</NonlinearityEntry>
				</NonlinearityTable>
			</Shift>
		</Element>		
        <Element id="Element">
            <FloatPosition>0.000,0.000</FloatPosition>
            <PolyLine id="PolyLine">
                <LineWidth>1</LineWidth>
                <LineColor>green</LineColor>
                <Point id="Point">
                    <FloatPosition>90.000,15.000</FloatPosition>
                </Point>
                <Point id="Point">
                    <FloatPosition>90.000,25.000</FloatPosition>
                </Point>
            </PolyLine>
        </Element>
    </SimGauge.Gauge>
</SimBase.Document>
 
We are sorry to ask you this, but if someone try our little piece of code with bmp attached to us it will help us to advance.

Thank you again.
 
I would but I don't use the FSX Schema or the ACES Tool to generate XML script... :o
 
hi

we using this bmp file :
echelle.bmp


Can we just help us to find the x position to put in my floatposition on the NonLinearity entry ?

We try but it doesn't work ... We just want that the bmp move to left to right or to right to left and showing the right heading in the middle of the Element.

Code:
 <Element id="Element">
            <FloatPosition>75.000,2.000</FloatPosition>
            <Element id="Element">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Image id="echelle.bmp" Name="echelle.bmp">
                    <Transparent>True</Transparent>
                </Image>
                <Shift id="Shift">
                    <Expression id="(A:PLANE HEADING DEGREES GYRO, degrees) dnor">
                        <Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>
                    </Expression>
                    <NonlinearityTable id="NonlinearityTable">
                        <NonlinearityEntry id="0">
                            <ExpressionResult>0.000</ExpressionResult>
                            <FloatPosition>62.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="180">
                            <ExpressionResult>180.000</ExpressionResult>
                            <FloatPosition>560.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="360">
                            <ExpressionResult>360.000</ExpressionResult>
                            <FloatPosition>1058.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                    </NonlinearityTable>
                </Shift>
                <ClipRect id="ClipRect">
                    <FloatPosition>0.000,0.000</FloatPosition>
                    <Size>50,18</Size>
                </ClipRect>
            </Element>
        </Element>
 
Last edited:
Well, you could start by using the correct variable for a compass!

Code:
<Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>

The above will never work...

Use this variable and try again.
Code:
<Script>(A:Wiskey compass indication degrees,degrees) dnor</Script>
 
I have try but still the same problem the bmp doesn't display.

I have add 2 NonLinearity Entry for more precision.

Code:
        <Element id="Element">
            <FloatPosition>75.000,2.000</FloatPosition>
            <Element id="Element">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Image id="echelle.bmp" Name="echelle.bmp">
                    <Transparent>True</Transparent>
                </Image>
                <Shift id="Shift">
                    <Expression id="(A:Wiskey compass indication degrees,degrees) dnor">
                        <Script>(A:Wiskey compass indication degrees,degrees) dnor</Script>
                    </Expression>
                    <NonlinearityTable id="NonlinearityTable">
                        <NonlinearityEntry id="0">
                            <ExpressionResult>0.000</ExpressionResult>
                            <FloatPosition>62.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="90">
                            <ExpressionResult>0.000</ExpressionResult>
                            <FloatPosition>311.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="180">
                            <ExpressionResult>180.000</ExpressionResult>
                            <FloatPosition>560.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="270">
                            <ExpressionResult>270.000</ExpressionResult>
                            <FloatPosition>809.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                        <NonlinearityEntry id="360">
                            <ExpressionResult>360.000</ExpressionResult>
                            <FloatPosition>1058.500,0.000</FloatPosition>
                        </NonlinearityEntry>
                    </NonlinearityTable>
                </Shift>
                <ClipRect id="ClipRect">
                    <FloatPosition>0.000,0.000</FloatPosition>
                    <Size>50,18</Size>
                </ClipRect>
            </Element>
        </Element>
 
Last edited:
After a several hours problem solved using this way !

Code:
    <Element id="Element">
        <FloatPosition>75.000,2.000</FloatPosition>
        <Element id="Element">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Image id="echelle.bmp" Name="echelle.bmp">
                <Transparent>True</Transparent>
            </Image>
            <Shift id="Shift">
                <Expression id="(A:PLANE HEADING DEGREES GYRO, degrees) dnor">
                    <Minimum>0.000</Minimum>
                    <Maximum>360.000</Maximum>
                    <Script>(A:PLANE HEADING DEGREES GYRO, degrees) dnor</Script>
                </Expression>
                <NonlinearityTable id="NonlinearityTable">
                    <NonlinearityEntry id="0">
                        <ExpressionResult>0.000</ExpressionResult>
                        <FloatPosition>-37.500,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="90">
                        <ExpressionResult>0.000</ExpressionResult>
                        <FloatPosition>-286.500,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="180">
                        <ExpressionResult>180.000</ExpressionResult>
                        <FloatPosition>-535.500,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="270">
                        <ExpressionResult>270.000</ExpressionResult>
                        <FloatPosition>-784.500,0.000</FloatPosition>
                    </NonlinearityEntry>
                    <NonlinearityEntry id="360">
                        <ExpressionResult>360.000</ExpressionResult>
                        <FloatPosition>-1033.500,0.000</FloatPosition>
                    </NonlinearityEntry>
                </NonlinearityTable>
            </Shift>
            <ClipRect id="ClipRect">
                <FloatPosition>0.000,0.000</FloatPosition>
                <Size>50,18</Size>
            </ClipRect>
        </Element>
    </Element>

I just put a min and max value on the shift element : min = 0 max = 360

I use this simulation variable on my expression : (A:PLANE HEADING DEGREES GYRO, degrees) dnor

I have put my x point as a negative value on the floatpoint of my NonLinearity Entry (I don't know why I must to put as a negative value but it's work)

And to center my value on my element, just substract the half of my ClipRect (my ClipRect is 50 to x so 25 is the half) to the value of my floatingpoint in the NonLinearity Entry.

Thx for all !
 
Just to mention the advice I gave you in a PM, for future readers of this post, you can also set the initial "zero" location of your shifted image using the <axis> flag.

This accomplishes pretty much the same thing as adding a FloatPosition value to your NonlinearityEntry "0", but in my opinion is a cleaner approach. It keeps your zero values at zero. The end user would never know the difference though, so it would only be cleaning from a code standpoint.
 
Back
Top