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

Kohlsman setting Drum question (XML)

Messages
9
Country
unitedstates
I'm working on an altimeter in xml and having trouble with the elimination of the "snap" effect when reaching the end of the number strip. If I implement a pixels per second delay the strip runs smoothly with the exception of the transition from 9 back to 0.

If I use a value per second delay the 9 to 0 looks great but the rest of the strip snaps rather than rolling. Any ideas?

Code:
<SimGauge.Element id="00.01">
    <FloatPosition>326.000,271.000</FloatPosition>
    <MaskImage id="FA33_Altimeter_Baro_HG_Strip_Mask.bmp" Name="FA33_Altimeter_Baro_HG_Strip_Mask.bmp">
        <Axis>-1.000,7.000</Axis>
    </MaskImage>
    <Image id="FA33_Altimeter_Baro_HG_Strip_Loop2.bmp" Name="FA33_Altimeter_Baro_HG_Strip_Loop2.bmp">
        <Transparent>True</Transparent>
        <Bright>True</Bright>
    </Image>
    <Shift id="Shift">
        <WrapMin>0.000,-270.000</WrapMin>
        <Expression id="Expression">
            <Script>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 100 % 0.01 / near</Script>
        </Expression>
        <NonlinearityTable id="NonlinearityTable">
            <NonlinearityEntry id="NonlinearityEntry">
                <ExpressionResult>2800.000</ExpressionResult>
                <FloatPosition>325.000,268.000</FloatPosition>
            </NonlinearityEntry>
            <NonlinearityEntry id="NonlinearityEntry">
                <ExpressionResult>2801.000</ExpressionResult>
                <FloatPosition>325.000,241.000</FloatPosition>
            </NonlinearityEntry>
        </NonlinearityTable>
        <Delay id="Delay">
            <DelayValue>200.000</DelayValue>
        </Delay>
    </Shift>
</SimGauge.Element>

Thanks for looking
Bao
 
1.
Make very long strips that span the whole range instead of just 0-9.
That way it doesn't have to move back when going from 0 to 9.

2.
Use the nonlinearity element to make the digits roll instead of the delay element.
The nonlinearity map would look like this:
Code:
value 0.00, y 0.00
value 0.49, position 0.01
value 0.51, position 0.99
value 1.49, position 1.01
value 1.51, position 1.99
value 2.49, position 2.01
etc
The input value would be a float (0-9.99) instead of an integer.
You can see that when there is a big interval between the values there is a small interval between the positions and vice versa.
This means that it will move slowly between 0.01 and 0.99 and then move very fast between 0.99 and 1.01.

However, FS sets the kollsman setting in .01 increments which will defeat this as it will never have values between .01, .02, etc.
You can solve that by using Lvars to position the kollsman digits.
These Lvars hold the visible position of the digits and are compared to the actual kollsman setting in FS.
Then, every cycle, you determine how much time has passed and adjust the Lvar towards the current kollsman setting by speed * dT.

Obviously this is more complicated than option 1.
 
Thanks for the help.

I was hoping to avoid making a strip that long... I don't really know why, I guess it just seemed rude to use a bitmap that was 10530 pixels long. But if the only other real alternative is to code three Nonlinear entries for each single digit in the hundredths, the strip is faster and easier to put it mildly.

Thanks again,
Bao
 
Back
Top