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.

Go to page 1Go to page 112Go to page 3Go to page 2
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Noch was !!!!

Bie dem ganzen HickHack hab ich vergessen das ja DAS eigentlich alles schon mal gemacht wurde..... https://www.mobiflight.com/forum/topic/251.html
Hatte den Topic schon noch im Kopf aber nicht mehr den Code.


iconCode:
function Lights_Taxi(offset, value)
	if (value == 1) then ipc.writeLvar("OHD_EXT_LIGHTS_L_TAXI_SW", 1) 
	else ipc.writeLvar("OHD_EXT_LIGHTS_L_TAXI_SW", 0) 
	end
end

function Lights_Landing(offset, value)
	if (value == 1) then 
			ipc.writeLvar("OHD_EXT_LIGHTS_L_FLARE_SW", 1)
			ipc.writeLvar("OHD_EXT_LIGHTS_L_APPR_SW", 1)
	else 	ipc.writeLvar("OHD_EXT_LIGHTS_L_FLARE_SW", 0)
			ipc.writeLvar("OHD_EXT_LIGHTS_L_APPR_SW", 0)
	end
end

event.offset("66C0","UB","Lights_Taxi")
event.offset("66C2","UB","Lights_Landing")


Jumpin84 hat es eigentlich erklärt und wir machen uns da so einen Kopf.... der Schlüssel ist de Befehl event.offset.

Bitte korrigiert mich.... Aber genau DIESER Befehl bewirkt das der Input ( Das schreiben der Lvar) Nur ausgeführt wird, wenn eben der Offset sich verändert.
Man bräuchte im Falle von deiner Altitude also nur einen Script der Immer läuft.... Der EINMAL den Wert synchronisiert.... Und der am Ende besagte "Funktion" beinhaltet.
Der Befehl "event.offset" sollte dann wenn ich es verstehe bei einer änderung ( Durch unseren Encoder über Mobiflight) die Funktion genau EINMAL ausführen.
Die Funktion wäre dann schlicht "Schreibe Offsetwert auf Lvar"

*********

Ich hoffe ich hab nächste Woche mal Zeit. spätestens Mitte/Ende Januar hab ich mal Urlaub. da geht sicher was
Good Luck !
2018-12-16 06:53
Go to page 1Go to page 112Go to page 3Go to page 2