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! 

05/03/2024 - This forum is read-only

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.

icon
Avatar
vektor1993
Posts: 1
Hello, I finally built a custom panel that replicates some of the A320 overhead panel, however I want to use it for multiple planes.

I have a momentary switch that in Fenix A320 toggles on and off the Wing Anti Ice using "FNX320 Icing Wing Button Press" event which works just fine as a toggle.

I want to use the exact same button on the TBM930, however, the in-plane button is a toggle switch and I don't have a toggle event for that button, but two events - TBM930_AIRFRAME_DE_ICE_ON and TBM930_AIRFRAME_DE_ICE_OFF.

I'd need help with a logic that says if(TBM930_AIRFRAME_DE_ICE_ON) then TBM930_AIRFRAME_DE_ICE_OFF else TBM930_AIRFRAME_DE_ICE_ON.

Would that be possible?

Thanks!
2023-03-29 15:04
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yes it is.

We can do both things with the same (inverted) logic.

So if there exist non ON/OFF Evebnt and only a Toggle is available we build a code that say e.g. for ON "If virtual switch is in OFF then use Toggle 1x if not (So Virtual switch is still in ON) do nothing !

If there exist no Toggle Event we reverse it.... We Say If Virtual switch is ON then send OFF ELSE send ON event.


But overall.... In your case this is not needed.... Cause your ON-OFF Events from TBM930 still use the first way..... In Real its still a Toggle Event !!

E.g. for OFF : (A:STRUCTURAL DEICE SWITCH, Bool) if{ (>K:TOGGLE_STRUCTURAL_DEICE) }

Means.... What you need is just this.... (>K:TOGGLE_STRUCTURAL_DEICE)

Enter this as Custom Code.
Good Luck !
2023-03-29 21:39
icon