2017-04-05 22:36:27 +00:00
|
|
|
# Aircraft Config Center
|
|
|
|
# Joshua Davidson (it0uchpods)
|
|
|
|
|
2017-08-16 20:53:35 +00:00
|
|
|
#########################################
|
|
|
|
# Copyright (c) it0uchpods Design Group #
|
|
|
|
#########################################
|
2017-07-13 17:30:33 +00:00
|
|
|
|
2017-06-07 18:58:49 +00:00
|
|
|
var spinning = maketimer(0.05, func {
|
2017-05-29 16:30:05 +00:00
|
|
|
var spinning = getprop("/systems/acconfig/spinning");
|
|
|
|
if (spinning == 0) {
|
|
|
|
setprop("/systems/acconfig/spin", "\\");
|
|
|
|
setprop("/systems/acconfig/spinning", 1);
|
|
|
|
} else if (spinning == 1) {
|
|
|
|
setprop("/systems/acconfig/spin", "|");
|
|
|
|
setprop("/systems/acconfig/spinning", 2);
|
|
|
|
} else if (spinning == 2) {
|
|
|
|
setprop("/systems/acconfig/spin", "/");
|
|
|
|
setprop("/systems/acconfig/spinning", 3);
|
|
|
|
} else if (spinning == 3) {
|
|
|
|
setprop("/systems/acconfig/spin", "-");
|
|
|
|
setprop("/systems/acconfig/spinning", 0);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-06-10 15:57:48 +00:00
|
|
|
var failReset = func {
|
|
|
|
setprop("/systems/failures/elac1", 0);
|
|
|
|
setprop("/systems/failures/elac2", 0);
|
|
|
|
setprop("/systems/failures/sec1", 0);
|
|
|
|
setprop("/systems/failures/sec2", 0);
|
|
|
|
setprop("/systems/failures/sec3", 0);
|
|
|
|
setprop("/systems/failures/fac1", 0);
|
|
|
|
setprop("/systems/failures/fac2", 0);
|
|
|
|
setprop("/systems/failures/aileron-left", 0);
|
|
|
|
setprop("/systems/failures/aileron-right", 0);
|
|
|
|
setprop("/systems/failures/elevator-left", 0);
|
|
|
|
setprop("/systems/failures/elevator-right", 0);
|
|
|
|
setprop("/systems/failures/rudder", 0);
|
2017-06-10 18:17:13 +00:00
|
|
|
setprop("/systems/failures/spoiler-l1", 0);
|
|
|
|
setprop("/systems/failures/spoiler-l2", 0);
|
|
|
|
setprop("/systems/failures/spoiler-l3", 0);
|
|
|
|
setprop("/systems/failures/spoiler-l4", 0);
|
|
|
|
setprop("/systems/failures/spoiler-l5", 0);
|
|
|
|
setprop("/systems/failures/spoiler-r1", 0);
|
|
|
|
setprop("/systems/failures/spoiler-r2", 0);
|
|
|
|
setprop("/systems/failures/spoiler-r3", 0);
|
|
|
|
setprop("/systems/failures/spoiler-r4", 0);
|
|
|
|
setprop("/systems/failures/spoiler-r5", 0);
|
2017-06-10 15:57:48 +00:00
|
|
|
setprop("/systems/failures/elec-ac-ess", 0);
|
|
|
|
setprop("/systems/failures/elec-batt1", 0);
|
|
|
|
setprop("/systems/failures/elec-batt2", 0);
|
|
|
|
setprop("/systems/failures/elec-galley", 0);
|
|
|
|
setprop("/systems/failures/elec-genapu", 0);
|
|
|
|
setprop("/systems/failures/elec-gen1", 0);
|
|
|
|
setprop("/systems/failures/elec-gen2", 0);
|
|
|
|
setprop("/systems/failures/bleed-apu", 0);
|
|
|
|
setprop("/systems/failures/bleed-ext", 0);
|
|
|
|
setprop("/systems/failures/bleed-eng1", 0);
|
|
|
|
setprop("/systems/failures/bleed-eng2", 0);
|
|
|
|
setprop("/systems/failures/pack1", 0);
|
|
|
|
setprop("/systems/failures/pack2", 0);
|
|
|
|
setprop("/systems/failures/hyd-blue", 0);
|
|
|
|
setprop("/systems/failures/hyd-green", 0);
|
|
|
|
setprop("/systems/failures/hyd-yellow", 0);
|
|
|
|
setprop("/systems/failures/ptu", 0);
|
|
|
|
setprop("/systems/failures/pump-blue", 0);
|
|
|
|
setprop("/systems/failures/pump-green", 0);
|
|
|
|
setprop("/systems/failures/pump-yellow-eng", 0);
|
|
|
|
setprop("/systems/failures/pump-yellow-elec", 0);
|
2017-09-23 01:56:44 +00:00
|
|
|
setprop("/systems/failures/tank0pump1", 0);
|
|
|
|
setprop("/systems/failures/tank0pump2", 0);
|
|
|
|
setprop("/systems/failures/tank1pump1", 0);
|
|
|
|
setprop("/systems/failures/tank1pump2", 0);
|
2017-07-25 16:21:41 +00:00
|
|
|
setprop("/systems/failures/tank2pump1", 0);
|
|
|
|
setprop("/systems/failures/tank2pump2", 0);
|
|
|
|
setprop("/systems/failures/fuelmode", 0);
|
2017-09-21 19:07:54 +00:00
|
|
|
setprop("/systems/failures/cargo-aft-fire", 0);
|
|
|
|
setprop("/systems/failures/cargo-fwd-fire", 0);
|
2017-06-10 15:57:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
failReset();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/systems/acconfig/autoconfig-running", 0);
|
2017-05-29 16:30:05 +00:00
|
|
|
setprop("/systems/acconfig/spinning", 0);
|
|
|
|
setprop("/systems/acconfig/spin", "-");
|
2017-08-11 05:49:48 +00:00
|
|
|
setprop("/systems/acconfig/new-revision", "");
|
|
|
|
setprop("/systems/acconfig/out-of-date", 0);
|
2017-09-21 01:09:20 +00:00
|
|
|
setprop("/systems/acconfig/mismatch-code", "0x000");
|
|
|
|
setprop("/systems/acconfig/mismatch-reason", "XX");
|
2017-09-17 17:11:35 +00:00
|
|
|
var main_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/main/dialog", "Aircraft/IDG-A32X/AircraftConfig/main.xml");
|
|
|
|
var welcome_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/welcome/dialog", "Aircraft/IDG-A32X/AircraftConfig/welcome.xml");
|
|
|
|
var ps_load_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psload/dialog", "Aircraft/IDG-A32X/AircraftConfig/psload.xml");
|
|
|
|
var ps_loaded_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psloaded/dialog", "Aircraft/IDG-A32X/AircraftConfig/psloaded.xml");
|
|
|
|
var init_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/init/dialog", "Aircraft/IDG-A32X/AircraftConfig/ac_init.xml");
|
|
|
|
var help_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/help/dialog", "Aircraft/IDG-A32X/AircraftConfig/help.xml");
|
|
|
|
var fbw_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fbw/dialog", "Aircraft/IDG-A32X/AircraftConfig/fbw.xml");
|
|
|
|
var fail_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fail/dialog", "Aircraft/IDG-A32X/AircraftConfig/fail.xml");
|
|
|
|
var about_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/about/dialog", "Aircraft/IDG-A32X/AircraftConfig/about.xml");
|
|
|
|
var update_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/update/dialog", "Aircraft/IDG-A32X/AircraftConfig/update.xml");
|
2017-09-21 01:09:20 +00:00
|
|
|
var error_mismatch = gui.Dialog.new("sim/gui/dialogs/acconfig/error/mismatch/dialog", "Aircraft/IDG-A32X/AircraftConfig/error-mismatch.xml");
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.start();
|
2017-04-05 22:36:27 +00:00
|
|
|
init_dlg.open();
|
|
|
|
|
2017-10-05 17:09:50 +00:00
|
|
|
http.load("https://raw.githubusercontent.com/it0uchpods/IDG-A32X/master/revision.txt").done(func(r) setprop("/systems/acconfig/new-revision", r.response));
|
2017-08-11 05:49:48 +00:00
|
|
|
var revisionFile = (getprop("/sim/aircraft-dir")~"/revision.txt");
|
|
|
|
var current_revision = io.readfile(revisionFile);
|
|
|
|
|
|
|
|
setlistener("/systems/acconfig/new-revision", func {
|
|
|
|
if (getprop("/systems/acconfig/new-revision") > current_revision) {
|
|
|
|
setprop("/systems/acconfig/out-of-date", 1);
|
|
|
|
} else {
|
|
|
|
setprop("/systems/acconfig/out-of-date", 0);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-09-21 01:09:20 +00:00
|
|
|
var mismatch_chk = func {
|
2017-09-28 23:07:10 +00:00
|
|
|
if (num(string.replace(getprop("/sim/version/flightgear"),".","")) < 201730) {
|
2017-09-21 01:09:20 +00:00
|
|
|
setprop("/systems/acconfig/mismatch-code", "0x121");
|
2017-09-28 23:07:10 +00:00
|
|
|
setprop("/systems/acconfig/mismatch-reason", "FGFS version older than 2017.3.0, please update FlightGear");
|
2017-09-21 01:09:20 +00:00
|
|
|
if (getprop("/systems/acconfig/out-of-date") != 1) {
|
|
|
|
error_mismatch.open();
|
|
|
|
}
|
|
|
|
print("Mismatch: 0x121");
|
2017-09-21 16:52:19 +00:00
|
|
|
} else if (getprop("/gear/gear[0]/wow") == 0 or getprop("/position/altitude-ft") >= 50000 or getprop("/systems/acconfig/libraries-loaded") == 0) {
|
|
|
|
setprop("/systems/acconfig/mismatch-code", "0x223");
|
|
|
|
setprop("/systems/acconfig/mismatch-reason", "Aircraft initialization failed");
|
|
|
|
if (getprop("/systems/acconfig/out-of-date") != 1) {
|
|
|
|
error_mismatch.open();
|
|
|
|
}
|
|
|
|
print("Mismatch: 0x223");
|
2017-09-21 01:09:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-05 22:36:27 +00:00
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
|
|
|
init_dlg.close();
|
2017-08-11 05:49:48 +00:00
|
|
|
if (getprop("/systems/acconfig/out-of-date") == 1) {
|
|
|
|
update_dlg.open();
|
2017-09-21 01:09:20 +00:00
|
|
|
print("System: The IDG-A32X is out of date!");
|
|
|
|
}
|
|
|
|
mismatch_chk();
|
|
|
|
if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
2017-08-11 05:49:48 +00:00
|
|
|
welcome_dlg.open();
|
|
|
|
}
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
});
|
|
|
|
|
2017-05-23 23:38:16 +00:00
|
|
|
var saveSettings = func {
|
2017-10-05 17:09:50 +00:00
|
|
|
aircraft.data.add("/options/system/keyboard-mode", "/controls/adirs/skip", "/controls/tray/surprise");
|
2017-05-23 23:38:16 +00:00
|
|
|
aircraft.data.save();
|
|
|
|
}
|
|
|
|
|
|
|
|
saveSettings();
|
2017-05-21 01:58:26 +00:00
|
|
|
|
2017-05-21 17:20:14 +00:00
|
|
|
var systemsReset = func {
|
2017-06-10 15:57:48 +00:00
|
|
|
fbw.fctlInit();
|
2017-05-21 17:20:14 +00:00
|
|
|
systems.elec_init();
|
|
|
|
systems.ADIRSreset();
|
|
|
|
systems.pneu_init();
|
|
|
|
systems.hyd_init();
|
2017-06-09 16:53:49 +00:00
|
|
|
systems.fuel_init();
|
2017-07-03 18:26:43 +00:00
|
|
|
systems.eng_init();
|
2017-10-04 19:53:07 +00:00
|
|
|
systems.autobrake_init();
|
2017-05-21 17:20:14 +00:00
|
|
|
fmgc.FMGCinit();
|
|
|
|
mcdu1.MCDU_reset();
|
|
|
|
mcdu2.MCDU_reset();
|
2017-07-07 14:32:39 +00:00
|
|
|
icing.icingInit();
|
2017-06-03 15:53:36 +00:00
|
|
|
fmgc.APinit();
|
2017-06-02 00:53:50 +00:00
|
|
|
setprop("/it-autoflight/input/fd1", 1);
|
|
|
|
setprop("/it-autoflight/input/fd2", 1);
|
|
|
|
libraries.ECAMinit();
|
2017-06-02 02:57:14 +00:00
|
|
|
libraries.variousReset();
|
2017-05-21 17:20:14 +00:00
|
|
|
}
|
|
|
|
|
2017-04-05 22:36:27 +00:00
|
|
|
################
|
|
|
|
# Panel States #
|
|
|
|
################
|
|
|
|
|
|
|
|
# Cold and Dark
|
|
|
|
var colddark = func {
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.start();
|
2017-04-05 22:36:27 +00:00
|
|
|
ps_load_dlg.open();
|
|
|
|
setprop("/systems/acconfig/autoconfig-running", 1);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 1);
|
|
|
|
setprop("/controls/gear/brake-right", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
# Initial shutdown, and reinitialization.
|
|
|
|
setprop("/controls/engines/engine-start-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/flight/slats", 0.000);
|
|
|
|
setprop("/controls/flight/flaps", 0.000);
|
|
|
|
setprop("/controls/flight/flap-lever", 0);
|
2017-05-07 19:26:41 +00:00
|
|
|
setprop("/controls/flight/flap-pos", 0);
|
|
|
|
setprop("/controls/flight/flap-txt", " ");
|
2017-05-29 16:30:05 +00:00
|
|
|
libraries.flaptimer.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/flight/speedbrake-arm", 0);
|
|
|
|
setprop("/controls/gear/gear-down", 1);
|
2017-06-10 14:56:11 +00:00
|
|
|
setprop("/controls/flight/elevator-trim", 0);
|
2017-05-21 17:20:14 +00:00
|
|
|
systemsReset();
|
2017-06-01 00:12:07 +00:00
|
|
|
failReset();
|
2017-04-05 22:36:27 +00:00
|
|
|
if (getprop("/engines/engine[1]/n2") < 2) {
|
|
|
|
colddark_b();
|
|
|
|
} else {
|
|
|
|
var colddark_eng_off = setlistener("/engines/engine[1]/n2", func {
|
|
|
|
if (getprop("/engines/engine[1]/n2") < 2) {
|
|
|
|
removelistener(colddark_eng_off);
|
|
|
|
colddark_b();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var colddark_b = func {
|
|
|
|
# Continues the Cold and Dark script, after engines fully shutdown.
|
|
|
|
setprop("/controls/APU/master", 0);
|
|
|
|
setprop("/controls/APU/start", 0);
|
2017-04-24 12:46:44 +00:00
|
|
|
setprop("/controls/bleed/OHP/bleedapu", 0);
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/battery1", 0);
|
|
|
|
setprop("/controls/electrical/switches/battery2", 0);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 0);
|
|
|
|
setprop("/controls/gear/brake-right", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/systems/acconfig/autoconfig-running", 0);
|
|
|
|
ps_load_dlg.close();
|
|
|
|
ps_loaded_dlg.open();
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Ready to Start Eng
|
|
|
|
var beforestart = func {
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.start();
|
2017-04-05 22:36:27 +00:00
|
|
|
ps_load_dlg.open();
|
|
|
|
setprop("/systems/acconfig/autoconfig-running", 1);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 1);
|
|
|
|
setprop("/controls/gear/brake-right", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
# First, we set everything to cold and dark.
|
|
|
|
setprop("/controls/engines/engine-start-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/flight/slats", 0.000);
|
|
|
|
setprop("/controls/flight/flaps", 0.000);
|
|
|
|
setprop("/controls/flight/flap-lever", 0);
|
2017-05-07 19:26:41 +00:00
|
|
|
setprop("/controls/flight/flap-pos", 0);
|
|
|
|
setprop("/controls/flight/flap-txt", " ");
|
2017-05-29 16:30:05 +00:00
|
|
|
libraries.flaptimer.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/flight/speedbrake-arm", 0);
|
|
|
|
setprop("/controls/gear/gear-down", 1);
|
2017-06-10 14:56:11 +00:00
|
|
|
setprop("/controls/flight/elevator-trim", 0);
|
2017-05-21 17:20:14 +00:00
|
|
|
systemsReset();
|
2017-06-01 00:12:07 +00:00
|
|
|
failReset();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/APU/master", 0);
|
|
|
|
setprop("/controls/APU/start", 0);
|
2017-04-24 12:46:44 +00:00
|
|
|
setprop("/controls/bleed/OHP/bleedapu", 0);
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/battery1", 0);
|
|
|
|
setprop("/controls/electrical/switches/battery2", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
|
|
|
|
# Now the Startup!
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/battery1", 1);
|
|
|
|
setprop("/controls/electrical/switches/battery2", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/APU/master", 1);
|
|
|
|
setprop("/controls/APU/start", 1);
|
|
|
|
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
|
2017-04-25 17:13:15 +00:00
|
|
|
if (getprop("/systems/apu/rpm") >= 98) {
|
2017-04-05 22:36:27 +00:00
|
|
|
removelistener(apu_rpm_chk);
|
|
|
|
beforestart_b();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
var beforestart_b = func {
|
|
|
|
# Continue with engine start prep.
|
2017-09-23 01:56:44 +00:00
|
|
|
setprop("/controls/fuel/tank0pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank0pump2", 1);
|
|
|
|
setprop("/controls/fuel/tank1pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank1pump2", 1);
|
2017-06-09 16:53:49 +00:00
|
|
|
setprop("/controls/fuel/tank2pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank2pump2", 1);
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/gen-apu", 1);
|
|
|
|
setprop("/controls/electrical/switches/galley", 1);
|
|
|
|
setprop("/controls/electrical/switches/gen1", 1);
|
|
|
|
setprop("/controls/electrical/switches/gen2", 1);
|
2017-04-28 22:27:21 +00:00
|
|
|
setprop("/controls/pneumatic/switches/bleedapu", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/bleed1", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/bleed2", 1);
|
2017-05-03 15:16:20 +00:00
|
|
|
setprop("/controls/pneumatic/switches/pack1", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/pack2", 1);
|
2017-04-07 17:49:01 +00:00
|
|
|
setprop("controls/adirs/ir[0]/knob","2");
|
|
|
|
setprop("controls/adirs/ir[1]/knob","2");
|
|
|
|
setprop("controls/adirs/ir[2]/knob","2");
|
|
|
|
setprop("instrumentation/adirs/ir[0]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[1]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[2]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[0]/aligned",1);
|
|
|
|
setprop("instrumentation/adirs/ir[1]/aligned",1);
|
|
|
|
setprop("instrumentation/adirs/ir[2]/aligned",1);
|
2017-05-21 17:20:14 +00:00
|
|
|
setprop("/controls/adirs/mcducbtn", 1);
|
2017-08-17 03:25:16 +00:00
|
|
|
setprop("/controls/lighting/beacon", 1);
|
|
|
|
setprop("/controls/lighting/nav-lights-switch", 1);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 0);
|
|
|
|
setprop("/controls/gear/brake-right", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/systems/acconfig/autoconfig-running", 0);
|
|
|
|
ps_load_dlg.close();
|
|
|
|
ps_loaded_dlg.open();
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Ready to Taxi
|
|
|
|
var taxi = func {
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.start();
|
2017-04-05 22:36:27 +00:00
|
|
|
ps_load_dlg.open();
|
|
|
|
setprop("/systems/acconfig/autoconfig-running", 1);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 1);
|
|
|
|
setprop("/controls/gear/brake-right", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
# First, we set everything to cold and dark.
|
|
|
|
setprop("/controls/engines/engine-start-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
|
|
|
setprop("/controls/flight/slats", 0.000);
|
|
|
|
setprop("/controls/flight/flaps", 0.000);
|
|
|
|
setprop("/controls/flight/flap-lever", 0);
|
2017-05-07 19:26:41 +00:00
|
|
|
setprop("/controls/flight/flap-pos", 0);
|
|
|
|
setprop("/controls/flight/flap-txt", " ");
|
2017-05-29 16:30:05 +00:00
|
|
|
libraries.flaptimer.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/flight/speedbrake-arm", 0);
|
|
|
|
setprop("/controls/gear/gear-down", 1);
|
2017-06-10 14:56:11 +00:00
|
|
|
setprop("/controls/flight/elevator-trim", 0);
|
2017-05-21 17:20:14 +00:00
|
|
|
systemsReset();
|
2017-06-01 00:12:07 +00:00
|
|
|
failReset();
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/APU/master", 0);
|
|
|
|
setprop("/controls/APU/start", 0);
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/battery1", 0);
|
|
|
|
setprop("/controls/electrical/switches/battery2", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
|
|
|
|
# Now the Startup!
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/battery1", 1);
|
|
|
|
setprop("/controls/electrical/switches/battery2", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/APU/master", 1);
|
|
|
|
setprop("/controls/APU/start", 1);
|
|
|
|
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
|
|
|
|
if (getprop("/systems/apu/rpm") >= 99) {
|
|
|
|
removelistener(apu_rpm_chk);
|
|
|
|
taxi_b();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
var taxi_b = func {
|
|
|
|
# Continue with engine start prep, and start engine 2.
|
2017-09-23 01:56:44 +00:00
|
|
|
setprop("/controls/fuel/tank0pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank0pump2", 1);
|
|
|
|
setprop("/controls/fuel/tank1pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank1pump2", 1);
|
2017-06-09 16:53:49 +00:00
|
|
|
setprop("/controls/fuel/tank2pump1", 1);
|
|
|
|
setprop("/controls/fuel/tank2pump2", 1);
|
2017-04-06 02:24:04 +00:00
|
|
|
setprop("/controls/electrical/switches/gen-apu", 1);
|
|
|
|
setprop("/controls/electrical/switches/galley", 1);
|
|
|
|
setprop("/controls/electrical/switches/gen1", 1);
|
|
|
|
setprop("/controls/electrical/switches/gen2", 1);
|
2017-04-28 22:27:21 +00:00
|
|
|
setprop("/controls/pneumatic/switches/bleedapu", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/bleed1", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/bleed2", 1);
|
2017-05-03 15:16:20 +00:00
|
|
|
setprop("/controls/pneumatic/switches/pack1", 1);
|
|
|
|
setprop("/controls/pneumatic/switches/pack2", 1);
|
2017-04-07 17:49:01 +00:00
|
|
|
setprop("controls/adirs/ir[0]/knob","2");
|
|
|
|
setprop("controls/adirs/ir[1]/knob","2");
|
|
|
|
setprop("controls/adirs/ir[2]/knob","2");
|
|
|
|
setprop("instrumentation/adirs/ir[0]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[1]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[2]/display/ttn",0);
|
|
|
|
setprop("instrumentation/adirs/ir[0]/aligned",1);
|
|
|
|
setprop("instrumentation/adirs/ir[1]/aligned",1);
|
|
|
|
setprop("instrumentation/adirs/ir[2]/aligned",1);
|
2017-05-21 17:20:14 +00:00
|
|
|
setprop("/controls/adirs/mcducbtn", 1);
|
2017-08-17 03:25:16 +00:00
|
|
|
setprop("/controls/lighting/beacon", 1);
|
|
|
|
setprop("/controls/lighting/nav-lights-switch", 1);
|
2017-06-09 16:53:49 +00:00
|
|
|
settimer(taxi_c, 2);
|
2017-04-28 22:27:21 +00:00
|
|
|
}
|
|
|
|
var taxi_c = func {
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/engines/engine-start-switch", 2);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
|
2017-10-05 14:53:24 +00:00
|
|
|
settimer(func {
|
|
|
|
taxi_d();
|
|
|
|
}, 10);
|
2017-04-05 22:36:27 +00:00
|
|
|
}
|
2017-04-28 22:27:21 +00:00
|
|
|
var taxi_d = func {
|
2017-04-05 22:36:27 +00:00
|
|
|
# After Start items.
|
|
|
|
setprop("/controls/engines/engine-start-switch", 1);
|
|
|
|
setprop("/controls/APU/master", 0);
|
|
|
|
setprop("/controls/APU/start", 0);
|
2017-04-28 22:27:21 +00:00
|
|
|
setprop("/controls/pneumatic/switches/bleedapu", 0);
|
2017-08-17 03:25:16 +00:00
|
|
|
setprop("/controls/lighting/taxi-light-switch", 1);
|
2017-10-05 14:53:24 +00:00
|
|
|
setprop("/controls/gear/brake-left", 0);
|
|
|
|
setprop("/controls/gear/brake-right", 0);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/systems/acconfig/autoconfig-running", 0);
|
|
|
|
ps_load_dlg.close();
|
|
|
|
ps_loaded_dlg.open();
|
2017-05-29 16:30:05 +00:00
|
|
|
spinning.stop();
|
2017-04-05 22:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Ready to Takeoff
|
|
|
|
var takeoff = func {
|
|
|
|
# The same as taxi, except we set some things afterwards.
|
|
|
|
taxi();
|
|
|
|
var eng_one_chk_c = setlistener("/engines/engine[0]/state", func {
|
|
|
|
if (getprop("/engines/engine[0]/state") == 3) {
|
|
|
|
removelistener(eng_one_chk_c);
|
2017-08-17 03:25:16 +00:00
|
|
|
setprop("/controls/lighting/strobe", 1);
|
|
|
|
setprop("/controls/lighting/landing-lights[1]", 1);
|
|
|
|
setprop("/controls/lighting/landing-lights[2]", 1);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/flight/speedbrake-arm", 1);
|
|
|
|
setprop("/controls/flight/flaps", 0.290);
|
|
|
|
setprop("/controls/flight/slats", 0.666);
|
|
|
|
setprop("/controls/flight/flap-lever", 1);
|
2017-05-07 19:26:41 +00:00
|
|
|
setprop("/controls/flight/flap-pos", 2);
|
2017-04-05 22:36:27 +00:00
|
|
|
setprop("/controls/flight/flap-txt", "1+F");
|
2017-05-29 16:30:05 +00:00
|
|
|
libraries.flaptimer.start();
|
2017-06-09 22:27:30 +00:00
|
|
|
setprop("/controls/flight/elevator-trim", -0.07);
|
2017-04-05 22:36:27 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|