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! 

icon
Avatar
kfoisy
Posts: 14
Hi,
First let me say, I have been SimVim user for several years and I love MobiFlight! Such a great tool. Love the implementation!
Now, as a new user, I'm probably doing something wrong.

I am looking at Flaps Percent and it's represented as a decimal in the range of 0-1. So, 0.5 would be 50%.
I am using Compare feature to check for 0.5 and set Output to 1. Anything else, set value to 0.
When I look at the output values everything looks correct, but it does not do the convert. Output value is always 0.

Am I missing something? I am using Compare on other variables with integer values and it's working perfect. Decimals though do not seem to work.

Thanks,
Kevin
2022-10-31 23:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
Hi Kevin.

Funny that your question come exactly now....

Mobiflight (since beginning 8 years ago and until now) make a truncate.
Means a Float is correctly read from Sim.... But is truncated after transform... ( No mater if Transform is active or not)
So a Value of 0,01 or 0,99 is behind transform ( so before the compare) truncate to 0 ..... 1,987 = 1 .... 2,0001 = 2 for example.

The funny fact. With next Version this is gone.... Then we push a float Value also through the Transform and compare by default.

Solutions:

1. Simply wait some days/weeks for MF v9.6 official release.
OR
2. Enable the BETA Programm in Settings. After next Mobiflight Start it will offer you the Download for newest Beta. Also this include that logic already.
OR

3. The Oldschool Solutions we do all the years.... Simply "multiply" in Transform, or do the needed compare there.
e.g.
Value goes from 0.01 to 1.00 .... Transform : $*100 result now in a number of 1-100 and then you can Compare like if Value= 50 THEN 1 ELSE 0
Or you say in Transform if($=0.5,1,0) Would do the same without need the compare anymore.

A last easy workflow.... You can also change the unit typ in the Variable.... So you not read a 0.01 to 1.00
In FS2020 unit typ "percent" gives 0-100 .... "Percent over 100" gives 0.0 to 1.0 .
Good Luck !
2022-11-01 13:08
Avatar
jlr91
Posts: 9
Hi,
I'm pretty sure that's the same problem. I'm getting hte wind velocity and get a decimal. The problem is that the output is also a decimal. I need an integer. Is there a transform which does that ? I tried int($), rnd($), round($), trunc($). None work.
Do I have to wait the next version ?
2022-11-02 14:28
Avatar
kfoisy
Posts: 14
This is GREAT news!! Thank you for the quick reply. I just installed the latest version and I will give it a go!
:thumbup:

iconpizman82:

Hi Kevin.

Funny that your question come exactly now....

Mobiflight (since beginning 8 years ago and until now) make a truncate.
Means a Float is correctly read from Sim.... But is truncated after transform... ( No mater if Transform is active or not)
So a Value of 0,01 or 0,99 is behind transform ( so before the compare) truncate to 0 ..... 1,987 = 1 .... 2,0001 = 2 for example.

The funny fact. With next Version this is gone.... Then we push a float Value also through the Transform and compare by default.

Solutions:

1. Simply wait some days/weeks for MF v9.6 official release.
OR
2. Enable the BETA Programm in Settings. After next Mobiflight Start it will offer you the Download for newest Beta. Also this include that logic already.
OR

3. The Oldschool Solutions we do all the years.... Simply "multiply" in Transform, or do the needed compare there.
e.g.
Value goes from 0.01 to 1.00 .... Transform : $*100 result now in a number of 1-100 and then you can Compare like if Value= 50 THEN 1 ELSE 0
Or you say in Transform if($=0.5,1,0) Would do the same without need the compare anymore.

A last easy workflow.... You can also change the unit typ in the Variable.... So you not read a 0.01 to 1.00
In FS2020 unit typ "percent" gives 0-100 .... "Percent over 100" gives 0.0 to 1.0 .

2022-11-04 02:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5884
Supporter
iconjlr91:

Hi,
I'm pretty sure that's the same problem. I'm getting hte wind velocity and get a decimal. The problem is that the output is also a decimal. I need an integer. Is there a transform which does that ? I tried int($), rnd($), round($), trunc($). None work.
Do I have to wait the next version ?



You need to use the correct syntax for the used NCalc Code....
https://github.com/ncalc/ncalc/wiki/Functions

So "Truncate($)" Will change 1,001 or 1,999 into "1" .....
"Round($,0)" would change 1,3999 into 1 .... 1,5001 into 2

NOTE: Nacalc is Case Sensetive.... So get sure you use e.g. Round and not round or ROUND.
Good Luck !
2022-11-09 18:59
icon