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!
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.
Yes, you can do that with preconditions.
You configure your rotary switch via several input config items (one for each rotary position)
You have to set values at a custom FSUIPC offset (e.g. 0x66C0) via the rotary switch. E.g. Pos HDG set 1, Pos ALT set 2, Pos V/S set 3.
Then you configure one config item, that reads this offset so that it can be used for preconditions.
Then you configure several config items for the different information (e.g. HDG, ALT, V/S) that you want to display. Each config item then will have a precondition where you use the custom offset and compare with the corresponding value (0x66C0 = 1 then HDG is active, 0x66C0 = 2 then is active, etc).
I hope that explains it.
Yes, you can do that with preconditions.
You configure your rotary switch via several input config items (one for each rotary position)
You have to set values at a custom FSUIPC offset (e.g. 0x66C0) via the rotary switch. E.g. Pos HDG set 1, Pos ALT set 2, Pos V/S set 3.
Then you configure one config item, that reads this offset so that it can be used for preconditions.
Then you configure several config items for the different information (e.g. HDG, ALT, V/S) that you want to display. Each config item then will have a precondition where you use the custom offset and compare with the corresponding value (0x66C0 = 1 then HDG is active, 0x66C0 = 2 then is active, etc).
I hope that explains it.
Thats Simple. ( Whatever the Text is long and detailed.... Sorry for that)
At first you need ONE Custom Offset for the whole system... Lets Say we use 66C0 1 Byte INT. ( Normaly thats a free offset.... Some AddOns use it then you need another one like 66C1 66C2 and so on. If System get in trouble you should check if the Offset is free.
Then lets build your Toggle Logic.
You say you use 5 functions ( Com1 Com2 Nav1 Nav2 and ADF )
So you need 5 Momentary Buttons ! Please get sure your LED in the Buttons are indipendent ! If you got Buttons where LED is light always aslong button is pushed ( electrical hardcoded setup) this will not work. You need Buttons where the LED is a own circuit.... so it can be powered ON/OFF indipendent of the Switch position. Normaly those buttons got 4 Pins .... IN-OUT-LEDPowr-GRD .
Create in MF 5 Input Devices Typ Button ( For example Pin 5,6,7,8,9 ) and call it for example "Button 1" "Button 2" and so on.
Wire each button to this Pins ( Not use LED at the moment)
Now open a New Mobiflight Config File.
1. Create "READOUT" Config we use later for Preconditioning. So create a OUTPUT Config ( No Device) and read the used Offset ( For example 66C0 1 Byte INT)
Call it for example "Status Radio"
2. Create 5x Input Config.
First Config use Button 1 as device and will write typ "FSUIPC Offset" . Use 66C0 1 Byte INT and Parameter is "0"
Next will use Button 2 as Device and will write again the SAME Offset 66C0 but now parameter is "1"
Do the same for Button 3,4,5 and use Parameters 2,3,4 there
( I start here with parameter "0" cause on Systemstart a Customoffset is always "0" ... So COM1 is always active when you start your Homecockpit. You can work here also with parameter 1,2,3,4,5 .... But then on Systemstart NO FUNCTION is selected and your Displays are Blank ! )
****
On That Point the system still work !
If you Press a Button then the CUSTOM Offset is written to a Value.... And our Readout Config show this Value. So we have a "Indicator" for the whole system already working !
All follow is simply like a Self running system.... We just use this indicator now for preconditioning or as direct value (for example in the LED System)
*******
Lets talk about the LEDs in your Buttons.
Here you first need every LED like a own device.... So create 5x LED Device ( for example Pin 10,11,12,13,14) and wire Your LEDs.
Create in Mobiflight Five Output Configs. ...
Config 1 Use LED 1 .... Config 2 Use LED2 and so on.
ALL 5 Configs use as Offset the SAME Cutom Offset we talk above ( For example 66C0 )
Now we must compare the value ( You can do this via compare tab of Mobiflight OR via a IF-ELSE in the Transform field... (I simply explane the Compare technic)
Com1 LED (First button) should light always if Com1 is active... So when our Button write the Custom offset to "0" .
So we say in Compare Tab.... IF Value = "0" THEN "1" ELSE "0" ....
That Means... If Value is Zero (Com1 is active) Then set Value to "1" (LED Light)... If Value is NOT 0 ( For example when Com2 is Active at the moment) then set Value to "0" and disable the LED.
Com2 LED (Second Button) should light always if Com2 is active. So when our Button write Custom Offset to "1"
Here you say in Compare Tab ... IF Value = "1" THEN "1" ELSE "0" .... Now LED light only aslong Custom Offset = 1 All other cases its "0" and its off.
Same for the Others ... NAV1 Say IF Value = 2 THEN 1 ELSE 0 ...... NAV2 Say IF Value = 3 THEN 1 ELSE 0 and ADF Say IF Value = 4 THEN 1 ELSE 0
NOW all the LEDs are working correct, too.
***********************
Finaly you need to build the Inputs and Outputs you need. Here its simple.
Create a Set of Configs like you will only build one System ( Like COM1)
So create the Output Configs for your Display ( or two if you build also a Standby Display)
Create all the Inputs for your Swap Button or your Encoders.
Use for all the Configs the needed Offsets and Events to controll COM1 stuff.
If all is working THEN simply add in ALL Configs here a Precondition and say " Only work if "Status Radio" Config = 0
Now the whole set of Configs you create for COM1 is only work aslong your Custom Offset is "0" ( Means Com 1 Button is selected)
And now you will create all this configs you did for Com1 once again. ( Or you copy/duplicate them) .
The second set of Configs now use SAME Devices like Displays and Buttons/Encoders BUT controll Offsets/Events of COM2
And now you must rework all Preconditions so that they work only if "Status Radio" Config = 1 ( Means Com2 is current mode)
Finaly you did it again for Nav1 Nav2 and ADF.... Create again all configs.... But just use in precondition now value 2,3,4
**********
In Easy words....
You create for each Function ( Like the Display that show Active Frequency) basicly 5 single Configs.... Each Config read its own value (like Com1, Com2 and so on)
With the Precondition we get sure that always there is only ONE of the Configs is active ! ... And we use the Custom Offset as "Indicator" to define this !