Jump to content

Saitek Multi Panel // JAR A330 Anpassung // LUA Script


Kaito164

Recommended Posts

Hi

Habe ein gebrauchtes Saitek Multi Panel bekomme und wollte es so Lange nutzen bis ich das mit der Arduino Programmierung in den Griff bekomme.

Heinz Flichtbeil ( Danke noch mal ^_^ ) hat mir ein Plugin empfohlen was dann auch mit meine CRJ und ein par andere Flieger Funktionierte, leider fehlt da die LUA Anpassung für den A330 von JAR.

Das Script für den A320neo geht leider nicht, evtl. kann mir jemand helfen das LUA Script für das Autopiloten Panel zu erstellen =)

Soweit ich das Script verstanden habe muss ich erst mal eine Abfrage machen ob es die A330 ist und dann Dataref Befehle anpassen.

Das LUA Script für den a320neo habe ich mal eingefügt.

Ein Anliegen habe ich da noch :P
Suche für das Panel die Halterung, leider fehlt sie mir da es ja Gebraucht war.
Wenn jemand noch eine nicht benutze abgeben möchte oder eine Idee hat wo ich das Teil mit Schrauben einzeln herbekommen kann währe Klasse.
So kann ich es leider nicht auf den Yoke befestigen :(

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Script:  A320 Neo engine start and more
-- Version: 1.4
-- Build:   12-29-2014
-- William Good
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Description:
-- Provide a script to help in starting engines
-- I am using my Saitek Pro Flight Throttle, Prop and Mixture System
-- I am using the swithes to expand what I have control over.
-- G3 APU master switch and start button G6 APU generator
-- G4 Hydraulic pumps Green, Blue and Yellow
-- G5 Air Condition
-- added function multi_panel_display_fix fpr people with only a multi panel
-- added function auto_throttle to make the auto throttle switch work like a button.
-- decreased delay in autopilot altitude update on multi panel

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

if PLANE_ICAO == "A320" then
require("xsaitekpanels_multi")

-- we need define the DataRef
dataref("ApuMaster", "sim/cockpit/engine/APU_switch", "writable")
dataref("ApuStart", "sim/custom/xap/apu/start_pb", "writable")
dataref("ApuGen", "sim/custom/xap/elec/apu_gen_on", "writable")


dataref("AltSelect", "sim/custom/xap/fcu/100_1000", "writable")
dataref("Alt1000x", "sim/custom/xap/fcu/alt1000x", "writable")
dataref("Alt100x", "sim/custom/xap/fcu/alt100x", "writable")

dataref("HydEngGrn", "sim/custom/xap/hydr/g/engpump/mode", "writable")
dataref("HydElBlu", "sim/custom/xap/hydr/b/elpump/mode", "writable")
dataref("HydPtu", "sim/custom/xap/hydr/ptu/mode", "writable")
dataref("HydEngYel", "sim/custom/xap/hydr/y/engpump/mode", "writable")
dataref("HydElYel", "sim/custom/xap/hydr/y/elpump/mode", "writable")


dataref("Pack1", "sim/custom/xap/cond/pack1", "writable")
dataref("Pack2", "sim/custom/xap/cond/pack2", "writable")

dataref("Eng1Bleed", "sim/custom/xap/bleed/eng1_bl_knob", "writable")
dataref("Eng2Bleed", "sim/custom/xap/bleed/eng2_bl_knob", "writable")

dataref("CockpitKnob", "sim/custom/xap/cond/ckpt_knob", "writable")
dataref("FwdCabinKnob", "sim/custom/xap/cond/fwd_knob", "writable")
dataref("AftCabinKnob", "sim/custom/xap/cond/aft_knob", "writable")

dataref("HotAir", "sim/custom/xap/cond/hot_air", "writable")

dataref("Bat1On", "sim/custom/xap/elec/bat1_on", "writable")
dataref("Bat2On", "sim/custom/xap/elec/bat2_on", "writable")

dataref("SimBatOn", "sim/cockpit/electrical/battery_on", "writable")

dataref("AutoThrottleMode", "sim/custom/xap/ap/athr_mode", "writable")

dataref("ShareFloat1", "bgood/xsaitekpanels/sharedata/float1", "writable")
dataref("ApAlt", "sim/cockpit/autopilot/altitude", "writable")


-- change button number to match what your button numbers
function apu()
	if not button(162) and last_button(162) then
		ApuMaster = 1
		ApuStart = 1

	end

	if button(162) and last_button(162) then
		ApuMaster = 0
		ApuStart = 0
	end

	if not button(165) and last_button(165) then
		ApuGen = 1

	end

	if button(165) and last_button(165) then
		ApuGen = 0
	end
end

function set_ap_alt()
	if (MULTI_ALT_SWITCH == 1) then
		if (last_multi_knob_inc == 1) and (MULTI_KNOB_INC == 0) then
			if (AltSelect == 0) then
				Alt100x = Alt100x + 1
			end
			if (AltSelect == 1) then
				Alt1000x = Alt1000x + 1
			end
		end
		last_multi_knob_inc = MULTI_KNOB_INC

		if (last_multi_knob_dec == 1) and (MULTI_KNOB_DEC == 0) then
			if (AltSelect == 0) then
				Alt100x = Alt100x - 1
			end
			if (AltSelect == 1) then
				Alt1000x = Alt1000x - 1
			end
		end
		last_multi_knob_dec = MULTI_KNOB_DEC
		ShareFloat1 = Alt100x * 100
		ApAlt = ShareFloat1
	end
end

function start_hyd()
	if not button(483) and last_button(483) then
		HydEngGrn = 1
		HydElBlu = 1
		HydPtu = 1
		HydEngYel = 1
		HydElYel = 1
	end

	if button(483) and last_button(483) then
		HydEngGrn = 0
		HydElBlu = 0
		HydPtu = 0
		HydEngYel = 0
		HydElYel = 0
	end
end

function air_cond()
	if not button(484) and last_button(484) then
		Pack1 = 1
		Pack2 = 1
		Eng1Bleed = 1
		Eng2Bleed = 1
		CockpitKnob = 24.0000
		FwdCabinKnob = 24.0000
		AftCabinKnob = 24.0000
		HotAir = 1
	end

	if button(484) and last_button(484) then
		Pack1 = 0
		Pack2 = 0
		Eng1Bleed = 0
		Eng2Bleed = 0
		CockpitKnob = 18.0000
		FwdCabinKnob = 18.0000
		AftCabinKnob = 18.0000
		HotAir = 0
	end

end

function multi_panel_display_fix()
	if (Bat1On == 1) or (Bat2On == 1) then
		SimBatOn = 1
	else
		SimBatOn = 0	
	end	
end

function auto_throttle()
	if MULTI_AT_SWITCH == 1 then
		if athr_loop < 2 then
			athr_loop = athr_loop + 1
			AutoThrottleMode = 1
		else 
			athr_loop = 2
		end
	else
		AutoThrottleMode = 0
		athr_loop = 0	
	end	
end

do_every_frame ("apu()")
do_every_frame ("set_ap_alt()")
do_every_frame ("start_hyd()")
do_every_frame ("air_cond()")
do_every_frame ("multi_panel_display_fix()")
do_every_frame ("auto_throttle()")
end

Link to comment
Share on other sites

So habe mal was probiert ob der A330 erkannt wird.

Zum Testen habe ich den FLAPS Regler umbelegt um Fahrwerk ein und auszufahren.

Sobald ich bei der IF abfrage 320 nehme funktioniert es nicht.

Leider bekomme ich immer noch nicht eine anzeige auf dem Display.

Finde den Passenden Befehl nicht. Möchte das so kompinieren das ich beim anschalten der Batterie das Display auch an bekommen.

Mit der A320neo und den passenden Script geht es leider sind die Dataref abfragen nicht korrekt.

Evtl. kann mir da jemand helfen, gibt es irgend ein Tool um zu sehen was für befehle der A330 nutzt?

require("xsaitekpanels_multi")
if PLANE_ICAO == "A330" then
	function landing_gear()
		if (MULTI_FLAPS_UP == 1) then
			command_once("sim/flight_controls/landing_gear_up")
		end

		if (MULTI_FLAPS_DN == 1) then
			command_once("sim/flight_controls/landing_gear_down")
		end
	end

do_every_frame ("landing_gear()")


end
Link to comment
Share on other sites

Ja gibt es . Nennt sich AC3D dazu das X Plane plugin für AC3D und schon kannst du ALLE Datarefs auslesen. Das Programm kannst du 14 Tage kostenlos nutzen. Meine Tage sind leider abgelaufen und Vollversion kostet 89 Dollar

LG Ronny

Link to comment
Share on other sites

  • 3 months later...

Öffne dein acf File mit einenm Editor und suche nach z.B. nach gear ;-)

Habe die 330 noch nicht kann aber nicht anderst sein wie die 320 ---> schaue mal hier ;-)

https://github.com/urbanswelt/XAutoCopilot/blob/master/scripts/xac_lua/logic/xac_publish_dataref.lua

Sind alle 320er refs die ich gefunden hatte ;-)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy & Terms of Use