April 20, 201016 yr Moderator I've been working on a 3d altimeter and have come to an odd problem with the barometric pressure digital display......most particularly the hundredths digit. Keyframed 0-9...This script should work, but it is precisely -0.01 unit off! When it should display 29.92, it is displaying 29.91... :( <PartInfo> <Name>baro_hundths</Name> <AnimLength>9</AnimLength> <Animation> <Parameter> <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 0.1 % 0.01 / flr</Code> </Parameter> </Animation> <MouseRect> <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID> </MouseRect> </PartInfo> Since that translates to a nine foot error, it is unacceptable. Anyone have any ideas? Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
April 20, 201016 yr I've been working on a 3d altimeter and have come to an odd problem with the barometric pressure digital display......most particularly the hundredths digit. Keyframed 0-9...This script should work, but it is precisely -0.01 unit off! When it should display 29.92, it is displaying 29.91... :( <PartInfo> <Name>baro_hundths</Name> <AnimLength>9</AnimLength> <Animation> <Parameter> <Code>(A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 0.1 % 0.01 / flr</Code> </Parameter> </Animation> <MouseRect> <TooltipID>TOOLTIPTEXT_ALTIMETER_FEET_METERS_SPECIAL</TooltipID> </MouseRect> </PartInfo> Since that translates to a nine foot error, it is unacceptable. Anyone have any ideas? Possibly it's a rounding error, arising from the actual value of (A:KOHLSMAN SETTING HG, inHg). If that actually returns 29.9199999 then your expression would give 1 instead of 2 for the last digit. The same effect could occur from rounding by the % and / operators.You might have to accept that, with only a 4-digit display, 29.92 actually represents a setting typically between 29.9150001 and 29.9249999.Incidentally, what is your reason for taking the absolute value and limiting it to between 0 and 99? Gerry Howard
April 20, 201016 yr Hi Bill!It seems that Flght Simulator uses a value of 29.919 inHg to aproximate a Baro value of 29.92, if you calibrate it increasing the baro pressure it changes to 29.928 so the offset is now 0.008. Using the math of your claculation it will show 29.91 unless you calibrate the altimeter or use NEAR instead of FLR to show 29.92. I use the folowing code to display the Barometric setting: <String>%((L:Standar Pressure, bool))%{if}% STD %{else}%((L:Baro Sel, bool))%{if}%((A:Kohlsman setting mb, Pa) 100 / flr)%!4.0f!%{else}%((A:Kohlsman setting hg, inHg) 0 max 99.99 min)%!5.2f!%{end}%{end}</String> RegardsJavier
April 20, 201016 yr Commercial Member Hi BillHave a squinty at sd2gau... there's a bit of corrective code somewhere near the end as I recall. FS equates 29.92Hg to 1013MB, which it ain't. -Dai
April 20, 201016 yr Author Moderator You might have to accept that, with only a 4-digit display, 29.92 actually represents a setting typically between 29.9150001 and 29.9249999.Incidentally, what is your reason for taking the absolute value and limiting it to between 0 and 99?Gerry, the reason for the 0 - 99 limit is to keep the output scaled for 0 to 99 keyframes of animation in the 3d model.Changing "flr" to "near" seems to have solved the display issue. "ceil" would also work. The remaining 3d drums continue to have "flr" to prevent premature rollover from occurring.Thanks to everyone for their suggestions! :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment