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
Kristian27
Posts: 12
Hello! I am trying to get my MCP to work properly so that the digits are blank when power is off. i have made a placeholder/config reference for power off but am stuck at the transform, I am trying to make it so if(a=0,$,99999) as suggested in another post. my problem is that i already have a transform ($/65536) that is necessary to display the correct numbers. is it possible to put these two together in 1 transform window?
2020-05-21 15:39
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1545
Supporter
Hi,

what's about: if(a=1,$/65636,99999) ?
Grüße,
Stephan
2020-05-21 16:24
Avatar
Kristian27
Posts: 12
"Error on config execution. An error occured on parsing your value formula. Please review and correct any errors."

Update: got it to work tried a=0 instead of 1 so thats why :P
so if i get this right, this forula means if a =1 set output value $/65636 else set output value 99999 ?
[Last edited by Kristian27, 2020-05-21 18:54]
2020-05-21 18:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3732
Supporter
It can be no error here whatever you use a=1 or a=0 thats both working.

Pretty sure you got a other issue.... do you create the Config "Battery Off" behind the other config ??
If Yes then at first run of Mobiflight there is a Error Warning cause it can not define "a" in case the Config "Battery Off" i still not readed.... Cause its behind!
Mayb then you change 1--->0 and then it work cause it was the second try.
If your Battery Config is realy behind then i would say there was another issue..... But . Technical here 1 or 0 is both OK.

About Formula:
Stephans Idea is correct.... If you change here 1/0 as you said then its inverted... Then it show 99999 if battery is ON and it show Value if Battery is OFF.

Basicly you got a lot of ways to solve this. Technical all will work. Can tell you 30 different logics if you like :P
Just the 2 most easy formulas:

1. Stephans Formula : if(a=1,$/65536,99999)
2. Or your Idea with A=0 : if(a=0,99999,$/65536)
Good Luck !
2020-05-21 19:15
Avatar
Kristian27
Posts: 12
Thank you, the Battery off config is at the bottom , i guess the only way to change this is to edit the .mcc file. maybe this is a feature that could be implemented in another version ? so you can change priority without having to fiddle around in the configs.
but how should i do this for the altitude display where "if($<0,$+65635,$)" is neccesarry since above 32700feet the numbers change to negative number ?
2020-05-21 19:20
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3732
Supporter
Hi again
Yes.... I also vote this "swap sequence" feature up. But thats a bit difficult to implement..... Whatever its medium Priority already on toDoList.

About Solution:

You can simply duplicate the first config... then the Duplicated one is on the second Line !
Then you just need to rename it and to set the same entrys as in Battery Off config.
Finaly you delete the Original Battery Config.

As you said the only alternate is to do this in the mcc file ( not difficult if you get a bit experience) or to create the whole file new ( usefull if this is just a testing config) .

******

About the second Problem..... here we can use a much more advanced formula or we can use a "bypass" by a other config or compare tab.

iconKristian27:

T but how should i do this for the altitude display where "if($<0,$+65635,$)" is neccesarry since above 32700feet the numbers change to negative number ?



For me the advanced Formula in transform is most comfortable but you can also use other systems if you like.

if(a=0,99999,if($<0,$+65536,$))

means.... If "a" ( Battery) is 0 (off) then set 99999.... ELSEIF ( so if battery is not zero and is on) Now check $ (altitude) .... if its below zero then $+65536 ( By the way your quoted 65635 is wrong.... should be as i said 65536) .... Finaly if its NOT below zero then set $ .
Good Luck !
2020-05-21 20:36
Avatar
Kristian27
Posts: 12
I will try that and see if it works:) when using 65536 the altitude was showing 100 feet lower than what the value actually was from 32800 and up don't know why but adding 100 worked
2020-05-21 20:56
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3732
Supporter
OK
May your right...... In a Heading with clear Values we also add +360 and not +359
In case i not see the Offset and not know the AddOn and how it workes this was just a theoretic idea. Some programmes round internal already.

To solve this the best way is a little math calculation.
Turn the Altitude exactly to the swap point. ( As you said 32700 is good 32800 not.... So turn 32800.
Then check the output Value of the Offset ( Mobiflight window behind the config in the "FSUIPC Value Field" This is now a negative number.)
Now Simply calculate the difference ..... Mathematical -xxxxxx + ??? = 32800 Simply add both numbers together and ignore the minus and you got the difference.

So your right.... If its 65635 then use it instead of my first recomandtion.
Good Luck !
2020-05-22 13:37
Avatar
Kristian27
Posts: 12
It works perfectly now :)
I am however wondering about another issue. sometimes when turning the encoders the value will continue to rise long after I have stopped turning the encoder, I have been made aware that this has something to do with how event ids are processed, but the weird thing is that sometimes when running mobiflight I can turn the encoders with almost no delay and it will work perfectly. I have yet to find what I am doing different to make it work, would you have any insight into this? I have the fsuipc pooling set to the highest setting as well as giving mobiflight realtime priority.
2020-05-26 20:37
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1545
Supporter
Hi Kristian,

switch off the logging and the delay is away
Logging should only be used to analize issues not for real operation.
Grüße,
Stephan
2020-05-26 22:09
Avatar
Kristian27
Posts: 12
ooh, ofcourse :P My mistake, thank you !
2020-05-27 17:22
icon