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
PaulH
Posts: 15
The output configuration may contain rules like 'Precondition', 'Comparison', 'Interpolation' and 'Transform'.

In what order are the rules applied to the value read?

I assume the following order when all rules are defined:
- the value is read from the offset
- the precondition is applied
- the comparison rule is executed
- the interpolation is done
- the transform is executed

is this correct?

Paul
2021-04-18 13:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
Negative

The Value is read from FSUIPC.....

Then Transform Field is working.... $ in Transform is the former Raw Falue read from FSUIPC.
Whatever if transform is enabled or not.... The Value is "floor" behind.... Means all decimal Numbers no longer exist behind the Transform.
A Value like 1,9999 reulst in "1" behind transform.

Then Compare come to act.
Here "$" represent the result of the Transform ( if no transform is active it means the Raw Value or a floor Integer of a Float )

Interpolation comes behind the Compare..... Whatever normaly we not use both same time.
Here i´m not sure. But if no Compare is active then i think Interpolation use the Raw Value behind Transform.
NOTE: Interpolation will crash if you use compare with "Strings" . For Interpolation you need logical a integer number !


**************
The "Precondition" is technical "outsourced" from that logic.
Precon just means if a Config should "execute" something.
A Output Config only send it final value to a device ( Display, LED Motor) if Precon is TRUE.
A Input Switch only execute a Command if Precon is TRUE.

BUT !!!!

A Disabled Config still work in Backround related to the Value.

So lets say you have a Offset That is "1" in sim.... You read it and say "$+100" in transform.
So result is "101".
This config still have Value 101 whatever Precon is True or False ( So the calculation is done at all time)
Precon just define if the used device ( Display) show something or not.


I hope i can explane all you need. More questions ? Simply ask again !
Good Luck !
2021-04-18 14:22
Avatar
PaulH
Posts: 15
Thank you for clarifying.

So to be complete, the sequence is (for integer types)

For INPUT configs first the precondition is checked, if true the action configured (Press or Release) is executed
- the current value is read from FSUIPC offset to $,
- the set value formula is executed,
- the result is 'floored' (truncated to integer part)
- the truncated value is written to the FSUIPC offset

For OUTPUT configs
- the current value is read from FSUIPC offset to $,
- the transform is executed,
- the transform result is 'floored' (truncated to integer part)
- the comparison rule is executed
- the interpolation is done
- the precondition is checked, if true the value is provided to the device (LED etc.)

Hopefully I got it right this time.
2021-04-18 21:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4647
Supporter
Basicly i´m not the Programmer....
So my information is not 100% Confirmed..... But i work with it that way since years and thats how i exolore the system !

Your Information for OUTPUT seems good.

For INPUT this sounds correctly ( If you use "FSUIPC Offset" as typ of Input ) For example Input Typ EventID not read something and there exist also no "$" or Transform !

The only Fact i not know is the behavour of Float Inputs...... Simply cause we normaly not do this. Verry Rare !
Most Inputs are SET Values.... Means we write "1" or "0" e.g.
At the moment i not remember to a INPUT Situation we would send a Float Value.... So i can not tell you if it´s rounded to a Integer or if it´s send as a float.

If you know a Value that is FLOAT and where it make sense to write it.... Tell me. Then i can do a test.
Good Luck !
2021-04-19 12:57
icon