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

FSXA Analog Kohlsman not staying in sink with mouse clicks

Messages
1,749
Country
unitedstates
Analog Kohlsman not staying in sink with mouse clicks. And when i click STD it says 29.91 and the tooltip says 29.92.

Has anyone ran into this issue? i use 10 keyframes for the drum wheels. I tried using 100 to see if the 1000th value would average out as you rotate the value. But this also was out of sink with the tooltip value. But the math is correct because it seems to catch back up when it falls behind or vice versa.

For the 1000th wheel i am using 10 animated frames with this code.
I also tried not rounding down with no flr in the code.

Code:
(A:KOHLSMAN SETTING HG, INHG) 99 min 0 max 0.1 % 0.01 / flr

Seems to me the issue is the default coding because the math is correct.:rolleyes:
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Try adding 'abs' and use 'near' instead of 'flr':
Code:
<Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 0.1 % 0.01 / near</Code>
 
Messages
1,749
Country
unitedstates
That worked perfect. But now i have another issue. The 100th drum is rounding down when it's time to flip up 1 value.
Example.....89, 80, 91

So i tried using near and then it flips 84, 95, 96.

Why?
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Here are mine tested and working perfectly:
Code:
  <PartInfo>
    <Name>C310_baro_hundths</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 0.1 % 0.01 / near</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID>
    </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>C310_baro_tenths</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 1 % 0.1 / flr</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID>
    </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>C310_baro_1</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 10 % 1 / flr</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID>
    </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>C310_baro_10</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 100 % 10 / flr</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID>
    </MouseRect>
  </PartInfo>
 
Messages
1,749
Country
unitedstates
Thanks for sharing your code Bill. I use the same code but what i learned today is i do not need to use 10 key frames with a second zero at the end.

It's easier to divide the drum by 10 images but if the drum only has 9 key frames then you still can divide by 10 but just use 9 images. So thanks again as this finally solved the issue why i was always in and out of sink.

I have to say it is almost perfect but i still find that it can skip a value every 2 or 4 cycles in the 100th and the 1000th value. So this to me is a fsx bug and not coding. But with your help my values are near perfect now.
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
That's your problem, the zero is repeating (frame 10). Consecutive single digit numbers will never reach 10...

Number strip should run:
0 1 2 3 4 5 6 7 8 9
 
Messages
1,749
Country
unitedstates
Yes that fixed it but all other custom drum wheels that use enum or bool will work using 10 key frames because 10 becomes 0 and i use the number zero twice.
But for reading variables i am learning now it causes an issue as we both are talking about. So i updated all my codes to only use 9 key frames and i still put 10 images on the drum wheel so it divides evenly.

So another lesson learned as gauges take years to master!:wizard:
 
Messages
1,749
Country
unitedstates
Bill i still get complaints about how the scale skips and repeats a value 2 times every 4 clicks then every 5 clicks and sometimes other odd amount of clicks. And the default tooltip does the same but on different values. Our beta tester looked at your 310 in FSX and it showed similar behavior. So i think there is some screw up when FSX created how the kohlsman math formula works.
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
That may well be. Perhaps that's the reason I simply use the "B" key instead of twiddling a knob... :rotfl:
 

DragonflightDesign

Resource contributor
Messages
1,082
Country
northernireland
Quote from the sd2gau docs:

It appears that the inches and millibars conversions in the token variables KOLLSMAN_SETTING_MB and KOLLSMAN_SETTING_HG are not quite in sync. The trick to keep them correct is to use KOLLSMAN_SETTING_MB only and then use the following calculation from Gordon Small:-

1013.25 mb = 1.0 atmospheres and each atmosphere is equal to 29.92 inches of mercury, therefore:

atmospheres=X/1013.25 where X is the pressure in mb

pressure in inches = atmospheres*29.92.

He comments that, "I think the problem with FS is that the code takes 1013mb to equal 29.92 inches when it obviously isn't."
 
Messages
1,564
Country
thailand
It appears that the inches and millibars conversions in the token variables KOLLSMAN_SETTING_MB and KOLLSMAN_SETTING_HG are not quite in sync.

Dai,

What was Gordon getting at?

1552329046715.png


The var names could be misleading since they are the same, or nearly the same, numbers, but the units conversions look ok.

Bob

FSXA
 

DragonflightDesign

Resource contributor
Messages
1,082
Country
northernireland
It's an old comment Bob; based on those figures it looks like the problem was fixed and that section needs deleting. Thank you.
 
Messages
1,749
Country
unitedstates
He comments that, "I think the problem with FS is that the code takes 1013mb to equal 29.92 inches when it obviously isn't."

This will not fix a drum wheel from repeating some values. This only puts the 1013 MB closer to 29.92 HG.
The answer would be to know how far off is each click for MB. Which is near 0.0008 then add this into the hard coding for the drum so it can stay closer to the the actual value.

We did some testing tonight and made a tooltip to display more places after the decimal point for the default HG value using 4.3f in the string. But we got too tired to do more testing.
Tomorrow we will use 4.4f in the string to show more decimal points to get a more accurate value and then re write the hard coding.

I also had trouble adding 0.0008 to the hard coding like the code bill posted. So if anyone can make a sample of how to offset this code by 0.0008 please show. Then tomorrow we will use our new value.
 
Messages
840
Country
indonesia
I've got this in one of my gauges. It's years old and I can't remember why it was done, but I assume it's linked to this problem.
The x 100 is because I'm using @ExtDigit to drive the drums so I need to get rid of the decimal point.

XML:
<!-- Add the 0.005 Fudge Factor -->
<Element>
  <Select>
    <Value>(A:KOHLSMAN SETTING HG,inHg) 0.005 + 100 * int (&gt;L:BaroSet,number)</Value>
  </Select>
</Element>
 
Last edited:

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
One inch of mercury pressure change equates to 1000 ft height change. So .01 inch is 10 ft. The average barometric altimeter accuracy is about +/- 30 ft.
You are seeking precision where it does not exist. The difference is common where imperial and metric units are compared.
Roy
 
Messages
1,749
Country
unitedstates
We found a decent solution but not perfect. The solution was to no longer use the "near" function to round to the nearest whole number for the last drum drum wheel. Instead we use the flr to round down to the lower whole number. This required the fudge factor of 0.005. So here is the upside and downside.

Upside:
No longer skips any values. (This is what we wanted)
Stays in sync with tooltip.

Downside:
Just like the tooltip it repeats a value every 12 clicks.

We also removed the abs because we do not see a reason for it because there are no negative values.
This fudge factor puts the start value over the 29.92 value since we now round down.
Code:
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) 0.005 + 99 min 0 max 0.1 % 0.01 / flr</Code>
      </Parameter>
    </Animation>
 
Last edited:
Messages
180
Country
unitedkingdom
How would I change from inHg to Millibars?

I tried replacing the simulation variable from HG, inHg to MB, millibars as below, but it does not seem to work. DoI need to change anything else for teh conversion?

Code:
Animation name="C310_baro_hundths" guid="bb637049-51a5-45b1-82ae-f34ab565dc9c" length="9" type="Sim" typeParam2="C310_baro_hundths" typeParam="AutoPlay" />
    <PartInfo>
    <Name>C310_baro_hundths</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING MB, millibars) abs 99 min 0 max 0.1 % 0.01 / near</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID>
    </MouseRect>
  </PartInfo>

Thanks.
Tyler
 
Messages
440
Country
us-wisconsin
Maybe this is the reason -
It looks like there are 4 separate drums for the display.
For InHG you would have XX.XX, for MB you would have XXXX.
In the code above it looks like you are still computing for X, ie YY.YX,
still in the inHG format for the hundreths where it should be the "ones" in the MB format.
Perhaps this will work: ( number retrieval based on the MS B747 Alt window )
XML:
<!-- CODE FOR THE MB 1's, part name "hundths" -->
<Code>(A:KOHLSMAN SETTING MB, millibars) 10 %</Code>

<!-- CODE FOR THE MB 10's, part name "tenths" -->
<Code>(A:KOHLSMAN SETTING MB, millibars) s1 10 / 10 % flr l1 10 % 9 &gt; if{ l1 10 % 9 - + }</Code>

<!-- CODE FOR THE MB 100's, part name "ones" -->
<Code>(A:KOHLSMAN SETTING MB, millibars) s1 100 / 10 % flr l1 100 % 99 &gt; if{ l1 10 % 9 - + }</Code>

<!-- CODE FOR THE MB 1000's, part name "tens" -->
<Code>(A:KOHLSMAN SETTING MB, millibars) s1 1000 / 10 % flr l1 1000 % 999 &gt; if{ l1 10 % 9 - + }</Code>
 
Top