MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Egyptair
Posts: 16
Hello,

as I want to convert an altimeter for use with the sim, I would like to add 7 segments to show the altitude.

Is it possible to show the altitude in 20 feet steps, e.g. 1000... 1020...1040... something like a round function ? (round 1009 to 1000 ... round 1011 to 1020) ?

Thanks !!

Egyptair
2021-01-12 15:14
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
Its cool what requests income from Users.

A "Decimal Round" is no problem.... So 12.345 feet can be roundet to 10.000 12.000 or 12.300 or 12.350
Here we simply divide the Value .... eg. if you like full thousends you say : Round($/1000,0)*1000 .
If its 12345 it will say.... 12345/1000 = 12,345 Roundet 12,345= 12 .... And 12 multiply again with 1000 = 12000

Other example to rounds for tenths ..... Round($/10,0)*10
Here 12345 / 10 = 1234,5 ---- Roundet 1234,5 = 1235 .... And multiply with 10 = 12350

*********

A round to 20 should be possible.... But YOU must decide at first what should happen at "10" ..... So e.g. 1010 feet.... Should it show 1000 or 1020 ?
For a "regulary" round we say 0-4 = down 5-9 is up ..... For your "custom logic" YOU must define the rules.

NOTE: I think it´s possible and i can figure out a good formula..... BUT you should realy think about the neednes. I never heard about that or see it in a real cockpit.
Rounding to 10th.... Yes.... But to 20 ????
Good Luck !
2021-01-15 23:53
Avatar
Egyptair
Posts: 16
Hi pizman82,

sorry for my late reaction and many thanks for your post.

the idea behind this is, that it would look to restless, when the altimeter shows every feet... the digital standby ADI shows the altimeter change in 20 feet steps

https://www.flightdeck737.be/wp-content/galleries/stby-instr/DSC00880.jpg

and during cruise, it would change constantly from e.g. 33.999 to 34.001 and so on...
I would like to have the values as these : 0 - 9 : round down to 0 .... 10 to 19 round up to 20... that means, 10 should be up rounded as 0 to 9 are 10 values and
10 to 19 are 10 values too (included is the 10) that would give a smoother change...

Greetings

Mido
2021-01-20 14:59
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Ok.
For a Standby Altimeter as i know mostly the 100 Round is used....
While a Climb or descent also the 20 feet steps occure in a extreme flickering ( cause you change by 20 feets in less then a second) And in Cruse Altitude its no mater if your 50 feet below or above ( the most wrong value is +49 or -50 feet in a rounding to full 100 feets) So Fly in 32960 feet or fly in 33040 feet.... Both is FL330 :-)


**********
But ok.... If you like a 20 step we should do it.

I think the key at first is a FLOOR to elimante the "ones" .....
So we say in the Transform Floor(Altitude Divide through 10) and finaly multiply with 10 again
I not know if you still use a formula to recalculate the raw FSUIPC Value into clear feets.... If yes this must include in bracets.
So it looks like Floor((your formula)/10)*10
With this transform a Altitude like 12345 is shown as 12340 now ( it get divide into 1234,5 and the Floor Function CUT the Decimal to 1234 ... and the Multiply make 12340)

So examples:
1000 to 1001 feet result in 1000 ... .. 1010 to 1019 feet is result in 1010 .... 1020 to 1029 result in 1020
Now the Down Steps are already fine.... But the UP states are shown as 10,30,50,70 and 90 instead of roundet to the next full tenths.

So we use the Compare:
Say IF Value is NOT Zero != 0
In the THEN field you say .... if($%20=0,$,$+10)
The Modulo means.... If Current Value divide through 20 result in a rest of zero ( so all Altitudes that ends with 00.20.40.60.80) then show the current Value . If NOT ( And the Divide through 20 result in a rest of 10.... Like in the 10,30,50,70,90 situations) THEN Add 10 to the current Altitude.

Result: 1001-1009 = 1000 ... 1010-1019 = 1020 .... 1020-1029 = 1020 ..... 1030-1039 = 1040


**************
NOTE: I not test it myself on the Computer.... Just in my Brain. Hope it work !
Good Luck !
2021-01-21 05:30
icon