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!
As Stephan startup .... If Value is a Float ( Decimal Number) then it must be 4 BYTES (32bits) long OR 8 BYTES (64 Bits)
Basicly your right.... Mobiflight see the Float Raw Value but behind the Config the Output Result is a full Number.....
So without any compare/transform a value like 0,1 or 0,99 is always "0" .... A Value like 1,77 is "1" . There is no Rounding. Mobiflight simply ignore all behind the Decimal.
To solve this:
If Raw Value is a Decimal like 0,01 , 0,99 until 1,00 then simply make a Transform : $*100
Then 0,01 result in 1 .... 0,77 result in 77 ..... and finaly 1,00 result in 100
Then you can Work with the Value (Like showing on Displays or using it for Motor Controlls)
what is your decimal, the dot (.) or the comma (,)? In MF the comma is a separator and not a part of a mathematical formula.
The values basicly can be manipulated via the transform-line.
So think about the mathematical rules: what is in brackets is calculated first, point before line calculation. the number of brackets on and off has to be equal.
Don't use spaces within the formulars.
If you use float instead of integer you have to change the number of bytes from 1 to 4 (or 8).
regarding the dataref note that the dataref mostly are only one bit. With a bit you can't got a value other than 0 or 1. Perhaps are there two bits. One for on/off and one for undimmed/dimmed. Then this item can be operated with only one bit.
The problem will be the timing. If you want to lit an annunicator full and after 5 seconds dimmed you will not have a timer in MobiFlight who is able to realize it.
But it could be possible if you read out the sim-time and there only the seconds and calculate them with modulo 10 or 5. Then this value will be 1 min after 1 and max after 5 or 10 seconds so that you have here the reference. Try it
Ok i've solved it, it was saying that for integers, i shall use either int, float or double. using double and adding " * 10" expression at the end solved the problem,