Merge branch 'dev' into FMGC
This commit is contained in:
commit
be7ce479aa
92 changed files with 8841 additions and 8690 deletions
|
@ -1455,8 +1455,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/engines/engine[0]/throttle", getprop("/controls/engines/engine[0]/throttle") + 0.01);
|
||||
setprop("/controls/engines/engine[1]/throttle", getprop("/controls/engines/engine[0]/throttle") + 0.01); # Not a typo, always use engine[0] as a reference
|
||||
setprop("controls/engines/engine[0]/throttle", getprop("controls/engines/engine[0]/throttle") + 0.01);
|
||||
setprop("controls/engines/engine[1]/throttle", getprop("controls/engines/engine[0]/throttle") + 0.01); # Not a typo, always use engine[0] as a reference
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1466,8 +1466,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/engines/engine[0]/throttle", getprop("/controls/engines/engine[0]/throttle") - 0.01);
|
||||
setprop("/controls/engines/engine[1]/throttle", getprop("/controls/engines/engine[0]/throttle") - 0.01); # Not a typo, always use engine[0] as a reference
|
||||
setprop("controls/engines/engine[0]/throttle", getprop("controls/engines/engine[0]/throttle") - 0.01);
|
||||
setprop("controls/engines/engine[1]/throttle", getprop("controls/engines/engine[0]/throttle") - 0.01); # Not a typo, always use engine[0] as a reference
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1508,7 +1508,7 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/elevator", getprop("/controls/flight/elevator") - 0.05);
|
||||
setprop("controls/flight/elevator", getprop("controls/flight/elevator") - 0.05);
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1529,8 +1529,8 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/engines/engine[0]/throttle", getprop("/controls/engines/engine[0]/throttle") - 0.01);
|
||||
setprop("/controls/engines/engine[1]/throttle", getprop("/controls/engines/engine[0]/throttle") - 0.01); # Not a typo, always use engine[0] as a reference
|
||||
setprop("controls/engines/engine[0]/throttle", getprop("controls/engines/engine[0]/throttle") - 0.01);
|
||||
setprop("controls/engines/engine[1]/throttle", getprop("controls/engines/engine[0]/throttle") - 0.01); # Not a typo, always use engine[0] as a reference
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1551,7 +1551,7 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/aileron", getprop("/controls/flight/aileron") - 0.05);
|
||||
setprop("controls/flight/aileron", getprop("controls/flight/aileron") - 0.05);
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1572,9 +1572,9 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/aileron", 0);
|
||||
setprop("/controls/flight/elevator", 0);
|
||||
setprop("/controls/flight/rudder", 0);
|
||||
setprop("controls/flight/aileron", 0);
|
||||
setprop("controls/flight/elevator", 0);
|
||||
setprop("controls/flight/rudder", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1595,7 +1595,7 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/aileron", getprop("/controls/flight/aileron") + 0.05);
|
||||
setprop("controls/flight/aileron", getprop("controls/flight/aileron") + 0.05);
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1636,7 +1636,7 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/elevator", getprop("/controls/flight/elevator") + 0.05);
|
||||
setprop("controls/flight/elevator", getprop("controls/flight/elevator") + 0.05);
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
@ -1657,8 +1657,8 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/engines/engine[0]/throttle", getprop("/controls/engines/engine[0]/throttle") + 0.01);
|
||||
setprop("/controls/engines/engine[1]/throttle", getprop("/controls/engines/engine[0]/throttle") + 0.01); # Not a typo, always use engine[0] as a reference
|
||||
setprop("controls/engines/engine[0]/throttle", getprop("controls/engines/engine[0]/throttle") + 0.01);
|
||||
setprop("controls/engines/engine[1]/throttle", getprop("controls/engines/engine[0]/throttle") + 0.01); # Not a typo, always use engine[0] as a reference
|
||||
</script>
|
||||
</binding>
|
||||
</key>
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var spinning = maketimer(0.05, func {
|
||||
var spinning = getprop("/systems/acconfig/spinning");
|
||||
var spinning = getprop("systems/acconfig/spinning");
|
||||
if (spinning == 0) {
|
||||
setprop("/systems/acconfig/spin", "\\");
|
||||
setprop("/systems/acconfig/spinning", 1);
|
||||
setprop("systems/acconfig/spin", "\\");
|
||||
setprop("systems/acconfig/spinning", 1);
|
||||
} else if (spinning == 1) {
|
||||
setprop("/systems/acconfig/spin", "|");
|
||||
setprop("/systems/acconfig/spinning", 2);
|
||||
setprop("systems/acconfig/spin", "|");
|
||||
setprop("systems/acconfig/spinning", 2);
|
||||
} else if (spinning == 2) {
|
||||
setprop("/systems/acconfig/spin", "/");
|
||||
setprop("/systems/acconfig/spinning", 3);
|
||||
setprop("systems/acconfig/spin", "/");
|
||||
setprop("systems/acconfig/spinning", 3);
|
||||
} else if (spinning == 3) {
|
||||
setprop("/systems/acconfig/spin", "-");
|
||||
setprop("/systems/acconfig/spinning", 0);
|
||||
setprop("systems/acconfig/spin", "-");
|
||||
setprop("systems/acconfig/spinning", 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -25,84 +25,84 @@ var failReset = func {
|
|||
}
|
||||
|
||||
var failResetOld = 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);
|
||||
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);
|
||||
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);
|
||||
setprop("/systems/failures/tank0pump1", 0);
|
||||
setprop("/systems/failures/tank0pump2", 0);
|
||||
setprop("/systems/failures/tank1pump1", 0);
|
||||
setprop("/systems/failures/tank1pump2", 0);
|
||||
setprop("/systems/failures/tank2pump1", 0);
|
||||
setprop("/systems/failures/tank2pump2", 0);
|
||||
setprop("/systems/failures/fuelmode", 0);
|
||||
setprop("/systems/failures/cargo-aft-fire", 0);
|
||||
setprop("/systems/failures/cargo-fwd-fire", 0);
|
||||
setprop("/systems/failures/engine-left-fire", 0);
|
||||
setprop("/systems/failures/engine-right-fire", 0);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
setprop("systems/failures/tank0pump1", 0);
|
||||
setprop("systems/failures/tank0pump2", 0);
|
||||
setprop("systems/failures/tank1pump1", 0);
|
||||
setprop("systems/failures/tank1pump2", 0);
|
||||
setprop("systems/failures/tank2pump1", 0);
|
||||
setprop("systems/failures/tank2pump2", 0);
|
||||
setprop("systems/failures/fuelmode", 0);
|
||||
setprop("systems/failures/cargo-aft-fire", 0);
|
||||
setprop("systems/failures/cargo-fwd-fire", 0);
|
||||
setprop("systems/failures/engine-left-fire", 0);
|
||||
setprop("systems/failures/engine-right-fire", 0);
|
||||
}
|
||||
|
||||
failResetOld();
|
||||
setprop("/systems/acconfig/autoconfig-running", 0);
|
||||
setprop("/systems/acconfig/spinning", 0);
|
||||
setprop("/systems/acconfig/spin", "-");
|
||||
setprop("/systems/acconfig/options/revision", 0);
|
||||
setprop("/systems/acconfig/new-revision", 0);
|
||||
setprop("/systems/acconfig/out-of-date", 0);
|
||||
setprop("/systems/acconfig/mismatch-code", "0x000");
|
||||
setprop("/systems/acconfig/mismatch-reason", "XX");
|
||||
setprop("/systems/acconfig/options/keyboard-mode", 0);
|
||||
setprop("systems/acconfig/autoconfig-running", 0);
|
||||
setprop("systems/acconfig/spinning", 0);
|
||||
setprop("systems/acconfig/spin", "-");
|
||||
setprop("systems/acconfig/options/revision", 0);
|
||||
setprop("systems/acconfig/new-revision", 0);
|
||||
setprop("systems/acconfig/out-of-date", 0);
|
||||
setprop("systems/acconfig/mismatch-code", "0x000");
|
||||
setprop("systems/acconfig/mismatch-reason", "XX");
|
||||
setprop("systems/acconfig/options/keyboard-mode", 0);
|
||||
# TODO Revert default weight-kgs to 1, when fully implemented
|
||||
setprop("/systems/acconfig/options/weight-kgs", 0);
|
||||
setprop("/systems/acconfig/options/adirs-skip", 0);
|
||||
setprop("/systems/acconfig/options/welcome-skip", 0);
|
||||
setprop("/systems/acconfig/options/no-rendering-warn", 0);
|
||||
setprop("/systems/acconfig/options/pfd-rate", 1);
|
||||
setprop("/systems/acconfig/options/nd-rate", 1);
|
||||
setprop("/systems/acconfig/options/uecam-rate", 1);
|
||||
setprop("/systems/acconfig/options/lecam-rate", 1);
|
||||
setprop("/systems/acconfig/options/iesi-rate", 1);
|
||||
setprop("/systems/acconfig/options/autopush/show-route", 1);
|
||||
setprop("/systems/acconfig/options/autopush/show-wingtip", 1);
|
||||
setprop("systems/acconfig/options/weight-kgs", 0);
|
||||
setprop("systems/acconfig/options/adirs-skip", 0);
|
||||
setprop("systems/acconfig/options/welcome-skip", 0);
|
||||
setprop("systems/acconfig/options/no-rendering-warn", 0);
|
||||
setprop("systems/acconfig/options/pfd-rate", 1);
|
||||
setprop("systems/acconfig/options/nd-rate", 1);
|
||||
setprop("systems/acconfig/options/uecam-rate", 1);
|
||||
setprop("systems/acconfig/options/lecam-rate", 1);
|
||||
setprop("systems/acconfig/options/iesi-rate", 1);
|
||||
setprop("systems/acconfig/options/autopush/show-route", 1);
|
||||
setprop("systems/acconfig/options/autopush/show-wingtip", 1);
|
||||
var main_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/main/dialog", "Aircraft/A320-family/AircraftConfig/main.xml");
|
||||
var welcome_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/welcome/dialog", "Aircraft/A320-family/AircraftConfig/welcome.xml");
|
||||
var ps_load_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psload/dialog", "Aircraft/A320-family/AircraftConfig/psload.xml");
|
||||
|
@ -121,43 +121,43 @@ var du_quality = gui.Dialog.new("sim/gui/dialogs/acconfig/du-quality/dialog", "A
|
|||
var rendering_dlg = gui.Dialog.new("sim/gui/dialogs/rendering/dialog", "Aircraft/A320-family/AircraftConfig/rendering.xml");
|
||||
spinning.start();
|
||||
init_dlg.open();
|
||||
http.load("https://raw.githubusercontent.com/legoboyvdlp/A320-family/201912/revision.txt").done(func(r) setprop("/systems/acconfig/new-revision", r.response));
|
||||
var revisionFile = (getprop("/sim/aircraft-dir") ~ "/revision.txt");
|
||||
http.load("https://raw.githubusercontent.com/legoboyvdlp/A320-family/201912/revision.txt").done(func(r) setprop("systems/acconfig/new-revision", r.response));
|
||||
var revisionFile = (getprop("sim/aircraft-dir") ~ "/revision.txt");
|
||||
var current_revision = io.readfile(revisionFile);
|
||||
print("A320-family Revision: " ~ current_revision);
|
||||
setprop("/systems/acconfig/revision", current_revision);
|
||||
setprop("systems/acconfig/revision", current_revision);
|
||||
|
||||
setlistener("/systems/acconfig/new-revision", func {
|
||||
if (getprop("/systems/acconfig/new-revision") > current_revision) {
|
||||
setprop("/systems/acconfig/out-of-date", 1);
|
||||
if (getprop("systems/acconfig/new-revision") > current_revision) {
|
||||
setprop("systems/acconfig/out-of-date", 1);
|
||||
} else {
|
||||
setprop("/systems/acconfig/out-of-date", 0);
|
||||
setprop("systems/acconfig/out-of-date", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var mismatch_chk = func {
|
||||
if (num(string.replace(getprop("/sim/version/flightgear"),".","")) < 201912) {
|
||||
setprop("/systems/acconfig/mismatch-code", "0x121");
|
||||
setprop("/systems/acconfig/mismatch-reason", "FGFS version is too old! Please update FlightGear to at least 2019.1.2.");
|
||||
if (getprop("/systems/acconfig/out-of-date") != 1) {
|
||||
if (num(string.replace(getprop("sim/version/flightgear"),".","")) < 201912) {
|
||||
setprop("systems/acconfig/mismatch-code", "0x121");
|
||||
setprop("systems/acconfig/mismatch-reason", "FGFS version is too old! Please update FlightGear to at least 2019.1.2.");
|
||||
if (getprop("systems/acconfig/out-of-date") != 1) {
|
||||
error_mismatch.open();
|
||||
}
|
||||
libraries.systemsLoop.stop();
|
||||
print("Mismatch: 0x121");
|
||||
welcome_dlg.close();
|
||||
} else if (getprop("/gear/gear[0]/wow") == 0 or getprop("/position/altitude-ft") >= 15000) {
|
||||
setprop("/systems/acconfig/mismatch-code", "0x223");
|
||||
setprop("/systems/acconfig/mismatch-reason", "Preposterous configuration detected for initialization. Check your position or scenery.");
|
||||
if (getprop("/systems/acconfig/out-of-date") != 1) {
|
||||
} else if (getprop("gear/gear[0]/wow") == 0 or getprop("position/altitude-ft") >= 15000) {
|
||||
setprop("systems/acconfig/mismatch-code", "0x223");
|
||||
setprop("systems/acconfig/mismatch-reason", "Preposterous configuration detected for initialization. Check your position or scenery.");
|
||||
if (getprop("systems/acconfig/out-of-date") != 1) {
|
||||
error_mismatch.open();
|
||||
}
|
||||
libraries.systemsLoop.stop();
|
||||
print("Mismatch: 0x223");
|
||||
welcome_dlg.close();
|
||||
} else if (getprop("/systems/acconfig/libraries-loaded") != 1) {
|
||||
setprop("/systems/acconfig/mismatch-code", "0x247");
|
||||
setprop("/systems/acconfig/mismatch-reason", "System files are missing or damaged. Please download a new copy of the aircraft.");
|
||||
if (getprop("/systems/acconfig/out-of-date") != 1) {
|
||||
} else if (getprop("systems/acconfig/libraries-loaded") != 1) {
|
||||
setprop("systems/acconfig/mismatch-code", "0x247");
|
||||
setprop("systems/acconfig/mismatch-reason", "System files are missing or damaged. Please download a new copy of the aircraft.");
|
||||
if (getprop("systems/acconfig/out-of-date") != 1) {
|
||||
error_mismatch.open();
|
||||
}
|
||||
libraries.systemsLoop.stop();
|
||||
|
@ -168,74 +168,74 @@ var mismatch_chk = func {
|
|||
|
||||
setlistener("/sim/signals/fdm-initialized", func {
|
||||
init_dlg.close();
|
||||
if (getprop("/systems/acconfig/out-of-date") == 1) {
|
||||
if (getprop("systems/acconfig/out-of-date") == 1) {
|
||||
update_dlg.open();
|
||||
print("System: The A320-family is out of date!");
|
||||
}
|
||||
mismatch_chk();
|
||||
readSettings();
|
||||
if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/options/revision") < current_revision and getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/out-of-date") != 1 and getprop("systems/acconfig/options/revision") < current_revision and getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
updated_dlg.open();
|
||||
if (getprop("/systems/acconfig/options/no-rendering-warn") != 1) {
|
||||
if (getprop("systems/acconfig/options/no-rendering-warn") != 1) {
|
||||
renderingSettings.check();
|
||||
}
|
||||
} else if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/mismatch-code") == "0x000" and getprop("/systems/acconfig/options/welcome-skip") != 1) {
|
||||
} else if (getprop("systems/acconfig/out-of-date") != 1 and getprop("systems/acconfig/mismatch-code") == "0x000" and getprop("systems/acconfig/options/welcome-skip") != 1) {
|
||||
welcome_dlg.open();
|
||||
if (getprop("/systems/acconfig/options/no-rendering-warn") != 1) {
|
||||
if (getprop("systems/acconfig/options/no-rendering-warn") != 1) {
|
||||
renderingSettings.check();
|
||||
}
|
||||
}
|
||||
setprop("/systems/acconfig/options/revision", current_revision);
|
||||
setprop("systems/acconfig/options/revision", current_revision);
|
||||
writeSettings();
|
||||
spinning.stop();
|
||||
});
|
||||
|
||||
var renderingSettings = {
|
||||
check: func() {
|
||||
var rembrandt = getprop("/sim/rendering/rembrandt/enabled");
|
||||
var ALS = getprop("/sim/rendering/shaders/skydome");
|
||||
var customSettings = getprop("/sim/rendering/shaders/custom-settings") == 1;
|
||||
var landmass = getprop("/sim/rendering/shaders/landmass") >= 4;
|
||||
var model = getprop("/sim/rendering/shaders/model") >= 2;
|
||||
var rembrandt = getprop("sim/rendering/rembrandt/enabled");
|
||||
var ALS = getprop("sim/rendering/shaders/skydome");
|
||||
var customSettings = getprop("sim/rendering/shaders/custom-settings") == 1;
|
||||
var landmass = getprop("sim/rendering/shaders/landmass") >= 4;
|
||||
var model = getprop("sim/rendering/shaders/model") >= 2;
|
||||
if (!rembrandt and (!ALS or !customSettings or !landmass or !model)) {
|
||||
rendering_dlg.open();
|
||||
}
|
||||
},
|
||||
fixAll: func() {
|
||||
me.fixCore();
|
||||
var landmass = getprop("/sim/rendering/shaders/landmass") >= 4;
|
||||
var model = getprop("/sim/rendering/shaders/model") >= 2;
|
||||
var landmass = getprop("sim/rendering/shaders/landmass") >= 4;
|
||||
var model = getprop("sim/rendering/shaders/model") >= 2;
|
||||
if (!landmass) {
|
||||
setprop("/sim/rendering/shaders/landmass", 4);
|
||||
setprop("sim/rendering/shaders/landmass", 4);
|
||||
}
|
||||
if (!model) {
|
||||
setprop("/sim/rendering/shaders/model", 2);
|
||||
setprop("sim/rendering/shaders/model", 2);
|
||||
}
|
||||
},
|
||||
fixCore: func() {
|
||||
setprop("/sim/rendering/shaders/skydome", 1); # ALS on
|
||||
setprop("/sim/rendering/shaders/custom-settings", 1);
|
||||
setprop("sim/rendering/shaders/skydome", 1); # ALS on
|
||||
setprop("sim/rendering/shaders/custom-settings", 1);
|
||||
gui.popupTip("Rendering Settings updated!");
|
||||
},
|
||||
};
|
||||
|
||||
var readSettings = func {
|
||||
io.read_properties(getprop("/sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
|
||||
setprop("/options/system/keyboard-mode", getprop("/systems/acconfig/options/keyboard-mode"));
|
||||
setprop("/options/system/weight-kgs", getprop("/systems/acconfig/options/weight-kgs"));
|
||||
setprop("/controls/adirs/skip", getprop("/systems/acconfig/options/adirs-skip"));
|
||||
setprop("/sim/model/autopush/route/show", getprop("/systems/acconfig/options/autopush/show-route"));
|
||||
setprop("/sim/model/autopush/route/show-wingtip", getprop("/systems/acconfig/options/autopush/show-wingtip"));
|
||||
io.read_properties(getprop("sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
|
||||
setprop("options/system/keyboard-mode", getprop("systems/acconfig/options/keyboard-mode"));
|
||||
setprop("options/system/weight-kgs", getprop("systems/acconfig/options/weight-kgs"));
|
||||
setprop("controls/adirs/skip", getprop("systems/acconfig/options/adirs-skip"));
|
||||
setprop("sim/model/autopush/route/show", getprop("systems/acconfig/options/autopush/show-route"));
|
||||
setprop("sim/model/autopush/route/show-wingtip", getprop("systems/acconfig/options/autopush/show-wingtip"));
|
||||
|
||||
}
|
||||
|
||||
var writeSettings = func {
|
||||
setprop("/systems/acconfig/options/keyboard-mode", getprop("/options/system/keyboard-mode"));
|
||||
setprop("/systems/acconfig/options/weight-kgs", getprop("/options/system/weight-kgs"));
|
||||
setprop("/systems/acconfig/options/adirs-skip", getprop("/controls/adirs/skip"));
|
||||
setprop("/systems/acconfig/options/autopush/show-route", getprop("/sim/model/autopush/route/show"));
|
||||
setprop("/systems/acconfig/options/autopush/show-wingtip", getprop("/sim/model/autopush/route/show-wingtip"));
|
||||
io.write_properties(getprop("/sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
|
||||
setprop("systems/acconfig/options/keyboard-mode", getprop("options/system/keyboard-mode"));
|
||||
setprop("systems/acconfig/options/weight-kgs", getprop("options/system/weight-kgs"));
|
||||
setprop("systems/acconfig/options/adirs-skip", getprop("controls/adirs/skip"));
|
||||
setprop("systems/acconfig/options/autopush/show-route", getprop("sim/model/autopush/route/show"));
|
||||
setprop("systems/acconfig/options/autopush/show-wingtip", getprop("sim/model/autopush/route/show-wingtip"));
|
||||
io.write_properties(getprop("sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
|
||||
}
|
||||
|
||||
################
|
||||
|
@ -244,47 +244,47 @@ var writeSettings = func {
|
|||
|
||||
# Cold and Dark
|
||||
var colddark = func {
|
||||
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
spinning.start();
|
||||
ps_loaded_dlg.close();
|
||||
ps_load_dlg.open();
|
||||
setprop("/systems/acconfig/autoconfig-running", 1);
|
||||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
setprop("systems/acconfig/autoconfig-running", 1);
|
||||
setprop("controls/gear/brake-left", 1);
|
||||
setprop("controls/gear/brake-right", 1);
|
||||
# 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);
|
||||
setprop("/controls/flight/flap-pos", 0);
|
||||
setprop("/controls/flight/flap-txt", " ");
|
||||
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);
|
||||
setprop("controls/flight/flap-pos", 0);
|
||||
setprop("controls/flight/flap-txt", " ");
|
||||
libraries.flaptimer.stop();
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0);
|
||||
setprop("/controls/gear/gear-down", 1);
|
||||
setprop("/controls/flight/elevator-trim", 0);
|
||||
setprop("/controls/switches/beacon", 0);
|
||||
setprop("/controls/switches/strobe", 0.0);
|
||||
setprop("/controls/switches/wing-lights", 0);
|
||||
setprop("/controls/lighting/nav-lights-switch", 0);
|
||||
setprop("/controls/lighting/turnoff-light-switch", 0);
|
||||
setprop("/controls/lighting/taxi-light-switch", 0.0);
|
||||
setprop("/controls/switches/landing-lights-l", 0.0);
|
||||
setprop("/controls/switches/landing-lights-r", 0.0);
|
||||
setprop("/controls/atc/mode-knob", 0);
|
||||
setprop("/controls/lighting/fcu-panel-knb", 0);
|
||||
setprop("/controls/lighting/main-panel-knb", 0);
|
||||
setprop("/controls/lighting/overhead-panel-knb", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0);
|
||||
setprop("controls/gear/gear-down", 1);
|
||||
setprop("controls/flight/elevator-trim", 0);
|
||||
setprop("controls/switches/beacon", 0);
|
||||
setprop("controls/switches/strobe", 0.0);
|
||||
setprop("controls/switches/wing-lights", 0);
|
||||
setprop("controls/lighting/nav-lights-switch", 0);
|
||||
setprop("controls/lighting/turnoff-light-switch", 0);
|
||||
setprop("controls/lighting/taxi-light-switch", 0.0);
|
||||
setprop("controls/switches/landing-lights-l", 0.0);
|
||||
setprop("controls/switches/landing-lights-r", 0.0);
|
||||
setprop("controls/atc/mode-knob", 0);
|
||||
setprop("controls/lighting/fcu-panel-knb", 0);
|
||||
setprop("controls/lighting/main-panel-knb", 0);
|
||||
setprop("controls/lighting/overhead-panel-knb", 0);
|
||||
atc.transponderPanel.modeSwitch(1);
|
||||
libraries.systemsInit();
|
||||
failResetOld();
|
||||
if (getprop("/engines/engine[1]/n2-actual") < 2) {
|
||||
if (getprop("engines/engine[1]/n2-actual") < 2) {
|
||||
colddark_b();
|
||||
} else {
|
||||
var colddark_eng_off = setlistener("/engines/engine[1]/n2-actual", func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") < 2) {
|
||||
if (getprop("engines/engine[1]/n2-actual") < 2) {
|
||||
removelistener(colddark_eng_off);
|
||||
colddark_b();
|
||||
}
|
||||
|
@ -294,12 +294,12 @@ var colddark = func {
|
|||
}
|
||||
var colddark_b = func {
|
||||
# Continues the Cold and Dark script, after engines fully shutdown.
|
||||
setprop("/controls/APU/master", 0);
|
||||
setprop("/controls/APU/start", 0);
|
||||
setprop("controls/APU/master", 0);
|
||||
setprop("controls/APU/start", 0);
|
||||
settimer(func {
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
setprop("/systems/acconfig/autoconfig-running", 0);
|
||||
setprop("controls/gear/brake-left", 0);
|
||||
setprop("controls/gear/brake-right", 0);
|
||||
setprop("systems/acconfig/autoconfig-running", 0);
|
||||
ps_load_dlg.close();
|
||||
ps_loaded_dlg.open();
|
||||
spinning.stop();
|
||||
|
@ -308,39 +308,39 @@ var colddark_b = func {
|
|||
|
||||
# Ready to Start Eng
|
||||
var beforestart = func {
|
||||
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
spinning.start();
|
||||
ps_loaded_dlg.close();
|
||||
ps_load_dlg.open();
|
||||
setprop("/systems/acconfig/autoconfig-running", 1);
|
||||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
setprop("systems/acconfig/autoconfig-running", 1);
|
||||
setprop("controls/gear/brake-left", 1);
|
||||
setprop("controls/gear/brake-right", 1);
|
||||
# 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);
|
||||
setprop("/controls/flight/flap-pos", 0);
|
||||
setprop("/controls/flight/flap-txt", " ");
|
||||
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);
|
||||
setprop("controls/flight/flap-pos", 0);
|
||||
setprop("controls/flight/flap-txt", " ");
|
||||
libraries.flaptimer.stop();
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0);
|
||||
setprop("/controls/gear/gear-down", 1);
|
||||
setprop("/controls/flight/elevator-trim", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0);
|
||||
setprop("controls/gear/gear-down", 1);
|
||||
setprop("controls/flight/elevator-trim", 0);
|
||||
libraries.systemsInit();
|
||||
failResetOld();
|
||||
setprop("/controls/APU/master", 0);
|
||||
setprop("/controls/APU/start", 0);
|
||||
setprop("controls/APU/master", 0);
|
||||
setprop("controls/APU/start", 0);
|
||||
|
||||
# Now the Startup!
|
||||
props.globals.getNode("/controls/electrical/switches/bat-1").setValue(1);
|
||||
props.globals.getNode("/controls/electrical/switches/bat-2").setValue(1);
|
||||
setprop("/controls/APU/master", 1);
|
||||
setprop("/controls/APU/start", 1);
|
||||
props.globals.getNode("controls/electrical/switches/bat-1").setValue(1);
|
||||
props.globals.getNode("controls/electrical/switches/bat-2").setValue(1);
|
||||
setprop("controls/APU/master", 1);
|
||||
setprop("controls/APU/start", 1);
|
||||
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
|
||||
if (getprop("/systems/apu/rpm") >= 98) {
|
||||
if (getprop("systems/apu/rpm") >= 98) {
|
||||
removelistener(apu_rpm_chk);
|
||||
beforestart_b();
|
||||
}
|
||||
|
@ -355,21 +355,21 @@ var beforestart_b = func {
|
|||
systems.FUEL.Switches.pumpCenter2.setValue(1);
|
||||
systems.FUEL.Switches.pumpRight1.setValue(1);
|
||||
systems.FUEL.Switches.pumpRight2.setValue(1);
|
||||
setprop("/controls/lighting/fcu-panel-knb", 1);
|
||||
setprop("/controls/lighting/main-panel-knb", 1);
|
||||
setprop("/controls/lighting/overhead-panel-knb", 1);
|
||||
setprop("/controls/electrical/switches/apu", 1);
|
||||
setprop("/controls/electrical/switches/galley", 1);
|
||||
setprop("/controls/electrical/switches/gen-1", 1);
|
||||
setprop("/controls/electrical/switches/gen-2", 1);
|
||||
setprop("/controls/pneumatic/switches/bleedapu", 1);
|
||||
setprop("/controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("/controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("/controls/pneumatic/switches/pack1", 1);
|
||||
setprop("/controls/pneumatic/switches/pack2", 1);
|
||||
setprop("/controls/adirs/ir[0]/knob","1");
|
||||
setprop("/controls/adirs/ir[1]/knob","1");
|
||||
setprop("/controls/adirs/ir[2]/knob","1");
|
||||
setprop("controls/lighting/fcu-panel-knb", 1);
|
||||
setprop("controls/lighting/main-panel-knb", 1);
|
||||
setprop("controls/lighting/overhead-panel-knb", 1);
|
||||
setprop("controls/electrical/switches/apu", 1);
|
||||
setprop("controls/electrical/switches/galley", 1);
|
||||
setprop("controls/electrical/switches/gen-1", 1);
|
||||
setprop("controls/electrical/switches/gen-2", 1);
|
||||
setprop("controls/pneumatic/switches/bleedapu", 1);
|
||||
setprop("controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("controls/pneumatic/switches/pack1", 1);
|
||||
setprop("controls/pneumatic/switches/pack2", 1);
|
||||
setprop("controls/adirs/ir[0]/knob","1");
|
||||
setprop("controls/adirs/ir[1]/knob","1");
|
||||
setprop("controls/adirs/ir[2]/knob","1");
|
||||
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
|
@ -379,18 +379,18 @@ var beforestart_b = func {
|
|||
systems.ADIRSnew.ADIRunits[0].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[1].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[2].instAlign();
|
||||
setprop("/controls/adirs/mcducbtn", 1);
|
||||
setprop("/controls/switches/beacon", 1);
|
||||
setprop("/controls/lighting/nav-lights-switch", 1);
|
||||
setprop("/controls/radio/rmp[0]/on", 1);
|
||||
setprop("/controls/radio/rmp[1]/on", 1);
|
||||
setprop("/controls/radio/rmp[2]/on", 1);
|
||||
setprop("/systems/fadec/power-avail", 1);
|
||||
setprop("/systems/fadec/powered-time", -310);
|
||||
setprop("controls/adirs/mcducbtn", 1);
|
||||
setprop("controls/switches/beacon", 1);
|
||||
setprop("controls/lighting/nav-lights-switch", 1);
|
||||
setprop("controls/radio/rmp[0]/on", 1);
|
||||
setprop("controls/radio/rmp[1]/on", 1);
|
||||
setprop("controls/radio/rmp[2]/on", 1);
|
||||
setprop("systems/fadec/power-avail", 1);
|
||||
setprop("systems/fadec/powered-time", -310);
|
||||
settimer(func {
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
setprop("/systems/acconfig/autoconfig-running", 0);
|
||||
setprop("controls/gear/brake-left", 0);
|
||||
setprop("controls/gear/brake-right", 0);
|
||||
setprop("systems/acconfig/autoconfig-running", 0);
|
||||
ps_load_dlg.close();
|
||||
ps_loaded_dlg.open();
|
||||
spinning.stop();
|
||||
|
@ -399,39 +399,39 @@ var beforestart_b = func {
|
|||
|
||||
# Ready to Taxi
|
||||
var taxi = func {
|
||||
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
spinning.start();
|
||||
ps_loaded_dlg.close();
|
||||
ps_load_dlg.open();
|
||||
setprop("/systems/acconfig/autoconfig-running", 1);
|
||||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
setprop("systems/acconfig/autoconfig-running", 1);
|
||||
setprop("controls/gear/brake-left", 1);
|
||||
setprop("controls/gear/brake-right", 1);
|
||||
# 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);
|
||||
setprop("/controls/flight/flap-pos", 0);
|
||||
setprop("/controls/flight/flap-txt", " ");
|
||||
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);
|
||||
setprop("controls/flight/flap-pos", 0);
|
||||
setprop("controls/flight/flap-txt", " ");
|
||||
libraries.flaptimer.stop();
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0);
|
||||
setprop("/controls/gear/gear-down", 1);
|
||||
setprop("/controls/flight/elevator-trim", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0);
|
||||
setprop("controls/gear/gear-down", 1);
|
||||
setprop("controls/flight/elevator-trim", 0);
|
||||
libraries.systemsInit();
|
||||
failResetOld();
|
||||
setprop("/controls/APU/master", 0);
|
||||
setprop("/controls/APU/start", 0);
|
||||
setprop("controls/APU/master", 0);
|
||||
setprop("controls/APU/start", 0);
|
||||
|
||||
# Now the Startup!
|
||||
props.globals.getNode("/controls/electrical/switches/bat-1").setValue(1);
|
||||
props.globals.getNode("/controls/electrical/switches/bat-2").setValue(1);
|
||||
setprop("/controls/APU/master", 1);
|
||||
setprop("/controls/APU/start", 1);
|
||||
props.globals.getNode("controls/electrical/switches/bat-1").setValue(1);
|
||||
props.globals.getNode("controls/electrical/switches/bat-2").setValue(1);
|
||||
setprop("controls/APU/master", 1);
|
||||
setprop("controls/APU/start", 1);
|
||||
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
|
||||
if (getprop("/systems/apu/rpm") >= 98) {
|
||||
if (getprop("systems/apu/rpm") >= 98) {
|
||||
removelistener(apu_rpm_chk);
|
||||
taxi_b();
|
||||
}
|
||||
|
@ -446,21 +446,21 @@ var taxi_b = func {
|
|||
systems.FUEL.Switches.pumpCenter2.setValue(1);
|
||||
systems.FUEL.Switches.pumpRight1.setValue(1);
|
||||
systems.FUEL.Switches.pumpRight2.setValue(1);
|
||||
setprop("/controls/lighting/fcu-panel-knb", 1);
|
||||
setprop("/controls/lighting/main-panel-knb", 1);
|
||||
setprop("/controls/lighting/overhead-panel-knb", 1);
|
||||
setprop("/controls/electrical/switches/apu", 1);
|
||||
setprop("/controls/electrical/switches/galley", 1);
|
||||
setprop("/controls/electrical/switches/gen-1", 1);
|
||||
setprop("/controls/electrical/switches/gen-2", 1);
|
||||
setprop("/controls/pneumatic/switches/bleedapu", 1);
|
||||
setprop("/controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("/controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("/controls/pneumatic/switches/pack1", 1);
|
||||
setprop("/controls/pneumatic/switches/pack2", 1);
|
||||
setprop("/controls/adirs/ir[0]/knob","1");
|
||||
setprop("/controls/adirs/ir[1]/knob","1");
|
||||
setprop("/controls/adirs/ir[2]/knob","1");
|
||||
setprop("controls/lighting/fcu-panel-knb", 1);
|
||||
setprop("controls/lighting/main-panel-knb", 1);
|
||||
setprop("controls/lighting/overhead-panel-knb", 1);
|
||||
setprop("controls/electrical/switches/apu", 1);
|
||||
setprop("controls/electrical/switches/galley", 1);
|
||||
setprop("controls/electrical/switches/gen-1", 1);
|
||||
setprop("controls/electrical/switches/gen-2", 1);
|
||||
setprop("controls/pneumatic/switches/bleedapu", 1);
|
||||
setprop("controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("controls/pneumatic/switches/pack1", 1);
|
||||
setprop("controls/pneumatic/switches/pack2", 1);
|
||||
setprop("controls/adirs/ir[0]/knob","1");
|
||||
setprop("controls/adirs/ir[1]/knob","1");
|
||||
setprop("controls/adirs/ir[2]/knob","1");
|
||||
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
|
@ -470,41 +470,41 @@ var taxi_b = func {
|
|||
systems.ADIRSnew.ADIRunits[0].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[1].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[2].instAlign();
|
||||
setprop("/controls/adirs/mcducbtn", 1);
|
||||
setprop("/controls/switches/beacon", 1);
|
||||
setprop("/controls/switches/wing-lights", 1);
|
||||
setprop("/controls/lighting/nav-lights-switch", 1);
|
||||
setprop("/controls/radio/rmp[0]/on", 1);
|
||||
setprop("/controls/radio/rmp[1]/on", 1);
|
||||
setprop("/controls/radio/rmp[2]/on", 1);
|
||||
setprop("/controls/atc/mode-knob", 2);
|
||||
setprop("controls/adirs/mcducbtn", 1);
|
||||
setprop("controls/switches/beacon", 1);
|
||||
setprop("controls/switches/wing-lights", 1);
|
||||
setprop("controls/lighting/nav-lights-switch", 1);
|
||||
setprop("controls/radio/rmp[0]/on", 1);
|
||||
setprop("controls/radio/rmp[1]/on", 1);
|
||||
setprop("controls/radio/rmp[2]/on", 1);
|
||||
setprop("controls/atc/mode-knob", 2);
|
||||
atc.transponderPanel.modeSwitch(3);
|
||||
setprop("/systems/fadec/power-avail", 1);
|
||||
setprop("/systems/fadec/powered-time", -310);
|
||||
setprop("/controls/lighting/turnoff-light-switch", 1);
|
||||
setprop("/controls/lighting/taxi-light-switch", 0.5);
|
||||
setprop("/controls/switches/landing-lights-l", 0.5);
|
||||
setprop("/controls/switches/landing-lights-r", 0.5);
|
||||
setprop("/instrumentation/altimeter[0]/setting-inhg", getprop("/environment/pressure-sea-level-inhg"));
|
||||
setprop("systems/fadec/power-avail", 1);
|
||||
setprop("systems/fadec/powered-time", -310);
|
||||
setprop("controls/lighting/turnoff-light-switch", 1);
|
||||
setprop("controls/lighting/taxi-light-switch", 0.5);
|
||||
setprop("controls/switches/landing-lights-l", 0.5);
|
||||
setprop("controls/switches/landing-lights-r", 0.5);
|
||||
setprop("instrumentation/altimeter[0]/setting-inhg", getprop("environment/pressure-sea-level-inhg"));
|
||||
settimer(taxi_c, 2);
|
||||
}
|
||||
var taxi_c = func {
|
||||
setprop("/controls/engines/engine-start-switch", 2);
|
||||
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
|
||||
setprop("controls/engines/engine-start-switch", 2);
|
||||
setprop("controls/engines/engine[0]/cutoff-switch", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff-switch", 0);
|
||||
settimer(func {
|
||||
taxi_d();
|
||||
}, 10);
|
||||
}
|
||||
var taxi_d = func {
|
||||
# After Start items.
|
||||
setprop("/controls/engines/engine-start-switch", 1);
|
||||
setprop("/controls/APU/master", 0);
|
||||
setprop("/controls/APU/start", 0);
|
||||
setprop("/controls/pneumatic/switches/bleedapu", 0);
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
setprop("/systems/acconfig/autoconfig-running", 0);
|
||||
setprop("controls/engines/engine-start-switch", 1);
|
||||
setprop("controls/APU/master", 0);
|
||||
setprop("controls/APU/start", 0);
|
||||
setprop("controls/pneumatic/switches/bleedapu", 0);
|
||||
setprop("controls/gear/brake-left", 0);
|
||||
setprop("controls/gear/brake-right", 0);
|
||||
setprop("systems/acconfig/autoconfig-running", 0);
|
||||
ps_load_dlg.close();
|
||||
ps_loaded_dlg.open();
|
||||
spinning.stop();
|
||||
|
@ -512,30 +512,30 @@ var taxi_d = func {
|
|||
|
||||
# Ready to Takeoff
|
||||
var takeoff = func {
|
||||
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
# 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) {
|
||||
if (getprop("engines/engine[0]/state") == 3) {
|
||||
removelistener(eng_one_chk_c);
|
||||
setprop("/controls/switches/strobe", 1.0);
|
||||
setprop("/controls/lighting/taxi-light-switch", 1);
|
||||
setprop("/controls/switches/landing-lights-l", 1);
|
||||
setprop("/controls/switches/landing-lights-r", 1);
|
||||
setprop("/controls/flight/speedbrake-arm", 1);
|
||||
setprop("/controls/flight/flaps", 0.290);
|
||||
setprop("/controls/flight/slats", 0.666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 2);
|
||||
setprop("/controls/flight/flap-txt", "1+F");
|
||||
setprop("/controls/atc/mode-knob", 4);
|
||||
setprop("controls/switches/strobe", 1.0);
|
||||
setprop("controls/lighting/taxi-light-switch", 1);
|
||||
setprop("controls/switches/landing-lights-l", 1);
|
||||
setprop("controls/switches/landing-lights-r", 1);
|
||||
setprop("controls/flight/speedbrake-arm", 1);
|
||||
setprop("controls/flight/flaps", 0.290);
|
||||
setprop("controls/flight/slats", 0.666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 2);
|
||||
setprop("controls/flight/flap-txt", "1+F");
|
||||
setprop("controls/atc/mode-knob", 4);
|
||||
atc.transponderPanel.modeSwitch(5);
|
||||
libraries.flaptimer.start();
|
||||
setprop("/controls/flight/elevator-trim", -0.07);
|
||||
setprop("controls/flight/elevator-trim", -0.07);
|
||||
systems.arm_autobrake(3);
|
||||
setprop("/ECAM/to-config-test", 1);
|
||||
setprop("ECAM/to-config-test", 1);
|
||||
settimer(func {
|
||||
setprop("/ECAM/to-config-test", 0);
|
||||
setprop("ECAM/to-config-test", 0);
|
||||
}, 1);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/it-fbw/degrade-law", 0);
|
||||
setprop("/it-fbw/law", 0);
|
||||
setprop("it-fbw/degrade-law", 0);
|
||||
setprop("it-fbw/law", 0);
|
||||
gui.popupTip("Fly By Wire switched to NORMAL law!");
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -67,8 +67,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/it-fbw/degrade-law", 1);
|
||||
setprop("/it-fbw/law", 1);
|
||||
setprop("it-fbw/degrade-law", 1);
|
||||
setprop("it-fbw/law", 1);
|
||||
gui.popupTip("Fly By Wire switched to ALTERNATE law!");
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -83,8 +83,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/it-fbw/degrade-law", 2);
|
||||
setprop("/it-fbw/law", 2);
|
||||
setprop("it-fbw/degrade-law", 2);
|
||||
setprop("it-fbw/law", 2);
|
||||
gui.popupTip("Fly By Wire switched to DIRECT law!");
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -99,8 +99,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/it-fbw/degrade-law", 3);
|
||||
setprop("/it-fbw/law", 3);
|
||||
setprop("it-fbw/degrade-law", 3);
|
||||
setprop("it-fbw/law", 3);
|
||||
gui.popupTip("Fly By Wire switched to MECHANICAL BACKUP law!");
|
||||
</script>
|
||||
</binding>
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
<script>
|
||||
<![CDATA[
|
||||
if (systems.fuelSvc.Nodes.requestLbs.getValue() > 0) {
|
||||
if ((getprop("/services/fuel-truck/enable") == 1) and getprop("/services/fuel-truck/connect") == 1) {
|
||||
if ((getprop("services/fuel-truck/enable") == 1) and getprop("services/fuel-truck/connect") == 1) {
|
||||
if (systems.fuelSvc.Nodes.requestTotalLbs.getValue() - pts.Consumables.Fuel.totalFuelLbs.getValue() > 0) {
|
||||
systems.fuelSvc.refuel();
|
||||
screen.log.write("Refueling process started.", 0, 0.584, 1);
|
||||
|
|
|
@ -158,8 +158,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("/systems/acconfig/options/welcome-skip") != 1) {
|
||||
if (getprop("systems/acconfig/mismatch-code") == "0x000") {
|
||||
if (getprop("systems/acconfig/options/welcome-skip") != 1) {
|
||||
acconfig.welcome_dlg.open();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/systems/acconfig/options/welcome-skip") != 1) {
|
||||
if (getprop("systems/acconfig/options/welcome-skip") != 1) {
|
||||
acconfig.welcome_dlg.open();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -38,7 +38,7 @@ var someOtherThing = func {
|
|||
something = 1;
|
||||
}
|
||||
settimer(func {
|
||||
setprop("/something", something);
|
||||
setprop("something", something);
|
||||
}, 5);
|
||||
}
|
||||
```
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<value>50</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>/position/altitude-ft</property>
|
||||
<property>position/altitude-ft</property>
|
||||
<value>19000</value>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<value>50</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>/position/altitude-ft</property>
|
||||
<property>position/altitude-ft</property>
|
||||
<value>19000</value>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
|
|
|
@ -497,8 +497,8 @@
|
|||
<object-name>vs-text-test</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<not><property>/FMGC/FCU-working</property></not>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<not><property>FMGC/FCU-working</property></not>
|
||||
<property>controls/switches/annun-test</property>
|
||||
</or>
|
||||
</condition>
|
||||
</animation>
|
||||
|
@ -520,9 +520,9 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var TrimVal = getprop("/controls/flight/rudder-trim");
|
||||
setprop("/controls/flight/rudder-trim", TrimVal + 0.005);
|
||||
setprop("/controls/switches/rudder-trim", 1);
|
||||
var TrimVal = getprop("controls/flight/rudder-trim");
|
||||
setprop("controls/flight/rudder-trim", TrimVal + 0.005);
|
||||
setprop("controls/switches/rudder-trim", 1);
|
||||
</script>
|
||||
</binding>
|
||||
<mod-up>
|
||||
|
@ -546,9 +546,9 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var TrimVal = getprop("/controls/flight/rudder-trim");
|
||||
setprop("/controls/flight/rudder-trim", TrimVal - 0.005);
|
||||
setprop("/controls/switches/rudder-trim", -1);
|
||||
var TrimVal = getprop("controls/flight/rudder-trim");
|
||||
setprop("controls/flight/rudder-trim", TrimVal - 0.005);
|
||||
setprop("controls/switches/rudder-trim", -1);
|
||||
</script>
|
||||
</binding>
|
||||
<mod-up>
|
||||
|
@ -586,7 +586,7 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/rudder-trim", 0);
|
||||
setprop("controls/flight/rudder-trim", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -880,12 +880,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/controls/autobrake/mode") != 1) {
|
||||
if (getprop("controls/autobrake/mode") != 1) {
|
||||
systems.arm_autobrake(1);
|
||||
} else {
|
||||
systems.arm_autobrake(0);
|
||||
}
|
||||
setprop("/sim/sounde/oh-btn", 1);
|
||||
setprop("sim/sounde/oh-btn", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -907,12 +907,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/controls/autobrake/mode") != 2) {
|
||||
if (getprop("controls/autobrake/mode") != 2) {
|
||||
systems.arm_autobrake(2);
|
||||
} else {
|
||||
systems.arm_autobrake(0);
|
||||
}
|
||||
setprop("/sim/sounde/oh-btn", 1);
|
||||
setprop("sim/sounde/oh-btn", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -934,12 +934,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/controls/autobrake/mode") != 3) {
|
||||
if (getprop("controls/autobrake/mode") != 3) {
|
||||
systems.arm_autobrake(3);
|
||||
} else {
|
||||
systems.arm_autobrake(0);
|
||||
}
|
||||
setprop("/sim/sounde/oh-btn", 1);
|
||||
setprop("sim/sounde/oh-btn", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -980,7 +980,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/switch1", 1);</script>
|
||||
<script>setprop("sim/sounde/switch1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -1511,13 +1511,13 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>property-assign</command>
|
||||
<property>/ECAM/to-config-test</property>
|
||||
<property>ECAM/to-config-test</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/ECAM/to-config-test</property>
|
||||
<property>ECAM/to-config-test</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
|
@ -1934,7 +1934,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/instrumentation/altimeter/setting-inhg", getprop("instrumentation/altimeter/setting-inhg") + 0.01);
|
||||
setprop("instrumentation/altimeter/setting-inhg", getprop("instrumentation/altimeter/setting-inhg") + 0.01);
|
||||
</script>
|
||||
<condition>
|
||||
<and>
|
||||
|
@ -1956,7 +1956,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/instrumentation/altimeter/setting-hpa", getprop("instrumentation/altimeter/setting-hpa") + 1.0);
|
||||
setprop("instrumentation/altimeter/setting-hpa", getprop("instrumentation/altimeter/setting-hpa") + 1.0);
|
||||
</script>
|
||||
<condition>
|
||||
<and>
|
||||
|
@ -1990,7 +1990,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/instrumentation/altimeter/setting-inhg", getprop("instrumentation/altimeter/setting-inhg") - 0.01);
|
||||
setprop("instrumentation/altimeter/setting-inhg", getprop("instrumentation/altimeter/setting-inhg") - 0.01);
|
||||
</script>
|
||||
<condition>
|
||||
<and>
|
||||
|
@ -2012,7 +2012,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/instrumentation/altimeter/setting-hpa", getprop("instrumentation/altimeter/setting-hpa") - 1.0);
|
||||
setprop("instrumentation/altimeter/setting-hpa", getprop("instrumentation/altimeter/setting-hpa") - 1.0);
|
||||
</script>
|
||||
<condition>
|
||||
<and>
|
||||
|
@ -2120,7 +2120,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.2f</format>
|
||||
<property>/instrumentation/altimeter/setting-inhg</property>
|
||||
<property>instrumentation/altimeter/setting-inhg</property>
|
||||
<truncate>false</truncate>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text>true</draw-text>
|
||||
|
@ -2146,7 +2146,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.2f</format>
|
||||
<property>/instrumentation/altimeter/setting-inhg</property>
|
||||
<property>instrumentation/altimeter/setting-inhg</property>
|
||||
<truncate>false</truncate>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text>true</draw-text>
|
||||
|
@ -2172,7 +2172,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.0f</format>
|
||||
<property>/instrumentation/altimeter/setting-hpa</property>
|
||||
<property>instrumentation/altimeter/setting-hpa</property>
|
||||
<truncate>false</truncate>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text>true</draw-text>
|
||||
|
@ -2198,7 +2198,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.0f</format>
|
||||
<property>/instrumentation/altimeter/setting-hpa</property>
|
||||
<property>instrumentation/altimeter/setting-hpa</property>
|
||||
<truncate>false</truncate>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text>true</draw-text>
|
||||
|
@ -2384,7 +2384,7 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
fcu.FCUController.FD1();
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2486,7 +2486,7 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
fcu.FCUController.FD2();
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2524,12 +2524,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis/inputs/CSTR") != 1) {
|
||||
if (getprop("instrumentation/efis/inputs/CSTR") != 1) {
|
||||
libraries.cpt_efis_btns("cstr");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2566,12 +2566,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis[1]/inputs/CSTR") != 1) {
|
||||
if (getprop("instrumentation/efis[1]/inputs/CSTR") != 1) {
|
||||
libraries.fo_efis_btns("cstr");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2608,12 +2608,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis/inputs/wpt") != 1) {
|
||||
if (getprop("instrumentation/efis/inputs/wpt") != 1) {
|
||||
libraries.cpt_efis_btns("wpt");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2650,12 +2650,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis[1]/inputs/wpt") != 1) {
|
||||
if (getprop("instrumentation/efis[1]/inputs/wpt") != 1) {
|
||||
libraries.fo_efis_btns("wpt");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2692,12 +2692,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis/inputs/VORD") != 1) {
|
||||
if (getprop("instrumentation/efis/inputs/VORD") != 1) {
|
||||
libraries.cpt_efis_btns("vord");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2734,12 +2734,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis[1]/inputs/VORD") != 1) {
|
||||
if (getprop("instrumentation/efis[1]/inputs/VORD") != 1) {
|
||||
libraries.fo_efis_btns("vord");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2776,12 +2776,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis/inputs/NDB") != 1) {
|
||||
if (getprop("instrumentation/efis/inputs/NDB") != 1) {
|
||||
libraries.cpt_efis_btns("ndb");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2818,12 +2818,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis[1]/inputs/NDB") != 1) {
|
||||
if (getprop("instrumentation/efis[1]/inputs/NDB") != 1) {
|
||||
libraries.fo_efis_btns("ndb");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2860,12 +2860,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis/inputs/arpt") != 1) {
|
||||
if (getprop("instrumentation/efis/inputs/arpt") != 1) {
|
||||
libraries.cpt_efis_btns("arpt");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -2902,12 +2902,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/instrumentation/efis[1]/inputs/arpt") != 1) {
|
||||
if (getprop("instrumentation/efis[1]/inputs/arpt") != 1) {
|
||||
libraries.fo_efis_btns("arpt");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
}
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -3900,7 +3900,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -3927,7 +3927,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -3939,7 +3939,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4018,7 +4018,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4030,7 +4030,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4099,7 +4099,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -4152,7 +4152,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -4167,7 +4167,7 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
fcu.FCUController.AP1();
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -4199,7 +4199,7 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
fcu.FCUController.AP2();
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -4231,7 +4231,7 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
fcu.FCUController.ATHR();
|
||||
setprop("/sim/sounde/btn1", 1);
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -4275,7 +4275,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4287,7 +4287,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4356,7 +4356,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/knb1", 1);</script>
|
||||
<script>setprop("sim/sounde/knb1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -4383,7 +4383,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4395,7 +4395,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -4464,7 +4464,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/btn1", 1);</script>
|
||||
<script>setprop("sim/sounde/btn1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -5307,12 +5307,12 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/it-autoflight/output/ap-warning") == 1) {
|
||||
setprop("/it-autoflight/output/ap-warning", 0);
|
||||
if (getprop("it-autoflight/output/ap-warning") == 1) {
|
||||
setprop("it-autoflight/output/ap-warning", 0);
|
||||
}
|
||||
if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("/it-autoflight/sound/apoffsound", 0);
|
||||
setprop("/it-autoflight/sound/apoffsound2", 0);
|
||||
if (getprop("it-autoflight/sound/apoffsound") == 1 or getprop("it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("it-autoflight/sound/apoffsound", 0);
|
||||
setprop("it-autoflight/sound/apoffsound2", 0);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -5345,8 +5345,8 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("/it-autoflight/output/athr-warning", 0);
|
||||
if (getprop("it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("it-autoflight/output/athr-warning", 0);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -5418,7 +5418,7 @@
|
|||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>/controls/flight/elevator-trim</property>
|
||||
<property>controls/flight/elevator-trim</property>
|
||||
<step>0.01</step>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -5428,7 +5428,7 @@
|
|||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>/controls/flight/elevator-trim</property>
|
||||
<property>controls/flight/elevator-trim</property>
|
||||
<step>-0.01</step>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -5543,17 +5543,17 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var spdBrk = getprop("/controls/flight/speedbrake" );
|
||||
var spdBrk = getprop("controls/flight/speedbrake" );
|
||||
if(spdBrk == 0){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0.5);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0.5);
|
||||
}
|
||||
elsif(spdBrk == 0.5){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 1);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 1);
|
||||
}
|
||||
elsif(spdBrk == 1){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
# Do nothing because spoilers are fully up.
|
||||
}
|
||||
</script>
|
||||
|
@ -5565,18 +5565,18 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var spdBrk = getprop("/controls/flight/speedbrake");
|
||||
var spdBrk = getprop("controls/flight/speedbrake");
|
||||
if(spdBrk == 0){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
# Do nothing because spoilers are fully down.
|
||||
}
|
||||
elsif(spdBrk == 0.5){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0);
|
||||
}
|
||||
elsif(spdBrk == 1){
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("/controls/flight/speedbrake", 0.5);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake", 0.5);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -5815,10 +5815,10 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var a = getprop("/controls/flight/rudder");
|
||||
var a = getprop("controls/flight/rudder");
|
||||
a += 0.1;
|
||||
if (a > 1) a = 1;
|
||||
setprop("/controls/flight/rudder", a);
|
||||
setprop("controls/flight/rudder", a);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -5828,10 +5828,10 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var a = getprop("/controls/flight/rudder");
|
||||
var a = getprop("controls/flight/rudder");
|
||||
a -= 0.1;
|
||||
if (abs(a) > 1) a = -1;
|
||||
setprop("/controls/flight/rudder", a);
|
||||
setprop("controls/flight/rudder", a);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -5841,7 +5841,7 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
setprop("/controls/flight/rudder", 0);
|
||||
setprop("controls/flight/rudder", 0);
|
||||
</script>
|
||||
</binding>
|
||||
</action>
|
||||
|
@ -6167,7 +6167,7 @@
|
|||
<object-name>ecam_air_data</object-name>
|
||||
<object-name>ecam_air_data.mark</object-name>
|
||||
<factor>30</factor>
|
||||
<property>/controls/navigation/switching/air-data</property>
|
||||
<property>controls/navigation/switching/air-data</property>
|
||||
<axis>
|
||||
<x1-m>-0.428673</x1-m>
|
||||
<y1-m>-0.022557</y1-m>
|
||||
|
@ -6197,7 +6197,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/knb1", 1);</script>
|
||||
<script>setprop("sim/sounde/knb1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -6216,7 +6216,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/knb1", 1);</script>
|
||||
<script>setprop("sim/sounde/knb1", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -6717,7 +6717,7 @@
|
|||
<object-name>HeadsetCpt</object-name>
|
||||
<condition>
|
||||
<not>
|
||||
<property>/controls/audio/headset-toggle</property>
|
||||
<property>controls/audio/headset-toggle</property>
|
||||
</not>
|
||||
</condition>
|
||||
</animation>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<object-name>Rudder</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/logo-lights</property>
|
||||
<property>sim/model/lights/logo-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<object-name>Rudder</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/logo-lights</property>
|
||||
<property>sim/model/lights/logo-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<object-name>Rudder</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/logo-lights</property>
|
||||
<property>sim/model/lights/logo-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<button>0</button>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/audio/headset-toggle</property>
|
||||
<property>controls/audio/headset-toggle</property>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
|
|
@ -14,24 +14,24 @@ var mach_act = 0;
|
|||
# props.nas nodes
|
||||
var iesi_init = props.globals.initNode("/instrumentation/iesi/iesi-init", 0, "BOOL");
|
||||
var iesi_time = props.globals.initNode("/instrumentation/iesi/iesi-init-time", 0.0, "DOUBLE");
|
||||
var iesi_rate = props.globals.getNode("/systems/acconfig/options/iesi-rate");
|
||||
var et = props.globals.getNode("/sim/time/elapsed-sec");
|
||||
var aconfig = props.globals.getNode("/systems/acconfig/autoconfig-running");
|
||||
var iesi_rate = props.globals.getNode("systems/acconfig/options/iesi-rate");
|
||||
var et = props.globals.getNode("sim/time/elapsed-sec");
|
||||
var aconfig = props.globals.getNode("systems/acconfig/autoconfig-running");
|
||||
|
||||
var dcess = 0;
|
||||
var dchot1 = 0;
|
||||
|
||||
var airspeed = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
var mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach");
|
||||
var pitch = props.globals.getNode("/orientation/pitch-deg");
|
||||
var roll = props.globals.getNode("/orientation/roll-deg");
|
||||
var skid = props.globals.getNode("/instrumentation/slip-skid-ball/indicated-slip-skid");
|
||||
var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
var altitude_ind = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft-pfd");
|
||||
var airspeed = props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
var mach = props.globals.getNode("instrumentation/airspeed-indicator/indicated-mach");
|
||||
var pitch = props.globals.getNode("orientation/pitch-deg");
|
||||
var roll = props.globals.getNode("orientation/roll-deg");
|
||||
var skid = props.globals.getNode("instrumentation/slip-skid-ball/indicated-slip-skid");
|
||||
var altitude = props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft");
|
||||
var altitude_ind = props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft-pfd");
|
||||
|
||||
var altimeter_mode = props.globals.getNode("/modes/altimeter/std");
|
||||
var qnh_hpa = props.globals.getNode("/instrumentation/altimeter/setting-hpa");
|
||||
var qnh_inhg = props.globals.getNode("/instrumentation/altimeter/setting-inhg");
|
||||
var altimeter_mode = props.globals.getNode("modes/altimeter/std");
|
||||
var qnh_hpa = props.globals.getNode("instrumentation/altimeter/setting-hpa");
|
||||
var qnh_inhg = props.globals.getNode("instrumentation/altimeter/setting-inhg");
|
||||
|
||||
var canvas_IESI_base = {
|
||||
init: func(canvas_group, file) {
|
||||
|
|
|
@ -18,7 +18,7 @@ var lowerECAM_wheel = nil;
|
|||
var lowerECAM_test = nil;
|
||||
var lowerECAM_display = nil;
|
||||
var page = "fctl";
|
||||
var oat = getprop("/environment/temperature-degc");
|
||||
var oat = getprop("environment/temperature-degc");
|
||||
var blue_psi = 0;
|
||||
var green_psi = 0;
|
||||
var yellow_psi = 0;
|
||||
|
@ -42,217 +42,217 @@ var essTrvolts = 0;
|
|||
LBS2KGS = 0.4535924;
|
||||
|
||||
# Fetch Nodes
|
||||
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
|
||||
var elapsed_sec = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var ac2 = props.globals.getNode("/systems/electrical/bus/ac-2", 1);
|
||||
var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
||||
var ac1_src = props.globals.getNode("/systems/electrical/ac1-src", 1);
|
||||
var ac2_src = props.globals.getNode("/systems/electrical/ac2-src", 1);
|
||||
var lighting_du4 = props.globals.getNode("/controls/lighting/DU/du4", 1);
|
||||
var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1);
|
||||
var hour = props.globals.getNode("/sim/time/utc/hour", 1);
|
||||
var minute = props.globals.getNode("/sim/time/utc/minute", 1);
|
||||
var apu_flap = props.globals.getNode("/systems/apu/flap", 1);
|
||||
var apu_rpm = props.globals.getNode("/systems/apu/rpm", 1);
|
||||
var apu_egt = props.globals.getNode("/systems/apu/egt", 1);
|
||||
var door_left = props.globals.getNode("/ECAM/Lower/door-left", 1);
|
||||
var door_right = props.globals.getNode("/ECAM/Lower/door-right", 1);
|
||||
var door_nose_left = props.globals.getNode("/ECAM/Lower/door-nose-left", 1);
|
||||
var door_nose_right = props.globals.getNode("/ECAM/Lower/door-nose-right", 1);
|
||||
var apu_rpm_rot = props.globals.getNode("/ECAM/Lower/APU-N", 1);
|
||||
var apu_egt_rot = props.globals.getNode("/ECAM/Lower/APU-EGT", 1);
|
||||
var oil_qt1 = props.globals.getNode("/ECAM/Lower/Oil-QT[0]", 1);
|
||||
var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1);
|
||||
var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1);
|
||||
var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1);
|
||||
var bleedapu = props.globals.getNode("/systems/pneumatic/bleedapu", 1);
|
||||
var oil_psi_actual1 = props.globals.getNode("/engines/engine[0]/oil-psi-actual", 1);
|
||||
var oil_psi_actual2 = props.globals.getNode("/engines/engine[1]/oil-psi-actual", 1);
|
||||
var aileron_ind_left = props.globals.getNode("/ECAM/Lower/aileron-ind-left", 1);
|
||||
var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1);
|
||||
var elevator_ind_left = props.globals.getNode("/ECAM/Lower/elevator-ind-left", 1);
|
||||
var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1);
|
||||
var elevator_trim_deg = props.globals.getNode("/ECAM/Lower/elevator-trim-deg", 1);
|
||||
var final_deg = props.globals.getNode("/fdm/jsbsim/hydraulics/rudder/final-deg", 1);
|
||||
var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1);
|
||||
var gw = props.globals.getNode("/FMGC/internal/gw", 1);
|
||||
var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1);
|
||||
var apu_master = props.globals.getNode("/controls/APU/master", 1);
|
||||
var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1);
|
||||
var switch_bleedapu = props.globals.getNode("/controls/pneumatic/switches/bleedapu", 1);
|
||||
var pneumatic_xbleed_state = props.globals.getNode("/systems/pneumatic/xbleed-state", 1);
|
||||
var xbleed = props.globals.getNode("/systems/pneumatic/xbleed", 1);
|
||||
var hp_valve1_state = props.globals.getNode("/systems/pneumatic/hp-valve-1-state", 1);
|
||||
var hp_valve2_state = props.globals.getNode("/systems/pneumatic/hp-valve-2-state", 1);
|
||||
var hp_valve1 = props.globals.getNode("/systems/pneumatic/hp-valve-1", 1);
|
||||
var hp_valve2 = props.globals.getNode("/systems/pneumatic/hp-valve-2", 1);
|
||||
var eng_valve1_state = props.globals.getNode("/systems/pneumatic/eng-valve-1-state", 1);
|
||||
var eng_valve2_state = props.globals.getNode("/systems/pneumatic/eng-valve-2-state", 1);
|
||||
var eng_valve1 = props.globals.getNode("/systems/pneumatic/eng-valve-1", 1);
|
||||
var eng_valve2 = props.globals.getNode("/systems/pneumatic/eng-valve-2", 1);
|
||||
var precooler1_psi = props.globals.getNode("/systems/pneumatic/precooler-1-psi", 1);
|
||||
var precooler2_psi = props.globals.getNode("/systems/pneumatic/precooler-2-psi", 1);
|
||||
var precooler1_temp = props.globals.getNode("/systems/pneumatic/precooler-1-temp", 1);
|
||||
var precooler2_temp = props.globals.getNode("/systems/pneumatic/precooler-2-temp", 1);
|
||||
var precooler1_ovht = props.globals.getNode("/systems/pneumatic/precooler-1-ovht", 1);
|
||||
var precooler2_ovht = props.globals.getNode("/systems/pneumatic/precooler-2-ovht", 1);
|
||||
var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1);
|
||||
var switch_wing_aice = props.globals.getNode("/controls/switches/wing", 1);
|
||||
var deice_wing = props.globals.getNode("/controls/deice/wing", 1);
|
||||
var eng1_n2_actual = props.globals.getNode("/engines/engine[0]/n2-actual", 1);
|
||||
var eng2_n2_actual = props.globals.getNode("/engines/engine[1]/n2-actual", 1);
|
||||
var pack1_out_temp = props.globals.getNode("/systems/pressurization/pack-1-out-temp", 1);
|
||||
var pack2_out_temp = props.globals.getNode("/systems/pressurization/pack-2-out-temp", 1);
|
||||
var pack1_comp_out_temp = props.globals.getNode("/systems/pressurization/pack-1-comp-out-temp", 1);
|
||||
var pack2_comp_out_temp = props.globals.getNode("/systems/pressurization/pack-2-comp-out-temp", 1);
|
||||
var pack1_bypass = props.globals.getNode("/systems/pressurization/pack-1-bypass", 1);
|
||||
var pack2_bypass = props.globals.getNode("/systems/pressurization/pack-2-bypass", 1);
|
||||
var pack1_flow = props.globals.getNode("/systems/pressurization/pack-1-flow", 1);
|
||||
var pack2_flow = props.globals.getNode("/systems/pressurization/pack-2-flow", 1);
|
||||
var pack1_valve = props.globals.getNode("/systems/pressurization/pack-1-valve", 1);
|
||||
var pack2_valve = props.globals.getNode("/systems/pressurization/pack-2-valve", 1);
|
||||
var switch_pack1 = props.globals.getNode("/controls/pneumatic/switches/pack1", 1);
|
||||
var switch_pack2 = props.globals.getNode("/controls/pneumatic/switches/pack2", 1);
|
||||
var oil_qt1_actual = props.globals.getNode("/engines/engine[0]/oil-qt-actual", 1);
|
||||
var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1);
|
||||
var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1);
|
||||
var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1);
|
||||
var acconfig_weight_kgs = props.globals.getNode("systems/acconfig/options/weight-kgs", 1);
|
||||
var elapsed_sec = props.globals.getNode("sim/time/elapsed-sec", 1);
|
||||
var ac2 = props.globals.getNode("systems/electrical/bus/ac-2", 1);
|
||||
var autoconfig_running = props.globals.getNode("systems/acconfig/autoconfig-running", 1);
|
||||
var ac1_src = props.globals.getNode("systems/electrical/ac1-src", 1);
|
||||
var ac2_src = props.globals.getNode("systems/electrical/ac2-src", 1);
|
||||
var lighting_du4 = props.globals.getNode("controls/lighting/DU/du4", 1);
|
||||
var ecam_page = props.globals.getNode("ECAM/Lower/page", 1);
|
||||
var hour = props.globals.getNode("sim/time/utc/hour", 1);
|
||||
var minute = props.globals.getNode("sim/time/utc/minute", 1);
|
||||
var apu_flap = props.globals.getNode("systems/apu/flap", 1);
|
||||
var apu_rpm = props.globals.getNode("systems/apu/rpm", 1);
|
||||
var apu_egt = props.globals.getNode("systems/apu/egt", 1);
|
||||
var door_left = props.globals.getNode("ECAM/Lower/door-left", 1);
|
||||
var door_right = props.globals.getNode("ECAM/Lower/door-right", 1);
|
||||
var door_nose_left = props.globals.getNode("ECAM/Lower/door-nose-left", 1);
|
||||
var door_nose_right = props.globals.getNode("ECAM/Lower/door-nose-right", 1);
|
||||
var apu_rpm_rot = props.globals.getNode("ECAM/Lower/APU-N", 1);
|
||||
var apu_egt_rot = props.globals.getNode("ECAM/Lower/APU-EGT", 1);
|
||||
var oil_qt1 = props.globals.getNode("ECAM/Lower/Oil-QT[0]", 1);
|
||||
var oil_qt2 = props.globals.getNode("ECAM/Lower/Oil-QT[1]", 1);
|
||||
var oil_psi1 = props.globals.getNode("ECAM/Lower/Oil-PSI[0]", 1);
|
||||
var oil_psi2 = props.globals.getNode("ECAM/Lower/Oil-PSI[1]", 1);
|
||||
var bleedapu = props.globals.getNode("systems/pneumatic/bleedapu", 1);
|
||||
var oil_psi_actual1 = props.globals.getNode("engines/engine[0]/oil-psi-actual", 1);
|
||||
var oil_psi_actual2 = props.globals.getNode("engines/engine[1]/oil-psi-actual", 1);
|
||||
var aileron_ind_left = props.globals.getNode("ECAM/Lower/aileron-ind-left", 1);
|
||||
var aileron_ind_right = props.globals.getNode("ECAM/Lower/aileron-ind-right", 1);
|
||||
var elevator_ind_left = props.globals.getNode("ECAM/Lower/elevator-ind-left", 1);
|
||||
var elevator_ind_right = props.globals.getNode("ECAM/Lower/elevator-ind-right", 1);
|
||||
var elevator_trim_deg = props.globals.getNode("ECAM/Lower/elevator-trim-deg", 1);
|
||||
var final_deg = props.globals.getNode("fdm/jsbsim/hydraulics/rudder/final-deg", 1);
|
||||
var temperature_degc = props.globals.getNode("environment/temperature-degc", 1);
|
||||
var gw = props.globals.getNode("FMGC/internal/gw", 1);
|
||||
var tank3_content_lbs = props.globals.getNode("fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1);
|
||||
var apu_master = props.globals.getNode("controls/APU/master", 1);
|
||||
var ir2_knob = props.globals.getNode("controls/adirs/ir[1]/knob", 1);
|
||||
var switch_bleedapu = props.globals.getNode("controls/pneumatic/switches/bleedapu", 1);
|
||||
var pneumatic_xbleed_state = props.globals.getNode("systems/pneumatic/xbleed-state", 1);
|
||||
var xbleed = props.globals.getNode("systems/pneumatic/xbleed", 1);
|
||||
var hp_valve1_state = props.globals.getNode("systems/pneumatic/hp-valve-1-state", 1);
|
||||
var hp_valve2_state = props.globals.getNode("systems/pneumatic/hp-valve-2-state", 1);
|
||||
var hp_valve1 = props.globals.getNode("systems/pneumatic/hp-valve-1", 1);
|
||||
var hp_valve2 = props.globals.getNode("systems/pneumatic/hp-valve-2", 1);
|
||||
var eng_valve1_state = props.globals.getNode("systems/pneumatic/eng-valve-1-state", 1);
|
||||
var eng_valve2_state = props.globals.getNode("systems/pneumatic/eng-valve-2-state", 1);
|
||||
var eng_valve1 = props.globals.getNode("systems/pneumatic/eng-valve-1", 1);
|
||||
var eng_valve2 = props.globals.getNode("systems/pneumatic/eng-valve-2", 1);
|
||||
var precooler1_psi = props.globals.getNode("systems/pneumatic/precooler-1-psi", 1);
|
||||
var precooler2_psi = props.globals.getNode("systems/pneumatic/precooler-2-psi", 1);
|
||||
var precooler1_temp = props.globals.getNode("systems/pneumatic/precooler-1-temp", 1);
|
||||
var precooler2_temp = props.globals.getNode("systems/pneumatic/precooler-2-temp", 1);
|
||||
var precooler1_ovht = props.globals.getNode("systems/pneumatic/precooler-1-ovht", 1);
|
||||
var precooler2_ovht = props.globals.getNode("systems/pneumatic/precooler-2-ovht", 1);
|
||||
var gs_kt = props.globals.getNode("velocities/groundspeed-kt", 1);
|
||||
var switch_wing_aice = props.globals.getNode("controls/switches/wing", 1);
|
||||
var deice_wing = props.globals.getNode("controls/deice/wing", 1);
|
||||
var eng1_n2_actual = props.globals.getNode("engines/engine[0]/n2-actual", 1);
|
||||
var eng2_n2_actual = props.globals.getNode("engines/engine[1]/n2-actual", 1);
|
||||
var pack1_out_temp = props.globals.getNode("systems/pressurization/pack-1-out-temp", 1);
|
||||
var pack2_out_temp = props.globals.getNode("systems/pressurization/pack-2-out-temp", 1);
|
||||
var pack1_comp_out_temp = props.globals.getNode("systems/pressurization/pack-1-comp-out-temp", 1);
|
||||
var pack2_comp_out_temp = props.globals.getNode("systems/pressurization/pack-2-comp-out-temp", 1);
|
||||
var pack1_bypass = props.globals.getNode("systems/pressurization/pack-1-bypass", 1);
|
||||
var pack2_bypass = props.globals.getNode("systems/pressurization/pack-2-bypass", 1);
|
||||
var pack1_flow = props.globals.getNode("systems/pressurization/pack-1-flow", 1);
|
||||
var pack2_flow = props.globals.getNode("systems/pressurization/pack-2-flow", 1);
|
||||
var pack1_valve = props.globals.getNode("systems/pressurization/pack-1-valve", 1);
|
||||
var pack2_valve = props.globals.getNode("systems/pressurization/pack-2-valve", 1);
|
||||
var switch_pack1 = props.globals.getNode("controls/pneumatic/switches/pack1", 1);
|
||||
var switch_pack2 = props.globals.getNode("controls/pneumatic/switches/pack2", 1);
|
||||
var oil_qt1_actual = props.globals.getNode("engines/engine[0]/oil-qt-actual", 1);
|
||||
var oil_qt2_actual = props.globals.getNode("engines/engine[1]/oil-qt-actual", 1);
|
||||
var fuel_used_lbs1 = props.globals.getNode("systems/fuel/fuel-used-1", 1);
|
||||
var fuel_used_lbs2 = props.globals.getNode("systems/fuel/fuel-used-2", 1);
|
||||
var doorL1_pos = props.globals.getNode("sim/model/door-positions/doorl1/position-norm", 1);
|
||||
var doorR1_pos = props.globals.getNode("sim/model/door-positions/doorr1/position-norm", 1);
|
||||
var doorL4_pos = props.globals.getNode("sim/model/door-positions/doorl4/position-norm", 1);
|
||||
var doorR4_pos = props.globals.getNode("sim/model/door-positions/doorr4/position-norm", 1);
|
||||
var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/position-norm", 1);
|
||||
var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1);
|
||||
var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1);
|
||||
var cargobulk_pos = props.globals.getNode("sim/model/door-positions/cargobulk/position-norm", 1);
|
||||
var cargofwd_pos = props.globals.getNode("sim/model/door-positions/cargofwd/position-norm", 1);
|
||||
var cargoaft_pos = props.globals.getNode("sim/model/door-positions/cargoaft/position-norm", 1);
|
||||
|
||||
# Electrical nodes
|
||||
var apu_volts = props.globals.getNode("/systems/electrical/sources/apu/output-volt", 1);
|
||||
var apu_hz = props.globals.getNode("/systems/electrical/sources/apu/output-hertz", 1);
|
||||
var gen_apu = props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos", 1);
|
||||
var switch_bat1 = props.globals.getNode("/controls/electrical/switches/bat-1", 1);
|
||||
var switch_bat2 = props.globals.getNode("/controls/electrical/switches/bat-2", 1);
|
||||
var bat1_amps = props.globals.getNode("/systems/electrical/sources/bat-1/amp", 1);
|
||||
var bat2_amps = props.globals.getNode("/systems/electrical/sources/bat-2/amp", 1);
|
||||
var bat1_volts = props.globals.getNode("/systems/electrical/sources/bat-1/volt", 1);
|
||||
var bat2_volts = props.globals.getNode("/systems/electrical/sources/bat-2/volt", 1);
|
||||
var bat1_fault = props.globals.getNode("/systems/electrical/light/bat-1-fault", 1);
|
||||
var bat2_fault = props.globals.getNode("/systems/electrical/light/bat-2-fault", 1);
|
||||
var emerGenVolts = props.globals.getNode("/systems/electrical/relay/emer-glc/output", 1);
|
||||
var emerGenHz = props.globals.getNode("/systems/electrical/sources/emer-gen/output-hertz", 1);
|
||||
var tr1_volts = props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output", 1);
|
||||
var tr2_volts = props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output", 1);
|
||||
var tr1_amps = props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output-amp", 1);
|
||||
var tr2_amps = props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp", 1);
|
||||
var dc1 = props.globals.getNode("/systems/electrical/bus/dc-1", 1);
|
||||
var dc2 = props.globals.getNode("/systems/electrical/bus/dc-2", 1);
|
||||
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
|
||||
var switch_emer_gen = props.globals.getNode("/systems/electrical/sources/emer-gen/output-volt", 1);
|
||||
var switch_gen1 = props.globals.getNode("/controls/electrical/switches/gen-1", 1);
|
||||
var switch_gen2 = props.globals.getNode("/controls/electrical/switches/gen-2", 1);
|
||||
var gen1_volts = props.globals.getNode("/systems/electrical/sources/idg-1/output-volt", 1);
|
||||
var gen2_volts = props.globals.getNode("/systems/electrical/sources/idg-2/output-volt", 1);
|
||||
var gen1_hz = props.globals.getNode("/systems/electrical/sources/idg-1/output-hertz", 1);
|
||||
var gen2_hz = props.globals.getNode("/systems/electrical/sources/idg-2/output-hertz", 1);
|
||||
var ext_volts = props.globals.getNode("/systems/electrical/sources/ext/output-volt", 1);
|
||||
var ext_hz = props.globals.getNode("/systems/electrical/sources/ext/output-hertz", 1);
|
||||
var galleyshed = props.globals.getNode("/systems/electrical/extra/galleyshed", 1);
|
||||
var switch_galley = props.globals.getNode("/controls/electrical/switches/galley", 1);
|
||||
var dcbat = props.globals.getNode("/systems/electrical/bus/dc-bat", 1);
|
||||
var ac_ess = props.globals.getNode("/systems/electrical/bus/ac-ess", 1);
|
||||
var ac1 = props.globals.getNode("/systems/electrical/bus/ac-1", 1);
|
||||
var ac2 = props.globals.getNode("/systems/electrical/bus/ac-2", 1);
|
||||
var switch_ac_ess_feed = props.globals.getNode("/controls/electrical/switches/ac-ess-feed", 1);
|
||||
var tr1_fault = props.globals.getNode("/systems/failures/electrical/tr-1", 1);
|
||||
var tr2_fault = props.globals.getNode("/systems/failures/electrical/tr-2", 1);
|
||||
var essTrVolt = props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output", 1);
|
||||
var essTrAmp = props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output-amp", 1);
|
||||
var apu_volts = props.globals.getNode("systems/electrical/sources/apu/output-volt", 1);
|
||||
var apu_hz = props.globals.getNode("systems/electrical/sources/apu/output-hertz", 1);
|
||||
var gen_apu = props.globals.getNode("systems/electrical/relay/apu-glc/contact-pos", 1);
|
||||
var switch_bat1 = props.globals.getNode("controls/electrical/switches/bat-1", 1);
|
||||
var switch_bat2 = props.globals.getNode("controls/electrical/switches/bat-2", 1);
|
||||
var bat1_amps = props.globals.getNode("systems/electrical/sources/bat-1/amp", 1);
|
||||
var bat2_amps = props.globals.getNode("systems/electrical/sources/bat-2/amp", 1);
|
||||
var bat1_volts = props.globals.getNode("systems/electrical/sources/bat-1/volt", 1);
|
||||
var bat2_volts = props.globals.getNode("systems/electrical/sources/bat-2/volt", 1);
|
||||
var bat1_fault = props.globals.getNode("systems/electrical/light/bat-1-fault", 1);
|
||||
var bat2_fault = props.globals.getNode("systems/electrical/light/bat-2-fault", 1);
|
||||
var emerGenVolts = props.globals.getNode("systems/electrical/relay/emer-glc/output", 1);
|
||||
var emerGenHz = props.globals.getNode("systems/electrical/sources/emer-gen/output-hertz", 1);
|
||||
var tr1_volts = props.globals.getNode("systems/electrical/relay/tr-contactor-1/output", 1);
|
||||
var tr2_volts = props.globals.getNode("systems/electrical/relay/tr-contactor-2/output", 1);
|
||||
var tr1_amps = props.globals.getNode("systems/electrical/relay/tr-contactor-1/output-amp", 1);
|
||||
var tr2_amps = props.globals.getNode("systems/electrical/relay/tr-contactor-2/output-amp", 1);
|
||||
var dc1 = props.globals.getNode("systems/electrical/bus/dc-1", 1);
|
||||
var dc2 = props.globals.getNode("systems/electrical/bus/dc-2", 1);
|
||||
var dc_ess = props.globals.getNode("systems/electrical/bus/dc-ess", 1);
|
||||
var switch_emer_gen = props.globals.getNode("systems/electrical/sources/emer-gen/output-volt", 1);
|
||||
var switch_gen1 = props.globals.getNode("controls/electrical/switches/gen-1", 1);
|
||||
var switch_gen2 = props.globals.getNode("controls/electrical/switches/gen-2", 1);
|
||||
var gen1_volts = props.globals.getNode("systems/electrical/sources/idg-1/output-volt", 1);
|
||||
var gen2_volts = props.globals.getNode("systems/electrical/sources/idg-2/output-volt", 1);
|
||||
var gen1_hz = props.globals.getNode("systems/electrical/sources/idg-1/output-hertz", 1);
|
||||
var gen2_hz = props.globals.getNode("systems/electrical/sources/idg-2/output-hertz", 1);
|
||||
var ext_volts = props.globals.getNode("systems/electrical/sources/ext/output-volt", 1);
|
||||
var ext_hz = props.globals.getNode("systems/electrical/sources/ext/output-hertz", 1);
|
||||
var galleyshed = props.globals.getNode("systems/electrical/extra/galleyshed", 1);
|
||||
var switch_galley = props.globals.getNode("controls/electrical/switches/galley", 1);
|
||||
var dcbat = props.globals.getNode("systems/electrical/bus/dc-bat", 1);
|
||||
var ac_ess = props.globals.getNode("systems/electrical/bus/ac-ess", 1);
|
||||
var ac1 = props.globals.getNode("systems/electrical/bus/ac-1", 1);
|
||||
var ac2 = props.globals.getNode("systems/electrical/bus/ac-2", 1);
|
||||
var switch_ac_ess_feed = props.globals.getNode("controls/electrical/switches/ac-ess-feed", 1);
|
||||
var tr1_fault = props.globals.getNode("systems/failures/electrical/tr-1", 1);
|
||||
var tr2_fault = props.globals.getNode("systems/failures/electrical/tr-2", 1);
|
||||
var essTrVolt = props.globals.getNode("systems/electrical/relay/dc-ess-feed-tr/output", 1);
|
||||
var essTrAmp = props.globals.getNode("systems/electrical/relay/dc-ess-feed-tr/output-amp", 1);
|
||||
|
||||
# Hydraulic
|
||||
var blue_psi = 0;
|
||||
var green_psi = 0;
|
||||
var yellow_psi = 0;
|
||||
var y_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/yellow-resv-lo-air-press", 1);
|
||||
var b_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/blue-resv-lo-air-press", 1);
|
||||
var g_resv_lo_air_press = props.globals.getNode("/systems/hydraulic/green-resv-lo-air-press", 1);
|
||||
var elec_pump_y_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-yellow-ovht", 1);
|
||||
var elec_pump_b_ovht = props.globals.getNode("/systems/hydraulic/elec-pump-blue-ovht", 1);
|
||||
var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1);
|
||||
var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1);
|
||||
var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1);
|
||||
var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1);
|
||||
var y_resv_lo_air_press = props.globals.getNode("systems/hydraulic/yellow-resv-lo-air-press", 1);
|
||||
var b_resv_lo_air_press = props.globals.getNode("systems/hydraulic/blue-resv-lo-air-press", 1);
|
||||
var g_resv_lo_air_press = props.globals.getNode("systems/hydraulic/green-resv-lo-air-press", 1);
|
||||
var elec_pump_y_ovht = props.globals.getNode("systems/hydraulic/elec-pump-yellow-ovht", 1);
|
||||
var elec_pump_b_ovht = props.globals.getNode("systems/hydraulic/elec-pump-blue-ovht", 1);
|
||||
var rat_deployed = props.globals.getNode("controls/hydraulic/rat-deployed", 1);
|
||||
var y_resv_ovht = props.globals.getNode("systems/hydraulic/yellow-resv-ovht", 1);
|
||||
var b_resv_ovht = props.globals.getNode("systems/hydraulic/blue-resv-ovht", 1);
|
||||
var g_resv_ovht = props.globals.getNode("systems/hydraulic/green-resv-ovht", 1);
|
||||
var askidsw = 0;
|
||||
var brakemode = 0;
|
||||
var accum = 0;
|
||||
var L1BrakeTempc = props.globals.getNode("/gear/gear[1]/L1brake-temp-degc", 1);
|
||||
var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1);
|
||||
var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1);
|
||||
var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1);
|
||||
var L1BrakeTempc = props.globals.getNode("gear/gear[1]/L1brake-temp-degc", 1);
|
||||
var L2BrakeTempc = props.globals.getNode("gear/gear[1]/L2brake-temp-degc", 1);
|
||||
var R3BrakeTempc = props.globals.getNode("gear/gear[2]/R3brake-temp-degc", 1);
|
||||
var R4BrakeTempc = props.globals.getNode("gear/gear[2]/R4brake-temp-degc", 1);
|
||||
|
||||
var eng1_running = props.globals.getNode("/engines/engine[0]/running", 1);
|
||||
var eng2_running = props.globals.getNode("/engines/engine[1]/running", 1);
|
||||
var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1);
|
||||
var total_psi = props.globals.getNode("/systems/pneumatic/total-psi", 1);
|
||||
var spoiler_L1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1);
|
||||
var spoiler_L2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1);
|
||||
var spoiler_L3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1);
|
||||
var spoiler_L4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1);
|
||||
var spoiler_L5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1);
|
||||
var spoiler_R1 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1);
|
||||
var spoiler_R2 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1);
|
||||
var spoiler_R3 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1);
|
||||
var spoiler_R4 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1);
|
||||
var spoiler_R5 = props.globals.getNode("/fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1);
|
||||
var spoiler_L1_fail = props.globals.getNode("/systems/failures/spoiler-l1", 1);
|
||||
var spoiler_L2_fail = props.globals.getNode("/systems/failures/spoiler-l2", 1);
|
||||
var spoiler_L3_fail = props.globals.getNode("/systems/failures/spoiler-l3", 1);
|
||||
var spoiler_L4_fail = props.globals.getNode("/systems/failures/spoiler-l4", 1);
|
||||
var spoiler_L5_fail = props.globals.getNode("/systems/failures/spoiler-l5", 1);
|
||||
var spoiler_R1_fail = props.globals.getNode("/systems/failures/spoiler-r1", 1);
|
||||
var spoiler_R2_fail = props.globals.getNode("/systems/failures/spoiler-r2", 1);
|
||||
var spoiler_R3_fail = props.globals.getNode("/systems/failures/spoiler-r3", 1);
|
||||
var spoiler_R4_fail = props.globals.getNode("/systems/failures/spoiler-r4", 1);
|
||||
var spoiler_R5_fail = props.globals.getNode("/systems/failures/spoiler-r5", 1);
|
||||
var elac1 = props.globals.getNode("/systems/fctl/elac1", 1);
|
||||
var elac2 = props.globals.getNode("/systems/fctl/elac2", 1);
|
||||
var sec1 = props.globals.getNode("/systems/fctl/sec1", 1);
|
||||
var sec2 = props.globals.getNode("/systems/fctl/sec2", 1);
|
||||
var sec3 = props.globals.getNode("/systems/fctl/sec3", 1);
|
||||
var elac1_fail = props.globals.getNode("/systems/failures/elac1", 1);
|
||||
var elac2_fail = props.globals.getNode("/systems/failures/elac2", 1);
|
||||
var sec1_fail = props.globals.getNode("/systems/failures/sec1", 1);
|
||||
var sec2_fail = props.globals.getNode("/systems/failures/sec2", 1);
|
||||
var sec3_fail = props.globals.getNode("/systems/failures/sec3", 1);
|
||||
var eng1_running = props.globals.getNode("engines/engine[0]/running", 1);
|
||||
var eng2_running = props.globals.getNode("engines/engine[1]/running", 1);
|
||||
var switch_cart = props.globals.getNode("controls/electrical/ground-cart", 1);
|
||||
var total_psi = props.globals.getNode("systems/pneumatic/total-psi", 1);
|
||||
var spoiler_L1 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-l1/final-deg", 1);
|
||||
var spoiler_L2 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-l2/final-deg", 1);
|
||||
var spoiler_L3 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-l3/final-deg", 1);
|
||||
var spoiler_L4 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-l4/final-deg", 1);
|
||||
var spoiler_L5 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-l5/final-deg", 1);
|
||||
var spoiler_R1 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-r1/final-deg", 1);
|
||||
var spoiler_R2 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-r2/final-deg", 1);
|
||||
var spoiler_R3 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-r3/final-deg", 1);
|
||||
var spoiler_R4 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-r4/final-deg", 1);
|
||||
var spoiler_R5 = props.globals.getNode("fdm/jsbsim/hydraulics/spoiler-r5/final-deg", 1);
|
||||
var spoiler_L1_fail = props.globals.getNode("systems/failures/spoiler-l1", 1);
|
||||
var spoiler_L2_fail = props.globals.getNode("systems/failures/spoiler-l2", 1);
|
||||
var spoiler_L3_fail = props.globals.getNode("systems/failures/spoiler-l3", 1);
|
||||
var spoiler_L4_fail = props.globals.getNode("systems/failures/spoiler-l4", 1);
|
||||
var spoiler_L5_fail = props.globals.getNode("systems/failures/spoiler-l5", 1);
|
||||
var spoiler_R1_fail = props.globals.getNode("systems/failures/spoiler-r1", 1);
|
||||
var spoiler_R2_fail = props.globals.getNode("systems/failures/spoiler-r2", 1);
|
||||
var spoiler_R3_fail = props.globals.getNode("systems/failures/spoiler-r3", 1);
|
||||
var spoiler_R4_fail = props.globals.getNode("systems/failures/spoiler-r4", 1);
|
||||
var spoiler_R5_fail = props.globals.getNode("systems/failures/spoiler-r5", 1);
|
||||
var elac1 = props.globals.getNode("systems/fctl/elac1", 1);
|
||||
var elac2 = props.globals.getNode("systems/fctl/elac2", 1);
|
||||
var sec1 = props.globals.getNode("systems/fctl/sec1", 1);
|
||||
var sec2 = props.globals.getNode("systems/fctl/sec2", 1);
|
||||
var sec3 = props.globals.getNode("systems/fctl/sec3", 1);
|
||||
var elac1_fail = props.globals.getNode("systems/failures/elac1", 1);
|
||||
var elac2_fail = props.globals.getNode("systems/failures/elac2", 1);
|
||||
var sec1_fail = props.globals.getNode("systems/failures/sec1", 1);
|
||||
var sec2_fail = props.globals.getNode("systems/failures/sec2", 1);
|
||||
var sec3_fail = props.globals.getNode("systems/failures/sec3", 1);
|
||||
var eng1_n1 = props.globals.getNode("engines/engine[0]/n1-actual", 1);
|
||||
var eng2_n1 = props.globals.getNode("engines/engine[1]/n1-actual", 1);
|
||||
var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
|
||||
var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
|
||||
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
|
||||
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
|
||||
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
|
||||
var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1);
|
||||
var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1);
|
||||
var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[3]/temperature_degC", 1);
|
||||
var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[4]/temperature_degC", 1);
|
||||
var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
|
||||
var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
|
||||
var fuel_xfeed = props.globals.getNode("/controls/fuel/x-feed", 1);
|
||||
var total_fuel_lbs = props.globals.getNode("consumables/fuel/total-fuel-lbs", 1);
|
||||
var fadec1 = props.globals.getNode("systems/fadec/powered1", 1);
|
||||
var fadec2 = props.globals.getNode("systems/fadec/powered2", 1);
|
||||
var fuel_flow1 = props.globals.getNode("engines/engine[0]/fuel-flow_actual", 1);
|
||||
var fuel_flow2 = props.globals.getNode("engines/engine[1]/fuel-flow_actual", 1);
|
||||
var fuel_left_outer_temp = props.globals.getNode("consumables/fuel/tank[0]/temperature_degC", 1);
|
||||
var fuel_left_inner_temp = props.globals.getNode("consumables/fuel/tank[1]/temperature_degC", 1);
|
||||
var fuel_right_outer_temp = props.globals.getNode("consumables/fuel/tank[3]/temperature_degC", 1);
|
||||
var fuel_right_inner_temp = props.globals.getNode("consumables/fuel/tank[4]/temperature_degC", 1);
|
||||
var cutoff_switch1 = props.globals.getNode("controls/engines/engine[0]/cutoff-switch", 1);
|
||||
var cutoff_switch2 = props.globals.getNode("controls/engines/engine[1]/cutoff-switch", 1);
|
||||
var fuel_xfeed = props.globals.getNode("controls/fuel/x-feed", 1);
|
||||
var tank0pump1 = props.globals.getNode("controls/fuel/tank0pump1", 1);
|
||||
var tank0pump2 = props.globals.getNode("controls/fuel/tank0pump2", 1);
|
||||
var tank1pump1 = props.globals.getNode("controls/fuel/tank1pump1", 1);
|
||||
var tank1pump2 = props.globals.getNode("controls/fuel/tank1pump2", 1);
|
||||
var tank2pump1 = props.globals.getNode("controls/fuel/tank2pump1", 1);
|
||||
var tank2pump2 = props.globals.getNode("controls/fuel/tank2pump2", 1);
|
||||
var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1);
|
||||
var autobreak_mode = props.globals.getNode("controls/autobrake/mode", 1);
|
||||
var gear1_pos = props.globals.getNode("gear/gear[0]/position-norm", 1);
|
||||
var gear2_pos = props.globals.getNode("gear/gear[1]/position-norm", 1);
|
||||
var gear3_pos = props.globals.getNode("gear/gear[2]/position-norm", 1);
|
||||
var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1);
|
||||
var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1);
|
||||
var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1);
|
||||
var gear_down = props.globals.getNode("/controls/gear/gear-down", 1);
|
||||
var press_vs_norm = props.globals.getNode("/systems/pressurization/vs-norm", 1);
|
||||
var cabinalt = props.globals.getNode("/systems/pressurization/cabinalt-norm", 1);
|
||||
var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
|
||||
var gear_door_L = props.globals.getNode("systems/hydraulic/gear/door-left", 1);
|
||||
var gear_door_R = props.globals.getNode("systems/hydraulic/gear/door-right", 1);
|
||||
var gear_door_N = props.globals.getNode("systems/hydraulic/gear/door-nose", 1);
|
||||
var gear_down = props.globals.getNode("controls/gear/gear-down", 1);
|
||||
var press_vs_norm = props.globals.getNode("systems/pressurization/vs-norm", 1);
|
||||
var cabinalt = props.globals.getNode("systems/pressurization/cabinalt-norm", 1);
|
||||
var gear0_wow = props.globals.getNode("gear/gear[0]/wow", 1);
|
||||
|
||||
# Create Nodes:
|
||||
var apu_load = props.globals.initNode("/systems/electrical/extra/apu-load", 0, "DOUBLE");
|
||||
|
@ -1676,25 +1676,25 @@ var canvas_lowerECAM_elec = {
|
|||
|
||||
|
||||
# Managment of the connecting lines between the components
|
||||
if (getprop("/systems/electrical/relay/apu-glc/contact-pos") and (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
if (getprop("systems/electrical/relay/apu-glc/contact-pos") and (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
me["APU-out"].show();
|
||||
} else {
|
||||
me["APU-out"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ext-epc/contact-pos") and (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
if (getprop("systems/electrical/relay/ext-epc/contact-pos") and (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
me["EXT-out"].show();
|
||||
} else {
|
||||
me["EXT-out"].hide();
|
||||
}
|
||||
|
||||
if (gen1_volts.getValue() >= 110 and getprop("/systems/electrical/relay/gen-1-glc/contact-pos")) {
|
||||
if (gen1_volts.getValue() >= 110 and getprop("systems/electrical/relay/gen-1-glc/contact-pos")) {
|
||||
me["ELEC-Line-GEN1-AC1"].show();
|
||||
} else {
|
||||
me["ELEC-Line-GEN1-AC1"].hide();
|
||||
}
|
||||
|
||||
if (gen2_volts.getValue() >= 110 and getprop("/systems/electrical/relay/gen-2-glc/contact-pos")) {
|
||||
if (gen2_volts.getValue() >= 110 and getprop("systems/electrical/relay/gen-2-glc/contact-pos")) {
|
||||
me["ELEC-Line-GEN2-AC2"].show();
|
||||
} else {
|
||||
me["ELEC-Line-GEN2-AC2"].hide();
|
||||
|
@ -1712,38 +1712,38 @@ var canvas_lowerECAM_elec = {
|
|||
me["AC2-in"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
me["ELEC-Line-APU-AC1"].show();
|
||||
me["ELEC-Line-APU-EXT"].show();
|
||||
me["ELEC-Line-EXT-AC2"].show();
|
||||
} else {
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos")) {
|
||||
me["ELEC-Line-APU-AC1"].show();
|
||||
} else {
|
||||
me["ELEC-Line-APU-AC1"].hide();
|
||||
}
|
||||
|
||||
if ((getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos") and getprop("/systems/electrical/relay/apu-glc/contact-pos") and !getprop("/systems/electrical/relay/gen-2-glc/contact-pos")) or (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("/systems/electrical/relay/ext-epc/contact-pos") and !getprop("/systems/electrical/relay/gen-1-glc/contact-pos"))) {
|
||||
if ((getprop("systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos") and getprop("systems/electrical/relay/apu-glc/contact-pos") and !getprop("systems/electrical/relay/gen-2-glc/contact-pos")) or (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("systems/electrical/relay/ext-epc/contact-pos") and !getprop("systems/electrical/relay/gen-1-glc/contact-pos"))) {
|
||||
me["ELEC-Line-APU-EXT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-APU-EXT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
me["ELEC-Line-EXT-AC2"].show();
|
||||
} else {
|
||||
me["ELEC-Line-EXT-AC2"].hide();
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-ess-feed-1/contact-pos") == 1) {
|
||||
if (getprop("systems/electrical/relay/ac-ess-feed-1/contact-pos") == 1) {
|
||||
if (ac1.getValue() >= 110) {
|
||||
me["ELEC-Line-AC1-ACESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-AC1-ACESS"].hide();
|
||||
}
|
||||
me["ELEC-Line-AC2-ACESS"].hide();
|
||||
} elsif (getprop("/systems/electrical/relay/ac-ess-feed-2/contact-pos") == 1) {
|
||||
} elsif (getprop("systems/electrical/relay/ac-ess-feed-2/contact-pos") == 1) {
|
||||
me["ELEC-Line-AC1-ACESS"].hide();
|
||||
if (ac2.getValue() >= 110) {
|
||||
me["ELEC-Line-AC2-ACESS"].show();
|
||||
|
@ -1755,7 +1755,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-AC2-ACESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/tr-contactor-1/contact-pos") == 1) {
|
||||
if (getprop("systems/electrical/relay/tr-contactor-1/contact-pos") == 1) {
|
||||
if (ac1.getValue() < 110) {
|
||||
me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0);
|
||||
} else {
|
||||
|
@ -1768,7 +1768,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-TR1-DC1"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/tr-contactor-2/contact-pos") == 1) {
|
||||
if (getprop("systems/electrical/relay/tr-contactor-2/contact-pos") == 1) {
|
||||
if (ac2.getValue() < 110) {
|
||||
me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0);
|
||||
} else {
|
||||
|
@ -1781,25 +1781,25 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-TR2-DC2"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
me["ELEC-Line-DC1-DCESS_DCBAT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCESS_DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-bat/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/dc-ess-feed-bat/contact-pos")) {
|
||||
me["ELEC-Line-DC1-DCESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-bat/contact-pos") or getprop("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/dc-ess-feed-bat/contact-pos") or getprop("systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
me["ELEC-Line-DC1-DCBAT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/dc-bus-tie-dc-2/contact-pos")) {
|
||||
me["ELEC-Line-DC2-DCBAT"].show();
|
||||
me["ELEC-Line-DC2-DCESS_DCBAT"].show();
|
||||
} else {
|
||||
|
@ -1807,7 +1807,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-DC2-DCESS_DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos")) {
|
||||
me["EMERGEN-out"].show();
|
||||
me["ELEC-Line-Emergen-ESSTR"].show();
|
||||
} else {
|
||||
|
@ -1815,13 +1815,13 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-Emergen-ESSTR"].hide();
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !getprop("/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos") and (!getprop("/systems/electrical/relay/tr-contactor-1/contact-pos") or !getprop("/systems/electrical/relay/tr-contactor-2/contact-pos"))) {
|
||||
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !getprop("systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos") and (!getprop("systems/electrical/relay/tr-contactor-1/contact-pos") or !getprop("systems/electrical/relay/tr-contactor-2/contact-pos"))) {
|
||||
me["ELEC-Line-ACESS-TRESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-ACESS-TRESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-tr/contact-pos")) {
|
||||
if (getprop("systems/electrical/relay/dc-ess-feed-tr/contact-pos")) {
|
||||
me["ELEC-Line-ESSTR-DCESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-ESSTR-DCESS"].hide();
|
||||
|
@ -2302,7 +2302,7 @@ var canvas_lowerECAM_fuel = {
|
|||
update: func() {
|
||||
_weight_kgs = acconfig_weight_kgs.getValue();
|
||||
|
||||
# if (getprop("engines/engine[0]/n1-actual") < getprop("/controls/engines/idle-limit")) {
|
||||
# if (getprop("engines/engine[0]/n1-actual") < getprop("controls/engines/idle-limit")) {
|
||||
if (eng1_n1.getValue() <= 18.8) {
|
||||
me["ENG1idFFlow"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2311,7 +2311,7 @@ var canvas_lowerECAM_fuel = {
|
|||
me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
# if (getprop("engines/engine[1]/n1-actual") < getprop("/controls/engines/idle-limit")) {
|
||||
# if (getprop("engines/engine[1]/n1-actual") < getprop("controls/engines/idle-limit")) {
|
||||
if (eng2_n1.getValue() <= 18.5) {
|
||||
me["ENG2idFFlow"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0);
|
||||
|
@ -3454,13 +3454,13 @@ setlistener("sim/signals/fdm-initialized", func {
|
|||
lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg");
|
||||
|
||||
lowerECAM_update.start();
|
||||
if (getprop("/systems/acconfig/options/lecam-rate") > 1) {
|
||||
if (getprop("systems/acconfig/options/lecam-rate") > 1) {
|
||||
l_rateApply();
|
||||
}
|
||||
});
|
||||
|
||||
var l_rateApply = func {
|
||||
lowerECAM_update.restart(0.05 * getprop("/systems/acconfig/options/lecam-rate"));
|
||||
lowerECAM_update.restart(0.05 * getprop("systems/acconfig/options/lecam-rate"));
|
||||
}
|
||||
|
||||
var lowerECAM_update = maketimer(0.05, func {
|
||||
|
|
|
@ -116,9 +116,9 @@ var transAlt = props.globals.getNode("/FMGC/internal/trans-alt", 1);
|
|||
var managedSpeed = props.globals.getNode("/it-autoflight/input/spd-managed", 1);
|
||||
|
||||
# Fetch nodes into vectors
|
||||
var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode("/MCDU[1]/page", 1)];
|
||||
var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode("/MCDU[1]/active", 1)];
|
||||
var scratchpad = [props.globals.getNode("/MCDU[0]/scratchpad", 1), props.globals.getNode("/MCDU[1]/scratchpad", 1)];
|
||||
var pageProp = [props.globals.getNode("MCDU[0]/page", 1), props.globals.getNode("MCDU[1]/page", 1)];
|
||||
var active = [props.globals.getNode("MCDU[0]/active", 1), props.globals.getNode("MCDU[1]/active", 1)];
|
||||
var scratchpad = [props.globals.getNode("MCDU[0]/scratchpad", 1), props.globals.getNode("MCDU[1]/scratchpad", 1)];
|
||||
|
||||
# Create Nodes:
|
||||
var pageSwitch = [props.globals.initNode("/MCDU[0]/internal/switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/switch", 0, "BOOL")];
|
||||
|
@ -2999,162 +2999,162 @@ var canvas_MCDU_base = {
|
|||
# ack = ignore, wht = white, grn = green, blu = blue, amb = amber, yel = yellow
|
||||
colorLeft: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_L1"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_L1"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_L2"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_L2"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_L3"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_L3"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_L4"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_L4"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_L5"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_L5"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_L6"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_L6"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorLeftS: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_L1S"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_L1S"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_L2S"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_L2S"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_L3S"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_L3S"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_L4S"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_L4S"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_L5S"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_L5S"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_L6S"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_L6S"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorLeftArrow: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_L1_Arrow"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_L1_Arrow"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_L2_Arrow"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_L2_Arrow"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_L3_Arrow"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_L3_Arrow"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_L4_Arrow"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_L4_Arrow"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_L5_Arrow"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_L5_Arrow"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_L6_Arrow"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorRight: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_R1"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_R1"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_R2"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_R2"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_R3"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_R3"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_R4"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_R4"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_R5"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_R5"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_R6"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_R6"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorRightS: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_R1S"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_R1S"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_R2S"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_R2S"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_R3S"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_R3S"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_R4S"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_R4S"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_R5S"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_R5S"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_R6S"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_R6S"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorRightArrow: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_R1_Arrow"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_R1_Arrow"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_R2_Arrow"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_R2_Arrow"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_R3_Arrow"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_R3_Arrow"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_R4_Arrow"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_R4_Arrow"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_R5_Arrow"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_R5_Arrow"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_R6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_R6_Arrow"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorCenter: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_C1"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_C1"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_C2"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_C2"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_C3"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_C3"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_C4"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_C4"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_C5"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_C5"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_C6"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_C6"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
colorCenterS: func(a, b, c, d, e, f) {
|
||||
if (a != "ack") {
|
||||
me["Simple_C1S"].setColor(getprop("/MCDUC/colors/" ~ a ~ "/r"), getprop("/MCDUC/colors/" ~ a ~ "/g"), getprop("/MCDUC/colors/" ~ a ~ "/b"));
|
||||
me["Simple_C1S"].setColor(getprop("MCDUC/colors/" ~ a ~ "/r"), getprop("MCDUC/colors/" ~ a ~ "/g"), getprop("MCDUC/colors/" ~ a ~ "/b"));
|
||||
}
|
||||
if (b != "ack") {
|
||||
me["Simple_C2S"].setColor(getprop("/MCDUC/colors/" ~ b ~ "/r"), getprop("/MCDUC/colors/" ~ b ~ "/g"), getprop("/MCDUC/colors/" ~ b ~ "/b"));
|
||||
me["Simple_C2S"].setColor(getprop("MCDUC/colors/" ~ b ~ "/r"), getprop("MCDUC/colors/" ~ b ~ "/g"), getprop("MCDUC/colors/" ~ b ~ "/b"));
|
||||
}
|
||||
if (c != "ack") {
|
||||
me["Simple_C3S"].setColor(getprop("/MCDUC/colors/" ~ c ~ "/r"), getprop("/MCDUC/colors/" ~ c ~ "/g"), getprop("/MCDUC/colors/" ~ c ~ "/b"));
|
||||
me["Simple_C3S"].setColor(getprop("MCDUC/colors/" ~ c ~ "/r"), getprop("MCDUC/colors/" ~ c ~ "/g"), getprop("MCDUC/colors/" ~ c ~ "/b"));
|
||||
}
|
||||
if (d != "ack") {
|
||||
me["Simple_C4S"].setColor(getprop("/MCDUC/colors/" ~ d ~ "/r"), getprop("/MCDUC/colors/" ~ d ~ "/g"), getprop("/MCDUC/colors/" ~ d ~ "/b"));
|
||||
me["Simple_C4S"].setColor(getprop("MCDUC/colors/" ~ d ~ "/r"), getprop("MCDUC/colors/" ~ d ~ "/g"), getprop("MCDUC/colors/" ~ d ~ "/b"));
|
||||
}
|
||||
if (e != "ack") {
|
||||
me["Simple_C5S"].setColor(getprop("/MCDUC/colors/" ~ e ~ "/r"), getprop("/MCDUC/colors/" ~ e ~ "/g"), getprop("/MCDUC/colors/" ~ e ~ "/b"));
|
||||
me["Simple_C5S"].setColor(getprop("MCDUC/colors/" ~ e ~ "/r"), getprop("MCDUC/colors/" ~ e ~ "/g"), getprop("MCDUC/colors/" ~ e ~ "/b"));
|
||||
}
|
||||
if (f != "ack") {
|
||||
me["Simple_C6S"].setColor(getprop("/MCDUC/colors/" ~ f ~ "/r"), getprop("/MCDUC/colors/" ~ f ~ "/g"), getprop("/MCDUC/colors/" ~ f ~ "/b"));
|
||||
me["Simple_C6S"].setColor(getprop("MCDUC/colors/" ~ f ~ "/r"), getprop("MCDUC/colors/" ~ f ~ "/g"), getprop("MCDUC/colors/" ~ f ~ "/b"));
|
||||
}
|
||||
},
|
||||
# 0 = ignore
|
||||
|
|
|
@ -14,23 +14,23 @@ var ND_2_test = nil;
|
|||
var elapsedtime = 0;
|
||||
|
||||
# Fetch nodes:
|
||||
var du1_test = props.globals.getNode("/instrumentation/du/du1-test");
|
||||
var du1_test_time = props.globals.getNode("/instrumentation/du/du1-test-time");
|
||||
var du1_test_amount = props.globals.getNode("/instrumentation/du/du1-test-amount");
|
||||
var du2_test = props.globals.getNode("/instrumentation/du/du2-test");
|
||||
var du2_test_time = props.globals.getNode("/instrumentation/du/du2-test-time");
|
||||
var du2_test_amount = props.globals.getNode("/instrumentation/du/du2-test-amount");
|
||||
var du1_test = props.globals.getNode("instrumentation/du/du1-test");
|
||||
var du1_test_time = props.globals.getNode("instrumentation/du/du1-test-time");
|
||||
var du1_test_amount = props.globals.getNode("instrumentation/du/du1-test-amount");
|
||||
var du2_test = props.globals.getNode("instrumentation/du/du2-test");
|
||||
var du2_test_time = props.globals.getNode("instrumentation/du/du2-test-time");
|
||||
var du2_test_amount = props.globals.getNode("instrumentation/du/du2-test-amount");
|
||||
var du2_offtime = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE");
|
||||
var du5_test = props.globals.getNode("/instrumentation/du/du5-test");
|
||||
var du5_test_time = props.globals.getNode("/instrumentation/du/du5-test-time");
|
||||
var du5_test = props.globals.getNode("instrumentation/du/du5-test");
|
||||
var du5_test_time = props.globals.getNode("instrumentation/du/du5-test-time");
|
||||
var du5_offtime = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE");
|
||||
var du5_test_amount = props.globals.getNode("/instrumentation/du/du5-test-amount");
|
||||
var du6_test = props.globals.getNode("/instrumentation/du/du6-test");
|
||||
var du6_test_time = props.globals.getNode("/instrumentation/du/du6-test-time");
|
||||
var du6_test_amount = props.globals.getNode("/instrumentation/du/du6-test-amount");
|
||||
var cpt_du_xfr = props.globals.getNode("/modes/cpt-du-xfr");
|
||||
var fo_du_xfr = props.globals.getNode("/modes/fo-du-xfr");
|
||||
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
|
||||
var du5_test_amount = props.globals.getNode("instrumentation/du/du5-test-amount");
|
||||
var du6_test = props.globals.getNode("instrumentation/du/du6-test");
|
||||
var du6_test_time = props.globals.getNode("instrumentation/du/du6-test-time");
|
||||
var du6_test_amount = props.globals.getNode("instrumentation/du/du6-test-amount");
|
||||
var cpt_du_xfr = props.globals.getNode("modes/cpt-du-xfr");
|
||||
var fo_du_xfr = props.globals.getNode("modes/fo-du-xfr");
|
||||
var wow0 = props.globals.getNode("gear/gear[0]/wow");
|
||||
|
||||
var nd_display = {};
|
||||
|
||||
|
@ -87,18 +87,18 @@ var canvas_nd_base = {
|
|||
return [];
|
||||
},
|
||||
updateDu2: func() {
|
||||
var elapsedtime = getprop("/sim/time/elapsed-sec");
|
||||
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110) {
|
||||
var elapsedtime = getprop("sim/time/elapsed-sec");
|
||||
if (getprop("systems/electrical/bus/ac-ess-shed") >= 110) {
|
||||
if (du2_offtime.getValue() + 3 < elapsedtime) {
|
||||
if (wow0.getValue() == 1) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
|
||||
du2_test.setValue(1);
|
||||
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du2_test_time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
|
||||
du2_test_time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
} else if (getprop("systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
|
||||
du2_test.setValue(1);
|
||||
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du2_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
|
||||
du2_test_time.setValue(getprop("sim/time/elapsed-sec") - 30);
|
||||
}
|
||||
} else {
|
||||
du2_test.setValue(1);
|
||||
|
@ -112,18 +112,18 @@ var canvas_nd_base = {
|
|||
}
|
||||
},
|
||||
updateDu5: func() {
|
||||
var elapsedtime = getprop("/sim/time/elapsed-sec");
|
||||
if (getprop("/systems/electrical/bus/ac-2") >= 110) {
|
||||
var elapsedtime = getprop("sim/time/elapsed-sec");
|
||||
if (getprop("systems/electrical/bus/ac-2") >= 110) {
|
||||
if (du5_offtime.getValue() + 3 < elapsedtime) {
|
||||
if (wow0.getValue() == 1) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
|
||||
du5_test.setValue(1);
|
||||
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du5_test_time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
|
||||
du5_test_time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
} else if (getprop("systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
|
||||
du5_test.setValue(1);
|
||||
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du5_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
|
||||
du5_test_time.setValue(getprop("sim/time/elapsed-sec") - 30);
|
||||
}
|
||||
} else {
|
||||
du5_test.setValue(1);
|
||||
|
@ -138,9 +138,9 @@ var canvas_nd_base = {
|
|||
|
||||
},
|
||||
update: func() {
|
||||
var elapsedtime = getprop("/sim/time/elapsed-sec");
|
||||
var elapsedtime = getprop("sim/time/elapsed-sec");
|
||||
|
||||
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110 and getprop("/controls/lighting/DU/du2") > 0) {
|
||||
if (getprop("systems/electrical/bus/ac-ess-shed") >= 110 and getprop("controls/lighting/DU/du2") > 0) {
|
||||
if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() != 1) {
|
||||
ND_1.page.hide();
|
||||
ND_1_test.page.show();
|
||||
|
@ -158,7 +158,7 @@ var canvas_nd_base = {
|
|||
ND_1_test.page.hide();
|
||||
ND_1.page.hide();
|
||||
}
|
||||
if (getprop("/systems/electrical/bus/ac-2") >= 110 and getprop("/controls/lighting/DU/du5") > 0) {
|
||||
if (getprop("systems/electrical/bus/ac-2") >= 110 and getprop("controls/lighting/DU/du5") > 0) {
|
||||
if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() != 1) {
|
||||
ND_2.page.hide();
|
||||
ND_2_test.page.show();
|
||||
|
@ -246,12 +246,12 @@ var canvas_ND_1_test = {
|
|||
return ["Test_white","Test_text"];
|
||||
},
|
||||
update: func() {
|
||||
elapsedtime = getprop("/sim/time/elapsed-sec") or 0;
|
||||
if ((du2_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 1) {
|
||||
elapsedtime = getprop("sim/time/elapsed-sec") or 0;
|
||||
if ((du2_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 1) {
|
||||
me["Test_white"].show();
|
||||
me["Test_text"].hide();
|
||||
} else if ((du1_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 0) {
|
||||
print(getprop("/modes/cpt-du-xfr"));
|
||||
} else if ((du1_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 0) {
|
||||
print(getprop("modes/cpt-du-xfr"));
|
||||
me["Test_white"].show();
|
||||
me["Test_text"].hide();
|
||||
} else {
|
||||
|
@ -288,11 +288,11 @@ var canvas_ND_2_test = {
|
|||
return ["Test_white","Test_text"];
|
||||
},
|
||||
update: func() {
|
||||
elapsedtime = getprop("/sim/time/elapsed-sec") or 0;
|
||||
if ((du5_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 1) {
|
||||
elapsedtime = getprop("sim/time/elapsed-sec") or 0;
|
||||
if ((du5_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 1) {
|
||||
me["Test_white"].show();
|
||||
me["Test_text"].hide();
|
||||
} else if ((du6_test_time.getValue() + 1 >= elapsedtime) and getprop("/modes/cpt-du-xfr") != 0) {
|
||||
} else if ((du6_test_time.getValue() + 1 >= elapsedtime) and getprop("modes/cpt-du-xfr") != 0) {
|
||||
me["Test_white"].show();
|
||||
me["Test_text"].hide();
|
||||
} else {
|
||||
|
@ -333,13 +333,13 @@ setlistener("sim/signals/fdm-initialized", func {
|
|||
ND_2_test = canvas_ND_2_test.new(group_nd2_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg");
|
||||
|
||||
nd_update.start();
|
||||
if (getprop("/systems/acconfig/options/nd-rate") > 1) {
|
||||
if (getprop("systems/acconfig/options/nd-rate") > 1) {
|
||||
rateApply();
|
||||
}
|
||||
});
|
||||
|
||||
var rateApply = func {
|
||||
nd_update.restart(0.05 * getprop("/systems/acconfig/options/nd-rate"));
|
||||
nd_update.restart(0.05 * getprop("systems/acconfig/options/nd-rate"));
|
||||
}
|
||||
|
||||
var nd_update = maketimer(0.05, func {
|
||||
|
@ -352,7 +352,7 @@ for (i = 0; i < 2; i = i + 1 ) {
|
|||
var idx = par.getIndex();
|
||||
var canvas_mode = "/instrumentation/efis["~idx~"]/nd/canvas-display-mode";
|
||||
var nd_centered = "/instrumentation/efis["~idx~"]/inputs/nd-centered";
|
||||
var mode = getprop("/instrumentation/efis["~idx~"]/nd/display-mode");
|
||||
var mode = getprop("instrumentation/efis["~idx~"]/nd/display-mode");
|
||||
var cvs_mode = "NAV";
|
||||
var centered = 1;
|
||||
if (mode == "ILS") {
|
||||
|
@ -377,7 +377,7 @@ for (i = 0; i < 2; i = i + 1 ) {
|
|||
}
|
||||
|
||||
setlistener("/instrumentation/efis[0]/nd/terrain-on-nd", func{
|
||||
var terr_on_hd = getprop("/instrumentation/efis[0]/nd/terrain-on-nd");
|
||||
var terr_on_hd = getprop("instrumentation/efis[0]/nd/terrain-on-nd");
|
||||
var alpha = 1;
|
||||
if (terr_on_hd) {
|
||||
alpha = 0.5;
|
||||
|
|
|
@ -304,12 +304,12 @@ canvas.NavDisplay.update_sub = func(){
|
|||
pos.lat = wp.wp_lat;
|
||||
pos.lon = wp.wp_lon;
|
||||
} else {
|
||||
pos.lat = getprop("/autopilot/route-manager/route/wp["~pln_wpt_idx~"]/latitude-deg");
|
||||
pos.lon = getprop("/autopilot/route-manager/route/wp["~pln_wpt_idx~"]/longitude-deg");
|
||||
pos.lat = getprop("autopilot/route-manager/route/wp["~pln_wpt_idx~"]/latitude-deg");
|
||||
pos.lon = getprop("autopilot/route-manager/route/wp["~pln_wpt_idx~"]/longitude-deg");
|
||||
}
|
||||
} else {
|
||||
pos.lat = getprop("/autopilot/route-manager/route/wp["~pln_wpt_idx~"]/latitude-deg");
|
||||
pos.lon = getprop("/autopilot/route-manager/route/wp["~pln_wpt_idx~"]/longitude-deg");
|
||||
pos.lat = getprop("autopilot/route-manager/route/wp["~pln_wpt_idx~"]/latitude-deg");
|
||||
pos.lon = getprop("autopilot/route-manager/route/wp["~pln_wpt_idx~"]/longitude-deg");
|
||||
}
|
||||
} else {
|
||||
pos.lat = userLat;
|
||||
|
@ -407,8 +407,8 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
|||
}
|
||||
|
||||
# Hide heading bug 10 secs after change
|
||||
var vhdg_bug = getprop("/it-autoflight/input/hdg") or 0;
|
||||
var hdg_bug_active = getprop("/it-autoflight/custom/show-hdg");
|
||||
var vhdg_bug = getprop("it-autoflight/input/hdg") or 0;
|
||||
var hdg_bug_active = getprop("it-autoflight/custom/show-hdg");
|
||||
if (hdg_bug_active == nil)
|
||||
hdg_bug_active = 1;
|
||||
|
||||
|
@ -445,13 +445,13 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
|||
var vorheading = userHdgTru;
|
||||
var adfheading = userHdgMag;
|
||||
}
|
||||
if (getprop("/instrumentation/nav[2]/heading-deg") != nil) {
|
||||
var nav0hdg = getprop("/instrumentation/nav[2]/heading-deg") - getprop("/orientation/heading-deg");
|
||||
if (getprop("instrumentation/nav[2]/heading-deg") != nil) {
|
||||
var nav0hdg = getprop("instrumentation/nav[2]/heading-deg") - getprop("orientation/heading-deg");
|
||||
} else {
|
||||
var nav0hdg = 0;
|
||||
}
|
||||
if (getprop("/instrumentation/nav[3]/heading-deg") != nil) {
|
||||
var nav1hdg = getprop("/instrumentation/nav[3]/heading-deg") - getprop("/orientation/heading-deg");
|
||||
if (getprop("instrumentation/nav[3]/heading-deg") != nil) {
|
||||
var nav1hdg = getprop("instrumentation/nav[3]/heading-deg") - getprop("orientation/heading-deg");
|
||||
} else {
|
||||
var nav1hdg = 0;
|
||||
}
|
||||
|
@ -595,5 +595,5 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
|||
me.symbols["status.sta"].setVisible( me.get_switch("toggle_stations") and me.in_mode("toggle_display_mode", ["MAP"]));
|
||||
# Okay, _how_ do we hook this up with FGPlot?
|
||||
printlog(_MP_dbg_lvl, "Total ND update took "~((systime()-_time)*100)~"ms");
|
||||
setprop("/instrumentation/navdisplay["~ canvas.NavDisplay.id ~"]/update-ms", systime() - _time);
|
||||
setprop("instrumentation/navdisplay["~ canvas.NavDisplay.id ~"]/update-ms", systime() - _time);
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ var element_id = "airplane";
|
|||
# Will have to be adapted if intended for use with other aircraft
|
||||
# (but one could simply copy the layer for that).
|
||||
var draw = func {
|
||||
var rot = getprop("/orientation/heading-deg");
|
||||
var rot = getprop("orientation/heading-deg");
|
||||
rot -= me.layer.map.getHdg();
|
||||
me.element.setRotation(rot*D2R);
|
||||
};
|
||||
|
|
|
@ -25,9 +25,9 @@ var new = func(layer) {
|
|||
};
|
||||
layer.searcher._equals = func(l,r) l.equals(r);
|
||||
m.addVisibilityListener();
|
||||
var aircraft_dir = split('/', getprop("/sim/aircraft-dir"))[-1];
|
||||
var saved_conf = getprop("/sim/fg-home") ~ "/Export/wxr_api.xml";
|
||||
var df_conf = getprop("/sim/fg-root") ~ "/Aircraft/" ~ aircraft_dir ~
|
||||
var aircraft_dir = split('/', getprop("sim/aircraft-dir"))[-1];
|
||||
var saved_conf = getprop("sim/fg-home") ~ "/Export/wxr_api.xml";
|
||||
var df_conf = getprop("sim/fg-root") ~ "/Aircraft/" ~ aircraft_dir ~
|
||||
"/Models/Instruments/ND/canvas/wxr_api.xml";
|
||||
if(io.stat(saved_conf) != nil)
|
||||
io.read_properties(saved_conf, wxr_tree);
|
||||
|
|
|
@ -51,11 +51,11 @@ var fetchWXRMap = func(size){
|
|||
.setSize(sz, sz)
|
||||
.setTranslation(transl, transl);
|
||||
me.wxlayer.show();
|
||||
me.last_request = getprop("/sim/time/elapsed-sec");
|
||||
me.last_request = getprop("sim/time/elapsed-sec");
|
||||
})
|
||||
.always(func(){
|
||||
setprop("/instrumentation/wxr/center/latitude-deg", lat);
|
||||
setprop("/instrumentation/wxr/center/longitude-deg", lon);
|
||||
setprop("instrumentation/wxr/center/latitude-deg", lat);
|
||||
setprop("instrumentation/wxr/center/longitude-deg", lon);
|
||||
me.fetching = 0;
|
||||
print("[WXR] Live Layer Request: "~url); # Debugging
|
||||
});
|
||||
|
@ -101,7 +101,7 @@ var draw = func {
|
|||
me.wxlayer.show();
|
||||
}
|
||||
|
||||
if(getprop("/sim/time/elapsed-sec") - me.last_request > me.update_interval) {
|
||||
if(getprop("sim/time/elapsed-sec") - me.last_request > me.update_interval) {
|
||||
#print('Fetching WXR map...');
|
||||
me.key = me.model.key; # API Key from Wunderground API Subscription
|
||||
me.res = me.model.res; # Resolution of image to fetch (default 2048)
|
||||
|
|
|
@ -687,7 +687,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) nd.aircraft_source.get_spd() > 100,
|
||||
is_true: func(nd) {
|
||||
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/velocities/TAS") ));
|
||||
nd.symbols.tas.setText(sprintf("%3.0f",getprop("velocities/TAS") ));
|
||||
nd.symbols.tas.show();
|
||||
},
|
||||
is_false: func(nd) nd.symbols.tas.hide(),
|
||||
|
@ -804,7 +804,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
var etaSec = getprop("/sim/time/utc/day-seconds")+
|
||||
var etaSec = getprop("sim/time/utc/day-seconds")+
|
||||
getprop("autopilot/route-manager/wp/eta-seconds");
|
||||
var h = math.floor(etaSec/3600);
|
||||
etaSec = etaSec-3600*h;
|
||||
|
@ -1194,9 +1194,9 @@ canvas.NDStyles["Airbus"] = {
|
|||
var type = (is_ils ? "ils" : "vor");
|
||||
var path = nd.get_nav_path(type, 0);
|
||||
if (is_ils) {
|
||||
nd.symbols.vorCrsPtr2.setRotation((getprop("/instrumentation/nav[0]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||
nd.symbols.vorCrsPtr2.setRotation((getprop("instrumentation/nav[0]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||
} else {
|
||||
nd.symbols.vorCrsPtr2.setRotation((getprop("/instrumentation/nav[2]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||
nd.symbols.vorCrsPtr2.setRotation((getprop("instrumentation/nav[2]/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||
}
|
||||
var line = nd.symbols.vorCrsPtr2.getElementById("vorCrsPtr2_line");
|
||||
if(!is_ils){
|
||||
|
@ -1217,7 +1217,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
predicate: func(nd) nd.in_mode("toggle_display_mode", ["APP"]),
|
||||
is_true: func(nd) {
|
||||
if(getprop("instrumentation/nav/gs-needle-deflection-norm") != nil)
|
||||
nd.symbols.gsDiamond.setTranslation(getprop("/instrumentation/nav[0]/gs-needle-deflection-norm")*150,0);
|
||||
nd.symbols.gsDiamond.setTranslation(getprop("instrumentation/nav[0]/gs-needle-deflection-norm")*150,0);
|
||||
},
|
||||
is_false: func(nd) nd.symbols.gsGroup.hide(),
|
||||
},
|
||||
|
@ -1229,7 +1229,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR"]) and !nd.get_switch("toggle_centered") and getprop("instrumentation/nav/in-range")),
|
||||
is_true: func(nd) {
|
||||
nd.symbols.locPtr.show();
|
||||
var deflection = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm");
|
||||
var deflection = getprop("instrumentation/nav[0]/heading-needle-deflection-norm");
|
||||
nd.symbols.locPtr.setTranslation(deflection*150,0);
|
||||
},
|
||||
is_false: func(nd) nd.symbols.locPtr.hide(),
|
||||
|
@ -1278,8 +1278,8 @@ canvas.NDStyles["Airbus"] = {
|
|||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) {
|
||||
var nav_id = getprop("/instrumentation/nav/nav-id");
|
||||
var ils_mode = getprop("/flight-management/freq/ils-mode");
|
||||
var nav_id = getprop("instrumentation/nav/nav-id");
|
||||
var ils_mode = getprop("flight-management/freq/ils-mode");
|
||||
var has_ils = (nav_id != nil and nav_id != "");
|
||||
(nd.get_switch("toggle_display_mode") == "MAP" and
|
||||
!nd.get_switch("toggle_centered") and has_ils and ils_mode);
|
||||
|
@ -1298,8 +1298,8 @@ canvas.NDStyles["Airbus"] = {
|
|||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) {
|
||||
var nav_id = getprop("/instrumentation/nav/nav-id");
|
||||
var ils_mode = getprop("/flight-management/freq/ils-mode");
|
||||
var nav_id = getprop("instrumentation/nav/nav-id");
|
||||
var ils_mode = getprop("flight-management/freq/ils-mode");
|
||||
var has_ils = (nav_id != nil and nav_id != "");
|
||||
(nd.get_switch("toggle_display_mode") == "MAP" and
|
||||
nd.get_switch("toggle_centered") and has_ils and ils_mode);
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<object-name>adirs-coords</object-name>
|
||||
<condition>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/outputs/efis</property>
|
||||
<property>systems/electrical/outputs/efis</property>
|
||||
<value>9</value>
|
||||
</greater-than-equals>
|
||||
</condition>
|
||||
|
@ -2002,7 +2002,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">%s</format>
|
||||
<property>/instrumentation/oh-panel/pos-string</property>
|
||||
<property>instrumentation/oh-panel/pos-string</property>
|
||||
<font type="string">Helvetica.txf</font>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
|
@ -2028,7 +2028,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.1f</format>
|
||||
<property>/systems/electrical/suppliers/battery</property>
|
||||
<property>systems/electrical/suppliers/battery</property>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
|
@ -2054,7 +2054,7 @@
|
|||
<axis-alignment>xy-plane</axis-alignment>
|
||||
<type type="string">number-value</type>
|
||||
<format type="string">%2.1f</format>
|
||||
<property>/systems/electrical/suppliers/battery</property>
|
||||
<property>systems/electrical/suppliers/battery</property>
|
||||
<font type="string">led.txf</font>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -63,7 +63,7 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-btn", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-btn", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -89,7 +89,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-cover", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-cover", 1);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
@ -164,7 +164,7 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-btn", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-btn", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -190,7 +190,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-cover", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-cover", 1);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-btn", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-btn", 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
|
|
@ -17,106 +17,109 @@ var altTens = 0;
|
|||
var altPolarity = "";
|
||||
|
||||
# Fetch nodes:
|
||||
var state1 = props.globals.getNode("/systems/thrust/state1", 1);
|
||||
var state2 = props.globals.getNode("/systems/thrust/state2", 1);
|
||||
var throttle_mode = props.globals.getNode("/modes/pfd/fma/throttle-mode", 1);
|
||||
var pitch_mode = props.globals.getNode("/modes/pfd/fma/pitch-mode", 1);
|
||||
var pitch_mode_armed = props.globals.getNode("/modes/pfd/fma/pitch-mode-armed", 1);
|
||||
var pitch_mode2_armed = props.globals.getNode("/modes/pfd/fma/pitch-mode2-armed", 1);
|
||||
var pitch_mode_armed_box = props.globals.getNode("/modes/pfd/fma/pitch-mode-armed-box", 1);
|
||||
var pitch_mode2_armed_box = props.globals.getNode("/modes/pfd/fma/pitch-mode2-armed-box", 1);
|
||||
var roll_mode = props.globals.getNode("/modes/pfd/fma/roll-mode", 1);
|
||||
var roll_mode_armed = props.globals.getNode("/modes/pfd/fma/roll-mode-armed", 1);
|
||||
var roll_mode_box = props.globals.getNode("/modes/pfd/fma/roll-mode-box", 1);
|
||||
var roll_mode_armed_box = props.globals.getNode("/modes/pfd/fma/roll-mode-armed-box", 1);
|
||||
var thr1 = props.globals.getNode("/controls/engines/engine[0]/throttle-pos", 1);
|
||||
var thr2 = props.globals.getNode("/controls/engines/engine[1]/throttle-pos", 1);
|
||||
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
|
||||
var wow1 = props.globals.getNode("/gear/gear[1]/wow");
|
||||
var wow2 = props.globals.getNode("/gear/gear[2]/wow");
|
||||
var pitch = props.globals.getNode("/orientation/pitch-deg", 1);
|
||||
var roll = props.globals.getNode("/orientation/roll-deg", 1);
|
||||
var elapsedtime = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var acess = props.globals.getNode("/systems/electrical/bus/ac-ess", 1);
|
||||
var ac2 = props.globals.getNode("/systems/electrical/bus/ac-2", 1);
|
||||
var du1_lgt = props.globals.getNode("/controls/lighting/DU/du1", 1);
|
||||
var du6_lgt = props.globals.getNode("/controls/lighting/DU/du6", 1);
|
||||
var acconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
||||
var acconfig_mismatch = props.globals.getNode("/systems/acconfig/mismatch-code", 1);
|
||||
var cpt_du_xfr = props.globals.getNode("/modes/cpt-du-xfr", 1);
|
||||
var fo_du_xfr = props.globals.getNode("/modes/fo-du-xfr", 1);
|
||||
var eng_out = props.globals.getNode("/systems/thrust/eng-out", 1);
|
||||
var eng0_state = props.globals.getNode("/engines/engine[0]/state", 1);
|
||||
var eng1_state = props.globals.getNode("/engines/engine[1]/state", 1);
|
||||
var alpha_floor = props.globals.getNode("/systems/thrust/alpha-floor", 1);
|
||||
var toga_lk = props.globals.getNode("/systems/thrust/toga-lk", 1);
|
||||
var thrust_limit = props.globals.getNode("/controls/engines/thrust-limit", 1);
|
||||
var flex = props.globals.getNode("/FMGC/internal/flex", 1);
|
||||
var lvr_clb = props.globals.getNode("/systems/thrust/lvrclb", 1);
|
||||
var throt_box = props.globals.getNode("/modes/pfd/fma/throttle-mode-box", 1);
|
||||
var pitch_box = props.globals.getNode("/modes/pfd/fma/pitch-mode-box", 1);
|
||||
var ap_box = props.globals.getNode("/modes/pfd/fma/ap-mode-box", 1);
|
||||
var fd_box = props.globals.getNode("/modes/pfd/fma/fd-mode-box", 1);
|
||||
var at_box = props.globals.getNode("/modes/pfd/fma/athr-mode-box", 1);
|
||||
var fbw_law = props.globals.getNode("/it-fbw/law", 1);
|
||||
var ap_mode = props.globals.getNode("/modes/pfd/fma/ap-mode", 1);
|
||||
var fd_mode = props.globals.getNode("/modes/pfd/fma/fd-mode", 1);
|
||||
var at_mode = props.globals.getNode("/modes/pfd/fma/at-mode", 1);
|
||||
var alt_std_mode = props.globals.getNode("/modes/altimeter/std", 1);
|
||||
var alt_inhg_mode = props.globals.getNode("/modes/altimeter/inhg", 1);
|
||||
var alt_hpa = props.globals.getNode("/instrumentation/altimeter/setting-hpa", 1);
|
||||
var alt_inhg = props.globals.getNode("/instrumentation/altimeter/setting-inhg", 1);
|
||||
var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var altitude_pfd = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft-pfd", 1);
|
||||
var alt_diff = props.globals.getNode("/instrumentation/pfd/alt-diff", 1);
|
||||
var ap_alt = props.globals.getNode("/it-autoflight/internal/alt", 1);
|
||||
var vs_needle = props.globals.getNode("/instrumentation/pfd/vs-needle", 1);
|
||||
var vs_digit = props.globals.getNode("/instrumentation/pfd/vs-digit-trans", 1);
|
||||
var ap_vs_pfd = props.globals.getNode("/it-autoflight/internal/vert-speed-fpm-pfd", 1);
|
||||
var athr_arm = props.globals.getNode("/modes/pfd/fma/athr-armed", 1);
|
||||
var FMGC_max_spd = props.globals.getNode("/FMGC/internal/maxspeed", 1);
|
||||
var ind_spd_kt = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
||||
var ind_spd_mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
|
||||
var at_mach_mode = props.globals.getNode("/it-autoflight/input/kts-mach", 1);
|
||||
var at_input_spd_mach = props.globals.getNode("/it-autoflight/input/spd-mach", 1);
|
||||
var at_input_spd_kts = props.globals.getNode("/it-autoflight/input/spd-kts", 1);
|
||||
var fd_roll = props.globals.getNode("/it-autoflight/fd/roll-bar", 1);
|
||||
var fd_pitch = props.globals.getNode("/it-autoflight/fd/pitch-bar", 1);
|
||||
var decision = props.globals.getNode("/instrumentation/mk-viii/inputs/arinc429/decision-height", 1);
|
||||
var slip_skid = props.globals.getNode("/instrumentation/pfd/slip-skid", 1);
|
||||
var FMGCphase = props.globals.getNode("/FMGC/status/phase", 1);
|
||||
var loc = props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm", 1);
|
||||
var gs = props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm", 1);
|
||||
var show_hdg = props.globals.getNode("/it-autoflight/custom/show-hdg", 1);
|
||||
var ap_hdg = props.globals.getNode("/it-autoflight/input/hdg", 1);
|
||||
var ap_trk_sw = props.globals.getNode("/it-autoflight/custom/trk-fpa", 1);
|
||||
var ap_ils_mode = props.globals.getNode("/modes/pfd/ILS1", 1);
|
||||
var ap_ils_mode2 = props.globals.getNode("/modes/pfd/ILS2", 1);
|
||||
var loc_in_range = props.globals.getNode("/instrumentation/nav[0]/in-range", 1);
|
||||
var gs_in_range = props.globals.getNode("/instrumentation/nav[0]/gs-in-range", 1);
|
||||
var nav0_signalq = props.globals.getNode("/instrumentation/nav[0]/signal-quality-norm", 1);
|
||||
var hasloc = props.globals.getNode("/instrumentation/nav[0]/nav-loc", 1);
|
||||
var hasgs = props.globals.getNode("/instrumentation/nav[0]/has-gs", 1);
|
||||
var pfdrate = props.globals.getNode("/systems/acconfig/options/pfd-rate", 1);
|
||||
var managed_spd = props.globals.getNode("/it-autoflight/input/spd-managed", 1);
|
||||
var at_tgt_ias = props.globals.getNode("/FMGC/internal/target-ias-pfd", 1);
|
||||
var ap1 = props.globals.getNode("/it-autoflight/output/ap1", 1);
|
||||
var ap2 = props.globals.getNode("/it-autoflight/output/ap2", 1);
|
||||
var fd1 = props.globals.getNode("/it-autoflight/output/fd1", 1);
|
||||
var fd2 = props.globals.getNode("/it-autoflight/output/fd2", 1);
|
||||
var athr = props.globals.getNode("/it-autoflight/output/athr", 1);
|
||||
var gear_agl = props.globals.getNode("/position/gear-agl-ft", 1);
|
||||
var aileron_input = props.globals.getNode("/controls/flight/aileron-input-fast", 1);
|
||||
var elevator_input = props.globals.getNode("/controls/flight/elevator-input-fast", 1);
|
||||
var att_switch = props.globals.getNode("/controls/switching/ATTHDG", 1);
|
||||
var air_switch = props.globals.getNode("/controls/switching/AIRDATA", 1);
|
||||
var appr_enabled = props.globals.getNode("/it-autoflight/output/appr-armed/", 1);
|
||||
var loc_enabled = props.globals.getNode("/it-autoflight/output/loc-armed/", 1);
|
||||
var ils_data1 = props.globals.getNode("/FMGC/internal/ils1-mcdu/", 1);
|
||||
var state1 = props.globals.getNode("systems/thrust/state1", 1);
|
||||
var state2 = props.globals.getNode("systems/thrust/state2", 1);
|
||||
var throttle_mode = props.globals.getNode("modes/pfd/fma/throttle-mode", 1);
|
||||
var pitch_mode = props.globals.getNode("modes/pfd/fma/pitch-mode", 1);
|
||||
var pitch_mode_armed = props.globals.getNode("modes/pfd/fma/pitch-mode-armed", 1);
|
||||
var pitch_mode2_armed = props.globals.getNode("modes/pfd/fma/pitch-mode2-armed", 1);
|
||||
var pitch_mode_armed_box = props.globals.getNode("modes/pfd/fma/pitch-mode-armed-box", 1);
|
||||
var pitch_mode2_armed_box = props.globals.getNode("modes/pfd/fma/pitch-mode2-armed-box", 1);
|
||||
var roll_mode = props.globals.getNode("modes/pfd/fma/roll-mode", 1);
|
||||
var roll_mode_armed = props.globals.getNode("modes/pfd/fma/roll-mode-armed", 1);
|
||||
var roll_mode_box = props.globals.getNode("modes/pfd/fma/roll-mode-box", 1);
|
||||
var roll_mode_armed_box = props.globals.getNode("modes/pfd/fma/roll-mode-armed-box", 1);
|
||||
var thr1 = props.globals.getNode("controls/engines/engine[0]/throttle-pos", 1);
|
||||
var thr2 = props.globals.getNode("controls/engines/engine[1]/throttle-pos", 1);
|
||||
var wow0 = props.globals.getNode("gear/gear[0]/wow");
|
||||
var wow1 = props.globals.getNode("gear/gear[1]/wow");
|
||||
var wow2 = props.globals.getNode("gear/gear[2]/wow");
|
||||
var pitch = props.globals.getNode("orientation/pitch-deg", 1);
|
||||
var roll = props.globals.getNode("orientation/roll-deg", 1);
|
||||
var elapsedtime = props.globals.getNode("sim/time/elapsed-sec", 1);
|
||||
var acess = props.globals.getNode("systems/electrical/bus/ac-ess", 1);
|
||||
var ac2 = props.globals.getNode("systems/electrical/bus/ac-2", 1);
|
||||
var du1_lgt = props.globals.getNode("controls/lighting/DU/du1", 1);
|
||||
var du6_lgt = props.globals.getNode("controls/lighting/DU/du6", 1);
|
||||
var acconfig = props.globals.getNode("systems/acconfig/autoconfig-running", 1);
|
||||
var acconfig_mismatch = props.globals.getNode("systems/acconfig/mismatch-code", 1);
|
||||
var cpt_du_xfr = props.globals.getNode("modes/cpt-du-xfr", 1);
|
||||
var fo_du_xfr = props.globals.getNode("modes/fo-du-xfr", 1);
|
||||
var eng_out = props.globals.getNode("systems/thrust/eng-out", 1);
|
||||
var eng0_state = props.globals.getNode("engines/engine[0]/state", 1);
|
||||
var eng1_state = props.globals.getNode("engines/engine[1]/state", 1);
|
||||
var alpha_floor = props.globals.getNode("systems/thrust/alpha-floor", 1);
|
||||
var toga_lk = props.globals.getNode("systems/thrust/toga-lk", 1);
|
||||
var thrust_limit = props.globals.getNode("controls/engines/thrust-limit", 1);
|
||||
var flex = props.globals.getNode("FMGC/internal/flex", 1);
|
||||
var lvr_clb = props.globals.getNode("systems/thrust/lvrclb", 1);
|
||||
var throt_box = props.globals.getNode("modes/pfd/fma/throttle-mode-box", 1);
|
||||
var pitch_box = props.globals.getNode("modes/pfd/fma/pitch-mode-box", 1);
|
||||
var ap_box = props.globals.getNode("modes/pfd/fma/ap-mode-box", 1);
|
||||
var fd_box = props.globals.getNode("modes/pfd/fma/fd-mode-box", 1);
|
||||
var at_box = props.globals.getNode("modes/pfd/fma/athr-mode-box", 1);
|
||||
var fbw_law = props.globals.getNode("it-fbw/law", 1);
|
||||
var ap_mode = props.globals.getNode("modes/pfd/fma/ap-mode", 1);
|
||||
var fd_mode = props.globals.getNode("modes/pfd/fma/fd-mode", 1);
|
||||
var at_mode = props.globals.getNode("modes/pfd/fma/at-mode", 1);
|
||||
var alt_std_mode = props.globals.getNode("modes/altimeter/std", 1);
|
||||
var alt_inhg_mode = props.globals.getNode("modes/altimeter/inhg", 1);
|
||||
var alt_hpa = props.globals.getNode("instrumentation/altimeter/setting-hpa", 1);
|
||||
var alt_inhg = props.globals.getNode("instrumentation/altimeter/setting-inhg", 1);
|
||||
var altitude = props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var altitude_pfd = props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft-pfd", 1);
|
||||
var alt_diff = props.globals.getNode("instrumentation/pfd/alt-diff", 1);
|
||||
var ap_alt = props.globals.getNode("it-autoflight/internal/alt", 1);
|
||||
var vs_needle = props.globals.getNode("instrumentation/pfd/vs-needle", 1);
|
||||
var vs_digit = props.globals.getNode("instrumentation/pfd/vs-digit-trans", 1);
|
||||
var ap_vs_pfd = props.globals.getNode("it-autoflight/internal/vert-speed-fpm-pfd", 1);
|
||||
var athr_arm = props.globals.getNode("modes/pfd/fma/athr-armed", 1);
|
||||
var FMGC_max_spd = props.globals.getNode("FMGC/internal/maxspeed", 1);
|
||||
var ind_spd_kt = props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
||||
var ind_spd_mach = props.globals.getNode("instrumentation/airspeed-indicator/indicated-mach", 1);
|
||||
var at_mach_mode = props.globals.getNode("it-autoflight/input/kts-mach", 1);
|
||||
var at_input_spd_mach = props.globals.getNode("it-autoflight/input/spd-mach", 1);
|
||||
var at_input_spd_kts = props.globals.getNode("it-autoflight/input/spd-kts", 1);
|
||||
var fd_roll = props.globals.getNode("it-autoflight/fd/roll-bar", 1);
|
||||
var fd_pitch = props.globals.getNode("it-autoflight/fd/pitch-bar", 1);
|
||||
var decision = props.globals.getNode("instrumentation/mk-viii/inputs/arinc429/decision-height", 1);
|
||||
var slip_skid = props.globals.getNode("instrumentation/pfd/slip-skid", 1);
|
||||
var FMGCphase = props.globals.getNode("FMGC/status/phase", 1);
|
||||
var loc = props.globals.getNode("instrumentation/nav[0]/heading-needle-deflection-norm", 1);
|
||||
var gs = props.globals.getNode("instrumentation/nav[0]/gs-needle-deflection-norm", 1);
|
||||
var show_hdg = props.globals.getNode("it-autoflight/custom/show-hdg", 1);
|
||||
var ap_hdg = props.globals.getNode("it-autoflight/input/hdg", 1);
|
||||
var ap_trk_sw = props.globals.getNode("it-autoflight/custom/trk-fpa", 1);
|
||||
var ap_ils_mode = props.globals.getNode("modes/pfd/ILS1", 1);
|
||||
var ap_ils_mode2 = props.globals.getNode("modes/pfd/ILS2", 1);
|
||||
var loc_in_range = props.globals.getNode("instrumentation/nav[0]/in-range", 1);
|
||||
var gs_in_range = props.globals.getNode("instrumentation/nav[0]/gs-in-range", 1);
|
||||
var nav0_signalq = props.globals.getNode("instrumentation/nav[0]/signal-quality-norm", 1);
|
||||
var hasloc = props.globals.getNode("instrumentation/nav[0]/nav-loc", 1);
|
||||
var hasgs = props.globals.getNode("instrumentation/nav[0]/has-gs", 1);
|
||||
var pfdrate = props.globals.getNode("systems/acconfig/options/pfd-rate", 1);
|
||||
var managed_spd = props.globals.getNode("it-autoflight/input/spd-managed", 1);
|
||||
var at_tgt_ias = props.globals.getNode("FMGC/internal/target-ias-pfd", 1);
|
||||
var ap1 = props.globals.getNode("it-autoflight/output/ap1", 1);
|
||||
var ap2 = props.globals.getNode("it-autoflight/output/ap2", 1);
|
||||
var fd1 = props.globals.getNode("it-autoflight/output/fd1", 1);
|
||||
var fd2 = props.globals.getNode("it-autoflight/output/fd2", 1);
|
||||
var athr = props.globals.getNode("it-autoflight/output/athr", 1);
|
||||
var gear_agl = props.globals.getNode("position/gear-agl-ft", 1);
|
||||
var aileron_input = props.globals.getNode("controls/flight/aileron-input-fast", 1);
|
||||
var elevator_input = props.globals.getNode("controls/flight/elevator-input-fast", 1);
|
||||
var att_switch = props.globals.getNode("controls/switching/ATTHDG", 1);
|
||||
var air_switch = props.globals.getNode("controls/switching/AIRDATA", 1);
|
||||
var appr_enabled = props.globals.getNode("it-autoflight/output/appr-armed/", 1);
|
||||
var loc_enabled = props.globals.getNode("it-autoflight/output/loc-armed/", 1);
|
||||
var ils_data1 = props.globals.getNode("FMGC/internal/ils1-mcdu/", 1);
|
||||
# Independent MCDU ILS not implemented yet, use MCDU1 in the meantime
|
||||
# var ils_data2 = props.globals.getNode("/FMGC/internal/ils2-mcdu/", 1);
|
||||
var dme_in_range = props.globals.getNode("/instrumentation/nav[0]/dme-in-range", 1);
|
||||
var dme_data = props.globals.getNode("/instrumentation/dme[0]/indicated-distance-nm", 1);
|
||||
# var ils_data2 = props.globals.getNode("FMGC/internal/ils2-mcdu/", 1);
|
||||
var dme_in_range = props.globals.getNode("instrumentation/nav[0]/dme-in-range", 1);
|
||||
var dme_data = props.globals.getNode("instrumentation/dme[0]/indicated-distance-nm", 1);
|
||||
var ils_crs = props.globals.getNode("instrumentation/nav[0]/radials/selected-deg", 1);
|
||||
var ils1_crs_set = props.globals.getNode("FMGC/internal/ils1crs-set/", 1);
|
||||
var arrival_airport = props.globals.getNode("FMGC/internal/arr-arpt", 1);
|
||||
|
||||
# Create Nodes:
|
||||
var vs_needle = props.globals.initNode("/instrumentation/pfd/vs-needle", 0.0, "DOUBLE");
|
||||
|
@ -194,7 +197,7 @@ var canvas_PFD_base = {
|
|||
"AI_bank_lim","AI_bank_lim_X","AI_pitch_lim","AI_pitch_lim_X","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","AI_error","AI_group","FD_roll","FD_pitch","ALT_scale","ALT_target",
|
||||
"ALT_target_digit","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_digit_UP","ALT_digit_DN","ALT_error","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting",
|
||||
"QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame",
|
||||
"TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend"];
|
||||
"TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend", "ILS_HDG_R", "ILS_HDG_L", "ILS_right", "ILS_left"];
|
||||
},
|
||||
updateDu1: func() {
|
||||
var elapsedtime_act = elapsedtime.getValue();
|
||||
|
@ -703,8 +706,7 @@ var canvas_PFD_base = {
|
|||
}
|
||||
|
||||
# ILS
|
||||
me["LOC_pointer"].setTranslation(loc.getValue() * 197, 0);
|
||||
|
||||
me["LOC_pointer"].setTranslation(loc.getValue() * 197, 0);
|
||||
me["GS_pointer"].setTranslation(0, gs.getValue() * -197);
|
||||
|
||||
# Heading
|
||||
|
@ -768,9 +770,76 @@ var canvas_PFD_base = {
|
|||
}
|
||||
|
||||
me["TRK_pointer"].setTranslation((track_diff.getValue() / 10) * 98.5416, 0);
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
me["CRS_pointer"].hide();
|
||||
#Secondary via RAD-NAV
|
||||
if (ap_ils_mode.getValue() == 1 and ils1_crs_set.getValue() == 1 and size(split_ils) == 2) {
|
||||
magnetic_hdg = ils_crs.getValue();
|
||||
magnetic_hdg_dif = geo.normdeg180(magnetic_hdg - heading.getValue());
|
||||
if (magnetic_hdg_dif >= -23.62 and magnetic_hdg_dif <= 23.62) {
|
||||
me["CRS_pointer"].setTranslation((magnetic_hdg_dif / 10) * 98.5416, 0);
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].show();
|
||||
} else if (magnetic_hdg_dif < -23.62 and magnetic_hdg_dif >= -180) {
|
||||
me["ILS_left"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
me["ILS_HDG_L"].show();
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
} else if (magnetic_hdg_dif > 23.62 and magnetic_hdg_dif <= 180) {
|
||||
me["ILS_right"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
me["ILS_HDG_R"].show();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
} else {
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
}
|
||||
} else {
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
}
|
||||
|
||||
# Primary via MCDU, not implemented yet
|
||||
# if (ap_ils_mode.getValue() == 1 and arrival_airport.getValue() != "" and size(split_ils) == 2) {
|
||||
# var runways = airportinfo(airportinfo(arrival_airport.getValue()).id).runways;
|
||||
# var runway_keys = sort(keys(runways), string.icmp);
|
||||
# foreach(var rwy; runway_keys) {
|
||||
# var r = runways[rwy];
|
||||
# if (r.ils_frequency_mhz == split_ils[1]) {
|
||||
# magnetic_hdg = r.heading - getprop("environment/magnetic-variation-deg");
|
||||
# magnetic_hdg_dif = geo.normdeg180(magnetic_hdg - heading.getValue());
|
||||
# if (magnetic_hdg_dif >= -23.62 and magnetic_hdg_dif <= 23.62) {
|
||||
# me["CRS_pointer"].setTranslation((magnetic_hdg_dif / 10) * 98.5416, 0);
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].show();
|
||||
# } else if (magnetic_hdg_dif < -23.62 and magnetic_hdg_dif >= -180) {
|
||||
# me["ILS_left"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
# me["ILS_HDG_L"].show();
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# } else if (magnetic_hdg_dif > 23.62 and magnetic_hdg_dif <= 180) {
|
||||
# me["ILS_right"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
# me["ILS_HDG_R"].show();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# } else {
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# }
|
||||
# break;
|
||||
# }
|
||||
# }
|
||||
# } else {
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# }
|
||||
|
||||
# AI HDG
|
||||
me.AI_horizon_hdg_trans.setTranslation(me.middleOffset, horizon_pitch.getValue() * 11.825);
|
||||
me.AI_horizon_hdg_rot.setRotation(-roll_cur * D2R, me["AI_center"].getCenter());
|
||||
|
@ -836,12 +905,28 @@ var canvas_PFD_1 = {
|
|||
if (ap_ils_mode.getValue() == 1) {
|
||||
me["LOC_scale"].show();
|
||||
me["GS_scale"].show();
|
||||
me["ils_code"].setText(split("/", ils_data1.getValue())[0]);
|
||||
me["ils_freq"].setText(split("/", ils_data1.getValue())[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
if (size(split_ils) < 2) {
|
||||
me["ils_freq"].setText(split_ils[0]);
|
||||
me["ils_freq"].show();
|
||||
me["ils_code"].hide();
|
||||
me["dme_dist"].hide();
|
||||
me["dme_dist_legend"].hide();
|
||||
} else {
|
||||
me["ils_code"].setText(split_ils[0]);
|
||||
me["ils_freq"].setText(split_ils[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
}
|
||||
|
||||
if (dme_in_range.getValue() == 1) {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", int(dme_data.getValue())));
|
||||
dme_dist_data = dme_data.getValue();
|
||||
if (dme_dist_data < 20.0) {
|
||||
me["dme_dist"].setText(sprintf("%1.1f", dme_dist_data));
|
||||
} else {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", dme_dist_data));
|
||||
}
|
||||
me["dme_dist"].show();
|
||||
me["dme_dist_legend"].show();
|
||||
}
|
||||
|
@ -1144,13 +1229,28 @@ var canvas_PFD_2 = {
|
|||
if (ap_ils_mode2.getValue() == 1) {
|
||||
me["LOC_scale"].show();
|
||||
me["GS_scale"].show();
|
||||
# Independent MCDU ILS not implemented yet, use MCDU1 in the meantime
|
||||
me["ils_code"].setText(split("/", ils_data1.getValue())[0]);
|
||||
me["ils_freq"].setText(split("/", ils_data1.getValue())[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
if (size(split_ils) < 2) {
|
||||
me["ils_freq"].setText(split_ils[0]);
|
||||
me["ils_freq"].show();
|
||||
me["ils_code"].hide();
|
||||
me["dme_dist"].hide();
|
||||
me["dme_dist_legend"].hide();
|
||||
} else {
|
||||
me["ils_code"].setText(split_ils[0]);
|
||||
me["ils_freq"].setText(split_ils[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
}
|
||||
|
||||
if (dme_in_range.getValue() == 1) {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", int(dme_data.getValue())));
|
||||
dme_dist_data = dme_data.getValue();
|
||||
if (dme_dist_data < 20.0) {
|
||||
me["dme_dist"].setText(sprintf("%1.1f", dme_dist_data));
|
||||
} else {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", dme_dist_data));
|
||||
}
|
||||
me["dme_dist"].show();
|
||||
me["dme_dist_legend"].show();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 282 KiB |
|
@ -135,8 +135,8 @@
|
|||
<object-name>engine_fire_1</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<property>/systems/fire/engine1/warning-active</property>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<property>systems/fire/engine1/warning-active</property>
|
||||
<property>controls/switches/annun-test</property>
|
||||
</or>
|
||||
</condition>
|
||||
</animation>
|
||||
|
@ -164,8 +164,8 @@
|
|||
<object-name>engine_fire_2</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<property>/systems/fire/engine2/warning-active</property>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<property>systems/fire/engine2/warning-active</property>
|
||||
<property>controls/switches/annun-test</property>
|
||||
</or>
|
||||
</condition>
|
||||
</animation>
|
||||
|
@ -397,7 +397,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>atc.transponderPanel.atcSwitch(getprop("/controls/atc/system-knob") + 1);</script>
|
||||
<script>atc.transponderPanel.atcSwitch(getprop("controls/atc/system-knob") + 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -437,7 +437,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>atc.transponderPanel.modeSwitch(getprop("/controls/atc/mode-knob") + 1);</script>
|
||||
<script>atc.transponderPanel.modeSwitch(getprop("controls/atc/mode-knob") + 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -454,7 +454,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>atc.transponderPanel.modeSwitch(getprop("/controls/atc/mode-knob") + 1);</script>
|
||||
<script>atc.transponderPanel.modeSwitch(getprop("controls/atc/mode-knob") + 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
|
|
@ -1090,7 +1090,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-cover", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-cover", 1);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
|
|
@ -1090,7 +1090,7 @@
|
|||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("/sim/sounde/oh-cover", 1);</script>
|
||||
<script>setprop("sim/sounde/oh-cover", 1);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
|
|
@ -34,70 +34,70 @@ var du3_test_amount = props.globals.initNode("/instrumentation/du/du3-test-amoun
|
|||
var du3_offtime = props.globals.initNode("/instrumentation/du/du3-off-time", 0.0, "DOUBLE");
|
||||
|
||||
# Fetch nodes:
|
||||
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
|
||||
var et = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var acconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
||||
var acess = props.globals.getNode("/systems/electrical/bus/ac-ess", 1);
|
||||
var eng_option = props.globals.getNode("/options/eng", 1);
|
||||
var du3_lgt = props.globals.getNode("/controls/lighting/DU/du3", 1);
|
||||
var rev_1 = props.globals.getNode("/engines/engine[0]/reverser-pos-norm", 1);
|
||||
var rev_2 = props.globals.getNode("/engines/engine[1]/reverser-pos-norm", 1);
|
||||
var eng1_n1mode = props.globals.getNode("/systems/fadec/eng1/n1", 1);
|
||||
var eng1_eprmode = props.globals.getNode("/systems/fadec/eng1/epr", 1);
|
||||
var eng2_n1mode = props.globals.getNode("/systems/fadec/eng2/n1", 1);
|
||||
var eng2_eprmode = props.globals.getNode("/systems/fadec/eng2/epr", 1);
|
||||
var eng1_n2mode = props.globals.getNode("/systems/fadec/eng1/n2", 1);
|
||||
var eng2_n2mode = props.globals.getNode("/systems/fadec/eng2/n2", 1);
|
||||
var flap_text = props.globals.getNode("/controls/flight/flap-txt", 1);
|
||||
var flap_pos = props.globals.getNode("/controls/flight/flap-pos", 1);
|
||||
var fuel = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
|
||||
var modeautobrake = props.globals.getNode("/controls/autobrake/mode", 1);
|
||||
var speedbrakearm = props.globals.getNode("/controls/flight/speedbrake-arm", 1);
|
||||
var ECAMtoconfig = props.globals.getNode("/ECAM/to-config", 1);
|
||||
var gear = props.globals.getNode("/gear/gear[1]/position-norm", 1);
|
||||
var smoke = props.globals.getNode("/controls/lighting/no-smoking-sign", 1);
|
||||
var seatbelt = props.globals.getNode("/controls/lighting/seatbelt-sign", 1);
|
||||
var flaps3_ovr = props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 1);
|
||||
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
|
||||
var eng1_n1 = props.globals.getNode("/engines/engine[0]/n1-actual", 1);
|
||||
var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1);
|
||||
var eng1_n2 = props.globals.getNode("/engines/engine[0]/n2-actual", 1);
|
||||
var eng2_n2 = props.globals.getNode("/engines/engine[1]/n2-actual", 1);
|
||||
var eng1_epr = props.globals.getNode("/engines/engine[0]/epr-actual", 1);
|
||||
var eng2_epr = props.globals.getNode("/engines/engine[1]/epr-actual", 1);
|
||||
var eng1_egt = props.globals.getNode("/engines/engine[0]/egt-actual", 1);
|
||||
var eng2_egt = props.globals.getNode("/engines/engine[1]/egt-actual", 1);
|
||||
var eng1_egtmode = props.globals.getNode("/systems/fadec/eng1/egt", 1);
|
||||
var eng2_egtmode = props.globals.getNode("/systems/fadec/eng2/egt", 1);
|
||||
var eng1_ffmode = props.globals.getNode("/systems/fadec/eng1/ff", 1);
|
||||
var eng2_ffmode = props.globals.getNode("/systems/fadec/eng2/ff", 1);
|
||||
var fadecpower_1 = props.globals.getNode("/systems/fadec/powered1", 1);
|
||||
var fadecpower_2 = props.globals.getNode("/systems/fadec/powered2", 1);
|
||||
var fadecpowerup = props.globals.getNode("/systems/fadec/powerup", 1);
|
||||
var thr_limit = props.globals.getNode("/controls/engines/thrust-limit", 1);
|
||||
var n1_limit = props.globals.getNode("/controls/engines/n1-limit", 1);
|
||||
var epr_limit = props.globals.getNode("/controls/engines/epr-limit", 1);
|
||||
var n1mode1 = props.globals.getNode("/systems/fadec/n1mode1", 1);
|
||||
var n1mode2 = props.globals.getNode("/systems/fadec/n1mode2", 1);
|
||||
var ECAM_line1 = props.globals.getNode("/ECAM/msg/line1", 1);
|
||||
var ECAM_line2 = props.globals.getNode("/ECAM/msg/line2", 1);
|
||||
var ECAM_line3 = props.globals.getNode("/ECAM/msg/line3", 1);
|
||||
var ECAM_line4 = props.globals.getNode("/ECAM/msg/line4", 1);
|
||||
var ECAM_line5 = props.globals.getNode("/ECAM/msg/line5", 1);
|
||||
var ECAM_line6 = props.globals.getNode("/ECAM/msg/line6", 1);
|
||||
var ECAM_line7 = props.globals.getNode("/ECAM/msg/line7", 1);
|
||||
var ECAM_line8 = props.globals.getNode("/ECAM/msg/line8", 1);
|
||||
var ECAM_line1c = props.globals.getNode("/ECAM/msg/linec1", 1);
|
||||
var ECAM_line2c = props.globals.getNode("/ECAM/msg/linec2", 1);
|
||||
var ECAM_line3c = props.globals.getNode("/ECAM/msg/linec3", 1);
|
||||
var ECAM_line4c = props.globals.getNode("/ECAM/msg/linec4", 1);
|
||||
var ECAM_line5c = props.globals.getNode("/ECAM/msg/linec5", 1);
|
||||
var ECAM_line6c = props.globals.getNode("/ECAM/msg/linec6", 1);
|
||||
var ECAM_line7c = props.globals.getNode("/ECAM/msg/linec7", 1);
|
||||
var ECAM_line8c = props.globals.getNode("/ECAM/msg/linec8", 1);
|
||||
var ECAMleft = props.globals.getNode("/ECAM/left-msg", 1);
|
||||
var ECAMright = props.globals.getNode("/ECAM/right-msg", 1);
|
||||
var rate = props.globals.getNode("/systems/acconfig/options/uecam-rate", 1);
|
||||
var acconfig_weight_kgs = props.globals.getNode("systems/acconfig/options/weight-kgs", 1);
|
||||
var et = props.globals.getNode("sim/time/elapsed-sec", 1);
|
||||
var acconfig = props.globals.getNode("systems/acconfig/autoconfig-running", 1);
|
||||
var acess = props.globals.getNode("systems/electrical/bus/ac-ess", 1);
|
||||
var eng_option = props.globals.getNode("options/eng", 1);
|
||||
var du3_lgt = props.globals.getNode("controls/lighting/DU/du3", 1);
|
||||
var rev_1 = props.globals.getNode("engines/engine[0]/reverser-pos-norm", 1);
|
||||
var rev_2 = props.globals.getNode("engines/engine[1]/reverser-pos-norm", 1);
|
||||
var eng1_n1mode = props.globals.getNode("systems/fadec/eng1/n1", 1);
|
||||
var eng1_eprmode = props.globals.getNode("systems/fadec/eng1/epr", 1);
|
||||
var eng2_n1mode = props.globals.getNode("systems/fadec/eng2/n1", 1);
|
||||
var eng2_eprmode = props.globals.getNode("systems/fadec/eng2/epr", 1);
|
||||
var eng1_n2mode = props.globals.getNode("systems/fadec/eng1/n2", 1);
|
||||
var eng2_n2mode = props.globals.getNode("systems/fadec/eng2/n2", 1);
|
||||
var flap_text = props.globals.getNode("controls/flight/flap-txt", 1);
|
||||
var flap_pos = props.globals.getNode("controls/flight/flap-pos", 1);
|
||||
var fuel = props.globals.getNode("consumables/fuel/total-fuel-lbs", 1);
|
||||
var modeautobrake = props.globals.getNode("controls/autobrake/mode", 1);
|
||||
var speedbrakearm = props.globals.getNode("controls/flight/speedbrake-arm", 1);
|
||||
var ECAMtoconfig = props.globals.getNode("ECAM/to-config", 1);
|
||||
var gear = props.globals.getNode("gear/gear[1]/position-norm", 1);
|
||||
var smoke = props.globals.getNode("controls/lighting/no-smoking-sign", 1);
|
||||
var seatbelt = props.globals.getNode("controls/lighting/seatbelt-sign", 1);
|
||||
var flaps3_ovr = props.globals.getNode("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 1);
|
||||
var wow0 = props.globals.getNode("gear/gear[0]/wow");
|
||||
var eng1_n1 = props.globals.getNode("engines/engine[0]/n1-actual", 1);
|
||||
var eng2_n1 = props.globals.getNode("engines/engine[1]/n1-actual", 1);
|
||||
var eng1_n2 = props.globals.getNode("engines/engine[0]/n2-actual", 1);
|
||||
var eng2_n2 = props.globals.getNode("engines/engine[1]/n2-actual", 1);
|
||||
var eng1_epr = props.globals.getNode("engines/engine[0]/epr-actual", 1);
|
||||
var eng2_epr = props.globals.getNode("engines/engine[1]/epr-actual", 1);
|
||||
var eng1_egt = props.globals.getNode("engines/engine[0]/egt-actual", 1);
|
||||
var eng2_egt = props.globals.getNode("engines/engine[1]/egt-actual", 1);
|
||||
var eng1_egtmode = props.globals.getNode("systems/fadec/eng1/egt", 1);
|
||||
var eng2_egtmode = props.globals.getNode("systems/fadec/eng2/egt", 1);
|
||||
var eng1_ffmode = props.globals.getNode("systems/fadec/eng1/ff", 1);
|
||||
var eng2_ffmode = props.globals.getNode("systems/fadec/eng2/ff", 1);
|
||||
var fadecpower_1 = props.globals.getNode("systems/fadec/powered1", 1);
|
||||
var fadecpower_2 = props.globals.getNode("systems/fadec/powered2", 1);
|
||||
var fadecpowerup = props.globals.getNode("systems/fadec/powerup", 1);
|
||||
var thr_limit = props.globals.getNode("controls/engines/thrust-limit", 1);
|
||||
var n1_limit = props.globals.getNode("controls/engines/n1-limit", 1);
|
||||
var epr_limit = props.globals.getNode("controls/engines/epr-limit", 1);
|
||||
var n1mode1 = props.globals.getNode("systems/fadec/n1mode1", 1);
|
||||
var n1mode2 = props.globals.getNode("systems/fadec/n1mode2", 1);
|
||||
var ECAM_line1 = props.globals.getNode("ECAM/msg/line1", 1);
|
||||
var ECAM_line2 = props.globals.getNode("ECAM/msg/line2", 1);
|
||||
var ECAM_line3 = props.globals.getNode("ECAM/msg/line3", 1);
|
||||
var ECAM_line4 = props.globals.getNode("ECAM/msg/line4", 1);
|
||||
var ECAM_line5 = props.globals.getNode("ECAM/msg/line5", 1);
|
||||
var ECAM_line6 = props.globals.getNode("ECAM/msg/line6", 1);
|
||||
var ECAM_line7 = props.globals.getNode("ECAM/msg/line7", 1);
|
||||
var ECAM_line8 = props.globals.getNode("ECAM/msg/line8", 1);
|
||||
var ECAM_line1c = props.globals.getNode("ECAM/msg/linec1", 1);
|
||||
var ECAM_line2c = props.globals.getNode("ECAM/msg/linec2", 1);
|
||||
var ECAM_line3c = props.globals.getNode("ECAM/msg/linec3", 1);
|
||||
var ECAM_line4c = props.globals.getNode("ECAM/msg/linec4", 1);
|
||||
var ECAM_line5c = props.globals.getNode("ECAM/msg/linec5", 1);
|
||||
var ECAM_line6c = props.globals.getNode("ECAM/msg/linec6", 1);
|
||||
var ECAM_line7c = props.globals.getNode("ECAM/msg/linec7", 1);
|
||||
var ECAM_line8c = props.globals.getNode("ECAM/msg/linec8", 1);
|
||||
var ECAMleft = props.globals.getNode("ECAM/left-msg", 1);
|
||||
var ECAMright = props.globals.getNode("ECAM/right-msg", 1);
|
||||
var rate = props.globals.getNode("systems/acconfig/options/uecam-rate", 1);
|
||||
|
||||
var canvas_upperECAM_base = {
|
||||
init: func(canvas_group, file) {
|
||||
|
@ -473,124 +473,124 @@ var canvas_upperECAM_base = {
|
|||
|
||||
# Right ECAM Messages
|
||||
if (rightmsg == "MSG") {
|
||||
me["ECAMR1"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line1")));
|
||||
me["ECAMR2"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line2")));
|
||||
me["ECAMR3"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line3")));
|
||||
me["ECAMR4"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line4")));
|
||||
me["ECAMR5"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line5")));
|
||||
me["ECAMR6"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line6")));
|
||||
me["ECAMR7"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line7")));
|
||||
me["ECAMR8"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line8")));
|
||||
me["ECAMR1"].setText(sprintf("%s", getprop("ECAM/rightmsg/line1")));
|
||||
me["ECAMR2"].setText(sprintf("%s", getprop("ECAM/rightmsg/line2")));
|
||||
me["ECAMR3"].setText(sprintf("%s", getprop("ECAM/rightmsg/line3")));
|
||||
me["ECAMR4"].setText(sprintf("%s", getprop("ECAM/rightmsg/line4")));
|
||||
me["ECAMR5"].setText(sprintf("%s", getprop("ECAM/rightmsg/line5")));
|
||||
me["ECAMR6"].setText(sprintf("%s", getprop("ECAM/rightmsg/line6")));
|
||||
me["ECAMR7"].setText(sprintf("%s", getprop("ECAM/rightmsg/line7")));
|
||||
me["ECAMR8"].setText(sprintf("%s", getprop("ECAM/rightmsg/line8")));
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec1") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec1") == "w") {
|
||||
me["ECAMR1"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec1") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec1") == "c") {
|
||||
me["ECAMR1"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec1") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec1") == "g") {
|
||||
me["ECAMR1"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec1") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec1") == "a") {
|
||||
me["ECAMR1"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec1") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec1") == "r") {
|
||||
me["ECAMR1"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec1") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec1") == "m") {
|
||||
me["ECAMR1"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec2") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec2") == "w") {
|
||||
me["ECAMR2"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec2") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec2") == "c") {
|
||||
me["ECAMR2"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec2") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec2") == "g") {
|
||||
me["ECAMR2"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec2") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec2") == "a") {
|
||||
me["ECAMR2"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec2") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec2") == "r") {
|
||||
me["ECAMR2"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec2") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec2") == "m") {
|
||||
me["ECAMR2"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec3") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec3") == "w") {
|
||||
me["ECAMR3"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec3") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec3") == "c") {
|
||||
me["ECAMR3"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec3") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec3") == "g") {
|
||||
me["ECAMR3"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec3") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec3") == "a") {
|
||||
me["ECAMR3"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec3") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec3") == "r") {
|
||||
me["ECAMR3"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec3") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec3") == "m") {
|
||||
me["ECAMR3"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec4") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec4") == "w") {
|
||||
me["ECAMR4"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec4") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec4") == "c") {
|
||||
me["ECAMR4"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec4") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec4") == "g") {
|
||||
me["ECAMR4"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec4") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec4") == "a") {
|
||||
me["ECAMR4"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec4") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec4") == "r") {
|
||||
me["ECAMR4"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec4") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec4") == "m") {
|
||||
me["ECAMR4"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec5") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec5") == "w") {
|
||||
me["ECAMR5"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec5") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec5") == "c") {
|
||||
me["ECAMR5"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec5") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec5") == "g") {
|
||||
me["ECAMR5"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec5") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec5") == "a") {
|
||||
me["ECAMR5"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec5") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec5") == "r") {
|
||||
me["ECAMR5"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec5") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec5") == "m") {
|
||||
me["ECAMR5"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec6") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec6") == "w") {
|
||||
me["ECAMR6"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec6") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec6") == "c") {
|
||||
me["ECAMR6"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec6") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec6") == "g") {
|
||||
me["ECAMR6"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec6") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec6") == "a") {
|
||||
me["ECAMR6"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec6") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec6") == "r") {
|
||||
me["ECAMR6"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec6") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec6") == "m") {
|
||||
me["ECAMR6"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec7") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec7") == "w") {
|
||||
me["ECAMR7"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec7") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec7") == "c") {
|
||||
me["ECAMR7"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec7") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec7") == "g") {
|
||||
me["ECAMR7"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec7") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec7") == "a") {
|
||||
me["ECAMR7"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec7") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec7") == "r") {
|
||||
me["ECAMR7"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec7") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec7") == "m") {
|
||||
me["ECAMR7"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/rightmsg/linec8") == "w") {
|
||||
if (getprop("ECAM/rightmsg/linec8") == "w") {
|
||||
me["ECAMR8"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if (getprop("/ECAM/rightmsg/linec8") == "c") {
|
||||
} else if (getprop("ECAM/rightmsg/linec8") == "c") {
|
||||
me["ECAMR8"].setColor(0.0901,0.6039,0.7176);
|
||||
} else if (getprop("/ECAM/rightmsg/linec8") == "g") {
|
||||
} else if (getprop("ECAM/rightmsg/linec8") == "g") {
|
||||
me["ECAMR8"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (getprop("/ECAM/rightmsg/linec8") == "a") {
|
||||
} else if (getprop("ECAM/rightmsg/linec8") == "a") {
|
||||
me["ECAMR8"].setColor(0.7333,0.3803,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec8") == "r") {
|
||||
} else if (getprop("ECAM/rightmsg/linec8") == "r") {
|
||||
me["ECAMR8"].setColor(1,0,0);
|
||||
} else if (getprop("/ECAM/rightmsg/linec8") == "m") {
|
||||
} else if (getprop("ECAM/rightmsg/linec8") == "m") {
|
||||
me["ECAMR8"].setColor(0.6901,0.3333,0.7450);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<object-name>Light</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/nav-lights</property>
|
||||
<property>sim/model/lights/nav-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</greater-than-equals>
|
||||
</or>
|
||||
<greater-than-equals>
|
||||
<property>/sim/model/lights/nose-lights</property>
|
||||
<property>sim/model/lights/nose-lights</property>
|
||||
<value>0.5</value>
|
||||
</greater-than-equals>
|
||||
<equals>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<object-name>Light</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/nav-lights</property>
|
||||
<property>sim/model/lights/nav-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<object-name>Light</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/sim/model/lights/nav-lights</property>
|
||||
<property>sim/model/lights/nav-lights</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<object-name>fan</object-name>
|
||||
<object-name>holder</object-name>
|
||||
<condition>
|
||||
<property>/systems/hydraulic/sources/rat/position</property>
|
||||
<property>systems/hydraulic/sources/rat/position</property>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ var _unitconv = M2FT / 3.6;
|
|||
var _debug = nil;
|
||||
|
||||
var _loop = func() {
|
||||
if (!getprop("/sim/model/autopush/available")) {
|
||||
if (!getprop("sim/model/autopush/available")) {
|
||||
_stop();
|
||||
return;
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ var _loop = func() {
|
|||
var y = 0.0;
|
||||
var z = 0.0;
|
||||
# Rollspeed is only adequate if the wheel is touching the ground.
|
||||
if (getprop("/gear/gear[0]/wow")) {
|
||||
var V = getprop("/gear/gear[0]/rollspeed-ms") * 3.6;
|
||||
var deltaV = getprop("/sim/model/autopush/target-speed-km_h") - V;
|
||||
if (getprop("gear/gear[0]/wow")) {
|
||||
var V = getprop("gear/gear[0]/rollspeed-ms") * 3.6;
|
||||
var deltaV = getprop("sim/model/autopush/target-speed-km_h") - V;
|
||||
var minus_dV = _V - V;
|
||||
var time = getprop("/sim/time/elapsed-sec");
|
||||
var time = getprop("sim/time/elapsed-sec");
|
||||
var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p);
|
||||
var dt = time - _time;
|
||||
var deriv = 0.0;
|
||||
|
@ -59,28 +59,28 @@ var _loop = func() {
|
|||
_V = V;
|
||||
_time = time;
|
||||
if (!_yasim) {
|
||||
force = accel * getprop("/fdm/jsbsim/inertia/weight-lbs") * _unitconv;
|
||||
force = accel * getprop("fdm/jsbsim/inertia/weight-lbs") * _unitconv;
|
||||
} else {
|
||||
force = accel * getprop("/fdm/yasim/gross-weight-lbs") * _unitconv;
|
||||
force = accel * getprop("fdm/yasim/gross-weight-lbs") * _unitconv;
|
||||
}
|
||||
var pitch = getprop("/sim/model/autopush/pitch-deg") * D2R;
|
||||
var pitch = getprop("sim/model/autopush/pitch-deg") * D2R;
|
||||
z = math.sin(pitch);
|
||||
var pz = math.cos(pitch);
|
||||
var yaw = getprop("/sim/model/autopush/yaw") * _K_yaw;
|
||||
var yaw = getprop("sim/model/autopush/yaw") * _K_yaw;
|
||||
x = math.cos(yaw) * pz;
|
||||
y = math.sin(yaw) * pz;
|
||||
setprop("/sim/model/autopush/force-x", x);
|
||||
setprop("/sim/model/autopush/force-y", y);
|
||||
setprop("sim/model/autopush/force-x", x);
|
||||
setprop("sim/model/autopush/force-y", y);
|
||||
# JSBSim force's z is down.
|
||||
setprop("/sim/model/autopush/force-z", -z);
|
||||
setprop("sim/model/autopush/force-z", -z);
|
||||
}
|
||||
setprop("/sim/model/autopush/force-lbf", force);
|
||||
setprop("sim/model/autopush/force-lbf", force);
|
||||
if (_yasim) {
|
||||
# The force is divided by YASim thrust="100000.0" setting.
|
||||
setprop("/sim/model/autopush/force-x-yasim", x * force * 0.00001);
|
||||
setprop("sim/model/autopush/force-x-yasim", x * force * 0.00001);
|
||||
# YASim force's y is to the left.
|
||||
setprop("/sim/model/autopush/force-y-yasim", -y * force * 0.00001);
|
||||
setprop("/sim/model/autopush/force-z-yasim", z * force * 0.00001);
|
||||
setprop("sim/model/autopush/force-y-yasim", -y * force * 0.00001);
|
||||
setprop("sim/model/autopush/force-z-yasim", z * force * 0.00001);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,26 +89,26 @@ var _timer = maketimer(0.0167, func{_loop()});
|
|||
var _start = func() {
|
||||
# Else overwritten by dialog.
|
||||
settimer(func() {
|
||||
setprop("/sim/model/autopush/target-speed-km_h", 0.0)
|
||||
setprop("sim/model/autopush/target-speed-km_h", 0.0)
|
||||
}, 0.1);
|
||||
_K_p = getprop("/sim/model/autopush/K_p");
|
||||
_F_p = getprop("/sim/model/autopush/F_p");
|
||||
_K_i = getprop("/sim/model/autopush/K_i");
|
||||
_F_i = getprop("/sim/model/autopush/F_i");
|
||||
_K_d = getprop("/sim/model/autopush/K_d");
|
||||
_F_d = getprop("/sim/model/autopush/F_d");
|
||||
_F = getprop("/sim/model/autopush/F");
|
||||
_T_f = getprop("/sim/model/autopush/T_f");
|
||||
_K_yaw = getprop("/sim/model/autopush/yaw-mult") * D2R;
|
||||
_yasim = (getprop("/sim/flight-model") == "yasim");
|
||||
_debug = getprop("/sim/model/autopush/debug") or 0;
|
||||
_K_p = getprop("sim/model/autopush/K_p");
|
||||
_F_p = getprop("sim/model/autopush/F_p");
|
||||
_K_i = getprop("sim/model/autopush/K_i");
|
||||
_F_i = getprop("sim/model/autopush/F_i");
|
||||
_K_d = getprop("sim/model/autopush/K_d");
|
||||
_F_d = getprop("sim/model/autopush/F_d");
|
||||
_F = getprop("sim/model/autopush/F");
|
||||
_T_f = getprop("sim/model/autopush/T_f");
|
||||
_K_yaw = getprop("sim/model/autopush/yaw-mult") * D2R;
|
||||
_yasim = (getprop("sim/flight-model") == "yasim");
|
||||
_debug = getprop("sim/model/autopush/debug") or 0;
|
||||
_int = 0.0;
|
||||
_V = 0.0;
|
||||
_time = getprop("/sim/time/elapsed-sec");
|
||||
setprop("/sim/model/autopush/connected", 1);
|
||||
_time = getprop("sim/time/elapsed-sec");
|
||||
setprop("sim/model/autopush/connected", 1);
|
||||
if (!_timer.isRunning) {
|
||||
if (getprop("/sim/model/autopush/chocks")) {
|
||||
setprop("/sim/model/autopush/chocks", 0);
|
||||
if (getprop("sim/model/autopush/chocks")) {
|
||||
setprop("sim/model/autopush/chocks", 0);
|
||||
screen.log.write("(pushback): Pushback connected, chocks removed. Please release brakes.");
|
||||
} else {
|
||||
screen.log.write("(pushback): Pushback connected, please release brakes.");
|
||||
|
@ -122,18 +122,18 @@ var _stop = func() {
|
|||
screen.log.write("(pushback): Pushback and bypass pin removed.");
|
||||
}
|
||||
_timer.stop();
|
||||
setprop("/sim/model/autopush/force-lbf", 0.0);
|
||||
setprop("sim/model/autopush/force-lbf", 0.0);
|
||||
if (_yasim) {
|
||||
setprop("/sim/model/autopush/force-x-yasim", 0.0);
|
||||
setprop("/sim/model/autopush/force-y-yasim", 0.0);
|
||||
setprop("sim/model/autopush/force-x-yasim", 0.0);
|
||||
setprop("sim/model/autopush/force-y-yasim", 0.0);
|
||||
}
|
||||
setprop("/sim/model/autopush/connected", 0);
|
||||
setprop("/sim/model/autopush/enabled", 0);
|
||||
setprop("sim/model/autopush/connected", 0);
|
||||
setprop("sim/model/autopush/enabled", 0);
|
||||
}
|
||||
|
||||
setlistener("/sim/model/autopush/enabled", func(p) {
|
||||
var enabled = p.getValue();
|
||||
if ((enabled) and getprop("/sim/model/autopush/available")) {
|
||||
if ((enabled) and getprop("sim/model/autopush/available")) {
|
||||
_start();
|
||||
} else {
|
||||
_stop();
|
||||
|
|
|
@ -46,7 +46,7 @@ var _advance_wp = func(flip_sign = 0) {
|
|||
}
|
||||
|
||||
var _loop = func() {
|
||||
if (!getprop("/sim/model/autopush/connected")) {
|
||||
if (!getprop("sim/model/autopush/connected")) {
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
|
@ -54,9 +54,9 @@ var _loop = func() {
|
|||
D *= NM2M;
|
||||
var (psi_leg, D_leg) = courseAndDistance(_route[_to_wp - 1], _route[_to_wp]);
|
||||
var deltapsi = geo.normdeg180(A - psi_leg);
|
||||
var psi = getprop("/orientation/heading-deg") + _push * 180.0;
|
||||
var psi = getprop("orientation/heading-deg") + _push * 180.0;
|
||||
var deltaA = math.min(math.max(_K_psi * geo.normdeg180(A - psi), -_F_psi), _F_psi);
|
||||
var time = getprop("/sim/time/elapsed-sec");
|
||||
var time = getprop("sim/time/elapsed-sec");
|
||||
var dt = time - _time;
|
||||
var minus_psidot = (dt > 0.002) * math.min(math.max(_K_psidot * (_psi - psi) / dt, -_F_psidot), _F_psidot);
|
||||
_psi = psi;
|
||||
|
@ -83,8 +83,8 @@ var _loop = func() {
|
|||
if (_debug > 1) {
|
||||
print("autopush_driver to_wp " ~ _to_wp ~ ", A " ~ geo.normdeg(A) ~ ", deltaA " ~ deltaA ~ ", minus_psidot " ~ minus_psidot);
|
||||
}
|
||||
setprop("/sim/model/autopush/target-speed-km_h", _sign * V);
|
||||
setprop("/sim/model/autopush/steer-cmd-norm", steering);
|
||||
setprop("sim/model/autopush/target-speed-km_h", _sign * V);
|
||||
setprop("sim/model/autopush/steer-cmd-norm", steering);
|
||||
}
|
||||
|
||||
var _timer = maketimer(0.051, func{_loop()});
|
||||
|
@ -100,7 +100,7 @@ var start = func() {
|
|||
gui.popupTip("Already moving");
|
||||
return;
|
||||
}
|
||||
if (!getprop("/sim/model/autopush/connected")) {
|
||||
if (!getprop("sim/model/autopush/connected")) {
|
||||
gui.popupTip("Pushback not connected");
|
||||
return;
|
||||
}
|
||||
|
@ -112,23 +112,23 @@ var start = func() {
|
|||
} else {
|
||||
autopush_route.done();
|
||||
}
|
||||
_K_V = getprop("/sim/model/autopush/driver/K_V");
|
||||
_F_V = getprop("/sim/model/autopush/driver/F_V");
|
||||
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
|
||||
_D_stop = getprop("/sim/model/autopush/stopping-distance-m");
|
||||
_K_psi = getprop("/sim/model/autopush/driver/K_psi");
|
||||
_F_psi = getprop("/sim/model/autopush/driver/F_psi");
|
||||
_K_psidot = getprop("/sim/model/autopush/driver/K_psidot");
|
||||
_F_psidot = getprop("/sim/model/autopush/driver/F_psidot");
|
||||
_debug = getprop("/sim/model/autopush/debug") or 0;
|
||||
_K_V = getprop("sim/model/autopush/driver/K_V");
|
||||
_F_V = getprop("sim/model/autopush/driver/F_V");
|
||||
_R_turn_min = getprop("sim/model/autopush/min-turn-radius-m");
|
||||
_D_stop = getprop("sim/model/autopush/stopping-distance-m");
|
||||
_K_psi = getprop("sim/model/autopush/driver/K_psi");
|
||||
_F_psi = getprop("sim/model/autopush/driver/F_psi");
|
||||
_K_psidot = getprop("sim/model/autopush/driver/K_psidot");
|
||||
_F_psidot = getprop("sim/model/autopush/driver/F_psidot");
|
||||
_debug = getprop("sim/model/autopush/debug") or 0;
|
||||
if (!_to_wp) {
|
||||
var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]);
|
||||
_push = (abs(geo.normdeg180(getprop("/orientation/heading-deg") - psi_park)) > 90.0);
|
||||
_push = (abs(geo.normdeg180(getprop("orientation/heading-deg") - psi_park)) > 90.0);
|
||||
_sign = 1.0 - 2.0 * _push;
|
||||
_advance_wp();
|
||||
_psi = 0.0;
|
||||
}
|
||||
_time = getprop("/sim/time/elapsed-sec");
|
||||
_time = getprop("sim/time/elapsed-sec");
|
||||
_timer.start();
|
||||
var endsign = _sign;
|
||||
for (ii = _to_wp; ii < size(_route_reverse); ii += 1) {
|
||||
|
@ -146,7 +146,7 @@ var start = func() {
|
|||
|
||||
var pause = func() {
|
||||
_timer.stop();
|
||||
setprop("/sim/model/autopush/target-speed-km_h", 0.0);
|
||||
setprop("sim/model/autopush/target-speed-km_h", 0.0);
|
||||
}
|
||||
|
||||
var stop = func() {
|
||||
|
|
|
@ -29,7 +29,7 @@ var _R_turn_min = 0;
|
|||
var _invalid = 0;
|
||||
|
||||
# Make top-down view point north in old FG.
|
||||
var __fg_version = num(string.replace(getprop("/sim/version/flightgear"),".",""));
|
||||
var __fg_version = num(string.replace(getprop("sim/version/flightgear"),".",""));
|
||||
if (__fg_version < 201920) {
|
||||
_top_view_heading_offset_deg = 94.5;
|
||||
}
|
||||
|
@ -144,14 +144,14 @@ var top_view = func() {
|
|||
return;
|
||||
}
|
||||
_top_view_index = view.indexof("Chase View Without Yaw");
|
||||
_reset_view_index = getprop("/sim/current-view/view-number");
|
||||
setprop("/sim/current-view/view-number", _top_view_index);
|
||||
_view_pitch_offset_deg = getprop("/sim/current-view/pitch-offset-deg");
|
||||
_view_heading_offset_deg = getprop("/sim/current-view/heading-offset-deg");
|
||||
_view_z_offset = getprop("/sim/current-view/z-offset-m");
|
||||
setprop("/sim/current-view/z-offset-m", -500.0);
|
||||
setprop("/sim/current-view/heading-offset-deg", _top_view_heading_offset_deg);
|
||||
setprop("/sim/current-view/pitch-offset-deg", 90.0);
|
||||
_reset_view_index = getprop("sim/current-view/view-number");
|
||||
setprop("sim/current-view/view-number", _top_view_index);
|
||||
_view_pitch_offset_deg = getprop("sim/current-view/pitch-offset-deg");
|
||||
_view_heading_offset_deg = getprop("sim/current-view/heading-offset-deg");
|
||||
_view_z_offset = getprop("sim/current-view/z-offset-m");
|
||||
setprop("sim/current-view/z-offset-m", -500.0);
|
||||
setprop("sim/current-view/heading-offset-deg", _top_view_heading_offset_deg);
|
||||
setprop("sim/current-view/pitch-offset-deg", 90.0);
|
||||
_view_listener = setlistener("/sim/current-view/name", func {
|
||||
_finalize_top_view();
|
||||
}, 0, 0);
|
||||
|
@ -164,11 +164,11 @@ var _finalize_top_view = func() {
|
|||
removelistener(_view_listener);
|
||||
_view_listener = nil;
|
||||
# Go back to the view to restore settings, in case user has switched away.
|
||||
setprop("/sim/current-view/view-number", _top_view_index);
|
||||
setprop("/sim/current-view/z-offset-m", _view_z_offset);
|
||||
setprop("/sim/current-view/heading-offset-deg", _view_heading_offset_deg);
|
||||
setprop("/sim/current-view/pitch-offset-deg", _view_pitch_offset_deg);
|
||||
setprop("/sim/current-view/view-number", _reset_view_index);
|
||||
setprop("sim/current-view/view-number", _top_view_index);
|
||||
setprop("sim/current-view/z-offset-m", _view_z_offset);
|
||||
setprop("sim/current-view/heading-offset-deg", _view_heading_offset_deg);
|
||||
setprop("sim/current-view/pitch-offset-deg", _view_pitch_offset_deg);
|
||||
setprop("sim/current-view/view-number", _reset_view_index);
|
||||
if (!_show) {
|
||||
_clear_user_point_models();
|
||||
_clear_waypoint_models();
|
||||
|
@ -330,7 +330,7 @@ var _check_turn_radius = func() {
|
|||
}
|
||||
}
|
||||
|
||||
setprop("/sim/model/autopush/route/invalid", _invalid);
|
||||
setprop("sim/model/autopush/route/invalid", _invalid);
|
||||
}
|
||||
|
||||
setlistener("/sim/model/autopush/route/show", func(p) {
|
||||
|
@ -351,7 +351,7 @@ setlistener("/sim/model/autopush/route/show", func(p) {
|
|||
var enter = func() {
|
||||
clear();
|
||||
top_view();
|
||||
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
|
||||
_R_turn_min = getprop("sim/model/autopush/min-turn-radius-m");
|
||||
var wp = geo.aircraft_position();
|
||||
var H = geo.elevation(wp.lat(), wp.lon());
|
||||
if (H != nil) {
|
||||
|
@ -362,17 +362,17 @@ var enter = func() {
|
|||
_add(geo.click_position());
|
||||
});
|
||||
# This property can be overridden manually, if needed.
|
||||
var wingspan = getprop("/sim/model/autopush/route/wingspan-m");
|
||||
var wingspan = getprop("sim/model/autopush/route/wingspan-m");
|
||||
if ((wingspan == nil) or (wingspan == 0.0)) {
|
||||
# JSBSim
|
||||
wingspan = getprop("/fdm/jsbsim/metrics/bw-ft");
|
||||
wingspan = getprop("fdm/jsbsim/metrics/bw-ft");
|
||||
if (wingspan != nil) {
|
||||
wingspan *= FT2M;
|
||||
} else {
|
||||
# YAsim
|
||||
wingspan = getprop("/fdm/yasim/model/wings/wing/wing-span");
|
||||
wingspan = getprop("fdm/yasim/model/wings/wing/wing-span");
|
||||
}
|
||||
setprop("/sim/model/autopush/route/wingspan-m", wingspan);
|
||||
setprop("sim/model/autopush/route/wingspan-m", wingspan);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ var DMC = {
|
|||
|
||||
activeADIRS: -9,
|
||||
|
||||
airspeeds: [props.globals.getNode("/systems/navigation/adr/output/cas-1", 1), props.globals.getNode("/systems/navigation/adr/output/cas-2", 1), props.globals.getNode("/systems/navigation/adr/output/cas-3", 1)],
|
||||
altitudes: [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)],
|
||||
machs: [props.globals.getNode("/systems/navigation/adr/output/mach-1", 1), props.globals.getNode("/systems/navigation/adr/output/mach-2", 1), props.globals.getNode("/systems/navigation/adr/output/mach-3", 1)],
|
||||
altitudesPfd: [props.globals.getNode("/instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)],
|
||||
sats: [props.globals.getNode("/systems/navigation/adr/output/sat-1", 1), props.globals.getNode("/systems/navigation/adr/output/sat-2", 1), props.globals.getNode("/systems/navigation/adr/output/sat-3", 1)],
|
||||
tats: [props.globals.getNode("/systems/navigation/adr/output/tat-1", 1), props.globals.getNode("/systems/navigation/adr/output/tat-2", 1), props.globals.getNode("/systems/navigation/adr/output/tat-3", 1)],
|
||||
trends: [props.globals.getNode("/instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("/instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("/instrumentation/pfd/speed-lookahead-3", 1)],
|
||||
airspeeds: [props.globals.getNode("systems/navigation/adr/output/cas-1", 1), props.globals.getNode("systems/navigation/adr/output/cas-2", 1), props.globals.getNode("systems/navigation/adr/output/cas-3", 1)],
|
||||
altitudes: [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)],
|
||||
machs: [props.globals.getNode("systems/navigation/adr/output/mach-1", 1), props.globals.getNode("systems/navigation/adr/output/mach-2", 1), props.globals.getNode("systems/navigation/adr/output/mach-3", 1)],
|
||||
altitudesPfd: [props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)],
|
||||
sats: [props.globals.getNode("systems/navigation/adr/output/sat-1", 1), props.globals.getNode("systems/navigation/adr/output/sat-2", 1), props.globals.getNode("systems/navigation/adr/output/sat-3", 1)],
|
||||
tats: [props.globals.getNode("systems/navigation/adr/output/tat-1", 1), props.globals.getNode("systems/navigation/adr/output/tat-2", 1), props.globals.getNode("systems/navigation/adr/output/tat-3", 1)],
|
||||
trends: [props.globals.getNode("instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-3", 1)],
|
||||
outputs: [nil, nil, nil, nil, nil, nil, nil], # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend
|
||||
|
||||
new: func(num) {
|
||||
|
@ -74,8 +74,8 @@ var DMController = {
|
|||
me.DMCs = [DMC.new(0), DMC.new(1), DMC.new(2)];
|
||||
|
||||
# update DMC2 to correct properties for first officer PFD
|
||||
me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
|
||||
me.DMCs[1].altitudesPfd = [props.globals.getNode("/instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
|
||||
me.DMCs[1].altitudes = [props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
|
||||
me.DMCs[1].altitudesPfd = [props.globals.getNode("instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
|
||||
|
||||
me._init = 1;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
# A3XX Electronic Centralised Aircraft Monitoring System
|
||||
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var lines = [props.globals.getNode("/ECAM/msg/line1", 1), props.globals.getNode("/ECAM/msg/line2", 1), props.globals.getNode("/ECAM/msg/line3", 1), props.globals.getNode("/ECAM/msg/line4", 1), props.globals.getNode("/ECAM/msg/line5", 1), props.globals.getNode("/ECAM/msg/line6", 1), props.globals.getNode("/ECAM/msg/line7", 1), props.globals.getNode("/ECAM/msg/line8", 1)];
|
||||
var linesCol = [props.globals.getNode("/ECAM/msg/linec1", 1), props.globals.getNode("/ECAM/msg/linec2", 1), props.globals.getNode("/ECAM/msg/linec3", 1), props.globals.getNode("/ECAM/msg/linec4", 1), props.globals.getNode("/ECAM/msg/linec5", 1), props.globals.getNode("/ECAM/msg/linec6", 1), props.globals.getNode("/ECAM/msg/linec7", 1), props.globals.getNode("/ECAM/msg/linec8", 1)];
|
||||
var rightLines = [props.globals.getNode("/ECAM/rightmsg/line1", 1), props.globals.getNode("/ECAM/rightmsg/line2", 1), props.globals.getNode("/ECAM/rightmsg/line3", 1), props.globals.getNode("/ECAM/rightmsg/line4", 1), props.globals.getNode("/ECAM/rightmsg/line5", 1), props.globals.getNode("/ECAM/rightmsg/line6", 1), props.globals.getNode("/ECAM/rightmsg/line7", 1), props.globals.getNode("/ECAM/rightmsg/line8", 1)];
|
||||
var rightLinesCol = [props.globals.getNode("/ECAM/rightmsg/linec1", 1), props.globals.getNode("/ECAM/rightmsg/linec2", 1), props.globals.getNode("/ECAM/rightmsg/linec3", 1), props.globals.getNode("/ECAM/rightmsg/linec4", 1), props.globals.getNode("/ECAM/rightmsg/linec5", 1), props.globals.getNode("/ECAM/rightmsg/linec6", 1), props.globals.getNode("/ECAM/rightmsg/linec7", 1), props.globals.getNode("/ECAM/rightmsg/linec8", 1)];
|
||||
var statusLines = [props.globals.getNode("/ECAM/status/line1", 1), props.globals.getNode("/ECAM/status/line2", 1), props.globals.getNode("/ECAM/status/line3", 1), props.globals.getNode("/ECAM/status/line4", 1), props.globals.getNode("/ECAM/status/line5", 1), props.globals.getNode("/ECAM/status/line6", 1), props.globals.getNode("/ECAM/status/line7", 1), props.globals.getNode("/ECAM/status/line8", 1)];
|
||||
var statusLinesCol = [props.globals.getNode("/ECAM/status/linec1", 1), props.globals.getNode("/ECAM/status/linec2", 1), props.globals.getNode("/ECAM/status/linec3", 1), props.globals.getNode("/ECAM/status/linec4", 1), props.globals.getNode("/ECAM/status/linec5", 1), props.globals.getNode("/ECAM/status/linec6", 1), props.globals.getNode("/ECAM/status/linec7", 1), props.globals.getNode("/ECAM/status/linec8", 1)];
|
||||
var lines = [props.globals.getNode("ECAM/msg/line1", 1), props.globals.getNode("ECAM/msg/line2", 1), props.globals.getNode("ECAM/msg/line3", 1), props.globals.getNode("ECAM/msg/line4", 1), props.globals.getNode("ECAM/msg/line5", 1), props.globals.getNode("ECAM/msg/line6", 1), props.globals.getNode("ECAM/msg/line7", 1), props.globals.getNode("ECAM/msg/line8", 1)];
|
||||
var linesCol = [props.globals.getNode("ECAM/msg/linec1", 1), props.globals.getNode("ECAM/msg/linec2", 1), props.globals.getNode("ECAM/msg/linec3", 1), props.globals.getNode("ECAM/msg/linec4", 1), props.globals.getNode("ECAM/msg/linec5", 1), props.globals.getNode("ECAM/msg/linec6", 1), props.globals.getNode("ECAM/msg/linec7", 1), props.globals.getNode("ECAM/msg/linec8", 1)];
|
||||
var rightLines = [props.globals.getNode("ECAM/rightmsg/line1", 1), props.globals.getNode("ECAM/rightmsg/line2", 1), props.globals.getNode("ECAM/rightmsg/line3", 1), props.globals.getNode("ECAM/rightmsg/line4", 1), props.globals.getNode("ECAM/rightmsg/line5", 1), props.globals.getNode("ECAM/rightmsg/line6", 1), props.globals.getNode("ECAM/rightmsg/line7", 1), props.globals.getNode("ECAM/rightmsg/line8", 1)];
|
||||
var rightLinesCol = [props.globals.getNode("ECAM/rightmsg/linec1", 1), props.globals.getNode("ECAM/rightmsg/linec2", 1), props.globals.getNode("ECAM/rightmsg/linec3", 1), props.globals.getNode("ECAM/rightmsg/linec4", 1), props.globals.getNode("ECAM/rightmsg/linec5", 1), props.globals.getNode("ECAM/rightmsg/linec6", 1), props.globals.getNode("ECAM/rightmsg/linec7", 1), props.globals.getNode("ECAM/rightmsg/linec8", 1)];
|
||||
var statusLines = [props.globals.getNode("ECAM/status/line1", 1), props.globals.getNode("ECAM/status/line2", 1), props.globals.getNode("ECAM/status/line3", 1), props.globals.getNode("ECAM/status/line4", 1), props.globals.getNode("ECAM/status/line5", 1), props.globals.getNode("ECAM/status/line6", 1), props.globals.getNode("ECAM/status/line7", 1), props.globals.getNode("ECAM/status/line8", 1)];
|
||||
var statusLinesCol = [props.globals.getNode("ECAM/status/linec1", 1), props.globals.getNode("ECAM/status/linec2", 1), props.globals.getNode("ECAM/status/linec3", 1), props.globals.getNode("ECAM/status/linec4", 1), props.globals.getNode("ECAM/status/linec5", 1), props.globals.getNode("ECAM/status/linec6", 1), props.globals.getNode("ECAM/status/linec7", 1), props.globals.getNode("ECAM/status/linec8", 1)];
|
||||
|
||||
var leftOverflow = props.globals.initNode("/ECAM/warnings/overflow-left", 0, "BOOL");
|
||||
var rightOverflow = props.globals.initNode("/ECAM/warnings/overflow-right", 0, "BOOL");
|
||||
var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL");
|
||||
|
||||
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
|
||||
var dc_ess = props.globals.getNode("systems/electrical/bus/dc-ess", 1);
|
||||
|
||||
var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")];
|
||||
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL")];
|
||||
|
@ -173,7 +173,7 @@ var ECAM_controller = {
|
|||
me.reset();
|
||||
},
|
||||
loop: func() {
|
||||
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !getprop("/systems/acconfig/acconfig-running")) {
|
||||
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !getprop("systems/acconfig/acconfig-running")) {
|
||||
# update FWC phases
|
||||
phaseLoop();
|
||||
|
||||
|
@ -206,7 +206,7 @@ var ECAM_controller = {
|
|||
# write to ECAM
|
||||
var counter = 0;
|
||||
|
||||
if (!getprop("/systems/acconfig/autoconfig-running")) {
|
||||
if (!getprop("systems/acconfig/autoconfig-running")) {
|
||||
foreach (var w; warnings.vector) {
|
||||
if (w.active == 1) {
|
||||
if (counter < 9) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -42,7 +42,7 @@ var clrLight = 0;
|
|||
var ECAM = {
|
||||
_cachePage: "",
|
||||
init: func() {
|
||||
setprop("/systems/gear/landing-gear-warning-light", 0);
|
||||
setprop("systems/gear/landing-gear-warning-light", 0);
|
||||
page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING");
|
||||
apuLight = props.globals.initNode("/ECAM/Lower/light/apu", 0, "BOOL");
|
||||
bleedLight = props.globals.initNode("/ECAM/Lower/light/bleed", 0, "BOOL");
|
||||
|
@ -70,38 +70,38 @@ var ECAM = {
|
|||
me.reset();
|
||||
},
|
||||
reset: func() {
|
||||
setprop("/ECAM/msg/line1", "");
|
||||
setprop("/ECAM/msg/line2", "");
|
||||
setprop("/ECAM/msg/line3", "");
|
||||
setprop("/ECAM/msg/line4", "");
|
||||
setprop("/ECAM/msg/line5", "");
|
||||
setprop("/ECAM/msg/line6", "");
|
||||
setprop("/ECAM/msg/line7", "");
|
||||
setprop("/ECAM/msg/line8", "");
|
||||
setprop("/ECAM/msg/linec1", "w");
|
||||
setprop("/ECAM/msg/linec2", "w");
|
||||
setprop("/ECAM/msg/linec3", "w");
|
||||
setprop("/ECAM/msg/linec4", "w");
|
||||
setprop("/ECAM/msg/linec5", "w");
|
||||
setprop("/ECAM/msg/linec6", "w");
|
||||
setprop("/ECAM/msg/linec7", "w");
|
||||
setprop("/ECAM/msg/linec8", "w");
|
||||
setprop("/ECAM/rightmsg/line1", "");
|
||||
setprop("/ECAM/rightmsg/line2", "");
|
||||
setprop("/ECAM/rightmsg/line3", "");
|
||||
setprop("/ECAM/rightmsg/line4", "");
|
||||
setprop("/ECAM/rightmsg/line5", "");
|
||||
setprop("/ECAM/rightmsg/line6", "");
|
||||
setprop("/ECAM/rightmsg/line7", "");
|
||||
setprop("/ECAM/rightmsg/line8", "");
|
||||
setprop("/ECAM/rightmsg/linec1", "w");
|
||||
setprop("/ECAM/rightmsg/linec2", "w");
|
||||
setprop("/ECAM/rightmsg/linec3", "w");
|
||||
setprop("/ECAM/rightmsg/linec4", "w");
|
||||
setprop("/ECAM/rightmsg/linec5", "w");
|
||||
setprop("/ECAM/rightmsg/linec6", "w");
|
||||
setprop("/ECAM/rightmsg/linec7", "w");
|
||||
setprop("/ECAM/rightmsg/linec8", "w");
|
||||
setprop("ECAM/msg/line1", "");
|
||||
setprop("ECAM/msg/line2", "");
|
||||
setprop("ECAM/msg/line3", "");
|
||||
setprop("ECAM/msg/line4", "");
|
||||
setprop("ECAM/msg/line5", "");
|
||||
setprop("ECAM/msg/line6", "");
|
||||
setprop("ECAM/msg/line7", "");
|
||||
setprop("ECAM/msg/line8", "");
|
||||
setprop("ECAM/msg/linec1", "w");
|
||||
setprop("ECAM/msg/linec2", "w");
|
||||
setprop("ECAM/msg/linec3", "w");
|
||||
setprop("ECAM/msg/linec4", "w");
|
||||
setprop("ECAM/msg/linec5", "w");
|
||||
setprop("ECAM/msg/linec6", "w");
|
||||
setprop("ECAM/msg/linec7", "w");
|
||||
setprop("ECAM/msg/linec8", "w");
|
||||
setprop("ECAM/rightmsg/line1", "");
|
||||
setprop("ECAM/rightmsg/line2", "");
|
||||
setprop("ECAM/rightmsg/line3", "");
|
||||
setprop("ECAM/rightmsg/line4", "");
|
||||
setprop("ECAM/rightmsg/line5", "");
|
||||
setprop("ECAM/rightmsg/line6", "");
|
||||
setprop("ECAM/rightmsg/line7", "");
|
||||
setprop("ECAM/rightmsg/line8", "");
|
||||
setprop("ECAM/rightmsg/linec1", "w");
|
||||
setprop("ECAM/rightmsg/linec2", "w");
|
||||
setprop("ECAM/rightmsg/linec3", "w");
|
||||
setprop("ECAM/rightmsg/linec4", "w");
|
||||
setprop("ECAM/rightmsg/linec5", "w");
|
||||
setprop("ECAM/rightmsg/linec6", "w");
|
||||
setprop("ECAM/rightmsg/linec7", "w");
|
||||
setprop("ECAM/rightmsg/linec8", "w");
|
||||
|
||||
page.setValue("door");
|
||||
apuLight.setValue(0);
|
||||
|
|
|
@ -36,8 +36,8 @@ var FWC = {
|
|||
phase5Output: props.globals.initNode("/ECAM/phases/monostable/phase-5-output"),
|
||||
phase7Output: props.globals.initNode("/ECAM/phases/monostable/phase-7-output"),
|
||||
phase9Output: props.globals.initNode("/ECAM/phases/monostable/phase-9-output"),
|
||||
toPowerOutput: props.globals.getNode("/ECAM/phases/monostable/to-power-set-output"),
|
||||
m80kt: props.globals.getNode("/ECAM/phases/monostable-80kt"),
|
||||
toPowerOutput: props.globals.getNode("ECAM/phases/monostable/to-power-set-output"),
|
||||
m80kt: props.globals.getNode("ECAM/phases/monostable-80kt"),
|
||||
},
|
||||
Flipflop: {
|
||||
gearSet: props.globals.initNode("/ECAM/phases/flipflop/gear-set", 0, "BOOL"),
|
||||
|
@ -59,11 +59,11 @@ var FWC = {
|
|||
eng1or2: props.globals.initNode("/ECAM/phases/timer/eng1or2", 0, "INT"),
|
||||
toInhibit: props.globals.initNode("/ECAM/phases/timer/to-inhibit", 0, "INT"),
|
||||
ldgInhibit: props.globals.initNode("/ECAM/phases/timer/ldg-inhibit", 0, "INT"),
|
||||
eng1idleOutput: props.globals.getNode("/ECAM/phases/timer/eng1idle-output"),
|
||||
eng2idleOutput: props.globals.getNode("/ECAM/phases/timer/eng2idle-output"),
|
||||
eng1idleOutput: props.globals.getNode("ECAM/phases/timer/eng1idle-output"),
|
||||
eng2idleOutput: props.globals.getNode("ECAM/phases/timer/eng2idle-output"),
|
||||
eng1or2Output: props.globals.initNode("/ECAM/phases/timer/eng1or2-output", 0, "INT"),
|
||||
toInhibitOutput: props.globals.getNode("/ECAM/phases/timer/to-inhibit-output"),
|
||||
ldgInhibitOutput: props.globals.getNode("/ECAM/phases/timer/ldg-inhibit-output"),
|
||||
toInhibitOutput: props.globals.getNode("ECAM/phases/timer/to-inhibit-output"),
|
||||
ldgInhibitOutput: props.globals.getNode("ECAM/phases/timer/ldg-inhibit-output"),
|
||||
},
|
||||
speed80: props.globals.initNode("/ECAM/phases/speed-gt-80", 0, "BOOL"),
|
||||
toPower: props.globals.initNode("/ECAM/phases/to-power-set", 0, "BOOL"),
|
||||
|
@ -131,15 +131,15 @@ var phaseLoop = func() {
|
|||
}
|
||||
|
||||
if (eng == "IAE") {
|
||||
eprlim = getprop("/controls/engines/epr-limit");
|
||||
if ((!getprop("/controls/engines/engine[0]/reverser") and !getprop("/controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine1.throttle.getValue() >= 0.8 or pts.Controls.Engines.Engine2.throttle.getValue() >= 0.8) and pts.PTSSystems.Thrust.flex.getBoolValue()) or (pts.Controls.Engines.Engine1.throttle.getValue() == 1.0 or pts.Controls.Engines.Engine2.throttle.getValue() == 1.0))) {
|
||||
eprlim = getprop("controls/engines/epr-limit");
|
||||
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine1.throttle.getValue() >= 0.8 or pts.Controls.Engines.Engine2.throttle.getValue() >= 0.8) and pts.PTSSystems.Thrust.flex.getBoolValue()) or (pts.Controls.Engines.Engine1.throttle.getValue() == 1.0 or pts.Controls.Engines.Engine2.throttle.getValue() == 1.0))) {
|
||||
FWC.toPower.setBoolValue(1);
|
||||
} else {
|
||||
FWC.toPower.setBoolValue(0);
|
||||
}
|
||||
} else {
|
||||
n1lim = getprop("/controls/engines/n1-limit");
|
||||
if ((!getprop("/controls/engines/engine[0]/reverser") and !getprop("/controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine1.throttle.getValue() >= 0.8 or pts.Controls.Engines.Engine2.throttle.getValue() >= 0.8) and pts.PTSSystems.Thrust.flex.getBoolValue()) or (pts.Controls.Engines.Engine1.throttle.getValue() == 1.0 or pts.Controls.Engines.Engine2.throttle.getValue() == 1.0))) {
|
||||
n1lim = getprop("controls/engines/n1-limit");
|
||||
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine1.throttle.getValue() >= 0.8 or pts.Controls.Engines.Engine2.throttle.getValue() >= 0.8) and pts.PTSSystems.Thrust.flex.getBoolValue()) or (pts.Controls.Engines.Engine1.throttle.getValue() == 1.0 or pts.Controls.Engines.Engine2.throttle.getValue() == 1.0))) {
|
||||
FWC.toPower.setBoolValue(1);
|
||||
} else {
|
||||
FWC.toPower.setBoolValue(0);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
# Thanks to BAWV12 / Thorsten
|
||||
|
||||
|
||||
var als_on = props.globals.getNode("/sim/rendering/shaders/skydome");
|
||||
var alt_agl = props.globals.getNode("/position/gear-agl-ft");
|
||||
var als_on = props.globals.getNode("sim/rendering/shaders/skydome");
|
||||
var alt_agl = props.globals.getNode("position/gear-agl-ft");
|
||||
var cur_alt = 0;
|
||||
|
||||
var light_manager = {
|
||||
|
@ -67,30 +67,30 @@ var light_manager = {
|
|||
flcpt: 0,
|
||||
prev_view : 1,
|
||||
|
||||
nd_ref_light1_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1),
|
||||
nd_ref_light1_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1),
|
||||
nd_ref_light1_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1),
|
||||
nd_ref_light1_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir", 1),
|
||||
nd_ref_light1_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m", 1),
|
||||
nd_ref_light1_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m", 1),
|
||||
nd_ref_light1_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m", 1),
|
||||
nd_ref_light1_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir", 1),
|
||||
|
||||
nd_ref_light2_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1),
|
||||
nd_ref_light2_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1),
|
||||
nd_ref_light2_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1),
|
||||
nd_ref_light2_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[1]", 1),
|
||||
nd_ref_light2_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[1]", 1),
|
||||
nd_ref_light2_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[1]", 1),
|
||||
nd_ref_light2_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[1]", 1),
|
||||
nd_ref_light2_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[1]", 1),
|
||||
|
||||
nd_ref_light3_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1),
|
||||
nd_ref_light3_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1),
|
||||
nd_ref_light3_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1),
|
||||
nd_ref_light3_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[2]", 1),
|
||||
nd_ref_light3_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[2]", 1),
|
||||
nd_ref_light3_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[2]", 1),
|
||||
nd_ref_light3_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[2]", 1),
|
||||
nd_ref_light3_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[2]", 1),
|
||||
|
||||
nd_ref_light4_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1),
|
||||
nd_ref_light4_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1),
|
||||
nd_ref_light4_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1),
|
||||
nd_ref_light4_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[3]", 1),
|
||||
nd_ref_light4_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[3]", 1),
|
||||
nd_ref_light4_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1),
|
||||
nd_ref_light4_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1),
|
||||
nd_ref_light4_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[3]", 1),
|
||||
|
||||
nd_ref_light5_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1),
|
||||
nd_ref_light5_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1),
|
||||
nd_ref_light5_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1),
|
||||
nd_ref_light5_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[4]", 1),
|
||||
nd_ref_light5_x: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1),
|
||||
nd_ref_light5_y: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1),
|
||||
nd_ref_light5_z: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1),
|
||||
nd_ref_light5_dir: props.globals.getNode("sim/rendering/als-secondary-lights/lightspot/dir[4]", 1),
|
||||
|
||||
init: func {
|
||||
# define your lights here
|
||||
|
@ -152,16 +152,16 @@ var light_manager = {
|
|||
},
|
||||
|
||||
start: func {
|
||||
setprop("/sim/rendering/als-secondary-lights/num-lightspots", 5);
|
||||
setprop("sim/rendering/als-secondary-lights/num-lightspots", 5);
|
||||
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size", me.light1_size);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size", me.light1_size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size);
|
||||
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch);
|
||||
|
||||
me.run = 1;
|
||||
me.update();
|
||||
|
@ -181,14 +181,14 @@ var light_manager = {
|
|||
ll1 = getprop("controls/lighting/landing-lights[1]");
|
||||
ll2 = getprop("controls/lighting/landing-lights[2]");
|
||||
ll3 = getprop("sim/model/lights/nose-lights");
|
||||
nav = getprop("/sim/model/lights/nav-lights");
|
||||
nav = getprop("sim/model/lights/nav-lights");
|
||||
|
||||
var apos = geo.aircraft_position();
|
||||
var vpos = geo.viewer_position();
|
||||
|
||||
me.lon_to_m = math.cos(apos.lat()*math.pi/180.0) * me.lat_to_m;
|
||||
|
||||
var heading = getprop("/orientation/heading-deg") * math.pi/180.0;
|
||||
var heading = getprop("orientation/heading-deg") * math.pi/180.0;
|
||||
|
||||
var lat = apos.lat();
|
||||
var lon = apos.lon();
|
||||
|
@ -197,15 +197,15 @@ var light_manager = {
|
|||
var sh = math.sin(heading);
|
||||
var ch = math.cos(heading);
|
||||
|
||||
if ((ll1 == 1 and getprop("/systems/electrical/bus/ac-1") != 0) and (ll2 == 1 and getprop("/systems/electrical/bus/ac-2") !=0)) {
|
||||
if ((ll1 == 1 and getprop("systems/electrical/bus/ac-1") != 0) and (ll2 == 1 and getprop("systems/electrical/bus/ac-2") !=0)) {
|
||||
me.light1_ypos = 0.0;
|
||||
me.light1_setSize(16);
|
||||
me.light1_on();
|
||||
} else if (ll1 == 1 and getprop("/systems/electrical/bus/ac-1") != 0) {
|
||||
} else if (ll1 == 1 and getprop("systems/electrical/bus/ac-1") != 0) {
|
||||
me.light1_ypos = 3.0;
|
||||
me.light1_setSize(12);
|
||||
me.light1_on();
|
||||
} else if (ll2 == 1 and getprop("/systems/electrical/bus/ac-2") !=0) {
|
||||
} else if (ll2 == 1 and getprop("systems/electrical/bus/ac-2") !=0) {
|
||||
me.light1_ypos = -3.0;
|
||||
me.light1_setSize(12);
|
||||
me.light1_on();
|
||||
|
@ -320,89 +320,89 @@ var light_manager = {
|
|||
|
||||
light1_on : func {
|
||||
if (me.light1_is_on == 1) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", me.light1_r);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", me.light1_g);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", me.light1_b);
|
||||
me.light1_is_on = 1;
|
||||
},
|
||||
|
||||
light1_off : func {
|
||||
if (me.light1_is_on == 0) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0);
|
||||
me.light1_is_on = 0;
|
||||
},
|
||||
|
||||
light1_setSize : func(size) {
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[0]", size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[0]", size);
|
||||
},
|
||||
|
||||
light2_on : func {
|
||||
if (me.light2_is_on == 1) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", me.light2_r);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", me.light2_g);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", me.light2_b);
|
||||
me.light2_is_on = 1;
|
||||
},
|
||||
|
||||
light2_off : func {
|
||||
if (me.light2_is_on == 0) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[1]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[1]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0);
|
||||
me.light2_is_on = 0;
|
||||
},
|
||||
|
||||
light2_setSize : func(size) {
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", size);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/size[1]", size);
|
||||
},
|
||||
|
||||
light3_on : func {
|
||||
if (me.light3_is_on == 1) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", me.light3_g);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", me.light3_b);
|
||||
me.light3_is_on = 1;
|
||||
},
|
||||
|
||||
light3_off : func {
|
||||
if (me.light3_is_on == 0) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[2]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[2]", 0.0);
|
||||
me.light3_is_on = 0;
|
||||
},
|
||||
|
||||
light4_on : func {
|
||||
if (me.light4_is_on == 1) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b);
|
||||
me.light4_is_on = 1;
|
||||
},
|
||||
|
||||
light4_off : func {
|
||||
if (me.light4_is_on == 0) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0);
|
||||
me.light4_is_on = 0;
|
||||
},
|
||||
|
||||
light5_on : func {
|
||||
if (me.light5_is_on == 1) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b);
|
||||
me.light5_is_on = 1;
|
||||
},
|
||||
|
||||
light5_off : func {
|
||||
if (me.light5_is_on == 0) {return;}
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0);
|
||||
setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0);
|
||||
setprop("sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0);
|
||||
me.light5_is_on = 0;
|
||||
},
|
||||
};
|
|
@ -44,49 +44,49 @@ var battery2_sw = 0;
|
|||
var law = 0;
|
||||
|
||||
var FBW = {
|
||||
degradeLaw: props.globals.getNode("/it-fbw/degrade-law"),
|
||||
activeLaw: props.globals.getNode("/it-fbw/law"),
|
||||
override: props.globals.getNode("/it-fbw/override"),
|
||||
rollBack: props.globals.getNode("/it-fbw/roll-back"),
|
||||
rollLim: props.globals.getNode("/it-fbw/roll-lim"),
|
||||
degradeLaw: props.globals.getNode("it-fbw/degrade-law"),
|
||||
activeLaw: props.globals.getNode("it-fbw/law"),
|
||||
override: props.globals.getNode("it-fbw/override"),
|
||||
rollBack: props.globals.getNode("it-fbw/roll-back"),
|
||||
rollLim: props.globals.getNode("it-fbw/roll-lim"),
|
||||
Computers: {
|
||||
elac1: props.globals.getNode("/systems/fctl/elac1"),
|
||||
elac2: props.globals.getNode("/systems/fctl/elac2"),
|
||||
sec1: props.globals.getNode("/systems/fctl/sec1"),
|
||||
sec2: props.globals.getNode("/systems/fctl/sec2"),
|
||||
sec3: props.globals.getNode("/systems/fctl/sec3"),
|
||||
fac1: props.globals.getNode("/systems/fctl/fac1"),
|
||||
fac2: props.globals.getNode("/systems/fctl/fac2"),
|
||||
elac1: props.globals.getNode("systems/fctl/elac1"),
|
||||
elac2: props.globals.getNode("systems/fctl/elac2"),
|
||||
sec1: props.globals.getNode("systems/fctl/sec1"),
|
||||
sec2: props.globals.getNode("systems/fctl/sec2"),
|
||||
sec3: props.globals.getNode("systems/fctl/sec3"),
|
||||
fac1: props.globals.getNode("systems/fctl/fac1"),
|
||||
fac2: props.globals.getNode("systems/fctl/fac2"),
|
||||
},
|
||||
Failures: {
|
||||
elac1: props.globals.getNode("/systems/failures/fctl/elac1"),
|
||||
elac2: props.globals.getNode("/systems/failures/fctl/elac2"),
|
||||
sec1: props.globals.getNode("/systems/failures/fctl/sec1"),
|
||||
sec2: props.globals.getNode("/systems/failures/fctl/sec2"),
|
||||
sec3: props.globals.getNode("/systems/failures/fctl/sec3"),
|
||||
fac1: props.globals.getNode("/systems/failures/fctl/fac1"),
|
||||
fac2: props.globals.getNode("/systems/failures/fctl/fac2"),
|
||||
elac1: props.globals.getNode("systems/failures/fctl/elac1"),
|
||||
elac2: props.globals.getNode("systems/failures/fctl/elac2"),
|
||||
sec1: props.globals.getNode("systems/failures/fctl/sec1"),
|
||||
sec2: props.globals.getNode("systems/failures/fctl/sec2"),
|
||||
sec3: props.globals.getNode("systems/failures/fctl/sec3"),
|
||||
fac1: props.globals.getNode("systems/failures/fctl/fac1"),
|
||||
fac2: props.globals.getNode("systems/failures/fctl/fac2"),
|
||||
},
|
||||
Lights: {
|
||||
elac1: props.globals.getNode("/controls/fctl/lights/elac1-fault"),
|
||||
elac2: props.globals.getNode("/controls/fctl/lights/elac2-fault"),
|
||||
sec1: props.globals.getNode("/controls/fctl/lights/sec1-fault"),
|
||||
sec2: props.globals.getNode("/controls/fctl/lights/sec2-fault"),
|
||||
sec2: props.globals.getNode("/controls/fctl/lights/sec3-fault"),
|
||||
fac1: props.globals.getNode("/controls/fctl/lights/fac1-fault"),
|
||||
fac2: props.globals.getNode("/controls/fctl/lights/fac2-fault"),
|
||||
elac1: props.globals.getNode("controls/fctl/lights/elac1-fault"),
|
||||
elac2: props.globals.getNode("controls/fctl/lights/elac2-fault"),
|
||||
sec1: props.globals.getNode("controls/fctl/lights/sec1-fault"),
|
||||
sec2: props.globals.getNode("controls/fctl/lights/sec2-fault"),
|
||||
sec2: props.globals.getNode("controls/fctl/lights/sec3-fault"),
|
||||
fac1: props.globals.getNode("controls/fctl/lights/fac1-fault"),
|
||||
fac2: props.globals.getNode("controls/fctl/lights/fac2-fault"),
|
||||
},
|
||||
Protections: {
|
||||
overspeedRoll: props.globals.getNode("/it-fbw/protections/overspeed-roll-back"),
|
||||
overspeedRoll: props.globals.getNode("it-fbw/protections/overspeed-roll-back"),
|
||||
},
|
||||
Switches: {
|
||||
elac1Sw: props.globals.getNode("/controls/fctl/switches/elac1"),
|
||||
elac2Sw: props.globals.getNode("/controls/fctl/switches/elac2"),
|
||||
sec1Sw: props.globals.getNode("/controls/fctl/switches/sec1"),
|
||||
sec2Sw: props.globals.getNode("/controls/fctl/switches/sec2"),
|
||||
sec3Sw: props.globals.getNode("/controls/fctl/switches/sec3"),
|
||||
fac1Sw: props.globals.getNode("/controls/fctl/switches/fac1"),
|
||||
fac2Sw: props.globals.getNode("/controls/fctl/switches/fac2"),
|
||||
elac1Sw: props.globals.getNode("controls/fctl/switches/elac1"),
|
||||
elac2Sw: props.globals.getNode("controls/fctl/switches/elac2"),
|
||||
sec1Sw: props.globals.getNode("controls/fctl/switches/sec1"),
|
||||
sec2Sw: props.globals.getNode("controls/fctl/switches/sec2"),
|
||||
sec3Sw: props.globals.getNode("controls/fctl/switches/sec3"),
|
||||
fac1Sw: props.globals.getNode("controls/fctl/switches/fac1"),
|
||||
fac2Sw: props.globals.getNode("controls/fctl/switches/fac2"),
|
||||
},
|
||||
init: func() {
|
||||
if (updatet.isRunning) {
|
||||
|
@ -180,92 +180,92 @@ var update_loop = func {
|
|||
}
|
||||
|
||||
if (sec1_sw and !sec1_fail and dc_ess >= 25) {
|
||||
setprop("/systems/fctl/sec1", 1);
|
||||
setprop("/systems/failures/spoiler-l3", 0);
|
||||
setprop("/systems/failures/spoiler-r3", 0);
|
||||
setprop("/systems/failures/spoiler-l4", 0);
|
||||
setprop("/systems/failures/spoiler-r4", 0);
|
||||
setprop("systems/fctl/sec1", 1);
|
||||
setprop("systems/failures/spoiler-l3", 0);
|
||||
setprop("systems/failures/spoiler-r3", 0);
|
||||
setprop("systems/failures/spoiler-l4", 0);
|
||||
setprop("systems/failures/spoiler-r4", 0);
|
||||
} else {
|
||||
setprop("/systems/fctl/sec1", 0);
|
||||
setprop("/systems/failures/spoiler-l3", 1);
|
||||
setprop("/systems/failures/spoiler-r3", 1);
|
||||
setprop("/systems/failures/spoiler-l4", 1);
|
||||
setprop("/systems/failures/spoiler-r4", 1);
|
||||
setprop("systems/fctl/sec1", 0);
|
||||
setprop("systems/failures/spoiler-l3", 1);
|
||||
setprop("systems/failures/spoiler-r3", 1);
|
||||
setprop("systems/failures/spoiler-l4", 1);
|
||||
setprop("systems/failures/spoiler-r4", 1);
|
||||
}
|
||||
|
||||
if (sec2_sw and !sec2_fail and dc2 >= 25) {
|
||||
setprop("/systems/fctl/sec2", 1);
|
||||
setprop("/systems/failures/spoiler-l5", 0);
|
||||
setprop("/systems/failures/spoiler-r5", 0);
|
||||
setprop("systems/fctl/sec2", 1);
|
||||
setprop("systems/failures/spoiler-l5", 0);
|
||||
setprop("systems/failures/spoiler-r5", 0);
|
||||
} else {
|
||||
setprop("/systems/fctl/sec2", 0);
|
||||
setprop("/systems/failures/spoiler-l5", 1);
|
||||
setprop("/systems/failures/spoiler-r5", 1);
|
||||
setprop("systems/fctl/sec2", 0);
|
||||
setprop("systems/failures/spoiler-l5", 1);
|
||||
setprop("systems/failures/spoiler-r5", 1);
|
||||
}
|
||||
|
||||
if (sec3_sw and !sec3_fail and dc2 >= 25) {
|
||||
setprop("/systems/fctl/sec3", 1);
|
||||
setprop("/systems/failures/spoiler-l1", 0);
|
||||
setprop("/systems/failures/spoiler-r1", 0);
|
||||
setprop("/systems/failures/spoiler-l2", 0);
|
||||
setprop("/systems/failures/spoiler-r2", 0);
|
||||
setprop("systems/fctl/sec3", 1);
|
||||
setprop("systems/failures/spoiler-l1", 0);
|
||||
setprop("systems/failures/spoiler-r1", 0);
|
||||
setprop("systems/failures/spoiler-l2", 0);
|
||||
setprop("systems/failures/spoiler-r2", 0);
|
||||
} else {
|
||||
setprop("/systems/fctl/sec3", 0);
|
||||
setprop("/systems/failures/spoiler-l1", 1);
|
||||
setprop("/systems/failures/spoiler-r1", 1);
|
||||
setprop("/systems/failures/spoiler-l2", 1);
|
||||
setprop("/systems/failures/spoiler-r2", 1);
|
||||
setprop("systems/fctl/sec3", 0);
|
||||
setprop("systems/failures/spoiler-l1", 1);
|
||||
setprop("systems/failures/spoiler-r1", 1);
|
||||
setprop("systems/failures/spoiler-l2", 1);
|
||||
setprop("systems/failures/spoiler-r2", 1);
|
||||
}
|
||||
|
||||
if (fac1_sw and !fac1_fail and (ac_ess >= 110 or dc_ess_shed >= 25)) {
|
||||
setprop("/systems/fctl/fac1", 1);
|
||||
setprop("/systems/failures/rudder", 0);
|
||||
setprop("/systems/failures/fac1-fault", 0);
|
||||
setprop("systems/fctl/fac1", 1);
|
||||
setprop("systems/failures/rudder", 0);
|
||||
setprop("systems/failures/fac1-fault", 0);
|
||||
} else if (fac1_sw and (battery1_sw or battery2_sw) and (fac1_fail or ac_ess < 110 or dc_ess_shed < 25)) {
|
||||
setprop("/systems/failures/fac1-fault", 1);
|
||||
setprop("/systems/fctl/fac1", 0);
|
||||
setprop("systems/failures/fac1-fault", 1);
|
||||
setprop("systems/fctl/fac1", 0);
|
||||
if (!fac2_sw or fac2_fail) {
|
||||
setprop("/systems/failures/rudder", 1);
|
||||
setprop("systems/failures/rudder", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("/systems/failures/fac1-fault", 0);
|
||||
setprop("/systems/fctl/fac1", 0);
|
||||
setprop("systems/failures/fac1-fault", 0);
|
||||
setprop("systems/fctl/fac1", 0);
|
||||
if (!fac2_sw or fac2_fail) {
|
||||
setprop("/systems/failures/rudder", 1);
|
||||
setprop("systems/failures/rudder", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (fac2_sw and !fac2_fail and (ac2 >= 110 or dc2 >= 25)) {
|
||||
setprop("/systems/fctl/fac2", 1);
|
||||
setprop("/systems/failures/fac2-fault", 0);
|
||||
setprop("systems/fctl/fac2", 1);
|
||||
setprop("systems/failures/fac2-fault", 0);
|
||||
} else if (fac2_sw and (fac2_fail or ac2 < 110 or dc2 < 25)) {
|
||||
setprop("/systems/failures/fac2-fault", 1);
|
||||
setprop("/systems/fctl/fac2", 0);
|
||||
setprop("systems/failures/fac2-fault", 1);
|
||||
setprop("systems/fctl/fac2", 0);
|
||||
if (!fac1_sw or fac1_fail) {
|
||||
setprop("/systems/failures/rudder", 1);
|
||||
setprop("systems/failures/rudder", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("/systems/fctl/fac2", 0);
|
||||
setprop("/systems/failures/fac2-fault", 0);
|
||||
setprop("systems/fctl/fac2", 0);
|
||||
setprop("systems/failures/fac2-fault", 0);
|
||||
if (!fac1_sw or fac1_fail) {
|
||||
setprop("/systems/failures/rudder", 1);
|
||||
setprop("systems/failures/rudder", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var elac1 = getprop("/systems/fctl/elac1");
|
||||
var elac2 = getprop("/systems/fctl/elac2");
|
||||
var sec1 = getprop("/systems/fctl/sec1");
|
||||
var sec2 = getprop("/systems/fctl/sec2");
|
||||
var sec3 = getprop("/systems/fctl/sec3");
|
||||
var fac1 = getprop("/systems/fctl/fac1");
|
||||
var fac2 = getprop("/systems/fctl/fac2");
|
||||
var elac1 = getprop("systems/fctl/elac1");
|
||||
var elac2 = getprop("systems/fctl/elac2");
|
||||
var sec1 = getprop("systems/fctl/sec1");
|
||||
var sec2 = getprop("systems/fctl/sec2");
|
||||
var sec3 = getprop("systems/fctl/sec3");
|
||||
var fac1 = getprop("systems/fctl/fac1");
|
||||
var fac2 = getprop("systems/fctl/fac2");
|
||||
law = FBW.activeLaw.getValue();
|
||||
|
||||
# Degrade logic, all failures which degrade FBW need to go here. -JD
|
||||
blue = systems.HYD.Psi.blue.getValue();
|
||||
green = systems.HYD.Psi.green.getValue();
|
||||
yellow = systems.HYD.Psi.yellow.getValue();
|
||||
if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0) {
|
||||
if (getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0) {
|
||||
if (!elac1 and !elac2) {
|
||||
if (law == 0) {
|
||||
FBW.degradeLaw.setValue(1);
|
||||
|
@ -273,7 +273,7 @@ var update_loop = func {
|
|||
fcu.athrOff("hard");
|
||||
}
|
||||
}
|
||||
if (getprop("/systems/electrical/some-electric-thingie/emer-elec-config") == 1) {
|
||||
if (getprop("systems/electrical/some-electric-thingie/emer-elec-config") == 1) {
|
||||
if (law == 0) {
|
||||
FBW.degradeLaw.setValue(1);
|
||||
fcu.apOff("hard", 0);
|
||||
|
@ -294,7 +294,7 @@ var update_loop = func {
|
|||
}
|
||||
}
|
||||
|
||||
if (getprop("/controls/gear/gear-down") == 1 and getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0) {
|
||||
if (getprop("controls/gear/gear-down") == 1 and getprop("it-autoflight/output/ap1") == 0 and getprop("it-autoflight/output/ap2") == 0) {
|
||||
if (law == 1) {
|
||||
FBW.degradeLaw.setValue(2);
|
||||
}
|
||||
|
@ -308,23 +308,23 @@ var update_loop = func {
|
|||
FBW.degradeLaw.setValue(2);
|
||||
}
|
||||
|
||||
mmoIAS = (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") / getprop("/instrumentation/airspeed-indicator/indicated-mach")) * 0.82;
|
||||
mmoIAS = (getprop("instrumentation/airspeed-indicator/indicated-speed-kt") / getprop("instrumentation/airspeed-indicator/indicated-mach")) * 0.82;
|
||||
if (mmoIAS < 350) {
|
||||
setprop("/it-fbw/speeds/vmo-mmo", mmoIAS);
|
||||
setprop("it-fbw/speeds/vmo-mmo", mmoIAS);
|
||||
} else {
|
||||
setprop("/it-fbw/speeds/vmo-mmo", 350);
|
||||
setprop("it-fbw/speeds/vmo-mmo", 350);
|
||||
}
|
||||
|
||||
if (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") > getprop("/it-fbw/speeds/vmo-mmo") + 6 and (law == 0 or law == 1)) {
|
||||
if (getprop("/it-autoflight/input/ap1") == 1 or getprop("/it-autoflight/input/ap2") == 1) {
|
||||
if (getprop("instrumentation/airspeed-indicator/indicated-speed-kt") > getprop("it-fbw/speeds/vmo-mmo") + 6 and (law == 0 or law == 1)) {
|
||||
if (getprop("it-autoflight/input/ap1") == 1 or getprop("it-autoflight/input/ap2") == 1) {
|
||||
fcu.apOff("hard", 0);
|
||||
}
|
||||
if (getprop("/it-fbw/protections/overspeed") != 1) {
|
||||
setprop("/it-fbw/protections/overspeed", 1);
|
||||
if (getprop("it-fbw/protections/overspeed") != 1) {
|
||||
setprop("it-fbw/protections/overspeed", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/it-fbw/protections/overspeed") != 0) {
|
||||
setprop("/it-fbw/protections/overspeed", 0);
|
||||
if (getprop("it-fbw/protections/overspeed") != 0) {
|
||||
setprop("it-fbw/protections/overspeed", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ var fbw_loop = func {
|
|||
FBW.Protections.overspeedRoll.setValue(1);
|
||||
}
|
||||
|
||||
if (getprop("/it-fbw/override") == 0) {
|
||||
if (getprop("it-fbw/override") == 0) {
|
||||
var active = FBW.activeLaw.getValue();
|
||||
var degrade = FBW.degradeLaw.getValue();
|
||||
if (degrade == 0) {
|
||||
|
@ -384,7 +384,7 @@ var fbw_loop = func {
|
|||
}
|
||||
|
||||
if (FBW.activeLaw.getValue() != 0) {
|
||||
if (getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) {
|
||||
if (getprop("it-autoflight/output/ap1") == 1 or getprop("it-autoflight/output/ap2") == 1) {
|
||||
fcu.apOff("hard", 0);
|
||||
fcu.athrOff("hard");
|
||||
}
|
||||
|
|
|
@ -3,37 +3,37 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450), Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
# Nodes
|
||||
var fd1 = props.globals.getNode("/it-autoflight/output/fd1", 1);
|
||||
var fd2 = props.globals.getNode("/it-autoflight/output/fd2", 1);
|
||||
var ap1 = props.globals.getNode("/it-autoflight/output/ap1", 1);
|
||||
var ap2 = props.globals.getNode("/it-autoflight/output/ap2", 1);
|
||||
var athr = props.globals.getNode("/it-autoflight/output/athr", 1);
|
||||
var fd1Input = props.globals.getNode("/it-autoflight/input/fd1", 1);
|
||||
var fd2Input = props.globals.getNode("/it-autoflight/input/fd2", 1);
|
||||
var ap1Input = props.globals.getNode("/it-autoflight/input/ap1", 1);
|
||||
var ap2Input = props.globals.getNode("/it-autoflight/input/ap2", 1);
|
||||
var athrInput = props.globals.getNode("/it-autoflight/input/athr", 1);
|
||||
var ktsMach = props.globals.getNode("/it-autoflight/input/kts-mach", 1);
|
||||
var iasSet = props.globals.getNode("/it-autoflight/input/spd-kts", 1);
|
||||
var machSet = props.globals.getNode("/it-autoflight/input/spd-mach", 1);
|
||||
var hdgSet = props.globals.getNode("/it-autoflight/input/hdg", 1);
|
||||
var altSet = props.globals.getNode("/it-autoflight/input/alt", 1);
|
||||
var altSetMode = props.globals.getNode("/it-autoflight/config/altitude-dial-mode", 1);
|
||||
var vsSet = props.globals.getNode("/it-autoflight/input/vs", 1);
|
||||
var fpaSet = props.globals.getNode("/it-autoflight/input/fpa", 1);
|
||||
var iasNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
||||
var machNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
|
||||
var spdManaged = props.globals.getNode("/it-autoflight/input/spd-managed", 1);
|
||||
var showHDG = props.globals.getNode("/it-autoflight/custom/show-hdg", 1);
|
||||
var trkFpaSW = props.globals.getNode("/it-autoflight/custom/trk-fpa", 1);
|
||||
var latMode = props.globals.getNode("/it-autoflight/output/lat", 1);
|
||||
var vertMode = props.globals.getNode("/it-autoflight/output/vert", 1);
|
||||
var fpaModeInput = props.globals.getNode("/it-autoflight/input/fpa", 1);
|
||||
var latModeInput = props.globals.getNode("/it-autoflight/input/lat", 1);
|
||||
var vertModeInput = props.globals.getNode("/it-autoflight/input/vert", 1);
|
||||
var vsModeInput = props.globals.getNode("/it-autoflight/input/vs", 1);
|
||||
var locArm = props.globals.getNode("/it-autoflight/output/loc-armed", 1);
|
||||
var apprArm = props.globals.getNode("/it-autoflight/output/appr-armed", 1);
|
||||
var fd1 = props.globals.getNode("it-autoflight/output/fd1", 1);
|
||||
var fd2 = props.globals.getNode("it-autoflight/output/fd2", 1);
|
||||
var ap1 = props.globals.getNode("it-autoflight/output/ap1", 1);
|
||||
var ap2 = props.globals.getNode("it-autoflight/output/ap2", 1);
|
||||
var athr = props.globals.getNode("it-autoflight/output/athr", 1);
|
||||
var fd1Input = props.globals.getNode("it-autoflight/input/fd1", 1);
|
||||
var fd2Input = props.globals.getNode("it-autoflight/input/fd2", 1);
|
||||
var ap1Input = props.globals.getNode("it-autoflight/input/ap1", 1);
|
||||
var ap2Input = props.globals.getNode("it-autoflight/input/ap2", 1);
|
||||
var athrInput = props.globals.getNode("it-autoflight/input/athr", 1);
|
||||
var ktsMach = props.globals.getNode("it-autoflight/input/kts-mach", 1);
|
||||
var iasSet = props.globals.getNode("it-autoflight/input/spd-kts", 1);
|
||||
var machSet = props.globals.getNode("it-autoflight/input/spd-mach", 1);
|
||||
var hdgSet = props.globals.getNode("it-autoflight/input/hdg", 1);
|
||||
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);
|
||||
var altSetMode = props.globals.getNode("it-autoflight/config/altitude-dial-mode", 1);
|
||||
var vsSet = props.globals.getNode("it-autoflight/input/vs", 1);
|
||||
var fpaSet = props.globals.getNode("it-autoflight/input/fpa", 1);
|
||||
var iasNow = props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
||||
var machNow = props.globals.getNode("instrumentation/airspeed-indicator/indicated-mach", 1);
|
||||
var spdManaged = props.globals.getNode("it-autoflight/input/spd-managed", 1);
|
||||
var showHDG = props.globals.getNode("it-autoflight/custom/show-hdg", 1);
|
||||
var trkFpaSW = props.globals.getNode("it-autoflight/custom/trk-fpa", 1);
|
||||
var latMode = props.globals.getNode("it-autoflight/output/lat", 1);
|
||||
var vertMode = props.globals.getNode("it-autoflight/output/vert", 1);
|
||||
var fpaModeInput = props.globals.getNode("it-autoflight/input/fpa", 1);
|
||||
var latModeInput = props.globals.getNode("it-autoflight/input/lat", 1);
|
||||
var vertModeInput = props.globals.getNode("it-autoflight/input/vert", 1);
|
||||
var vsModeInput = props.globals.getNode("it-autoflight/input/vs", 1);
|
||||
var locArm = props.globals.getNode("it-autoflight/output/loc-armed", 1);
|
||||
var apprArm = props.globals.getNode("it-autoflight/output/appr-armed", 1);
|
||||
var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL");
|
||||
|
||||
var FCU = {
|
||||
|
@ -59,7 +59,7 @@ var FCU = {
|
|||
var FCUController = {
|
||||
FCU1: nil,
|
||||
FCU2: nil,
|
||||
activeFMGC: props.globals.getNode("/FMGC/active-fmgc-channel"),
|
||||
activeFMGC: props.globals.getNode("FMGC/active-fmgc-channel"),
|
||||
FCUworking: 0,
|
||||
_init: 0,
|
||||
init: func() {
|
||||
|
@ -150,13 +150,13 @@ var FCUController = {
|
|||
if (ap1.getBoolValue() or ap2.getBoolValue()) {
|
||||
apOff("soft", 0);
|
||||
} else {
|
||||
if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("/it-autoflight/sound/apoffsound", 0);
|
||||
setprop("/it-autoflight/sound/apoffsound2", 0);
|
||||
if (getprop("it-autoflight/sound/apoffsound") == 1 or getprop("it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("it-autoflight/sound/apoffsound", 0);
|
||||
setprop("it-autoflight/sound/apoffsound2", 0);
|
||||
}
|
||||
if (getprop("/it-autoflight/output/ap-warning") != 0) {
|
||||
setprop("/it-autoflight/output/ap-warning", 0);
|
||||
setprop("/ECAM/warnings/master-warning-light", 0);
|
||||
if (getprop("it-autoflight/output/ap-warning") != 0) {
|
||||
setprop("it-autoflight/output/ap-warning", 0);
|
||||
setprop("ECAM/warnings/master-warning-light", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,11 +165,11 @@ var FCUController = {
|
|||
if (me.FCUworking) {
|
||||
if (athr.getBoolValue()) {
|
||||
athrOff("soft");
|
||||
setprop("/ECAM/warnings/master-caution-light", 1);
|
||||
setprop("ECAM/warnings/master-caution-light", 1);
|
||||
} else {
|
||||
if (getprop("/it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("/it-autoflight/output/athr-warning", 0);
|
||||
setprop("/ECAM/warnings/master-caution-light", 0);
|
||||
if (getprop("it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("it-autoflight/output/athr-warning", 0);
|
||||
setprop("ECAM/warnings/master-caution-light", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ var FCUController = {
|
|||
},
|
||||
SPDPush: func() {
|
||||
if (me.FCUworking) {
|
||||
if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) {
|
||||
if (getprop("FMGC/internal/cruise-lvl-set") == 1 and getprop("FMGC/internal/cost-index-set") == 1) {
|
||||
spdManaged.setBoolValue(1);
|
||||
fmgc.ManagedSPD.start();
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ var FCUController = {
|
|||
},
|
||||
ALTPush: func() {
|
||||
if (me.FCUworking) {
|
||||
# setprop("/it-autoflight/input/vert", 8); # He don't work yet m8
|
||||
# setprop("it-autoflight/input/vert", 8); # He don't work yet m8
|
||||
}
|
||||
},
|
||||
ALTPull: func() {
|
||||
|
@ -506,7 +506,7 @@ var athrOff = func(type) {
|
|||
var hdgInput = func {
|
||||
if (latMode.getValue() != 0) {
|
||||
showHDG.setBoolValue(1);
|
||||
var hdgnow = getprop("/it-autoflight/input/hdg");
|
||||
setprop("/modes/fcu/hdg-time", getprop("/sim/time/elapsed-sec"));
|
||||
var hdgnow = getprop("it-autoflight/input/hdg");
|
||||
setprop("modes/fcu/hdg-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
}
|
|
@ -5,45 +5,45 @@
|
|||
# Initialize all used variables and property nodes
|
||||
# Sim
|
||||
var Velocity = {
|
||||
airspeedKt: props.globals.getNode("/velocities/airspeed-kt", 1), # Only used for gain scheduling
|
||||
groundspeedKt: props.globals.getNode("/velocities/groundspeed-kt", 1),
|
||||
airspeedKt: props.globals.getNode("velocities/airspeed-kt", 1), # Only used for gain scheduling
|
||||
groundspeedKt: props.globals.getNode("velocities/groundspeed-kt", 1),
|
||||
groundspeedMps: 0,
|
||||
indicatedAirspeedKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1),
|
||||
indicatedMach: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1),
|
||||
trueAirspeedKt: props.globals.getNode("/instrumentation/airspeed-indicator/true-speed-kt", 1),
|
||||
indicatedAirspeedKt: props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt", 1),
|
||||
indicatedMach: props.globals.getNode("instrumentation/airspeed-indicator/indicated-mach", 1),
|
||||
trueAirspeedKt: props.globals.getNode("instrumentation/airspeed-indicator/true-speed-kt", 1),
|
||||
trueAirspeedKtTemp: 0,
|
||||
};
|
||||
|
||||
var Position = {
|
||||
gearAglFtTemp: 0,
|
||||
gearAglFt: props.globals.getNode("/position/gear-agl-ft", 1),
|
||||
indicatedAltitudeFt: props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1),
|
||||
gearAglFt: props.globals.getNode("position/gear-agl-ft", 1),
|
||||
indicatedAltitudeFt: props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft", 1),
|
||||
indicatedAltitudeFtTemp: 0,
|
||||
};
|
||||
|
||||
var Gear = {
|
||||
wow0: props.globals.getNode("/gear/gear[0]/wow", 1),
|
||||
wow1: props.globals.getNode("/gear/gear[1]/wow", 1),
|
||||
wow0: props.globals.getNode("gear/gear[0]/wow", 1),
|
||||
wow1: props.globals.getNode("gear/gear[1]/wow", 1),
|
||||
wow1Temp: 1,
|
||||
wow2: props.globals.getNode("/gear/gear[2]/wow", 1),
|
||||
wow2: props.globals.getNode("gear/gear[2]/wow", 1),
|
||||
wow2Temp: 1,
|
||||
};
|
||||
|
||||
var Control = {
|
||||
aileron: props.globals.getNode("/controls/flight/aileron", 1),
|
||||
elevator: props.globals.getNode("/controls/flight/elevator", 1),
|
||||
rudder: props.globals.getNode("/controls/flight/rudder", 1),
|
||||
aileron: props.globals.getNode("controls/flight/aileron", 1),
|
||||
elevator: props.globals.getNode("controls/flight/elevator", 1),
|
||||
rudder: props.globals.getNode("controls/flight/rudder", 1),
|
||||
};
|
||||
|
||||
var Radio = {
|
||||
gsDefl: [props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm", 1), props.globals.getNode("/instrumentation/nav[1]/gs-needle-deflection-norm", 1)],
|
||||
gsDefl: [props.globals.getNode("instrumentation/nav[0]/gs-needle-deflection-norm", 1), props.globals.getNode("instrumentation/nav[1]/gs-needle-deflection-norm", 1)],
|
||||
gsDeflTemp: 0,
|
||||
inRange: [props.globals.getNode("/instrumentation/nav[0]/in-range", 1), props.globals.getNode("/instrumentation/nav[1]/in-range", 1)],
|
||||
inRange: [props.globals.getNode("instrumentation/nav[0]/in-range", 1), props.globals.getNode("instrumentation/nav[1]/in-range", 1)],
|
||||
inRangeTemp: 0,
|
||||
locDefl: [props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm", 1), props.globals.getNode("/instrumentation/nav[1]/heading-needle-deflection-norm", 1)],
|
||||
locDefl: [props.globals.getNode("instrumentation/nav[0]/heading-needle-deflection-norm", 1), props.globals.getNode("instrumentation/nav[1]/heading-needle-deflection-norm", 1)],
|
||||
locDeflTemp: 0,
|
||||
radioSel: 0,
|
||||
signalQuality: [props.globals.getNode("/instrumentation/nav[0]/signal-quality-norm", 1), props.globals.getNode("/instrumentation/nav[1]/signal-quality-norm", 1)],
|
||||
signalQuality: [props.globals.getNode("instrumentation/nav[0]/signal-quality-norm", 1), props.globals.getNode("instrumentation/nav[1]/signal-quality-norm", 1)],
|
||||
signalQualityTemp: 0,
|
||||
};
|
||||
|
||||
|
@ -68,11 +68,11 @@ var FPLN = {
|
|||
};
|
||||
|
||||
var Misc = {
|
||||
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess", 1),
|
||||
elapsedSec: props.globals.getNode("/sim/time/elapsed-sec", 1),
|
||||
fbwLaw: props.globals.getNode("/it-fbw/law", 1),
|
||||
flapNorm: props.globals.getNode("/surface-positions/flap-pos-norm", 1),
|
||||
pfdHeadingScale: props.globals.getNode("/instrumentation/pfd/heading-scale", 1),
|
||||
acEss: props.globals.getNode("systems/electrical/bus/ac-ess", 1),
|
||||
elapsedSec: props.globals.getNode("sim/time/elapsed-sec", 1),
|
||||
fbwLaw: props.globals.getNode("it-fbw/law", 1),
|
||||
flapNorm: props.globals.getNode("surface-positions/flap-pos-norm", 1),
|
||||
pfdHeadingScale: props.globals.getNode("instrumentation/pfd/heading-scale", 1),
|
||||
};
|
||||
|
||||
# IT-AUTOFLIGHT
|
||||
|
@ -164,12 +164,12 @@ var Sound = {
|
|||
# A3XX Custom
|
||||
var Custom = {
|
||||
apFdOn: 0,
|
||||
hdgTime: props.globals.getNode("/modes/fcu/hdg-time", 1),
|
||||
ndTrkSel: [props.globals.getNode("/instrumentation/efis[0]/trk-selected", 1), props.globals.getNode("/instrumentation/efis[1]/trk-selected", 1)],
|
||||
hdgTime: props.globals.getNode("modes/fcu/hdg-time", 1),
|
||||
ndTrkSel: [props.globals.getNode("instrumentation/efis[0]/trk-selected", 1), props.globals.getNode("instrumentation/efis[1]/trk-selected", 1)],
|
||||
showHdg: props.globals.initNode("/it-autoflight/custom/show-hdg", 1, "BOOL"),
|
||||
trkFpa: props.globals.initNode("/it-autoflight/custom/trk-fpa", 0, "BOOL"),
|
||||
Input: {
|
||||
spdManaged: props.globals.getNode("/it-autoflight/input/spd-managed", 1),
|
||||
spdManaged: props.globals.getNode("it-autoflight/input/spd-managed", 1),
|
||||
},
|
||||
Output: {
|
||||
fmaPower: props.globals.initNode("/it-autoflight/output/fma-pwr", 0, "BOOL"),
|
||||
|
@ -178,7 +178,7 @@ var Custom = {
|
|||
athrOff: props.globals.initNode("/it-autoflight/sound/athrsound", 0, "BOOL"),
|
||||
enableAthrOff: 0,
|
||||
},
|
||||
ThrLock: props.globals.getNode("/systems/thrust/thr-locked", 1)
|
||||
ThrLock: props.globals.getNode("systems/thrust/thr-locked", 1)
|
||||
};
|
||||
|
||||
var ITAF = {
|
||||
|
@ -356,9 +356,9 @@ var ITAF = {
|
|||
# Preselect Heading
|
||||
if (Output.latTemp != 0 and Output.latTemp != 9) { # Modes that always show HDG
|
||||
if (Custom.hdgTime.getValue() + 45 >= Misc.elapsedSec.getValue()) {
|
||||
setprop("/it-autoflight/custom/show-hdg", 1);
|
||||
setprop("it-autoflight/custom/show-hdg", 1);
|
||||
} else {
|
||||
setprop("/it-autoflight/custom/show-hdg", 0);
|
||||
setprop("it-autoflight/custom/show-hdg", 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1012,11 +1012,11 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
|
||||
# For Canvas Nav Display.
|
||||
setlistener("/it-autoflight/input/hdg", func {
|
||||
setprop("/autopilot/settings/heading-bug-deg", getprop("/it-autoflight/input/hdg"));
|
||||
setprop("autopilot/settings/heading-bug-deg", getprop("it-autoflight/input/hdg"));
|
||||
});
|
||||
|
||||
setlistener("/it-autoflight/internal/alt", func {
|
||||
setprop("/autopilot/settings/target-altitude-ft", getprop("/it-autoflight/internal/alt"));
|
||||
setprop("autopilot/settings/target-altitude-ft", getprop("it-autoflight/internal/alt"));
|
||||
});
|
||||
|
||||
var loopTimer = maketimer(0.1, ITAF, ITAF.loop);
|
||||
|
|
|
@ -3,37 +3,37 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/it-autoflight/internal/alt", 10000);
|
||||
setprop("/modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("/modes/pfd/fma/pitch-mode", " ");
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed", " ");
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", " ");
|
||||
setprop("/modes/pfd/fma/ap-mode", " ");
|
||||
setprop("/modes/pfd/fma/fd-mode", " ");
|
||||
setprop("/modes/pfd/fma/at-mode", " ");
|
||||
setprop("/modes/pfd/fma/athr-armed", 0);
|
||||
setprop("/modes/pfd/fma/throttle-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-box", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0);
|
||||
setprop("/modes/pfd/fma/roll-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-box", 0);
|
||||
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
||||
setprop("/modes/pfd/fma/throttle-mode-time", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode-time", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-time", 0);
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-time", 0);
|
||||
setprop("/modes/pfd/fma/roll-mode-time", 0);
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-time", 0);
|
||||
setprop("/modes/pfd/fma/ap-mode-time", 0);
|
||||
setprop("/modes/pfd/fma/fd-mode-time", 0);
|
||||
setprop("/modes/pfd/fma/athr-mode-time", 0);
|
||||
setprop("/modes/fcu/hdg-time", -45);
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("it-autoflight/internal/alt", 10000);
|
||||
setprop("modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
setprop("modes/pfd/fma/roll-mode", " ");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/ap-mode", " ");
|
||||
setprop("modes/pfd/fma/fd-mode", " ");
|
||||
setprop("modes/pfd/fma/at-mode", " ");
|
||||
setprop("modes/pfd/fma/athr-armed", 0);
|
||||
setprop("modes/pfd/fma/throttle-mode-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-box", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-box", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-armed-box", 0);
|
||||
setprop("modes/pfd/fma/ap-mode-box", 0);
|
||||
setprop("modes/pfd/fma/fd-mode-box", 0);
|
||||
setprop("modes/pfd/fma/athr-mode-box", 0);
|
||||
setprop("modes/pfd/fma/throttle-mode-time", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-time", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-time", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-time", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-time", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-armed-time", 0);
|
||||
setprop("modes/pfd/fma/ap-mode-time", 0);
|
||||
setprop("modes/pfd/fma/fd-mode-time", 0);
|
||||
setprop("modes/pfd/fma/athr-mode-time", 0);
|
||||
setprop("modes/fcu/hdg-time", -45);
|
||||
|
||||
setlistener("sim/signals/fdm-initialized", func {
|
||||
loopFMA.start();
|
||||
|
@ -41,51 +41,51 @@ setlistener("sim/signals/fdm-initialized", func {
|
|||
|
||||
# Master Thrust
|
||||
var loopFMA = maketimer(0.05, func {
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
var newthr = getprop("/modes/pfd/fma/throttle-mode");
|
||||
var thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
var thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
var state1 = getprop("systems/thrust/state1");
|
||||
var state2 = getprop("systems/thrust/state2");
|
||||
var newthr = getprop("modes/pfd/fma/throttle-mode");
|
||||
var thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
var thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
if (state1 == "TOGA" or state2 == "TOGA") {
|
||||
if (newthr != " ") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("modes/pfd/fma/throttle-mode", " ");
|
||||
}
|
||||
} else if ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) {
|
||||
if (newthr != " ") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("modes/pfd/fma/throttle-mode", " ");
|
||||
}
|
||||
} else if ((state1 == "MCT" or state2 == "MCT") and getprop("/systems/thrust/eng-out") != 1) {
|
||||
} else if ((state1 == "MCT" or state2 == "MCT") and getprop("systems/thrust/eng-out") != 1) {
|
||||
if (newthr != " ") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("modes/pfd/fma/throttle-mode", " ");
|
||||
}
|
||||
} else if (((state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/eng-out") != 1) {
|
||||
} else if (((state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("systems/thrust/eng-out") != 1) {
|
||||
if (newthr != " ") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", " ");
|
||||
setprop("modes/pfd/fma/throttle-mode", " ");
|
||||
}
|
||||
} else {
|
||||
if ((getprop("/it-autoflight/output/vert") == 4) or (getprop("/it-autoflight/output/vert") == 6) or (getprop("/it-autoflight/output/vert") == 7) or (getprop("/it-autoflight/output/vert") == 8)) {
|
||||
if (getprop("/it-autoflight/output/fd1") == 0 and getprop("/it-autoflight/output/fd2") == 0 and getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0) {
|
||||
if ((getprop("it-autoflight/output/vert") == 4) or (getprop("it-autoflight/output/vert") == 6) or (getprop("it-autoflight/output/vert") == 7) or (getprop("it-autoflight/output/vert") == 8)) {
|
||||
if (getprop("it-autoflight/output/fd1") == 0 and getprop("it-autoflight/output/fd2") == 0 and getprop("it-autoflight/output/ap1") == 0 and getprop("it-autoflight/output/ap2") == 0) {
|
||||
loopFMA_b();
|
||||
} else {
|
||||
var thr = getprop("/it-autoflight/output/thr-mode");
|
||||
var thr = getprop("it-autoflight/output/thr-mode");
|
||||
if (thr == 0) {
|
||||
loopFMA_b();
|
||||
} else if (thr == 1) {
|
||||
if (newthr != "THR IDLE") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "THR IDLE");
|
||||
setprop("modes/pfd/fma/throttle-mode", "THR IDLE");
|
||||
}
|
||||
} else if (thr == 2) {
|
||||
if (state1 == "MCT" or state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1) {
|
||||
if (state1 == "MCT" or state2 == "MCT" and getprop("systems/thrust/eng-out") == 1) {
|
||||
if (newthr != "THR MCT") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "THR MCT");
|
||||
setprop("modes/pfd/fma/throttle-mode", "THR MCT");
|
||||
}
|
||||
} else if (state1 == "CL" or state2 == "CL") {
|
||||
if (newthr != "THR CLB") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "THR CLB");
|
||||
setprop("modes/pfd/fma/throttle-mode", "THR CLB");
|
||||
}
|
||||
} else {
|
||||
if (newthr != "THR LVR") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "THR LVR");
|
||||
setprop("modes/pfd/fma/throttle-mode", "THR LVR");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,164 +96,164 @@ var loopFMA = maketimer(0.05, func {
|
|||
}
|
||||
|
||||
# A/THR Armed/Active
|
||||
if (getprop("/it-autoflight/output/athr") == 1 and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA") and getprop("/systems/thrust/eng-out") != 1) {
|
||||
if (getprop("/modes/pfd/fma/athr-armed") != 1) {
|
||||
setprop("/modes/pfd/fma/athr-armed", 1);
|
||||
if (getprop("it-autoflight/output/athr") == 1 and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA") and getprop("systems/thrust/eng-out") != 1) {
|
||||
if (getprop("modes/pfd/fma/athr-armed") != 1) {
|
||||
setprop("modes/pfd/fma/athr-armed", 1);
|
||||
}
|
||||
} else if (getprop("/it-autoflight/output/athr") == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83) or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or
|
||||
(state2 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or state1 == "TOGA" or state2 == "TOGA") and getprop("/systems/thrust/eng-out") == 1) {
|
||||
if (getprop("/modes/pfd/fma/athr-armed") != 1) {
|
||||
setprop("/modes/pfd/fma/athr-armed", 1);
|
||||
} else if (getprop("it-autoflight/output/athr") == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83) or (state1 == "MCT" and getprop("controls/engines/thrust-limit") == "FLX") or
|
||||
(state2 == "MCT" and getprop("controls/engines/thrust-limit") == "FLX") or state1 == "TOGA" or state2 == "TOGA") and getprop("systems/thrust/eng-out") == 1) {
|
||||
if (getprop("modes/pfd/fma/athr-armed") != 1) {
|
||||
setprop("modes/pfd/fma/athr-armed", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/modes/pfd/fma/athr-armed") != 0) {
|
||||
setprop("/modes/pfd/fma/athr-armed", 0);
|
||||
if (getprop("modes/pfd/fma/athr-armed") != 0) {
|
||||
setprop("modes/pfd/fma/athr-armed", 0);
|
||||
}
|
||||
}
|
||||
|
||||
# SRS RWY Engagement
|
||||
var flx = getprop("/systems/thrust/lim-flex");
|
||||
var lat = getprop("/it-autoflight/mode/lat");
|
||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
var vert = getprop("/it-autoflight/mode/vert");
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
var thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
var thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
var wow = getprop("/gear/gear[0]/wow");
|
||||
var engstate1 = getprop("/engines/engine[0]/state");
|
||||
var engstate2 = getprop("/engines/engine[1]/state");
|
||||
var flx = getprop("systems/thrust/lim-flex");
|
||||
var lat = getprop("it-autoflight/mode/lat");
|
||||
var newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
var vert = getprop("it-autoflight/mode/vert");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
var newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
var thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
var thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
var wow = getprop("gear/gear[0]/wow");
|
||||
var engstate1 = getprop("engines/engine[0]/state");
|
||||
var engstate2 = getprop("engines/engine[1]/state");
|
||||
if (((state1 == "TOGA" or state2 == "TOGA") or (flx == 1 and (state1 == "MCT" or state2 == "MCT")) or (flx == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)))) and (engstate1 == 3 or engstate2 == 3)) {
|
||||
# RWY Engagement would go here, but automatic ILS selection is not simulated yet.
|
||||
if (wow and getprop("/FMGC/internal/v2-set") == 1 and getprop("/it-autoflight/output/vert") != 7) {
|
||||
if (wow and getprop("FMGC/internal/v2-set") == 1 and getprop("it-autoflight/output/vert") != 7) {
|
||||
ITAF.setVertMode(7);
|
||||
setprop("/it-autoflight/mode/vert", "T/O CLB");
|
||||
setprop("it-autoflight/mode/vert", "T/O CLB");
|
||||
}
|
||||
} else {
|
||||
var gear1 = getprop("/gear/gear[1]/wow");
|
||||
var gear2 = getprop("/gear/gear[2]/wow");
|
||||
if (getprop("/it-autoflight/input/lat") == 5 and (gear1 or gear2)) {
|
||||
var gear1 = getprop("gear/gear[1]/wow");
|
||||
var gear2 = getprop("gear/gear[2]/wow");
|
||||
if (getprop("it-autoflight/input/lat") == 5 and (gear1 or gear2)) {
|
||||
ITAF.setLatMode(9);
|
||||
}
|
||||
if (getprop("/it-autoflight/output/vert") == 7 and (gear1 or gear2)) {
|
||||
if (getprop("it-autoflight/output/vert") == 7 and (gear1 or gear2)) {
|
||||
ITAF.setVertMode(9);
|
||||
}
|
||||
}
|
||||
|
||||
var trk = getprop("/it-autoflight/custom/trk-fpa");
|
||||
var trk = getprop("it-autoflight/custom/trk-fpa");
|
||||
if (lat == "HDG" and trk == 0) {
|
||||
if (newlat != "HDG") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "HDG");
|
||||
setprop("modes/pfd/fma/roll-mode", "HDG");
|
||||
}
|
||||
} else if (lat == "HDG" and trk == 1) {
|
||||
if (newlat != "TRACK") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "TRACK");
|
||||
setprop("modes/pfd/fma/roll-mode", "TRACK");
|
||||
}
|
||||
}
|
||||
|
||||
# Boxes
|
||||
var elapsedtime = getprop("/sim/time/elapsed-sec");
|
||||
if (getprop("/modes/pfd/fma/ap-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/ap-mode-box", 1);
|
||||
var elapsedtime = getprop("sim/time/elapsed-sec");
|
||||
if (getprop("modes/pfd/fma/ap-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/ap-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/ap-mode-box", 0);
|
||||
setprop("modes/pfd/fma/ap-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/fd-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/fd-mode-box", 1);
|
||||
if (getprop("modes/pfd/fma/fd-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/fd-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/fd-mode-box", 0);
|
||||
setprop("modes/pfd/fma/fd-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/athr-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/athr-mode-box", 1);
|
||||
if (getprop("modes/pfd/fma/athr-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/athr-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/athr-mode-box", 0);
|
||||
setprop("modes/pfd/fma/athr-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/throttle-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/throttle-mode-box", 1);
|
||||
if (getprop("modes/pfd/fma/throttle-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/throttle-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/throttle-mode-box", 0);
|
||||
setprop("modes/pfd/fma/throttle-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/roll-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/roll-mode-box", 1);
|
||||
if (getprop("modes/pfd/fma/roll-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/roll-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/roll-mode-box", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/pitch-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/pitch-mode-box", 1);
|
||||
if (getprop("modes/pfd/fma/pitch-mode-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/pitch-mode-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/pitch-mode-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/roll-mode-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-box", 1);
|
||||
if (getprop("modes/pfd/fma/roll-mode-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/roll-mode-armed-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-box", 0);
|
||||
setprop("modes/pfd/fma/roll-mode-armed-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/pitch-mode-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-box", 1);
|
||||
if (getprop("modes/pfd/fma/pitch-mode-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-box", 0);
|
||||
}
|
||||
if (getprop("/modes/pfd/fma/pitch-mode2-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 1);
|
||||
if (getprop("modes/pfd/fma/pitch-mode2-armed-time") + 10 >= elapsedtime) {
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-box", 1);
|
||||
} else {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0);
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-box", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var loopFMA_b = func {
|
||||
var newthr = getprop("/modes/pfd/fma/throttle-mode");
|
||||
if (getprop("/it-autoflight/input/kts-mach") == 0) {
|
||||
var newthr = getprop("modes/pfd/fma/throttle-mode");
|
||||
if (getprop("it-autoflight/input/kts-mach") == 0) {
|
||||
if (newthr != "SPEED") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "SPEED");
|
||||
setprop("modes/pfd/fma/throttle-mode", "SPEED");
|
||||
}
|
||||
} else if (getprop("/it-autoflight/input/kts-mach") == 1) {
|
||||
} else if (getprop("it-autoflight/input/kts-mach") == 1) {
|
||||
if (newthr != "MACH") {
|
||||
setprop("/modes/pfd/fma/throttle-mode", "MACH");
|
||||
setprop("modes/pfd/fma/throttle-mode", "MACH");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Master Lateral
|
||||
setlistener("/it-autoflight/mode/lat", func {
|
||||
var lat = getprop("/it-autoflight/mode/lat");
|
||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
var lat = getprop("it-autoflight/mode/lat");
|
||||
var newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
if (lat == "LNAV") {
|
||||
if (newlat != "NAV") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "NAV");
|
||||
setprop("modes/pfd/fma/roll-mode", "NAV");
|
||||
}
|
||||
} else if (lat == "LOC") {
|
||||
if (newlat != "LOC*" and newlat != "LOC") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "LOC*");
|
||||
setprop("modes/pfd/fma/roll-mode", "LOC*");
|
||||
locupdate.start();
|
||||
}
|
||||
} else if (lat == "ALGN") {
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
setprop("modes/pfd/fma/roll-mode", " ");
|
||||
}
|
||||
} else if (lat == "RLOU") {
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
setprop("modes/pfd/fma/roll-mode", " ");
|
||||
}
|
||||
} else if (lat == "T/O") {
|
||||
if (newlat != "RWY") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "RWY");
|
||||
setprop("modes/pfd/fma/roll-mode", "RWY");
|
||||
}
|
||||
} else if (lat == " ") {
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode", " ");
|
||||
setprop("modes/pfd/fma/roll-mode", " ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var locupdate = maketimer(0.5, func {
|
||||
var lat = getprop("/it-autoflight/mode/lat");
|
||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
var nav_defl = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm");
|
||||
var lat = getprop("it-autoflight/mode/lat");
|
||||
var newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
var nav_defl = getprop("instrumentation/nav[0]/heading-needle-deflection-norm");
|
||||
if (lat == "LOC") {
|
||||
if (nav_defl > -0.06 and nav_defl < 0.06) {
|
||||
locupdate.stop();
|
||||
if (newlat != "LOC") {
|
||||
setprop("/modes/pfd/fma/roll-mode", "LOC");
|
||||
setprop("modes/pfd/fma/roll-mode", "LOC");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -261,82 +261,82 @@ var locupdate = maketimer(0.5, func {
|
|||
|
||||
# Master Vertical
|
||||
setlistener("/it-autoflight/mode/vert", func {
|
||||
var vert = getprop("/it-autoflight/mode/vert");
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
var vert = getprop("it-autoflight/mode/vert");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
var newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
if (vert == "ALT HLD") {
|
||||
altvert();
|
||||
if (newvertarm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
}
|
||||
} else if (vert == "ALT CAP") {
|
||||
altvert();
|
||||
if (newvertarm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
}
|
||||
} else if (vert == "V/S") {
|
||||
if (newvert != "V/S") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "V/S");
|
||||
setprop("modes/pfd/fma/pitch-mode", "V/S");
|
||||
}
|
||||
if (newvertarm != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
}
|
||||
} else if (vert == "G/S") {
|
||||
if (newvert != "G/S*" and newvert != "G/S") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "G/S*");
|
||||
setprop("modes/pfd/fma/pitch-mode", "G/S*");
|
||||
gsupdate.start();
|
||||
}
|
||||
if (newvertarm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
}
|
||||
} else if (vert == "SPD CLB") {
|
||||
if (newvert != "OP CLB") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "OP CLB");
|
||||
setprop("modes/pfd/fma/pitch-mode", "OP CLB");
|
||||
}
|
||||
if (newvertarm != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
}
|
||||
} else if (vert == "SPD DES") {
|
||||
if (newvert != "OP DES") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "OP DES");
|
||||
setprop("modes/pfd/fma/pitch-mode", "OP DES");
|
||||
}
|
||||
if (newvertarm != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
}
|
||||
} else if (vert == "FPA") {
|
||||
if (newvert != "FPA") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "FPA");
|
||||
setprop("modes/pfd/fma/pitch-mode", "FPA");
|
||||
}
|
||||
if (newvertarm != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
}
|
||||
} else if (vert == "LAND") {
|
||||
if (newvert != "LAND") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "LAND");
|
||||
setprop("modes/pfd/fma/pitch-mode", "LAND");
|
||||
}
|
||||
} else if (vert == "FLARE") {
|
||||
if (newvert != "FLARE") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "FLARE");
|
||||
setprop("modes/pfd/fma/pitch-mode", "FLARE");
|
||||
}
|
||||
} else if (vert == "ROLLOUT") {
|
||||
if (newvert != "ROLL OUT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ROLL OUT");
|
||||
setprop("modes/pfd/fma/pitch-mode", "ROLL OUT");
|
||||
}
|
||||
} else if (vert == "T/O CLB") {
|
||||
if (newvert != "SRS") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "SRS");
|
||||
setprop("modes/pfd/fma/pitch-mode", "SRS");
|
||||
}
|
||||
updatePitchArm2();
|
||||
} else if (vert == "G/A CLB") {
|
||||
if (newvert != "SRS") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "SRS");
|
||||
setprop("modes/pfd/fma/pitch-mode", "SRS");
|
||||
}
|
||||
if (newvertarm != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "ALT");
|
||||
}
|
||||
} else if (vert == " ") {
|
||||
if (newvert != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode", " ");
|
||||
}
|
||||
updatePitchArm2();
|
||||
}
|
||||
|
@ -348,52 +348,52 @@ setlistener("/FMGC/internal/v2-set", func {
|
|||
});
|
||||
|
||||
var updatePitchArm2 = func {
|
||||
var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
if (newvertarm != "CLB" and getprop("/FMGC/internal/v2-set") == 1) {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB");
|
||||
} else if (newvertarm != " " and getprop("/FMGC/internal/v2-set") != 1) {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
var newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
if (newvertarm != "CLB" and getprop("FMGC/internal/v2-set") == 1) {
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", "CLB");
|
||||
} else if (newvertarm != " " and getprop("FMGC/internal/v2-set") != 1) {
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed", " ");
|
||||
}
|
||||
}
|
||||
|
||||
var gsupdate = maketimer(0.5, func {
|
||||
var vert = getprop("/it-autoflight/mode/vert");
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var gs_defl = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm");
|
||||
var vert = getprop("it-autoflight/mode/vert");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
var gs_defl = getprop("instrumentation/nav[0]/gs-needle-deflection-norm");
|
||||
if (vert == "G/S") {
|
||||
if (gs_defl > -0.06 and gs_defl < 0.06) {
|
||||
gsupdate.stop();
|
||||
if (newvert != "G/S") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "G/S");
|
||||
setprop("modes/pfd/fma/pitch-mode", "G/S");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var altvert = func {
|
||||
var FMGCalt = getprop("/FMGC/internal/cruise-ft");
|
||||
var MCPalt = getprop("/it-autoflight/internal/alt");
|
||||
var FMGCalt = getprop("FMGC/internal/cruise-ft");
|
||||
var MCPalt = getprop("it-autoflight/internal/alt");
|
||||
var ALTdif = abs(FMGCalt - MCPalt);
|
||||
var vert = getprop("/it-autoflight/mode/vert");
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var vert = getprop("it-autoflight/mode/vert");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
if (ALTdif <= 20) {
|
||||
if (vert == "ALT HLD") {
|
||||
if (newvert != "ALT CRZ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ALT CRZ");
|
||||
setprop("modes/pfd/fma/pitch-mode", "ALT CRZ");
|
||||
}
|
||||
} else if (vert == "ALT CAP") {
|
||||
if (newvert != "ALT CRZ*") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ALT CRZ*");
|
||||
setprop("modes/pfd/fma/pitch-mode", "ALT CRZ*");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (vert == "ALT HLD") {
|
||||
if (newvert != "ALT") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ALT");
|
||||
setprop("modes/pfd/fma/pitch-mode", "ALT");
|
||||
}
|
||||
} else if (vert == "ALT CAP") {
|
||||
if (newvert != "ALT*") {
|
||||
setprop("/modes/pfd/fma/pitch-mode", "ALT*");
|
||||
setprop("modes/pfd/fma/pitch-mode", "ALT*");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -403,123 +403,123 @@ setlistener("/FMGC/internal/cruise-ft", altvert);
|
|||
|
||||
# Arm HDG or NAV
|
||||
setlistener("/it-autoflight/mode/arm", func {
|
||||
var arm = getprop("/it-autoflight/mode/arm");
|
||||
var newarm = getprop("/modes/pfd/fma/roll-mode-armed");
|
||||
var arm = getprop("it-autoflight/mode/arm");
|
||||
var newarm = getprop("modes/pfd/fma/roll-mode-armed");
|
||||
if (arm == "HDG") {
|
||||
if (newarm != "HDG") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", " ");
|
||||
}
|
||||
} else if (arm == "LNV") {
|
||||
if (newarm != "NAV") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", "NAV");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", "NAV");
|
||||
}
|
||||
} else if (arm == " ") {
|
||||
if (newarm != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", " ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
# Arm LOC
|
||||
setlistener("/it-autoflight/output/loc-armed", func {
|
||||
var loca = getprop("/it-autoflight/output/loc-armed");
|
||||
var newarm = getprop("/modes/pfd/fma/roll-mode-armed");
|
||||
var loca = getprop("it-autoflight/output/loc-armed");
|
||||
var newarm = getprop("modes/pfd/fma/roll-mode-armed");
|
||||
if (loca) {
|
||||
if (newarm != "LOC") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", "LOC");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", "LOC");
|
||||
}
|
||||
} else {
|
||||
if (newarm != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/roll-mode-armed", " ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
# Arm G/S
|
||||
setlistener("/it-autoflight/output/appr-armed", func {
|
||||
var appa = getprop("/it-autoflight/output/appr-armed");
|
||||
var newvert2arm = getprop("/modes/pfd/fma/pitch-mode-armed");
|
||||
var appa = getprop("it-autoflight/output/appr-armed");
|
||||
var newvert2arm = getprop("modes/pfd/fma/pitch-mode-armed");
|
||||
if (appa) {
|
||||
if (newvert2arm != "G/S") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed", "G/S");
|
||||
setprop("modes/pfd/fma/pitch-mode-armed", "G/S");
|
||||
}
|
||||
} else {
|
||||
if (newvert2arm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed", " ");
|
||||
setprop("modes/pfd/fma/pitch-mode-armed", " ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
# AP
|
||||
var ap = func {
|
||||
var ap1 = getprop("/it-autoflight/output/ap1");
|
||||
var ap2 = getprop("/it-autoflight/output/ap2");
|
||||
var newap = getprop("/modes/pfd/fma/ap-mode");
|
||||
var ap1 = getprop("it-autoflight/output/ap1");
|
||||
var ap2 = getprop("it-autoflight/output/ap2");
|
||||
var newap = getprop("modes/pfd/fma/ap-mode");
|
||||
if (ap1 and ap2 and newap != "AP1+2") {
|
||||
setprop("/modes/pfd/fma/ap-mode", "AP 1+2");
|
||||
setprop("modes/pfd/fma/ap-mode", "AP 1+2");
|
||||
} else if (ap1 and !ap2 and newap != "AP 1") {
|
||||
setprop("/modes/pfd/fma/ap-mode", "AP 1");
|
||||
setprop("modes/pfd/fma/ap-mode", "AP 1");
|
||||
} else if (ap2 and !ap1 and newap != "AP 2") {
|
||||
setprop("/modes/pfd/fma/ap-mode", "AP 2");
|
||||
setprop("modes/pfd/fma/ap-mode", "AP 2");
|
||||
} else if (!ap1 and !ap2) {
|
||||
setprop("/modes/pfd/fma/ap-mode", " ");
|
||||
setprop("modes/pfd/fma/ap-mode", " ");
|
||||
}
|
||||
}
|
||||
|
||||
# FD
|
||||
var fd = func {
|
||||
var fd1 = getprop("/it-autoflight/output/fd1");
|
||||
var fd2 = getprop("/it-autoflight/output/fd2");
|
||||
var newfd = getprop("/modes/pfd/fma/fd-mode");
|
||||
var fd1 = getprop("it-autoflight/output/fd1");
|
||||
var fd2 = getprop("it-autoflight/output/fd2");
|
||||
var newfd = getprop("modes/pfd/fma/fd-mode");
|
||||
if (fd1 and fd2 and newfd != "1FD2") {
|
||||
setprop("/modes/pfd/fma/fd-mode", "1 FD 2");
|
||||
setprop("modes/pfd/fma/fd-mode", "1 FD 2");
|
||||
} else if (fd1 and !fd2 and newfd != "1 FD -") {
|
||||
setprop("/modes/pfd/fma/fd-mode", "1 FD -");
|
||||
setprop("modes/pfd/fma/fd-mode", "1 FD -");
|
||||
} else if (fd2 and !fd1 and newfd != "- FD 2") {
|
||||
setprop("/modes/pfd/fma/fd-mode", "- FD 2");
|
||||
setprop("modes/pfd/fma/fd-mode", "- FD 2");
|
||||
} else if (!fd1 and !fd2) {
|
||||
setprop("/modes/pfd/fma/fd-mode", " ");
|
||||
setprop("modes/pfd/fma/fd-mode", " ");
|
||||
}
|
||||
}
|
||||
|
||||
# AT
|
||||
var at = func {
|
||||
var at = getprop("/it-autoflight/output/athr");
|
||||
var newat = getprop("/modes/pfd/fma/at-mode");
|
||||
var at = getprop("it-autoflight/output/athr");
|
||||
var newat = getprop("modes/pfd/fma/at-mode");
|
||||
if (at and newat != "A/THR") {
|
||||
setprop("/modes/pfd/fma/at-mode", "A/THR");
|
||||
setprop("modes/pfd/fma/at-mode", "A/THR");
|
||||
} else if (!at) {
|
||||
setprop("/modes/pfd/fma/at-mode", " ");
|
||||
setprop("modes/pfd/fma/at-mode", " ");
|
||||
}
|
||||
}
|
||||
|
||||
var boxchk = func {
|
||||
if ((getprop("/it-autoflight/output/ap1") or getprop("/it-autoflight/output/ap2") or getprop("/it-autoflight/output/fd1") or getprop("/it-autoflight/output/fd2")) and getprop("/it-autoflight/output/fma-pwr") == 0) {
|
||||
setprop("/it-autoflight/input/lat", 3);
|
||||
if ((getprop("it-autoflight/output/ap1") or getprop("it-autoflight/output/ap2") or getprop("it-autoflight/output/fd1") or getprop("it-autoflight/output/fd2")) and getprop("it-autoflight/output/fma-pwr") == 0) {
|
||||
setprop("it-autoflight/input/lat", 3);
|
||||
boxchk_b();
|
||||
}
|
||||
}
|
||||
|
||||
var boxchk_b = func {
|
||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
var newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/roll-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
if (newvert != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
var newarmr = getprop("/modes/pfd/fma/roll-mode-armed");
|
||||
var newarmr = getprop("modes/pfd/fma/roll-mode-armed");
|
||||
if (newarmr != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/roll-mode-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
var newarmp = getprop("/modes/pfd/fma/pitch-mode-armed");
|
||||
var newarmp = getprop("modes/pfd/fma/pitch-mode-armed");
|
||||
if (newarmp != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
var newarmp2 = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
var newarmp2 = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
if (newarmp2 != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -546,74 +546,74 @@ setlistener("/it-autoflight/output/athr", func {
|
|||
|
||||
# Boxes
|
||||
setlistener("/modes/pfd/fma/ap-mode", func {
|
||||
if (getprop("/modes/pfd/fma/ap-mode") != " ") {
|
||||
setprop("/modes/pfd/fma/ap-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
if (getprop("modes/pfd/fma/ap-mode") != " ") {
|
||||
setprop("modes/pfd/fma/ap-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/fd-mode", func {
|
||||
if (getprop("/modes/pfd/fma/fd-mode") != " ") {
|
||||
setprop("/modes/pfd/fma/fd-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
if (getprop("modes/pfd/fma/fd-mode") != " ") {
|
||||
setprop("modes/pfd/fma/fd-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/at-mode", func {
|
||||
if (getprop("/modes/pfd/fma/at-mode") != " ") {
|
||||
setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("/modes/pfd/fma/athr-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
if (getprop("modes/pfd/fma/at-mode") != " ") {
|
||||
setprop("modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/athr-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/athr-armed", func {
|
||||
if (getprop("/modes/pfd/fma/at-mode") != " ") {
|
||||
setprop("/modes/pfd/fma/athr-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
if (getprop("modes/pfd/fma/at-mode") != " ") {
|
||||
setprop("modes/pfd/fma/athr-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/throttle-mode", func {
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and
|
||||
getprop("/systems/thrust/eng-out") != 1) {
|
||||
setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
} else if (getprop("/it-autoflight/output/athr") == 1 and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and getprop("/systems/thrust/eng-out") == 1) {
|
||||
if (getprop("/controls/engines/engine[0]/throttle-pos") < 0.83 and getprop("/controls/engines/engine[1]/throttle-pos") < 0.83) {
|
||||
setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
var state1 = getprop("systems/thrust/state1");
|
||||
var state2 = getprop("systems/thrust/state2");
|
||||
if (getprop("it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and
|
||||
getprop("systems/thrust/eng-out") != 1) {
|
||||
setprop("modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
} else if (getprop("it-autoflight/output/athr") == 1 and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and getprop("systems/thrust/eng-out") == 1) {
|
||||
if (getprop("controls/engines/engine[0]/throttle-pos") < 0.83 and getprop("controls/engines/engine[1]/throttle-pos") < 0.83) {
|
||||
setprop("modes/pfd/fma/throttle-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/roll-mode", func {
|
||||
var newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
var newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
if (newlat != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/roll-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/pitch-mode", func {
|
||||
var newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
var newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
if (newvert != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/roll-mode-armed", func {
|
||||
var newarm = getprop("/modes/pfd/fma/roll-mode-armed");
|
||||
var newarm = getprop("modes/pfd/fma/roll-mode-armed");
|
||||
if (newarm != " ") {
|
||||
setprop("/modes/pfd/fma/roll-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/roll-mode-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/pitch-mode-armed", func {
|
||||
var newarm = getprop("/modes/pfd/fma/pitch-mode-armed");
|
||||
var newarm = getprop("modes/pfd/fma/pitch-mode-armed");
|
||||
if (newarm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/modes/pfd/fma/pitch-mode2-armed", func {
|
||||
var newarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
var newarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
if (newarm != " ") {
|
||||
setprop("/modes/pfd/fma/pitch-mode2-armed-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("modes/pfd/fma/pitch-mode2-armed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -95,38 +95,38 @@ var newvert = 0;
|
|||
var newvertarm = 0;
|
||||
var thr1 = 0;
|
||||
var thr2 = 0;
|
||||
setprop("/FMGC/internal/maxspeed", 0);
|
||||
setprop("/FMGC/internal/minspeed", 0);
|
||||
setprop("/position/gear-agl-ft", 0);
|
||||
setprop("/FMGC/internal/mng-spd", 157);
|
||||
setprop("/FMGC/internal/mng-spd-cmd", 157);
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("/FMGC/internal/mach-switchover", 0);
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", 3000);
|
||||
setprop("/it-autoflight/internal/vert-speed-fpm", 0);
|
||||
setprop("/it-autoflight/output/fma-pwr", 0);
|
||||
setprop("/instrumentation/nav[0]/nav-id", "XXX");
|
||||
setprop("/instrumentation/nav[1]/nav-id", "XXX");
|
||||
setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99");
|
||||
setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99");
|
||||
setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99");
|
||||
setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX");
|
||||
setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99");
|
||||
setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX");
|
||||
setprop("/gear/gear[0]/wow-fmgc", 1);
|
||||
setprop("FMGC/internal/maxspeed", 0);
|
||||
setprop("FMGC/internal/minspeed", 0);
|
||||
setprop("position/gear-agl-ft", 0);
|
||||
setprop("FMGC/internal/mng-spd", 157);
|
||||
setprop("FMGC/internal/mng-spd-cmd", 157);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mach-switchover", 0);
|
||||
setprop("it-autoflight/settings/reduc-agl-ft", 3000);
|
||||
setprop("it-autoflight/internal/vert-speed-fpm", 0);
|
||||
setprop("it-autoflight/output/fma-pwr", 0);
|
||||
setprop("instrumentation/nav[0]/nav-id", "XXX");
|
||||
setprop("instrumentation/nav[1]/nav-id", "XXX");
|
||||
setprop("FMGC/internal/ils1-mcdu", "XXX/999.99");
|
||||
setprop("FMGC/internal/ils2-mcdu", "XXX/999.99");
|
||||
setprop("FMGC/internal/vor1-mcdu", "XXX/999.99");
|
||||
setprop("FMGC/internal/vor2-mcdu", "999.99/XXX");
|
||||
setprop("FMGC/internal/adf1-mcdu", "XXX/999.99");
|
||||
setprop("FMGC/internal/adf2-mcdu", "999.99/XXX");
|
||||
setprop("gear/gear[0]/wow-fmgc", 1);
|
||||
|
||||
var FMGCinit = func {
|
||||
setprop("/FMGC/status/to-state", 0);
|
||||
setprop("/FMGC/status/phase", "0"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
setprop("/FMGC/internal/maxspeed", 338);
|
||||
setprop("/FMGC/internal/mng-spd", 157);
|
||||
setprop("/FMGC/internal/mng-spd-cmd", 157);
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("/FMGC/internal/mach-switchover", 0);
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", 3000);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/loc-source", "NAV0");
|
||||
setprop("/FMGC/internal/optalt", 0);
|
||||
setprop("FMGC/status/to-state", 0);
|
||||
setprop("FMGC/status/phase", "0"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
setprop("FMGC/internal/maxspeed", 338);
|
||||
setprop("FMGC/internal/mng-spd", 157);
|
||||
setprop("FMGC/internal/mng-spd-cmd", 157);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mach-switchover", 0);
|
||||
setprop("it-autoflight/settings/reduc-agl-ft", 3000);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("FMGC/internal/loc-source", "NAV0");
|
||||
setprop("FMGC/internal/optalt", 0);
|
||||
masterFMGC.start();
|
||||
various.start();
|
||||
various2.start();
|
||||
|
@ -141,9 +141,9 @@ setlistener("/gear/gear[0]/wow-fmgc", func {
|
|||
});
|
||||
|
||||
var trimReset = func {
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
flaps = getprop("/controls/flight/flap-pos");
|
||||
if (gear0 == 1 and getprop("/FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
flaps = getprop("controls/flight/flap-pos");
|
||||
if (gear0 == 1 and getprop("FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
|
||||
interpolate("/controls/flight/elevator-trim", 0.0, 1.5);
|
||||
}
|
||||
}
|
||||
|
@ -153,81 +153,81 @@ var trimReset = func {
|
|||
############################
|
||||
|
||||
var masterFMGC = maketimer(0.2, func {
|
||||
n1_left = getprop("/engines/engine[0]/n1-actual");
|
||||
n1_right = getprop("/engines/engine[1]/n1-actual");
|
||||
flaps = getprop("/controls/flight/flap-pos");
|
||||
modelat = getprop("/modes/pfd/fma/roll-mode");
|
||||
mode = getprop("/modes/pfd/fma/pitch-mode");
|
||||
modeI = getprop("/it-autoflight/mode/vert");
|
||||
gs = getprop("/velocities/groundspeed-kt");
|
||||
alt = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
n1_left = getprop("engines/engine[0]/n1-actual");
|
||||
n1_right = getprop("engines/engine[1]/n1-actual");
|
||||
flaps = getprop("controls/flight/flap-pos");
|
||||
modelat = getprop("modes/pfd/fma/roll-mode");
|
||||
mode = getprop("modes/pfd/fma/pitch-mode");
|
||||
modeI = getprop("it-autoflight/mode/vert");
|
||||
gs = getprop("velocities/groundspeed-kt");
|
||||
alt = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
aglalt = pts.Position.gearAglFt.getValue();
|
||||
cruiseft = getprop("/FMGC/internal/cruise-ft");
|
||||
cruiseft_b = getprop("/FMGC/internal/cruise-ft") - 200;
|
||||
newcruise = getprop("/it-autoflight/internal/alt");
|
||||
phase = getprop("/FMGC/status/phase");
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
targetalt = getprop("/it-autoflight/internal/alt");
|
||||
targetvs = getprop("/it-autoflight/input/vs");
|
||||
targetfpa = getprop("/it-autoflight/input/fpa");
|
||||
reduc_agl_ft = getprop("/it-autoflight/settings/reduc-agl-ft");
|
||||
locarm = getprop("/it-autopilot/output/loc-armed");
|
||||
apprarm = getprop("/it-autopilot/output/appr-armed");
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
ap1 = getprop("/it-autoflight/output/ap1");
|
||||
ap2 = getprop("/it-autoflight/output/ap2");
|
||||
flx = getprop("/systems/thrust/lim-flex");
|
||||
lat = getprop("/it-autoflight/mode/lat");
|
||||
newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
vert = getprop("/it-autoflight/mode/vert");
|
||||
newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
cruiseft = getprop("FMGC/internal/cruise-ft");
|
||||
cruiseft_b = getprop("FMGC/internal/cruise-ft") - 200;
|
||||
newcruise = getprop("it-autoflight/internal/alt");
|
||||
phase = getprop("FMGC/status/phase");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
targetalt = getprop("it-autoflight/internal/alt");
|
||||
targetvs = getprop("it-autoflight/input/vs");
|
||||
targetfpa = getprop("it-autoflight/input/fpa");
|
||||
reduc_agl_ft = getprop("it-autoflight/settings/reduc-agl-ft");
|
||||
locarm = getprop("it-autopilot/output/loc-armed");
|
||||
apprarm = getprop("it-autopilot/output/appr-armed");
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
ap1 = getprop("it-autoflight/output/ap1");
|
||||
ap2 = getprop("it-autoflight/output/ap2");
|
||||
flx = getprop("systems/thrust/lim-flex");
|
||||
lat = getprop("it-autoflight/mode/lat");
|
||||
newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
vert = getprop("it-autoflight/mode/vert");
|
||||
newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
|
||||
if (getprop("/gear/gear[0]/wow") != getprop("/gear/gear[0]/wow-fmgc")) {
|
||||
setprop("/gear/gear[0]/wow-fmgc", getprop("/gear/gear[0]/wow"));
|
||||
if (getprop("gear/gear[0]/wow") != getprop("gear/gear[0]/wow-fmgc")) {
|
||||
setprop("gear/gear[0]/wow-fmgc", getprop("gear/gear[0]/wow"));
|
||||
}
|
||||
|
||||
if ((n1_left < 70 or n1_right < 70) and gs < 90 and mode == " " and gear0 == 1 and phase == 1) {
|
||||
setprop("/FMGC/status/phase", "0");
|
||||
setprop("/systems/pressurization/mode", "GN");
|
||||
setprop("FMGC/status/phase", "0");
|
||||
setprop("systems/pressurization/mode", "GN");
|
||||
}
|
||||
|
||||
if (gear0 == 1 and phase == 0 and ((n1_left >= 70 and n1_right >= 70) or gs >= 90) and (state1 == "TOGA" or state2 == "TOGA") or (flx == 1 and (state1 == "MCT" or state2 == "MCT")) or (flx == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or
|
||||
(state2 == "MAN THR" and thr2 >= 0.83)))) {
|
||||
setprop("/FMGC/status/phase", "1");
|
||||
setprop("/systems/pressurization/mode", "TO");
|
||||
setprop("FMGC/status/phase", "1");
|
||||
setprop("systems/pressurization/mode", "TO");
|
||||
}
|
||||
|
||||
if (phase == 1 and mode != "SRS" and mode != " ") {
|
||||
setprop("/FMGC/status/phase", "2");
|
||||
setprop("/systems/pressurization/mode", "TO");
|
||||
setprop("FMGC/status/phase", "2");
|
||||
setprop("systems/pressurization/mode", "TO");
|
||||
}
|
||||
|
||||
if ((phase == 3 or phase == 4 or phase == 5 or phase == 6) and (mode == "OP CLB" or mode == "CLB" or (modeI == "V/S" and getprop("/it-autoflight/input/vs") >= 100) or (modeI == "FPA" and getprop("/it-autoflight/input/fpa") >= 0.1))) {
|
||||
setprop("/FMGC/status/phase", "2");
|
||||
setprop("/systems/pressurization/mode", "TO");
|
||||
if ((phase == 3 or phase == 4 or phase == 5 or phase == 6) and (mode == "OP CLB" or mode == "CLB" or (modeI == "V/S" and getprop("it-autoflight/input/vs") >= 100) or (modeI == "FPA" and getprop("it-autoflight/input/fpa") >= 0.1))) {
|
||||
setprop("FMGC/status/phase", "2");
|
||||
setprop("systems/pressurization/mode", "TO");
|
||||
}
|
||||
|
||||
if ((phase == 2 or phase == 4 or phase == 5) and (mode == "ALT" or mode == "ALT CRZ" or mode == "ALT CST")) {
|
||||
setprop("/FMGC/status/phase", "3");
|
||||
setprop("/systems/pressurization/mode", "CR");
|
||||
setprop("FMGC/status/phase", "3");
|
||||
setprop("systems/pressurization/mode", "CR");
|
||||
}
|
||||
|
||||
if ((phase == 2 or phase == 3) and (mode == "OP DES" or mode == "DES" or (modeI == "V/S" and getprop("/it-autoflight/input/vs") <= -100) or (modeI == "FPA" and getprop("/it-autoflight/input/fpa") <= -0.1))) {
|
||||
setprop("/FMGC/status/phase", "4");
|
||||
setprop("/systems/pressurization/mode", "DE");
|
||||
if ((phase == 2 or phase == 3) and (mode == "OP DES" or mode == "DES" or (modeI == "V/S" and getprop("it-autoflight/input/vs") <= -100) or (modeI == "FPA" and getprop("it-autoflight/input/fpa") <= -0.1))) {
|
||||
setprop("FMGC/status/phase", "4");
|
||||
setprop("systems/pressurization/mode", "DE");
|
||||
}
|
||||
|
||||
if (getprop("/FMGC/status/to-state") == 0 and flaps >= 3 and (phase == "4" or mode == "G/S" or mode == "LAND" or mode == "FLARE")) {
|
||||
setprop("/FMGC/status/phase", "5");
|
||||
if (getprop("FMGC/status/to-state") == 0 and flaps >= 3 and (phase == "4" or mode == "G/S" or mode == "LAND" or mode == "FLARE")) {
|
||||
setprop("FMGC/status/phase", "5");
|
||||
}
|
||||
|
||||
if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15) {
|
||||
|
@ -237,98 +237,98 @@ var masterFMGC = maketimer(0.2, func {
|
|||
}
|
||||
|
||||
if (phase == "5" and state1 == "TOGA" and state2 == "TOGA") {
|
||||
setprop("/FMGC/status/phase", "6");
|
||||
setprop("/systems/pressurization/mode", "TO");
|
||||
setprop("/it-autoflight/input/toga", 1);
|
||||
setprop("FMGC/status/phase", "6");
|
||||
setprop("systems/pressurization/mode", "TO");
|
||||
setprop("it-autoflight/input/toga", 1);
|
||||
}
|
||||
|
||||
if (wowl and wowr and gs <= 40 and (phase == "2" or phase == "3" or phase == "4" or phase == "5" or phase == "6") and ap1 == 0 and ap2 == 0) {
|
||||
reset_FMGC();
|
||||
}
|
||||
|
||||
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
|
||||
setprop("/FMGC/internal/maxspeed", getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
|
||||
if (getprop("systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
|
||||
setprop("FMGC/internal/maxspeed", getprop("systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
|
||||
} elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) {
|
||||
setprop("/FMGC/internal/maxspeed", 284);
|
||||
setprop("FMGC/internal/maxspeed", 284);
|
||||
} else {
|
||||
setprop("/FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
|
||||
setprop("FMGC/internal/maxspeed", getprop("it-fbw/speeds/vmo-mmo"));
|
||||
}
|
||||
|
||||
flap = getprop("/controls/flight/flap-pos");
|
||||
flap = getprop("controls/flight/flap-pos");
|
||||
if (flap == 0) { # 0
|
||||
setprop("/FMGC/internal/minspeed", 202);
|
||||
setprop("FMGC/internal/minspeed", 202);
|
||||
} else if (flap == 1) { # 1
|
||||
setprop("/FMGC/internal/minspeed", 184);
|
||||
setprop("FMGC/internal/minspeed", 184);
|
||||
} else if (flap == 2) { # 1+F
|
||||
setprop("/FMGC/internal/minspeed", 171);
|
||||
setprop("FMGC/internal/minspeed", 171);
|
||||
} else if (flap == 3) { # 2
|
||||
setprop("/FMGC/internal/minspeed", 156);
|
||||
setprop("FMGC/internal/minspeed", 156);
|
||||
} else if (flap == 4) { # 3
|
||||
setprop("/FMGC/internal/minspeed", 147);
|
||||
setprop("FMGC/internal/minspeed", 147);
|
||||
} else if (flap == 5) { # FULL
|
||||
setprop("/FMGC/internal/minspeed", 131);
|
||||
setprop("FMGC/internal/minspeed", 131);
|
||||
}
|
||||
|
||||
if (gear0 == 1 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA") and flaps < 5) {
|
||||
setprop("/FMGC/status/to-state", 1);
|
||||
setprop("FMGC/status/to-state", 1);
|
||||
}
|
||||
if (pts.Position.gearAglFt.getValue() >= 55) {
|
||||
setprop("/FMGC/status/to-state", 0);
|
||||
setprop("FMGC/status/to-state", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var reset_FMGC = func {
|
||||
setprop("/FMGC/status/phase", "7");
|
||||
fd1 = getprop("/it-autoflight/input/fd1");
|
||||
fd2 = getprop("/it-autoflight/input/fd2");
|
||||
spd = getprop("/it-autoflight/input/spd-kts");
|
||||
hdg = getprop("/it-autoflight/input/hdg");
|
||||
alt = getprop("/it-autoflight/input/alt");
|
||||
setprop("FMGC/status/phase", "7");
|
||||
fd1 = getprop("it-autoflight/input/fd1");
|
||||
fd2 = getprop("it-autoflight/input/fd2");
|
||||
spd = getprop("it-autoflight/input/spd-kts");
|
||||
hdg = getprop("it-autoflight/input/hdg");
|
||||
alt = getprop("it-autoflight/input/alt");
|
||||
ITAF.init();
|
||||
FMGCinit();
|
||||
flightPlanController.reset();
|
||||
mcdu.MCDU_reset(0);
|
||||
mcdu.MCDU_reset(1);
|
||||
setprop("/it-autoflight/input/fd1", fd1);
|
||||
setprop("/it-autoflight/input/fd2", fd2);
|
||||
setprop("/it-autoflight/input/spd-kts", spd);
|
||||
setprop("/it-autoflight/input/hdg", hdg);
|
||||
setprop("/it-autoflight/input/alt", alt);
|
||||
setprop("/systems/pressurization/mode", "GN");
|
||||
setprop("/systems/pressurization/vs", "0");
|
||||
setprop("/systems/pressurization/targetvs", "0");
|
||||
setprop("/systems/pressurization/vs-norm", "0");
|
||||
setprop("/systems/pressurization/auto", 1);
|
||||
setprop("/systems/pressurization/deltap", "0");
|
||||
setprop("/systems/pressurization/outflowpos", "0");
|
||||
setprop("/systems/pressurization/deltap-norm", "0");
|
||||
setprop("/systems/pressurization/outflowpos-norm", "0");
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
setprop("/systems/pressurization/cabinalt", altitude);
|
||||
setprop("/systems/pressurization/targetalt", altitude);
|
||||
setprop("/systems/pressurization/diff-to-target", "0");
|
||||
setprop("/systems/pressurization/ditchingpb", 0);
|
||||
setprop("/systems/pressurization/targetvs", "0");
|
||||
setprop("/systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("/systems/ventilation/avionics/fan", 0);
|
||||
setprop("/systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("/systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("/systems/ventilation/lavatory/extractvalve", "0");
|
||||
setprop("/systems/pressurization/ambientpsi", "0");
|
||||
setprop("/systems/pressurization/cabinpsi", "0");
|
||||
setprop("it-autoflight/input/fd1", fd1);
|
||||
setprop("it-autoflight/input/fd2", fd2);
|
||||
setprop("it-autoflight/input/spd-kts", spd);
|
||||
setprop("it-autoflight/input/hdg", hdg);
|
||||
setprop("it-autoflight/input/alt", alt);
|
||||
setprop("systems/pressurization/mode", "GN");
|
||||
setprop("systems/pressurization/vs", "0");
|
||||
setprop("systems/pressurization/targetvs", "0");
|
||||
setprop("systems/pressurization/vs-norm", "0");
|
||||
setprop("systems/pressurization/auto", 1);
|
||||
setprop("systems/pressurization/deltap", "0");
|
||||
setprop("systems/pressurization/outflowpos", "0");
|
||||
setprop("systems/pressurization/deltap-norm", "0");
|
||||
setprop("systems/pressurization/outflowpos-norm", "0");
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
setprop("systems/pressurization/cabinalt", altitude);
|
||||
setprop("systems/pressurization/targetalt", altitude);
|
||||
setprop("systems/pressurization/diff-to-target", "0");
|
||||
setprop("systems/pressurization/ditchingpb", 0);
|
||||
setprop("systems/pressurization/targetvs", "0");
|
||||
setprop("systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("systems/ventilation/avionics/fan", 0);
|
||||
setprop("systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("systems/ventilation/lavatory/extractvalve", "0");
|
||||
setprop("systems/pressurization/ambientpsi", "0");
|
||||
setprop("systems/pressurization/cabinpsi", "0");
|
||||
}
|
||||
|
||||
var various = maketimer(1, func {
|
||||
if (getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") != 3) {
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
|
||||
} else if (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") == 3) {
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
|
||||
if (getprop("engines/engine[0]/state") == 3 and getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("it-autoflight/settings/reduc-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
|
||||
} else if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") == 3) {
|
||||
setprop("it-autoflight/settings/reduc-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
|
||||
} else {
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", getprop("/FMGC/internal/reduc-agl-ft"));
|
||||
setprop("it-autoflight/settings/reduc-agl-ft", getprop("FMGC/internal/reduc-agl-ft"));
|
||||
}
|
||||
|
||||
setprop("/FMGC/internal/gw", math.round(getprop("/fdm/jsbsim/inertia/weight-lbs"), 100));
|
||||
setprop("FMGC/internal/gw", math.round(getprop("fdm/jsbsim/inertia/weight-lbs"), 100));
|
||||
});
|
||||
|
||||
var various2 = maketimer(0.5, func {
|
||||
|
@ -341,79 +341,79 @@ var various2 = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var nav0 = func {
|
||||
var freqnav0uf = getprop("/instrumentation/nav[0]/frequencies/selected-mhz");
|
||||
var freqnav0uf = getprop("instrumentation/nav[0]/frequencies/selected-mhz");
|
||||
var freqnav0 = sprintf("%.2f", freqnav0uf);
|
||||
var namenav0 = getprop("/instrumentation/nav[0]/nav-id");
|
||||
var namenav0 = getprop("instrumentation/nav[0]/nav-id");
|
||||
if (freqnav0 >= 108.10 and freqnav0 <= 111.95) {
|
||||
if (namenav0 != "") {
|
||||
setprop("/FMGC/internal/ils1-mcdu", namenav0 ~ "/" ~ freqnav0);
|
||||
setprop("FMGC/internal/ils1-mcdu", namenav0 ~ "/" ~ freqnav0);
|
||||
} else {
|
||||
setprop("/FMGC/internal/ils1-mcdu", freqnav0);
|
||||
setprop("FMGC/internal/ils1-mcdu", freqnav0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var nav1 = func {
|
||||
var freqnav1uf = getprop("/instrumentation/nav[1]/frequencies/selected-mhz");
|
||||
var freqnav1uf = getprop("instrumentation/nav[1]/frequencies/selected-mhz");
|
||||
var freqnav1 = sprintf("%.2f", freqnav1uf);
|
||||
var namenav1 = getprop("/instrumentation/nav[1]/nav-id");
|
||||
var namenav1 = getprop("instrumentation/nav[1]/nav-id");
|
||||
if (freqnav1 >= 108.10 and freqnav1 <= 111.95) {
|
||||
if (namenav1 != "") {
|
||||
setprop("/FMGC/internal/ils2-mcdu", freqnav1 ~ "/" ~ namenav1);
|
||||
setprop("FMGC/internal/ils2-mcdu", freqnav1 ~ "/" ~ namenav1);
|
||||
} else {
|
||||
setprop("/FMGC/internal/ils2-mcdu", freqnav1);
|
||||
setprop("FMGC/internal/ils2-mcdu", freqnav1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var nav2 = func {
|
||||
var freqnav2uf = getprop("/instrumentation/nav[2]/frequencies/selected-mhz");
|
||||
var freqnav2uf = getprop("instrumentation/nav[2]/frequencies/selected-mhz");
|
||||
var freqnav2 = sprintf("%.2f", freqnav2uf);
|
||||
var namenav2 = getprop("/instrumentation/nav[2]/nav-id");
|
||||
var namenav2 = getprop("instrumentation/nav[2]/nav-id");
|
||||
if (freqnav2 >= 108.00 and freqnav2 <= 117.95) {
|
||||
if (namenav2 != "") {
|
||||
setprop("/FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2);
|
||||
setprop("FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2);
|
||||
} else {
|
||||
setprop("/FMGC/internal/vor1-mcdu", freqnav2);
|
||||
setprop("FMGC/internal/vor1-mcdu", freqnav2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var nav3 = func {
|
||||
var freqnav3uf = getprop("/instrumentation/nav[3]/frequencies/selected-mhz");
|
||||
var freqnav3uf = getprop("instrumentation/nav[3]/frequencies/selected-mhz");
|
||||
var freqnav3 = sprintf("%.2f", freqnav3uf);
|
||||
var namenav3 = getprop("/instrumentation/nav[3]/nav-id");
|
||||
var namenav3 = getprop("instrumentation/nav[3]/nav-id");
|
||||
if (freqnav3 >= 108.00 and freqnav3 <= 117.95) {
|
||||
if (namenav3 != "") {
|
||||
setprop("/FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3);
|
||||
setprop("FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3);
|
||||
} else {
|
||||
setprop("/FMGC/internal/vor2-mcdu", freqnav3);
|
||||
setprop("FMGC/internal/vor2-mcdu", freqnav3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var adf0 = func {
|
||||
var freqadf0uf = getprop("/instrumentation/adf[0]/frequencies/selected-khz");
|
||||
var freqadf0uf = getprop("instrumentation/adf[0]/frequencies/selected-khz");
|
||||
var freqadf0 = sprintf("%.2f", freqadf0uf);
|
||||
var nameadf0 = getprop("/instrumentation/adf[0]/ident");
|
||||
var nameadf0 = getprop("instrumentation/adf[0]/ident");
|
||||
if (freqadf0 >= 190 and freqadf0 <= 1750) {
|
||||
if (nameadf0 != "") {
|
||||
setprop("/FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0);
|
||||
setprop("FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0);
|
||||
} else {
|
||||
setprop("/FMGC/internal/adf1-mcdu", freqadf0);
|
||||
setprop("FMGC/internal/adf1-mcdu", freqadf0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var adf1 = func {
|
||||
var freqadf1uf = getprop("/instrumentation/adf[1]/frequencies/selected-khz");
|
||||
var freqadf1uf = getprop("instrumentation/adf[1]/frequencies/selected-khz");
|
||||
var freqadf1 = sprintf("%.2f", freqadf1uf);
|
||||
var nameadf1 = getprop("/instrumentation/adf[1]/ident");
|
||||
var nameadf1 = getprop("instrumentation/adf[1]/ident");
|
||||
if (freqadf1 >= 190 and freqadf1 <= 1750) {
|
||||
if (nameadf1 != "") {
|
||||
setprop("/FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1);
|
||||
setprop("FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1);
|
||||
} else {
|
||||
setprop("/FMGC/internal/adf2-mcdu", freqadf1);
|
||||
setprop("FMGC/internal/adf2-mcdu", freqadf1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -423,124 +423,124 @@ var adf1 = func {
|
|||
#################
|
||||
|
||||
var ManagedSPD = maketimer(0.25, func {
|
||||
if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) {
|
||||
if (getprop("/it-autoflight/input/spd-managed") == 1) {
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
mode = getprop("/modes/pfd/fma/pitch-mode");
|
||||
ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
mach = getprop("/instrumentation/airspeed-indicator/indicated-mach");
|
||||
ktsmach = getprop("/it-autoflight/input/kts-mach");
|
||||
mngktsmach = getprop("/FMGC/internal/mng-kts-mach");
|
||||
mng_spd = getprop("/FMGC/internal/mng-spd");
|
||||
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
|
||||
kts_sel = getprop("/it-autoflight/input/spd-kts");
|
||||
mach_sel = getprop("/it-autoflight/input/spd-mach");
|
||||
srsSPD = getprop("/it-autoflight/settings/togaspd");
|
||||
phase = getprop("/FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
flap = getprop("/controls/flight/flap-pos");
|
||||
maxspeed = getprop("/FMGC/internal/maxspeed");
|
||||
minspeed = getprop("/FMGC/internal/minspeed");
|
||||
mach_switchover = getprop("/FMGC/internal/mach-switchover");
|
||||
decel = getprop("/FMGC/internal/decel");
|
||||
if (getprop("FMGC/internal/cruise-lvl-set") == 1 and getprop("FMGC/internal/cost-index-set") == 1) {
|
||||
if (getprop("it-autoflight/input/spd-managed") == 1) {
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
mode = getprop("modes/pfd/fma/pitch-mode");
|
||||
ias = getprop("instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
mach = getprop("instrumentation/airspeed-indicator/indicated-mach");
|
||||
ktsmach = getprop("it-autoflight/input/kts-mach");
|
||||
mngktsmach = getprop("FMGC/internal/mng-kts-mach");
|
||||
mng_spd = getprop("FMGC/internal/mng-spd");
|
||||
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
|
||||
kts_sel = getprop("it-autoflight/input/spd-kts");
|
||||
mach_sel = getprop("it-autoflight/input/spd-mach");
|
||||
srsSPD = getprop("it-autoflight/settings/togaspd");
|
||||
phase = getprop("FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
flap = getprop("controls/flight/flap-pos");
|
||||
maxspeed = getprop("FMGC/internal/maxspeed");
|
||||
minspeed = getprop("FMGC/internal/minspeed");
|
||||
mach_switchover = getprop("FMGC/internal/mach-switchover");
|
||||
decel = getprop("FMGC/internal/decel");
|
||||
|
||||
mng_alt_spd_cmd = getprop("/FMGC/internal/mng-alt-spd");
|
||||
mng_alt_spd_cmd = getprop("FMGC/internal/mng-alt-spd");
|
||||
mng_alt_spd = math.round(mng_alt_spd_cmd, 1);
|
||||
|
||||
mng_alt_mach_cmd = getprop("/FMGC/internal/mng-alt-mach");
|
||||
mng_alt_mach_cmd = getprop("FMGC/internal/mng-alt-mach");
|
||||
mng_alt_mach = math.round(mng_alt_mach_cmd, 0.001);
|
||||
|
||||
if (mach > mng_alt_mach and (phase == 2 or phase == 3)) {
|
||||
setprop("/FMGC/internal/mach-switchover", 1);
|
||||
setprop("FMGC/internal/mach-switchover", 1);
|
||||
}
|
||||
|
||||
if (ias > mng_alt_spd and (phase == 4 or phase == 5)) {
|
||||
setprop("/FMGC/internal/mach-switchover", 0);
|
||||
setprop("FMGC/internal/mach-switchover", 0);
|
||||
}
|
||||
|
||||
if ((mode == " " or mode == "SRS") and (phase == 0 or phase == 1)) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != srsSPD) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", srsSPD);
|
||||
setprop("FMGC/internal/mng-spd-cmd", srsSPD);
|
||||
}
|
||||
} else if ((phase == 2 or phase == 3) and altitude <= 10050) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != 250 and !decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", 250);
|
||||
setprop("FMGC/internal/mng-spd-cmd", 250);
|
||||
} else if (mng_spd_cmd != minspeed and decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", minspeed);
|
||||
setprop("FMGC/internal/mng-spd-cmd", minspeed);
|
||||
}
|
||||
} else if ((phase == 2 or phase == 3) and altitude > 10070 and !mach_switchover) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != mng_alt_spd) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
setprop("FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
}
|
||||
} else if ((phase == 2 or phase == 3) and altitude > 10070 and mach_switchover) {
|
||||
if (!mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 1);
|
||||
setprop("FMGC/internal/mng-kts-mach", 1);
|
||||
}
|
||||
if (mng_spd_cmd != mng_alt_mach) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_mach);
|
||||
setprop("FMGC/internal/mng-spd-cmd", mng_alt_mach);
|
||||
}
|
||||
} else if (phase == 4 and altitude > 11000 and !mach_switchover) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != mng_alt_spd) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
setprop("FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
}
|
||||
} else if (phase == 4 and altitude > 11000 and mach_switchover) {
|
||||
if (!mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 1);
|
||||
setprop("FMGC/internal/mng-kts-mach", 1);
|
||||
}
|
||||
if (mng_spd_cmd != mng_alt_mach) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_mach);
|
||||
setprop("FMGC/internal/mng-spd-cmd", mng_alt_mach);
|
||||
}
|
||||
} else if ((phase == 4 or phase == 5 or phase == 6) and altitude > 11000 and !mach_switchover) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != mng_alt_spd and !decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
setprop("FMGC/internal/mng-spd-cmd", mng_alt_spd);
|
||||
} else if (mng_spd_cmd != minspeed and decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", minspeed);
|
||||
setprop("FMGC/internal/mng-spd-cmd", minspeed);
|
||||
}
|
||||
} else if ((phase == 4 or phase == 5 or phase == 6) and altitude <= 10980) {
|
||||
if (mngktsmach) {
|
||||
setprop("/FMGC/internal/mng-kts-mach", 0);
|
||||
setprop("FMGC/internal/mng-kts-mach", 0);
|
||||
}
|
||||
if (mng_spd_cmd != 250 and !decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", 250);
|
||||
setprop("FMGC/internal/mng-spd-cmd", 250);
|
||||
} else if (mng_spd_cmd != minspeed and decel) {
|
||||
setprop("/FMGC/internal/mng-spd-cmd", minspeed);
|
||||
setprop("FMGC/internal/mng-spd-cmd", minspeed);
|
||||
}
|
||||
}
|
||||
|
||||
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
|
||||
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
|
||||
|
||||
if (mng_spd_cmd > maxspeed -5) {
|
||||
setprop("/FMGC/internal/mng-spd", maxspeed -5);
|
||||
setprop("FMGC/internal/mng-spd", maxspeed -5);
|
||||
} else {
|
||||
setprop("/FMGC/internal/mng-spd", mng_spd_cmd);
|
||||
setprop("FMGC/internal/mng-spd", mng_spd_cmd);
|
||||
}
|
||||
|
||||
if (ktsmach and !mngktsmach) {
|
||||
setprop("/it-autoflight/input/kts-mach", 0);
|
||||
setprop("it-autoflight/input/kts-mach", 0);
|
||||
} else if (!ktsmach and mngktsmach) {
|
||||
setprop("/it-autoflight/input/kts-mach", 1);
|
||||
setprop("it-autoflight/input/kts-mach", 1);
|
||||
}
|
||||
|
||||
mng_spd = getprop("/FMGC/internal/mng-spd");
|
||||
mng_spd = getprop("FMGC/internal/mng-spd");
|
||||
|
||||
if (kts_sel != mng_spd and !ktsmach) {
|
||||
setprop("/it-autoflight/input/spd-kts", mng_spd);
|
||||
setprop("it-autoflight/input/spd-kts", mng_spd);
|
||||
} else if (mach_sel != mng_spd and ktsmach) {
|
||||
setprop("/it-autoflight/input/spd-mach", mng_spd);
|
||||
setprop("it-autoflight/input/spd-mach", mng_spd);
|
||||
}
|
||||
} else {
|
||||
ManagedSPD.stop();
|
||||
|
@ -552,12 +552,12 @@ var ManagedSPD = maketimer(0.25, func {
|
|||
});
|
||||
|
||||
var switchDatabase = func {
|
||||
database1 = getprop("/FMGC/internal/navdatabase");
|
||||
database2 = getprop("/FMGC/internal/navdatabase2");
|
||||
code1 = getprop("/FMGC/internal/navdatabasecode");
|
||||
code2 = getprop("/FMGC/internal/navdatabasecode2");
|
||||
setprop("/FMGC/internal/navdatabase", database2);
|
||||
setprop("/FMGC/internal/navdatabase2", database1);
|
||||
setprop("/FMGC/internal/navdatabasecode", code2);
|
||||
setprop("/FMGC/internal/navdatabasecode2", code1);
|
||||
database1 = getprop("FMGC/internal/navdatabase");
|
||||
database2 = getprop("FMGC/internal/navdatabase2");
|
||||
code1 = getprop("FMGC/internal/navdatabasecode");
|
||||
code2 = getprop("FMGC/internal/navdatabasecode2");
|
||||
setprop("FMGC/internal/navdatabase", database2);
|
||||
setprop("FMGC/internal/navdatabase2", database1);
|
||||
setprop("FMGC/internal/navdatabasecode", code2);
|
||||
setprop("FMGC/internal/navdatabasecode2", code1);
|
||||
}
|
|
@ -4,66 +4,66 @@
|
|||
|
||||
var dataInput = func(key, i) {
|
||||
if (key == "L1") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "POSMON");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "POSMON");
|
||||
}
|
||||
if (key == "L2") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "IRSMON");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "IRSMON");
|
||||
}
|
||||
if (key == "R5") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
||||
}
|
||||
}
|
||||
|
||||
var printInput = func(key, i) {
|
||||
if (key == "L1") {
|
||||
setprop("/FMGC/print/mcdu/page1/L1auto", 1);
|
||||
setprop("FMGC/print/mcdu/page1/L1auto", 1);
|
||||
}
|
||||
if (key == "L2") {
|
||||
setprop("/FMGC/print/mcdu/page1/L2auto", 1);
|
||||
setprop("FMGC/print/mcdu/page1/L2auto", 1);
|
||||
}
|
||||
if (key == "L3") {
|
||||
setprop("/FMGC/print/mcdu/page1/L3auto", 1);
|
||||
setprop("FMGC/print/mcdu/page1/L3auto", 1);
|
||||
}
|
||||
if (key == "L5") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DATA");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||
}
|
||||
if (key == "R1") {
|
||||
setprop("/FMGC/print/mcdu/page1/R1req", 1);
|
||||
setprop("FMGC/print/mcdu/page1/R1req", 1);
|
||||
}
|
||||
if (key == "R2") {
|
||||
setprop("/FMGC/print/mcdu/page1/R2req", 1);
|
||||
setprop("FMGC/print/mcdu/page1/R2req", 1);
|
||||
}
|
||||
if (key == "R3") {
|
||||
setprop("/FMGC/print/mcdu/page1/R3req", 1);
|
||||
setprop("FMGC/print/mcdu/page1/R3req", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var printInput2 = func(key, i) {
|
||||
if (key == "L1") {
|
||||
setprop("/FMGC/print/mcdu/page2/L1auto", 1);
|
||||
setprop("FMGC/print/mcdu/page2/L1auto", 1);
|
||||
}
|
||||
if (key == "L2") {
|
||||
setprop("/FMGC/print/mcdu/page2/L2auto", 1);
|
||||
setprop("FMGC/print/mcdu/page2/L2auto", 1);
|
||||
}
|
||||
if (key == "L3") {
|
||||
setprop("/FMGC/print/mcdu/page2/L3auto", 1);
|
||||
setprop("FMGC/print/mcdu/page2/L3auto", 1);
|
||||
}
|
||||
if (key == "L4") {
|
||||
setprop("/FMGC/print/mcdu/page2/L4auto", 1);
|
||||
setprop("FMGC/print/mcdu/page2/L4auto", 1);
|
||||
}
|
||||
if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DATA");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||
}
|
||||
if (key == "R1") {
|
||||
setprop("/FMGC/print/mcdu/page2/R1req", 1);
|
||||
setprop("FMGC/print/mcdu/page2/R1req", 1);
|
||||
}
|
||||
if (key == "R2") {
|
||||
setprop("/FMGC/print/mcdu/page2/R2req", 1);
|
||||
setprop("FMGC/print/mcdu/page2/R2req", 1);
|
||||
}
|
||||
if (key == "R3") {
|
||||
setprop("/FMGC/print/mcdu/page2/R3req", 1);
|
||||
setprop("FMGC/print/mcdu/page2/R3req", 1);
|
||||
}
|
||||
if (key == "R4") {
|
||||
setprop("/FMGC/print/mcdu/page2/R4req", 1);
|
||||
setprop("FMGC/print/mcdu/page2/R4req", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,29 +3,29 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var initInputA = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/MCDUC/flight-num", "");
|
||||
setprop("/MCDUC/flight-num-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var flts = size(scratchpad);
|
||||
if (flts >= 1 and flts <= 8) {
|
||||
setprop("/MCDUC/flight-num", scratchpad);
|
||||
setprop("/MCDUC/flight-num-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDUC/flight-num", scratchpad);
|
||||
setprop("MCDUC/flight-num-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -33,9 +33,9 @@ var initInputA = func(key, i) {
|
|||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -45,11 +45,11 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
} else if (key == "L6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/FMGC/internal/cruise-fl", 100);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("FMGC/internal/cruise-fl", 100);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var crz = int(scratchpad);
|
||||
var crzs = size(scratchpad);
|
||||
|
@ -57,10 +57,10 @@ var initInputA = func(key, i) {
|
|||
if (crz == nil) {
|
||||
notAllowed(i);
|
||||
} else if (crz > 0 and crz <= 430) {
|
||||
setprop("/FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("/FMGC/internal/cruise-fl", crz);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("FMGC/internal/cruise-fl", crz);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -97,21 +97,21 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
#if (getprop("/controls/adirs/mcducbtn") == 0) {
|
||||
# setprop("/controls/adirs/mcducbtn", 1);
|
||||
#if (getprop("controls/adirs/mcducbtn") == 0) {
|
||||
# setprop("controls/adirs/mcducbtn", 1);
|
||||
#}
|
||||
} else if (key == "R6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/tropo", 36090);
|
||||
setprop("/FMGC/internal/tropo-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tropo = size(scratchpad);
|
||||
if (tropo == 5) {
|
||||
setprop("/FMGC/internal/tropo-set", 1);
|
||||
setprop("/FMGC/internal/tropo", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/tropo-set", 1);
|
||||
setprop("FMGC/internal/tropo", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
|
|
@ -3,38 +3,38 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var initInputB = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
var zfw = getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = size(zfwi[0]);
|
||||
var zfw = size(zfwi[1]);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) {
|
||||
setprop("/FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
}
|
||||
if (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9) {
|
||||
setprop("/FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
}
|
||||
if ((zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) or (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9)) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("/FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -44,20 +44,20 @@ var initInputB = func(key, i) {
|
|||
}
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/block", 0.0);
|
||||
setprop("/FMGC/internal/block-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
setprop("FMGC/internal/block-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
var maxblock = getprop("/options/maxblock");
|
||||
var maxblock = getprop("options/maxblock");
|
||||
if (tfs == 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", sprintf("%3.1f", math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", sprintf("%3.1f", math.round(getprop("consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
if (scratchpad >= 1.0 and scratchpad <= maxblock) {
|
||||
setprop("/FMGC/internal/block", scratchpad);
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/block", scratchpad);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
|
|
@ -7,93 +7,93 @@ var MCDU_init = func(i) {
|
|||
}
|
||||
|
||||
var MCDU_reset = func(i) {
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 0);
|
||||
setprop("/it-autoflight/settings/togaspd", 157);
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/last-page", "NONE");
|
||||
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDUC/flight-num", "");
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/MCDUC/reducacc-set", 0);
|
||||
setprop("/MCDUC/flight-num-set", 0);
|
||||
setprop("/FMGC/internal/flex", 0);
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
setprop("/FMGC/internal/arr-arpt", "");
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/FMGC/internal/cruise-fl", 100);
|
||||
setprop("/FMGC/internal/cost-index", "0");
|
||||
setprop("/FMGC/internal/trans-alt", 18000);
|
||||
setprop("/FMGC/internal/reduc-agl-ft", "3000");
|
||||
setprop("/FMGC/internal/eng-out-reduc", "3500");
|
||||
setprop("/FMGC/internal/v1", 0);
|
||||
setprop("/FMGC/internal/vr", 0);
|
||||
setprop("/FMGC/internal/v2", 0);
|
||||
setprop("/FMGC/internal/block", 0.0);
|
||||
setprop("/FMGC/internal/zfw", 0);
|
||||
setprop("/FMGC/internal/zfwcg", 55.1); # 25KG default
|
||||
setprop("/FMGC/internal/v1-set", 0);
|
||||
setprop("/FMGC/internal/vr-set", 0);
|
||||
setprop("/FMGC/internal/v2-set", 0);
|
||||
setprop("/FMGC/internal/block-set", 0);
|
||||
setprop("/FMGC/internal/zfw-set", 0);
|
||||
setprop("/FMGC/internal/zfwcg-set", 0);
|
||||
setprop("/FMGC/internal/to-flap", 0);
|
||||
setprop("/FMGC/internal/to-ths", "0.0");
|
||||
setprop("/FMGC/internal/tofrom-set", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("/FMGC/internal/flap-ths-set", 0);
|
||||
setprop("/FMGC/internal/flex-set", 0);
|
||||
setprop("/FMGC/internal/ils1freq-set", 0);
|
||||
setprop("/FMGC/internal/ils1crs-set", 0);
|
||||
setprop("/FMGC/internal/vor1freq-set", 0);
|
||||
setprop("/FMGC/internal/vor1crs-set", 0);
|
||||
setprop("/FMGC/internal/vor2freq-set", 0);
|
||||
setprop("/FMGC/internal/vor2crs-set", 0);
|
||||
setprop("/FMGC/internal/adf1freq-set", 0);
|
||||
setprop("/FMGC/internal/adf2freq-set", 0);
|
||||
setprop("/FMGC/internal/navdatabase", "01JAN-28JAN");
|
||||
setprop("/FMGC/internal/navdatabase2", "29JAN-26FEB");
|
||||
setprop("/FMGC/internal/navdatabasecode", "AB20170101");
|
||||
setprop("/FMGC/internal/navdatabasecode2", "AB20170102");
|
||||
setprop("/FMGC/print/mcdu/page1/L1auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page1/L2auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page1/L3auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page1/R1req", 0);
|
||||
setprop("/FMGC/print/mcdu/page1/R2req", 0);
|
||||
setprop("/FMGC/print/mcdu/page1/R3req", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/L1auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/L2auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/L3auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/L4auto", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/R1req", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/R2req", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/R3req", 0);
|
||||
setprop("/FMGC/print/mcdu/page2/R4req", 0);
|
||||
setprop("/FMGC/internal/tropo", 36090);
|
||||
setprop("/FMGC/internal/tropo-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/active", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157);
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/last-page", "NONE");
|
||||
setprop("MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("FMGC/internal/flex", 0);
|
||||
setprop("FMGC/internal/dep-arpt", "");
|
||||
setprop("FMGC/internal/arr-arpt", "");
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("FMGC/internal/cruise-fl", 100);
|
||||
setprop("FMGC/internal/cost-index", "0");
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("FMGC/internal/reduc-agl-ft", "3000");
|
||||
setprop("FMGC/internal/eng-out-reduc", "3500");
|
||||
setprop("FMGC/internal/v1", 0);
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/v2", 0);
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
setprop("FMGC/internal/zfw", 0);
|
||||
setprop("FMGC/internal/zfwcg", 55.1); # 25KG default
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("FMGC/internal/vr-set", 0);
|
||||
setprop("FMGC/internal/v2-set", 0);
|
||||
setprop("FMGC/internal/block-set", 0);
|
||||
setprop("FMGC/internal/zfw-set", 0);
|
||||
setprop("FMGC/internal/zfwcg-set", 0);
|
||||
setprop("FMGC/internal/to-flap", 0);
|
||||
setprop("FMGC/internal/to-ths", "0.0");
|
||||
setprop("FMGC/internal/tofrom-set", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("FMGC/internal/flap-ths-set", 0);
|
||||
setprop("FMGC/internal/flex-set", 0);
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
setprop("FMGC/internal/ils1crs-set", 0);
|
||||
setprop("FMGC/internal/vor1freq-set", 0);
|
||||
setprop("FMGC/internal/vor1crs-set", 0);
|
||||
setprop("FMGC/internal/vor2freq-set", 0);
|
||||
setprop("FMGC/internal/vor2crs-set", 0);
|
||||
setprop("FMGC/internal/adf1freq-set", 0);
|
||||
setprop("FMGC/internal/adf2freq-set", 0);
|
||||
setprop("FMGC/internal/navdatabase", "01JAN-28JAN");
|
||||
setprop("FMGC/internal/navdatabase2", "29JAN-26FEB");
|
||||
setprop("FMGC/internal/navdatabasecode", "AB20170101");
|
||||
setprop("FMGC/internal/navdatabasecode2", "AB20170102");
|
||||
setprop("FMGC/print/mcdu/page1/L1auto", 0);
|
||||
setprop("FMGC/print/mcdu/page1/L2auto", 0);
|
||||
setprop("FMGC/print/mcdu/page1/L3auto", 0);
|
||||
setprop("FMGC/print/mcdu/page1/R1req", 0);
|
||||
setprop("FMGC/print/mcdu/page1/R2req", 0);
|
||||
setprop("FMGC/print/mcdu/page1/R3req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/L1auto", 0);
|
||||
setprop("FMGC/print/mcdu/page2/L2auto", 0);
|
||||
setprop("FMGC/print/mcdu/page2/L3auto", 0);
|
||||
setprop("FMGC/print/mcdu/page2/L4auto", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R1req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R2req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R3req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R4req", 0);
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
}
|
||||
|
||||
var lskbutton = func(btn, i) {
|
||||
if (btn == "1") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/active") != 2) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 1);
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/active") != 2) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
|
||||
setprop("MCDU[" ~ i ~ "]/active", 1);
|
||||
settimer(func(){
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/active", 2);
|
||||
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/active", 2);
|
||||
}, 2);
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-fmgc-page"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
perfTOInput("L1", i);
|
||||
|
@ -341,11 +341,11 @@ var rskbutton = func(btn, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "6") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/last-page") != "NONE") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "MCDU") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/last-page") != "NONE") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-page"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ var rskbutton = func(btn, i) {
|
|||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
|
@ -440,28 +440,28 @@ var arrowbutton = func(btn, i) {
|
|||
}
|
||||
|
||||
var pagebutton = func(btn, i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
if (btn == "radnav") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "RADNAV");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "RADNAV");
|
||||
} else if (btn == "perf") {
|
||||
if (getprop("/FMGC/status/phase") == 0 or getprop("/FMGC/status/phase") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "TO");
|
||||
} else if (getprop("/FMGC/status/phase") == 2) {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CLB");
|
||||
} else if (getprop("/FMGC/status/phase") == 3) {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
} else if (getprop("/FMGC/status/phase") == 4) {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DES");
|
||||
if (getprop("FMGC/status/phase") == 0 or getprop("FMGC/status/phase") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "TO");
|
||||
} else if (getprop("FMGC/status/phase") == 2) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CLB");
|
||||
} else if (getprop("FMGC/status/phase") == 3) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
} else if (getprop("FMGC/status/phase") == 4) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DES");
|
||||
}
|
||||
} else if (btn == "init") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "INITA");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
} else if (btn == "data") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DATA");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||
} else if (btn == "mcdu") {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-page", getprop("/MCDU[" ~ i ~ "]/page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page"));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
setprop("MCDU[" ~ i ~ "]/last-page", getprop("MCDU[" ~ i ~ "]/page"));
|
||||
setprop("MCDU[" ~ i ~ "]/last-fmgc-page", getprop("MCDU[" ~ i ~ "]/page"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
} else if (btn == "f-pln") {
|
||||
if (fmgc.flightPlanController.active.getBoolValue()) {
|
||||
if (canvas_mcdu.myFpln[i] == nil) {
|
||||
|
@ -473,173 +473,173 @@ var pagebutton = func(btn, i) {
|
|||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
|
||||
}
|
||||
} else if (btn == "fuel-pred") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var button = func(btn, i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 0 and getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 0 and getprop("MCDU[" ~ i ~ "]/page") != "MCDU") {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (btn == "A") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "A");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "A");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "B") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "B");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "B");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "C") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "C");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "C");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "D") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "D");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "D");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "E") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "E");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "E");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "F") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "F");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "F");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "G") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "G");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "G");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "H") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "H");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "H");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "I") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "I");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "I");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "J") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "J");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "J");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "K") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "K");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "K");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "L") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "L");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "L");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "M") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "M");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "M");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "N") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "N");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "N");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "O") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "O");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "O");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "P") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "P");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "P");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "Q") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Q");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Q");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "R") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "R");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "R");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "S") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "S");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "S");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "T") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "T");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "T");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "U") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "U");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "U");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "V") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "V");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "V");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "W") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "W");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "W");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "X") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "X");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "X");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "Y") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Y");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Y");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "Z") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Z");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Z");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "SLASH") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "/");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "/");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "SP") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ " ");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ " ");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "CLR") {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (size(scratchpad) > 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", left(scratchpad, size(scratchpad) - 1));
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", left(scratchpad, size(scratchpad) - 1));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
} else if (btn == "0") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "0");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "0");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "1") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "1");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "1");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "2") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "2");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "2");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "3") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "3");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "3");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "4") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "4");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "4");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "5") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "5");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "5");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "6");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "6");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "7") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "7");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "7");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "8") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "8");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "8");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "9") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "9");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "9");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "DOT") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ ".");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ ".");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
} else if (btn == "PLUSMINUS") {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "-");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "-");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
} else {
|
||||
if (btn == "CLR") {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", getprop("/MCDU[" ~ i ~ "]/last-scratchpad"));
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "CLR");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", getprop("MCDU[" ~ i ~ "]/last-scratchpad"));
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var notAllowed = func(i) {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad") != "NOT ALLOWED") {
|
||||
if (getprop("/MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "NOT ALLOWED") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ i ~ "]/last-scratchpad", getprop("/MCDU[" ~ i ~ "]/scratchpad"));
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
|
||||
var formatError = func(i) {
|
||||
|
@ -655,9 +655,9 @@ var formatError = func(i) {
|
|||
}
|
||||
|
||||
var screenFlash = func(time, i) {
|
||||
var page = getprop("/MCDU[" ~ i ~ "]/page");
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "NONE");
|
||||
var page = getprop("MCDU[" ~ i ~ "]/page");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "NONE");
|
||||
settimer(func {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", page);
|
||||
setprop("MCDU[" ~ i ~ "]/page", page);
|
||||
}, time);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var perfCLBInput = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
|
@ -17,9 +17,9 @@ var perfCLBInput = func(key, i) {
|
|||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ var perfCLBInput = func(key, i) {
|
|||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "TO");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "TO");
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
var perfCRZInput = func(key, i) {
|
||||
if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CLB");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CLB");
|
||||
}
|
||||
if (key == "R6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "DES");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DES");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
var perfDESInput = func(key, i) {
|
||||
if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CRZ");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,20 +3,20 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var perfTOInput = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/v1", 0);
|
||||
setprop("/FMGC/internal/v1-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/v1", 0);
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("/FMGC/internal/v1", scratchpad);
|
||||
setprop("/FMGC/internal/v1-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/v1", scratchpad);
|
||||
setprop("FMGC/internal/v1-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -26,17 +26,17 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vr", 0);
|
||||
setprop("/FMGC/internal/vr-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/vr-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("/FMGC/internal/vr", scratchpad);
|
||||
setprop("/FMGC/internal/vr-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vr", scratchpad);
|
||||
setprop("FMGC/internal/vr-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -46,19 +46,19 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/v2", 0);
|
||||
setprop("/FMGC/internal/v2-set", 0);
|
||||
setprop("/it-autoflight/settings/togaspd", 157);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/v2", 0);
|
||||
setprop("FMGC/internal/v2-set", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("/FMGC/internal/v2", scratchpad);
|
||||
setprop("/FMGC/internal/v2-set", 1);
|
||||
setprop("/it-autoflight/settings/togaspd", scratchpad + 10);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/v2", scratchpad);
|
||||
setprop("FMGC/internal/v2-set", 1);
|
||||
setprop("it-autoflight/settings/togaspd", scratchpad + 10);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -73,8 +73,8 @@ var perfTOInput = func(key, i) {
|
|||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 or tfs == 5) {
|
||||
if (scratchpad >= 1000 and scratchpad <= 18000) {
|
||||
setprop("/FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -84,11 +84,11 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/FMGC/internal/reduc-agl-ft", "3000");
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("FMGC/internal/reduc-agl-ft", "3000");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 7 and tfs <= 9 and find("/", scratchpad) != -1) {
|
||||
|
@ -96,10 +96,10 @@ var perfTOInput = func(key, i) {
|
|||
var thrred = size(thracc[0]);
|
||||
var acc = size(thracc[1]);
|
||||
if ((thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("/FMGC/internal/reduc-agl-ft", thracc[1]);
|
||||
setprop("/MCDUC/thracc-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("FMGC/internal/reduc-agl-ft", thracc[1]);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -109,20 +109,20 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/to-flap", 0);
|
||||
setprop("/FMGC/internal/to-ths", "0.0");
|
||||
setprop("/FMGC/internal/flap-ths-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/to-flap", 0);
|
||||
setprop("FMGC/internal/to-ths", "0.0");
|
||||
setprop("FMGC/internal/flap-ths-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 7 and find("/", scratchpad) != -1) {
|
||||
var flapths = split("/UP", scratchpad);
|
||||
if ((flapths[0] >= 1 and flapths[0] <= 4) and (flapths[1] >= 0.0 and flapths[1] <= 2.5)) {
|
||||
setprop("/FMGC/internal/to-flap", flapths[0]);
|
||||
setprop("/FMGC/internal/to-ths", flapths[1]);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/to-flap", flapths[0]);
|
||||
setprop("FMGC/internal/to-ths", flapths[1]);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -132,19 +132,19 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/flex", 0);
|
||||
setprop("/FMGC/internal/flex-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/flex", 0);
|
||||
setprop("FMGC/internal/flex-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 1 or tfs == 2) {
|
||||
if (scratchpad >= 0 and scratchpad <= 70) {
|
||||
setprop("/FMGC/internal/flex", scratchpad);
|
||||
setprop("/FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("/FMGC/internal/flex") - getprop("/environment/temperature-degc");
|
||||
setprop("/FMGC/internal/flex-cmd", flex_calc);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/flex", scratchpad);
|
||||
setprop("FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("FMGC/internal/flex") - getprop("environment/temperature-degc");
|
||||
setprop("FMGC/internal/flex-cmd", flex_calc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -154,21 +154,21 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/eng-out-reduc", "3500");
|
||||
setprop("/MCDUC/reducacc-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/eng-out-reduc", "3500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 5) {
|
||||
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("/MCDUC/reducacc-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "CLB");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "CLB");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var radnavInput = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor1freq-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vor1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -19,14 +19,14 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
setprop("/instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("/instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -36,16 +36,16 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor1crs-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vor1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("/instrumentation/nav[2]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/vor1crs-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/vor1crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -55,9 +55,9 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/ils1freq-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -66,9 +66,9 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
|
||||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
setprop("/instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/ils1freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/ils1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -81,16 +81,16 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/ils1crs-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/ils1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("/instrumentation/nav[0]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/ils1crs-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/ils1crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -100,16 +100,16 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/adf1freq-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/adf1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("/instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
|
||||
setprop("/FMGC/internal/adf1freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
|
||||
setprop("FMGC/internal/adf1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -119,9 +119,9 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor2freq-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vor2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -132,14 +132,14 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
setprop("/instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("/instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -149,16 +149,16 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vor2crs-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/vor2crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("/instrumentation/nav[3]/radials/selected-deg", scratchpad);
|
||||
setprop("/FMGC/internal/vor2crs-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/vor2crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -168,16 +168,16 @@ var radnavInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/adf2freq-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/adf2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("/instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
|
||||
setprop("/FMGC/internal/adf2freq-set", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
|
||||
setprop("FMGC/internal/adf2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ var vhf2_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1
|
|||
var vhf1_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE");
|
||||
var vhf2_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE");
|
||||
|
||||
var com1_volume = props.globals.getNode("/instrumentation/comm[0]/volume");
|
||||
var com2_volume = props.globals.getNode("/instrumentation/comm[1]/volume");
|
||||
var com1_volume = props.globals.getNode("instrumentation/comm[0]/volume");
|
||||
var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume");
|
||||
|
||||
var init = func() {
|
||||
vhf1_recive.setValue(1);
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
# Copyright (c) 2019 Jonathan Redpath
|
||||
|
||||
var idCode = props.globals.getNode("/instrumentation/transponder/id-code", 1);
|
||||
var idCode = props.globals.getNode("instrumentation/transponder/id-code", 1);
|
||||
|
||||
var guiModes = ['OFF', 'STANDBY', 'TEST', 'GROUND', 'ON', 'ALTITUDE'];
|
||||
var guiNode = props.globals.getNode("/sim/gui/dialogs/radios/transponder-mode", 1);
|
||||
var guiNode = props.globals.getNode("sim/gui/dialogs/radios/transponder-mode", 1);
|
||||
var forLoopFlag = 0;
|
||||
|
||||
var altimeter = props.globals.initNode("/instrumentation/transponder/altimeter-input-src", 0, "INT");
|
||||
|
@ -20,15 +20,15 @@ var Transponder = {
|
|||
activeADIRS: 0,
|
||||
condition: 0,
|
||||
failed: 0,
|
||||
codeDigitsNodes: [props.globals.getNode("/instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[3]", 1)],
|
||||
serviceableNode: props.globals.getNode("/instrumentation/transponder/serviceable", 1),
|
||||
codeDigitsNodes: [props.globals.getNode("instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[3]", 1)],
|
||||
serviceableNode: props.globals.getNode("instrumentation/transponder/serviceable", 1),
|
||||
knobNode: props.globals.getNode("instrumentation/transponder/inputs/knob-mode", 1),
|
||||
identNode: props.globals.getNode("/instrumentation/transponder/inputs/ident-btn", 1),
|
||||
wowNode: props.globals.getNode("/fdm/jsbsim/position/wow"),
|
||||
ac1Node: props.globals.getNode("/systems/electrical/bus/ac-1", 1),
|
||||
tcasNode: props.globals.getNode("/instrumentation/tcas/inputs/mode"),
|
||||
aglNode: props.globals.getNode("/position/gear-agl-ft", 1),
|
||||
electricNode: props.globals.getNode("/systems/electrical/outputs/transponder", 1), # communicate to generic systems
|
||||
identNode: props.globals.getNode("instrumentation/transponder/inputs/ident-btn", 1),
|
||||
wowNode: props.globals.getNode("fdm/jsbsim/position/wow"),
|
||||
ac1Node: props.globals.getNode("systems/electrical/bus/ac-1", 1),
|
||||
tcasNode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
|
||||
aglNode: props.globals.getNode("position/gear-agl-ft", 1),
|
||||
electricNode: props.globals.getNode("systems/electrical/outputs/transponder", 1), # communicate to generic systems
|
||||
new: func(elecSrc, ADIRS) {
|
||||
var t = {parents:[Transponder]};
|
||||
t.mode = 1;
|
||||
|
@ -146,7 +146,7 @@ var transponderPanel = {
|
|||
failLight: 0,
|
||||
clearFlag: 0,
|
||||
keypad: func(keyNum) {
|
||||
if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) {
|
||||
if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) {
|
||||
return;
|
||||
}
|
||||
if (keyNum < 0 or keyNum > 7) {
|
||||
|
@ -164,7 +164,7 @@ var transponderPanel = {
|
|||
}
|
||||
},
|
||||
clearKey: func() {
|
||||
if (props.globals.getNode("/controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("/systems/electrical/bus/dc-ess", 1).getValue() < 25) {
|
||||
if (props.globals.getNode("controls/switches/annun-test", 1).getBoolValue() or props.globals.getNode("systems/electrical/bus/dc-ess", 1).getValue() < 25) {
|
||||
return;
|
||||
}
|
||||
if (me.codeDisp != "") {
|
||||
|
@ -216,7 +216,7 @@ var transponderPanel = {
|
|||
return;
|
||||
}
|
||||
me.failLight = newFail;
|
||||
props.globals.getNode("/systems/atc/failed").setBoolValue(me.failLight);
|
||||
props.globals.getNode("systems/atc/failed").setBoolValue(me.failLight);
|
||||
},
|
||||
identSwitch: func() {
|
||||
Transponders.vector[me.atcSel - 1].ident();
|
||||
|
|
|
@ -11,9 +11,9 @@ var chan_rmp1_v = "vhr1";
|
|||
var chan_rmp2_v = "vhr2";
|
||||
var chan_rmp3_v = "vhr3";
|
||||
|
||||
var act_vhf1 = props.globals.getNode("/instrumentation/comm[0]/frequencies/selected-mhz");
|
||||
var act_vhf2 = props.globals.getNode("/instrumentation/comm[1]/frequencies/selected-mhz");
|
||||
var act_vhf3 = props.globals.getNode("/instrumentation/comm[2]/frequencies/selected-mhz");
|
||||
var act_vhf1 = props.globals.getNode("instrumentation/comm[0]/frequencies/selected-mhz");
|
||||
var act_vhf2 = props.globals.getNode("instrumentation/comm[1]/frequencies/selected-mhz");
|
||||
var act_vhf3 = props.globals.getNode("instrumentation/comm[2]/frequencies/selected-mhz");
|
||||
|
||||
var act_display_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/active-display", "118.700", "STRING");
|
||||
var stby_display_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/standby-display", "121.400", "STRING");
|
||||
|
@ -51,8 +51,8 @@ var am_mode_rmp3 = props.globals.initNode("/systems/radio/rmp[2]/am-active", 0,
|
|||
|
||||
var init = func() {
|
||||
for(var i = 0; i < 3; i += 1) {
|
||||
setprop("/systems/radio/rmp[" ~ i ~ "]/hf1-standby", 510);
|
||||
setprop("/systems/radio/rmp[" ~ i ~ "]/hf2-standby", 891);
|
||||
setprop("systems/radio/rmp[" ~ i ~ "]/hf1-standby", 510);
|
||||
setprop("systems/radio/rmp[" ~ i ~ "]/hf2-standby", 891);
|
||||
}
|
||||
|
||||
chan_rmp1.setValue("vhf1");
|
||||
|
@ -250,15 +250,15 @@ var update_chan_sel = func(rmp_no) {
|
|||
|
||||
var transfer = func(rmp_no) {
|
||||
rmp_no = rmp_no - 1;
|
||||
var sel_chan = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan");
|
||||
var sel_chan = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan");
|
||||
|
||||
if (string.match(sel_chan, "vhf[1-3]")) {
|
||||
var mod1 = int(string.replace(sel_chan, "vhf", ""));
|
||||
var mod = mod1 - 1;
|
||||
|
||||
var mem = getprop("/instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz");
|
||||
setprop("/instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby"));
|
||||
setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem);
|
||||
var mem = getprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz");
|
||||
setprop("instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby"));
|
||||
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,78 +5,78 @@
|
|||
|
||||
# Resets buttons to the default values
|
||||
var variousReset = func {
|
||||
setprop("/modes/cpt-du-xfr", 0);
|
||||
setprop("/modes/fo-du-xfr", 0);
|
||||
setprop("/controls/fadec/n1mode1", 0);
|
||||
setprop("/controls/fadec/n1mode2", 0);
|
||||
setprop("/instrumentation/mk-viii/serviceable", 1);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/terr-inhibit", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/gpws-inhibit", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/glideslope-cancel", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
|
||||
setprop("/controls/switches/cabinCall", 0);
|
||||
setprop("/controls/switches/mechCall", 0);
|
||||
setprop("/controls/switches/emer-lights", 0.5);
|
||||
setprop("modes/cpt-du-xfr", 0);
|
||||
setprop("modes/fo-du-xfr", 0);
|
||||
setprop("controls/fadec/n1mode1", 0);
|
||||
setprop("controls/fadec/n1mode2", 0);
|
||||
setprop("instrumentation/mk-viii/serviceable", 1);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/terr-inhibit", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/gpws-inhibit", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/glideslope-cancel", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
|
||||
setprop("controls/switches/cabinCall", 0);
|
||||
setprop("controls/switches/mechCall", 0);
|
||||
setprop("controls/switches/emer-lights", 0.5);
|
||||
# cockpit voice recorder stuff
|
||||
setprop("/controls/CVR/power", 0);
|
||||
setprop("/controls/CVR/test", 0);
|
||||
setprop("/controls/CVR/tone", 0);
|
||||
setprop("/controls/CVR/gndctl", 0);
|
||||
setprop("/controls/CVR/erase", 0);
|
||||
setprop("/controls/switches/cabinfan", 1);
|
||||
setprop("/controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
|
||||
setprop("/controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
|
||||
setprop("/controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
|
||||
setprop("/controls/switches/emerCall", 0);
|
||||
setprop("/controls/switches/LrainRpt", 0);
|
||||
setprop("/controls/switches/RrainRpt", 0);
|
||||
setprop("/controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("/controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("/controls/lighting/strobe", 0);
|
||||
setprop("/controls/lighting/beacon", 0);
|
||||
setprop("/controls/switches/beacon", 0);
|
||||
setprop("/controls/switches/wing-lights", 0);
|
||||
setprop("/controls/switches/landing-lights-l", 0);
|
||||
setprop("/controls/switches/landing-lights-r", 0);
|
||||
setprop("/controls/lighting/wing-lights", 0);
|
||||
setprop("/controls/lighting/nav-lights-switch", 0);
|
||||
setprop("/controls/lighting/landing-lights[1]", 0);
|
||||
setprop("/controls/lighting/landing-lights[2]", 0);
|
||||
setprop("/controls/lighting/taxi-light-switch", 0);
|
||||
setprop("/controls/lighting/DU/du1", 1);
|
||||
setprop("/controls/lighting/DU/du2", 1);
|
||||
setprop("/controls/lighting/DU/du3", 1);
|
||||
setprop("/controls/lighting/DU/du4", 1);
|
||||
setprop("/controls/lighting/DU/du5", 1);
|
||||
setprop("/controls/lighting/DU/du6", 1);
|
||||
setprop("/controls/lighting/DU/mcdu1", 1);
|
||||
setprop("/controls/lighting/DU/mcdu2", 1);
|
||||
setprop("/modes/fcu/hdg-time", -45);
|
||||
setprop("/controls/switching/ATTHDG", 0);
|
||||
setprop("/controls/switching/AIRDATA", 0);
|
||||
setprop("/controls/switches/no-smoking-sign", 1);
|
||||
setprop("/controls/switches/seatbelt-sign", 1);
|
||||
setprop("controls/CVR/power", 0);
|
||||
setprop("controls/CVR/test", 0);
|
||||
setprop("controls/CVR/tone", 0);
|
||||
setprop("controls/CVR/gndctl", 0);
|
||||
setprop("controls/CVR/erase", 0);
|
||||
setprop("controls/switches/cabinfan", 1);
|
||||
setprop("controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
|
||||
setprop("controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
|
||||
setprop("controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
|
||||
setprop("controls/switches/emerCall", 0);
|
||||
setprop("controls/switches/LrainRpt", 0);
|
||||
setprop("controls/switches/RrainRpt", 0);
|
||||
setprop("controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("controls/lighting/strobe", 0);
|
||||
setprop("controls/lighting/beacon", 0);
|
||||
setprop("controls/switches/beacon", 0);
|
||||
setprop("controls/switches/wing-lights", 0);
|
||||
setprop("controls/switches/landing-lights-l", 0);
|
||||
setprop("controls/switches/landing-lights-r", 0);
|
||||
setprop("controls/lighting/wing-lights", 0);
|
||||
setprop("controls/lighting/nav-lights-switch", 0);
|
||||
setprop("controls/lighting/landing-lights[1]", 0);
|
||||
setprop("controls/lighting/landing-lights[2]", 0);
|
||||
setprop("controls/lighting/taxi-light-switch", 0);
|
||||
setprop("controls/lighting/DU/du1", 1);
|
||||
setprop("controls/lighting/DU/du2", 1);
|
||||
setprop("controls/lighting/DU/du3", 1);
|
||||
setprop("controls/lighting/DU/du4", 1);
|
||||
setprop("controls/lighting/DU/du5", 1);
|
||||
setprop("controls/lighting/DU/du6", 1);
|
||||
setprop("controls/lighting/DU/mcdu1", 1);
|
||||
setprop("controls/lighting/DU/mcdu2", 1);
|
||||
setprop("modes/fcu/hdg-time", -45);
|
||||
setprop("controls/switching/ATTHDG", 0);
|
||||
setprop("controls/switching/AIRDATA", 0);
|
||||
setprop("controls/switches/no-smoking-sign", 1);
|
||||
setprop("controls/switches/seatbelt-sign", 1);
|
||||
}
|
||||
|
||||
var BUTTONS = {
|
||||
init: func() {
|
||||
var stateL = getprop("/engines/engine[0]/state");
|
||||
var stateR = getprop("/engines/engine[1]/state");
|
||||
var Lrain = getprop("/controls/switches/LrainRpt");
|
||||
var Rrain = getprop("/controls/switches/RrainRpt");
|
||||
var OnLt = getprop("/controls/switches/emerCallLtO");
|
||||
var CallLt = getprop("/controls/switches/emerCallLtC");
|
||||
var EmerCall = getprop("/controls/switches/emerCall");
|
||||
var wow = getprop("/gear/gear[1]/wow");
|
||||
var wowr = getprop("/gear/gear[2]/wow");
|
||||
var gndCtl = getprop("/systems/CVR/gndctl");
|
||||
var acPwr = getprop("/systems/electrical/bus/ac-ess");
|
||||
var stateL = getprop("engines/engine[0]/state");
|
||||
var stateR = getprop("engines/engine[1]/state");
|
||||
var Lrain = getprop("controls/switches/LrainRpt");
|
||||
var Rrain = getprop("controls/switches/RrainRpt");
|
||||
var OnLt = getprop("controls/switches/emerCallLtO");
|
||||
var CallLt = getprop("controls/switches/emerCallLtC");
|
||||
var EmerCall = getprop("controls/switches/emerCall");
|
||||
var wow = getprop("gear/gear[1]/wow");
|
||||
var wowr = getprop("gear/gear[2]/wow");
|
||||
var gndCtl = getprop("systems/CVR/gndctl");
|
||||
var acPwr = getprop("systems/electrical/bus/ac-ess");
|
||||
},
|
||||
update: func() {
|
||||
rainRepel();
|
||||
CVR_master();
|
||||
if (getprop("/controls/switches/emerCall")) {
|
||||
if (getprop("controls/switches/emerCall")) {
|
||||
EmerCallOnLight();
|
||||
EmerCallLight();
|
||||
}
|
||||
|
@ -84,78 +84,78 @@ var BUTTONS = {
|
|||
};
|
||||
|
||||
var rainRepel = func() {
|
||||
Lrain = getprop("/controls/switches/LrainRpt");
|
||||
Rrain = getprop("/controls/switches/RrainRpt");
|
||||
wow = getprop("/gear/gear[1]/wow");
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
Lrain = getprop("controls/switches/LrainRpt");
|
||||
Rrain = getprop("controls/switches/RrainRpt");
|
||||
wow = getprop("gear/gear[1]/wow");
|
||||
stateL = getprop("engines/engine[0]/state");
|
||||
stateR = getprop("engines/engine[1]/state");
|
||||
if (Lrain and (stateL != 3 and stateR != 3 and wow)) {
|
||||
setprop("/controls/switches/LrainRpt", 0);
|
||||
setprop("controls/switches/LrainRpt", 0);
|
||||
}
|
||||
if (Rrain and (stateL != 3 and stateR != 3 and wow)) {
|
||||
setprop("/controls/switches/RrainRpt", 0);
|
||||
setprop("controls/switches/RrainRpt", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var EmerCallOnLight = func() {
|
||||
OnLt = getprop("/controls/switches/emerCallLtO");
|
||||
EmerCall = getprop("/controls/switches/emerCall");
|
||||
OnLt = getprop("controls/switches/emerCallLtO");
|
||||
EmerCall = getprop("controls/switches/emerCall");
|
||||
if ((OnLt and EmerCall) or !EmerCall) {
|
||||
setprop("/controls/switches/emerCallLtO", 0);
|
||||
setprop("controls/switches/emerCallLtO", 0);
|
||||
} else if (!OnLt and EmerCall) {
|
||||
setprop("/controls/switches/emerCallLtO", 1);
|
||||
setprop("controls/switches/emerCallLtO", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var EmerCallLight = func() {
|
||||
CallLt = getprop("/controls/switches/emerCallLtC");
|
||||
EmerCall = getprop("/controls/switches/emerCall");
|
||||
CallLt = getprop("controls/switches/emerCallLtC");
|
||||
EmerCall = getprop("controls/switches/emerCall");
|
||||
if ((CallLt and EmerCall) or !EmerCall) {
|
||||
setprop("/controls/switches/emerCallLtC", 0);
|
||||
setprop("controls/switches/emerCallLtC", 0);
|
||||
} else if (!CallLt and EmerCall) {
|
||||
setprop("/controls/switches/emerCallLtC", 1);
|
||||
setprop("controls/switches/emerCallLtC", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var CVR_master = func() {
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
wow = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
gndCtl = getprop("/systems/CVR/gndctl");
|
||||
acPwr = getprop("/systems/electrical/bus/ac-ess");
|
||||
stateL = getprop("engines/engine[0]/state");
|
||||
stateR = getprop("engines/engine[1]/state");
|
||||
wow = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
gndCtl = getprop("systems/CVR/gndctl");
|
||||
acPwr = getprop("systems/electrical/bus/ac-ess");
|
||||
if (acPwr > 0 and wow and wowr and (gndCtl or (stateL == 3 or stateR == 3))) {
|
||||
setprop("/controls/CVR/power", 1);
|
||||
setprop("controls/CVR/power", 1);
|
||||
} else if (!wow and !wowr and acPwr > 0) {
|
||||
setprop("/controls/CVR/power", 1);
|
||||
setprop("controls/CVR/power", 1);
|
||||
} else {
|
||||
setprop("/controls/CVR/power", 0);
|
||||
setprop("controls/CVR/power", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var EmerCall = func {
|
||||
setprop("/controls/switches/emerCall", 1);
|
||||
setprop("controls/switches/emerCall", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/emerCall", 0);
|
||||
setprop("controls/switches/emerCall", 0);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
var CabinCall = func {
|
||||
setprop("/controls/switches/cabinCall", 0);
|
||||
setprop("controls/switches/cabinCall", 0);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/cabinCall", 0);
|
||||
setprop("controls/switches/cabinCall", 0);
|
||||
}, 15);
|
||||
}
|
||||
|
||||
var MechCall = func {
|
||||
setprop("/controls/switches/mechCall", 1);
|
||||
setprop("controls/switches/mechCall", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/mechCall", 0);
|
||||
setprop("controls/switches/mechCall", 0);
|
||||
}, 15);
|
||||
}
|
||||
|
||||
var CVR_test = func {
|
||||
var parkBrake = getprop("/controls/gear/brake-parking");
|
||||
var parkBrake = getprop("controls/gear/brake-parking");
|
||||
if (parkBrake) {
|
||||
setprop("controls/CVR/tone", 1);
|
||||
settimer(func() {
|
||||
|
@ -165,7 +165,7 @@ var CVR_test = func {
|
|||
}
|
||||
|
||||
setlistener("/controls/APU/master", func() {
|
||||
if (!getprop("/controls/APU/master") and systems.apuEmerShutdown.getBoolValue()) {
|
||||
if (!getprop("controls/APU/master") and systems.apuEmerShutdown.getBoolValue()) {
|
||||
systems.apuEmerShutdown.setBoolValue(0);
|
||||
}
|
||||
}, 0, 0);
|
|
@ -7,64 +7,64 @@ print("-------------------------------------------------------------------------
|
|||
print("Copyright (c) 2016-2019 Joshua Davidson (Octal450)");
|
||||
print("-----------------------------------------------------------------------------");
|
||||
|
||||
setprop("/sim/replay/was-active", 0);
|
||||
setprop("sim/replay/was-active", 0);
|
||||
|
||||
setprop("/sim/menubar/default/menu[0]/item[0]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[2]/item[0]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[2]/item[2]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[3]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[5]/item[9]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[5]/item[10]/enabled", 0);
|
||||
setprop("/sim/menubar/default/menu[5]/item[11]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[0]/item[0]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[2]/item[0]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[2]/item[2]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[3]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[5]/item[9]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[5]/item[10]/enabled", 0);
|
||||
setprop("sim/menubar/default/menu[5]/item[11]/enabled", 0);
|
||||
|
||||
# Dimmers
|
||||
setprop("/controls/lighting/ndl-norm", 1);
|
||||
setprop("/controls/lighting/ndr-norm", 1);
|
||||
setprop("/controls/lighting/upper-norm", 1);
|
||||
setprop("controls/lighting/ndl-norm", 1);
|
||||
setprop("controls/lighting/ndr-norm", 1);
|
||||
setprop("controls/lighting/upper-norm", 1);
|
||||
|
||||
# Lights
|
||||
setprop("/sim/model/lights/nose-lights", 0);
|
||||
setprop("/sim/model/lights/turnoffsw", 0);
|
||||
setprop("/controls/lighting/turnoff-light-switch", 0);
|
||||
setprop("/controls/lighting/leftturnoff", 0);
|
||||
setprop("/controls/lighting/rightturnoff", 0);
|
||||
setprop("sim/model/lights/nose-lights", 0);
|
||||
setprop("sim/model/lights/turnoffsw", 0);
|
||||
setprop("controls/lighting/turnoff-light-switch", 0);
|
||||
setprop("controls/lighting/leftturnoff", 0);
|
||||
setprop("controls/lighting/rightturnoff", 0);
|
||||
|
||||
# Oil Qty
|
||||
var qty1 = math.round((rand() * 5 ) + 20, 0.1);
|
||||
var qty2 = math.round((rand() * 5 ) + 20, 0.1);
|
||||
setprop("/engines/engine[0]/oil-qt-actual", qty1);
|
||||
setprop("/engines/engine[1]/oil-qt-actual", qty2);
|
||||
setprop("engines/engine[0]/oil-qt-actual", qty1);
|
||||
setprop("engines/engine[1]/oil-qt-actual", qty2);
|
||||
|
||||
##########
|
||||
# Lights #
|
||||
##########
|
||||
|
||||
var beacon_switch = props.globals.getNode("/controls/switches/beacon", 1);
|
||||
var beacon_ctl = props.globals.getNode("/controls/lighting/beacon", 1);
|
||||
var beacon_switch = props.globals.getNode("controls/switches/beacon", 1);
|
||||
var beacon_ctl = props.globals.getNode("controls/lighting/beacon", 1);
|
||||
var beacon = aircraft.light.new("/sim/model/lights/beacon", [0.1, 1], "/controls/lighting/beacon");
|
||||
var strobe_switch = props.globals.getNode("/controls/switches/strobe", 1);
|
||||
var strobe_light = props.globals.getNode("/controls/lighting/strobe", 1);
|
||||
var strobe_switch = props.globals.getNode("controls/switches/strobe", 1);
|
||||
var strobe_light = props.globals.getNode("controls/lighting/strobe", 1);
|
||||
var strobe = aircraft.light.new("/sim/model/lights/strobe", [0.05, 0.06, 0.05, 1], "/controls/lighting/strobe");
|
||||
var tail_strobe = aircraft.light.new("/sim/model/lights/tailstrobe", [0.1, 1], "/controls/lighting/strobe");
|
||||
var logo_lights = getprop("/sim/model/lights/logo-lights");
|
||||
var nav_lights = props.globals.getNode("/sim/model/lights/nav-lights");
|
||||
var wing_switch = props.globals.getNode("/controls/switches/wing-lights", 1);
|
||||
var wing_ctl = props.globals.getNode("/controls/lighting/wing-lights", 1);
|
||||
var logo_lights = getprop("sim/model/lights/logo-lights");
|
||||
var nav_lights = props.globals.getNode("sim/model/lights/nav-lights");
|
||||
var wing_switch = props.globals.getNode("controls/switches/wing-lights", 1);
|
||||
var wing_ctl = props.globals.getNode("controls/lighting/wing-lights", 1);
|
||||
var dome_light = props.globals.initNode("/sim/model/lights/dome-light", 0.0, "DOUBLE");
|
||||
var wow = getprop("/gear/gear[2]/wow");
|
||||
var slats = getprop("/controls/flight/slats");
|
||||
var gear = getprop("/gear/gear[0]/position-norm");
|
||||
var nose_lights = getprop("/sim/model/lights/nose-lights");
|
||||
var left_turnoff_light = props.globals.getNode("/controls/lighting/leftturnoff");
|
||||
var right_turnoff_light = props.globals.getNode("/controls/lighting/rightturnoff");
|
||||
var settingT = getprop("/controls/lighting/taxi-light-switch");
|
||||
var settingTurnoff = getprop("/controls/lighting/turnoff-light-switch");
|
||||
var setting = getprop("/controls/lighting/nav-lights-switch");
|
||||
var domeSetting = getprop("/controls/lighting/dome-norm");
|
||||
var wow = getprop("gear/gear[2]/wow");
|
||||
var slats = getprop("controls/flight/slats");
|
||||
var gear = getprop("gear/gear[0]/position-norm");
|
||||
var nose_lights = getprop("sim/model/lights/nose-lights");
|
||||
var left_turnoff_light = props.globals.getNode("controls/lighting/leftturnoff");
|
||||
var right_turnoff_light = props.globals.getNode("controls/lighting/rightturnoff");
|
||||
var settingT = getprop("controls/lighting/taxi-light-switch");
|
||||
var settingTurnoff = getprop("controls/lighting/turnoff-light-switch");
|
||||
var setting = getprop("controls/lighting/nav-lights-switch");
|
||||
var domeSetting = getprop("controls/lighting/dome-norm");
|
||||
var landL = props.globals.getNode("controls/lighting/landing-lights[1]", 1);
|
||||
var landR = props.globals.getNode("controls/lighting/landing-lights[2]", 1);
|
||||
var landlSw = props.globals.getNode("/controls/switches/landing-lights-l", 1);
|
||||
var landrSw = props.globals.getNode("/controls/switches/landing-lights-r", 1);
|
||||
var landlSw = props.globals.getNode("controls/switches/landing-lights-l", 1);
|
||||
var landrSw = props.globals.getNode("controls/switches/landing-lights-r", 1);
|
||||
|
||||
###################
|
||||
# Tire Smoke/Rain #
|
||||
|
@ -78,74 +78,74 @@ aircraft.rain.init();
|
|||
##########
|
||||
|
||||
setlistener("/sim/sounde/btn1", func {
|
||||
if (!getprop("/sim/sounde/btn1")) {
|
||||
if (!getprop("sim/sounde/btn1")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/btn1").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/btn1").setBoolValue(0);
|
||||
}, 0.05);
|
||||
});
|
||||
|
||||
setlistener("/sim/sounde/oh-btn", func {
|
||||
if (!getprop("/sim/sounde/oh-btn")) {
|
||||
if (!getprop("sim/sounde/oh-btn")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/oh-btn").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/oh-btn").setBoolValue(0);
|
||||
}, 0.05);
|
||||
});
|
||||
|
||||
setlistener("/sim/sounde/btn3", func {
|
||||
if (!getprop("/sim/sounde/btn3")) {
|
||||
if (!getprop("sim/sounde/btn3")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/btn3").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/btn3").setBoolValue(0);
|
||||
}, 0.05);
|
||||
});
|
||||
|
||||
setlistener("/sim/sounde/knb1", func {
|
||||
if (!getprop("/sim/sounde/knb1")) {
|
||||
if (!getprop("sim/sounde/knb1")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/knb1").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/knb1").setBoolValue(0);
|
||||
}, 0.05);
|
||||
});
|
||||
|
||||
setlistener("/sim/sounde/switch1", func {
|
||||
if (!getprop("/sim/sounde/switch1")) {
|
||||
if (!getprop("sim/sounde/switch1")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/switch1").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/switch1").setBoolValue(0);
|
||||
}, 0.05);
|
||||
});
|
||||
|
||||
setlistener("/controls/lighting/seatbelt-sign", func {
|
||||
props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(1);
|
||||
props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(1);
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/seatbelt-sign").setBoolValue(0);
|
||||
}, 2);
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/lighting/no-smoking-sign", func {
|
||||
props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(1);
|
||||
props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(1);
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/no-smoking-sign").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/no-smoking-sign").setBoolValue(0);
|
||||
}, 1);
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/flight/flap-lever", func {
|
||||
props.globals.getNode("/sim/sounde/flaps-click").setBoolValue(1);
|
||||
props.globals.getNode("sim/sounde/flaps-click").setBoolValue(1);
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/sim/sounde/flaps-click", func {
|
||||
if (!getprop("/sim/sounde/flaps-click")) {
|
||||
if (!getprop("sim/sounde/flaps-click")) {
|
||||
return;
|
||||
}
|
||||
settimer(func {
|
||||
props.globals.getNode("/sim/sounde/flaps-click").setBoolValue(0);
|
||||
props.globals.getNode("sim/sounde/flaps-click").setBoolValue(0);
|
||||
}, 0.4);
|
||||
});
|
||||
#########
|
||||
|
@ -176,11 +176,11 @@ var armrests = aircraft.door.new("/sim/model/door-positions/armrests", 2);
|
|||
|
||||
# door opener/closer
|
||||
var triggerDoor = func(door, doorName, doorDesc) {
|
||||
if (getprop("/sim/model/door-positions/" ~ doorName ~ "/position-norm") > 0) {
|
||||
if (getprop("sim/model/door-positions/" ~ doorName ~ "/position-norm") > 0) {
|
||||
gui.popupTip("Closing " ~ doorDesc ~ " door");
|
||||
door.toggle();
|
||||
} else {
|
||||
if (getprop("/velocities/groundspeed-kt") > 5) {
|
||||
if (getprop("velocities/groundspeed-kt") > 5) {
|
||||
gui.popupTip("You cannot open the doors while the aircraft is moving!");
|
||||
} else {
|
||||
gui.popupTip("Opening " ~ doorDesc ~ " door");
|
||||
|
@ -243,56 +243,56 @@ var systemsLoop = maketimer(0.1, func {
|
|||
fcu.FCUController.loop();
|
||||
dmc.DMController.loop();
|
||||
|
||||
if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/nose") == 0 and getprop("/services/chocks/left") == 0 and getprop("/services/chocks/right") == 0))) {
|
||||
setprop("/controls/electrical/ground-cart", 0);
|
||||
setprop("/controls/pneumatic/switches/groundair", 0);
|
||||
if ((getprop("controls/pneumatic/switches/groundair") or getprop("controls/electrical/ground-cart")) and ((getprop("velocities/groundspeed-kt") > 2) or (getprop("controls/gear/brake-parking") == 0 and getprop("services/chocks/nose") == 0 and getprop("services/chocks/left") == 0 and getprop("services/chocks/right") == 0))) {
|
||||
setprop("controls/electrical/ground-cart", 0);
|
||||
setprop("controls/pneumatic/switches/groundair", 0);
|
||||
}
|
||||
|
||||
if (getprop("/velocities/groundspeed-kt") > 15) {
|
||||
setprop("/systems/shake/effect", 1);
|
||||
if (getprop("velocities/groundspeed-kt") > 15) {
|
||||
setprop("systems/shake/effect", 1);
|
||||
} else {
|
||||
setprop("/systems/shake/effect", 0);
|
||||
setprop("systems/shake/effect", 0);
|
||||
}
|
||||
|
||||
if (getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override") == 1 or (getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override") == 1 and getprop("/controls/flight/flap-pos") >= 4)) {
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-override", 1);
|
||||
if (getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override") == 1 or (getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override") == 1 and getprop("controls/flight/flap-pos") >= 4)) {
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-override", 1);
|
||||
} else {
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-override", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-override", 0);
|
||||
}
|
||||
|
||||
if (getprop("/instrumentation/mk-viii/inputs/discretes/gpws-inhibit") == 1) {
|
||||
setprop("/instrumentation/mk-viii/speaker/volume", 0);
|
||||
if (getprop("instrumentation/mk-viii/inputs/discretes/gpws-inhibit") == 1) {
|
||||
setprop("instrumentation/mk-viii/speaker/volume", 0);
|
||||
} else {
|
||||
setprop("/instrumentation/mk-viii/speaker/volume", 2);
|
||||
setprop("instrumentation/mk-viii/speaker/volume", 2);
|
||||
}
|
||||
|
||||
if (getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) {
|
||||
setprop("/engines/ready", 1);
|
||||
if (getprop("engines/engine[0]/state") == 3 and getprop("engines/engine[1]/state") == 3) {
|
||||
setprop("engines/ready", 1);
|
||||
} else {
|
||||
setprop("/engines/ready", 0);
|
||||
setprop("engines/ready", 0);
|
||||
}
|
||||
|
||||
if ((getprop("/engines/engine[0]/state") == 2 or getprop("/engines/engine[0]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[5]/contents-lbs") < 1) {
|
||||
if ((getprop("engines/engine[0]/state") == 2 or getprop("engines/engine[0]/state") == 3) and getprop("fdm/jsbsim/propulsion/tank[5]/contents-lbs") < 1) {
|
||||
systems.cutoff_one();
|
||||
}
|
||||
if ((getprop("/engines/engine[1]/state") == 2 or getprop("/engines/engine[1]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[6]/contents-lbs") < 1) {
|
||||
if ((getprop("engines/engine[1]/state") == 2 or getprop("engines/engine[1]/state") == 3) and getprop("fdm/jsbsim/propulsion/tank[6]/contents-lbs") < 1) {
|
||||
systems.cutoff_two();
|
||||
}
|
||||
|
||||
if (getprop("/sim/replay/replay-state") == 1) {
|
||||
setprop("/sim/replay/was-active", 1);
|
||||
} else if (getprop("/sim/replay/replay-state") == 0 and getprop("/sim/replay/was-active") == 1) {
|
||||
setprop("/sim/replay/was-active", 0);
|
||||
if (getprop("sim/replay/replay-state") == 1) {
|
||||
setprop("sim/replay/was-active", 1);
|
||||
} else if (getprop("sim/replay/replay-state") == 0 and getprop("sim/replay/was-active") == 1) {
|
||||
setprop("sim/replay/was-active", 0);
|
||||
acconfig.colddark();
|
||||
gui.popupTip("Replay Ended: Setting Cold and Dark state...");
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/options/steep-ils", func {
|
||||
if (getprop("/options/steep-ils") == 1) {
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/steep-approach", 1);
|
||||
if (getprop("options/steep-ils") == 1) {
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/steep-approach", 1);
|
||||
} else {
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/steep-approach", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/steep-approach", 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -322,96 +322,96 @@ canvas.Element.setVisible = func(vis) {
|
|||
|
||||
# In air, flaps 1 is slats only. On ground, it is slats and flaps.
|
||||
|
||||
setprop("/controls/flight/flap-lever", 0);
|
||||
setprop("/controls/flight/flap-pos", 0);
|
||||
setprop("/controls/flight/flap-txt", " ");
|
||||
setprop("controls/flight/flap-lever", 0);
|
||||
setprop("controls/flight/flap-pos", 0);
|
||||
setprop("controls/flight/flap-txt", " ");
|
||||
|
||||
controls.flapsDown = func(step) {
|
||||
if (step == 1) {
|
||||
if (getprop("/controls/flight/flap-lever") == 0) {
|
||||
if (getprop("/velocities/airspeed-kt") <= 100) {
|
||||
setprop("/controls/flight/flaps", 0.2857);
|
||||
setprop("/controls/flight/slats", 0.6666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 2);
|
||||
setprop("/controls/flight/flap-txt", "1+F");
|
||||
if (getprop("controls/flight/flap-lever") == 0) {
|
||||
if (getprop("velocities/airspeed-kt") <= 100) {
|
||||
setprop("controls/flight/flaps", 0.2857);
|
||||
setprop("controls/flight/slats", 0.6666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 2);
|
||||
setprop("controls/flight/flap-txt", "1+F");
|
||||
flaptimer.start();
|
||||
return;
|
||||
} else {
|
||||
setprop("/controls/flight/flaps", 0.000);
|
||||
setprop("/controls/flight/slats", 0.6666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 1);
|
||||
setprop("/controls/flight/flap-txt", "1");
|
||||
setprop("controls/flight/flaps", 0.000);
|
||||
setprop("controls/flight/slats", 0.6666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 1);
|
||||
setprop("controls/flight/flap-txt", "1");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
}
|
||||
} else if (getprop("/controls/flight/flap-lever") == 1) {
|
||||
setprop("/controls/flight/flaps", 0.4286);
|
||||
setprop("/controls/flight/slats", 0.8148);
|
||||
setprop("/controls/flight/flap-lever", 2);
|
||||
setprop("/controls/flight/flap-pos", 3);
|
||||
setprop("/controls/flight/flap-txt", "2");
|
||||
} else if (getprop("controls/flight/flap-lever") == 1) {
|
||||
setprop("controls/flight/flaps", 0.4286);
|
||||
setprop("controls/flight/slats", 0.8148);
|
||||
setprop("controls/flight/flap-lever", 2);
|
||||
setprop("controls/flight/flap-pos", 3);
|
||||
setprop("controls/flight/flap-txt", "2");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
} else if (getprop("/controls/flight/flap-lever") == 2) {
|
||||
setprop("/controls/flight/flaps", 0.5714);
|
||||
setprop("/controls/flight/slats", 0.8148);
|
||||
setprop("/controls/flight/flap-lever", 3);
|
||||
setprop("/controls/flight/flap-pos", 4);
|
||||
setprop("/controls/flight/flap-txt", "3");
|
||||
} else if (getprop("controls/flight/flap-lever") == 2) {
|
||||
setprop("controls/flight/flaps", 0.5714);
|
||||
setprop("controls/flight/slats", 0.8148);
|
||||
setprop("controls/flight/flap-lever", 3);
|
||||
setprop("controls/flight/flap-pos", 4);
|
||||
setprop("controls/flight/flap-txt", "3");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
} else if (getprop("/controls/flight/flap-lever") == 3) {
|
||||
setprop("/controls/flight/flaps", 1.000);
|
||||
setprop("/controls/flight/slats", 1.000);
|
||||
setprop("/controls/flight/flap-lever", 4);
|
||||
setprop("/controls/flight/flap-pos", 5);
|
||||
setprop("/controls/flight/flap-txt", "FULL");
|
||||
} else if (getprop("controls/flight/flap-lever") == 3) {
|
||||
setprop("controls/flight/flaps", 1.000);
|
||||
setprop("controls/flight/slats", 1.000);
|
||||
setprop("controls/flight/flap-lever", 4);
|
||||
setprop("controls/flight/flap-pos", 5);
|
||||
setprop("controls/flight/flap-txt", "FULL");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
}
|
||||
} else if (step == -1) {
|
||||
if (getprop("/controls/flight/flap-lever") == 4) {
|
||||
setprop("/controls/flight/flaps", 0.5714);
|
||||
setprop("/controls/flight/slats", 0.8148);
|
||||
setprop("/controls/flight/flap-lever", 3);
|
||||
setprop("/controls/flight/flap-pos", 4);
|
||||
setprop("/controls/flight/flap-txt", "3");
|
||||
if (getprop("controls/flight/flap-lever") == 4) {
|
||||
setprop("controls/flight/flaps", 0.5714);
|
||||
setprop("controls/flight/slats", 0.8148);
|
||||
setprop("controls/flight/flap-lever", 3);
|
||||
setprop("controls/flight/flap-pos", 4);
|
||||
setprop("controls/flight/flap-txt", "3");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
} else if (getprop("/controls/flight/flap-lever") == 3) {
|
||||
setprop("/controls/flight/flaps", 0.4286);
|
||||
setprop("/controls/flight/slats", 0.8148);
|
||||
setprop("/controls/flight/flap-lever", 2);
|
||||
setprop("/controls/flight/flap-pos", 3);
|
||||
setprop("/controls/flight/flap-txt", "2");
|
||||
} else if (getprop("controls/flight/flap-lever") == 3) {
|
||||
setprop("controls/flight/flaps", 0.4286);
|
||||
setprop("controls/flight/slats", 0.8148);
|
||||
setprop("controls/flight/flap-lever", 2);
|
||||
setprop("controls/flight/flap-pos", 3);
|
||||
setprop("controls/flight/flap-txt", "2");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
} else if (getprop("/controls/flight/flap-lever") == 2) {
|
||||
if (getprop("/velocities/airspeed-kt") <= 100) {
|
||||
setprop("/controls/flight/flaps", 0.2857);
|
||||
setprop("/controls/flight/slats", 0.6666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 2);
|
||||
setprop("/controls/flight/flap-txt", "1+F");
|
||||
} else if (getprop("controls/flight/flap-lever") == 2) {
|
||||
if (getprop("velocities/airspeed-kt") <= 100) {
|
||||
setprop("controls/flight/flaps", 0.2857);
|
||||
setprop("controls/flight/slats", 0.6666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 2);
|
||||
setprop("controls/flight/flap-txt", "1+F");
|
||||
flaptimer.start();
|
||||
return;
|
||||
} else {
|
||||
setprop("/controls/flight/flaps", 0.000);
|
||||
setprop("/controls/flight/slats", 0.6666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 1);
|
||||
setprop("/controls/flight/flap-txt", "1");
|
||||
setprop("controls/flight/flaps", 0.000);
|
||||
setprop("controls/flight/slats", 0.6666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 1);
|
||||
setprop("controls/flight/flap-txt", "1");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
}
|
||||
} else if (getprop("/controls/flight/flap-lever") == 1) {
|
||||
setprop("/controls/flight/flaps", 0.000);
|
||||
setprop("/controls/flight/slats", 0.000);
|
||||
setprop("/controls/flight/flap-lever", 0);
|
||||
setprop("/controls/flight/flap-pos", 0);
|
||||
setprop("/controls/flight/flap-txt", " ");
|
||||
} else if (getprop("controls/flight/flap-lever") == 1) {
|
||||
setprop("controls/flight/flaps", 0.000);
|
||||
setprop("controls/flight/slats", 0.000);
|
||||
setprop("controls/flight/flap-lever", 0);
|
||||
setprop("controls/flight/flap-pos", 0);
|
||||
setprop("controls/flight/flap-txt", " ");
|
||||
flaptimer.stop();
|
||||
return;
|
||||
}
|
||||
|
@ -421,18 +421,18 @@ controls.flapsDown = func(step) {
|
|||
}
|
||||
|
||||
var flaptimer = maketimer(0.5, func {
|
||||
if (getprop("/controls/flight/flap-pos") == 2 and getprop("/velocities/airspeed-kt") >= 208) {
|
||||
setprop("/controls/flight/flaps", 0.000);
|
||||
setprop("/controls/flight/slats", 0.666);
|
||||
setprop("/controls/flight/flap-lever", 1);
|
||||
setprop("/controls/flight/flap-pos", 1);
|
||||
setprop("/controls/flight/flap-txt", "1");
|
||||
if (getprop("controls/flight/flap-pos") == 2 and getprop("velocities/airspeed-kt") >= 208) {
|
||||
setprop("controls/flight/flaps", 0.000);
|
||||
setprop("controls/flight/slats", 0.666);
|
||||
setprop("controls/flight/flap-lever", 1);
|
||||
setprop("controls/flight/flap-pos", 1);
|
||||
setprop("controls/flight/flap-txt", "1");
|
||||
flaptimer.stop();
|
||||
}
|
||||
});
|
||||
|
||||
controls.stepSpoilers = func(step) {
|
||||
setprop("/controls/flight/speedbrake-arm", 0);
|
||||
setprop("controls/flight/speedbrake-arm", 0);
|
||||
if (step == 1) {
|
||||
deploySpeedbrake();
|
||||
} else if (step == -1) {
|
||||
|
@ -441,100 +441,100 @@ controls.stepSpoilers = func(step) {
|
|||
}
|
||||
|
||||
var deploySpeedbrake = func {
|
||||
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
|
||||
if (getprop("/controls/flight/speedbrake") < 1.0) {
|
||||
setprop("/controls/flight/speedbrake", 1.0);
|
||||
if (getprop("gear/gear[1]/wow") == 1 or getprop("gear/gear[2]/wow") == 1) {
|
||||
if (getprop("controls/flight/speedbrake") < 1.0) {
|
||||
setprop("controls/flight/speedbrake", 1.0);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/controls/flight/speedbrake") < 0.5) {
|
||||
setprop("/controls/flight/speedbrake", 0.5);
|
||||
} else if (getprop("/controls/flight/speedbrake") < 1.0) {
|
||||
setprop("/controls/flight/speedbrake", 1.0);
|
||||
if (getprop("controls/flight/speedbrake") < 0.5) {
|
||||
setprop("controls/flight/speedbrake", 0.5);
|
||||
} else if (getprop("controls/flight/speedbrake") < 1.0) {
|
||||
setprop("controls/flight/speedbrake", 1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var retractSpeedbrake = func {
|
||||
if (getprop("/gear/gear[1]/wow") == 1 or getprop("/gear/gear[2]/wow") == 1) {
|
||||
if (getprop("/controls/flight/speedbrake") > 0.0) {
|
||||
setprop("/controls/flight/speedbrake", 0.0);
|
||||
if (getprop("gear/gear[1]/wow") == 1 or getprop("gear/gear[2]/wow") == 1) {
|
||||
if (getprop("controls/flight/speedbrake") > 0.0) {
|
||||
setprop("controls/flight/speedbrake", 0.0);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/controls/flight/speedbrake") > 0.5) {
|
||||
setprop("/controls/flight/speedbrake", 0.5);
|
||||
} else if (getprop("/controls/flight/speedbrake") > 0.0) {
|
||||
setprop("/controls/flight/speedbrake", 0.0);
|
||||
if (getprop("controls/flight/speedbrake") > 0.5) {
|
||||
setprop("controls/flight/speedbrake", 0.5);
|
||||
} else if (getprop("controls/flight/speedbrake") > 0.0) {
|
||||
setprop("controls/flight/speedbrake", 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var slewProp = func(prop, delta) {
|
||||
delta *= getprop("/sim/time/delta-realtime-sec");
|
||||
delta *= getprop("sim/time/delta-realtime-sec");
|
||||
setprop(prop, getprop(prop) + delta);
|
||||
return getprop(prop);
|
||||
}
|
||||
|
||||
controls.elevatorTrim = func(speed) {
|
||||
if (getprop("/systems/hydraulic/green-psi") >= 1500) {
|
||||
if (getprop("systems/hydraulic/green-psi") >= 1500) {
|
||||
slewProp("/controls/flight/elevator-trim", speed * 0.045);
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/controls/flight/elevator-trim", func {
|
||||
if (getprop("/controls/flight/elevator-trim") > 0.32) {
|
||||
setprop("/controls/flight/elevator-trim", 0.32);
|
||||
if (getprop("controls/flight/elevator-trim") > 0.32) {
|
||||
setprop("controls/flight/elevator-trim", 0.32);
|
||||
}
|
||||
});
|
||||
|
||||
var lightsLoop = maketimer(0.2, func {
|
||||
gear = getprop("/gear/gear[0]/position-norm");
|
||||
nose_lights = getprop("/sim/model/lights/nose-lights");
|
||||
settingT = getprop("/controls/lighting/taxi-light-switch");
|
||||
domeSetting = getprop("/controls/lighting/dome-norm");
|
||||
gear = getprop("gear/gear[0]/position-norm");
|
||||
nose_lights = getprop("sim/model/lights/nose-lights");
|
||||
settingT = getprop("controls/lighting/taxi-light-switch");
|
||||
domeSetting = getprop("controls/lighting/dome-norm");
|
||||
|
||||
# nose lights
|
||||
|
||||
if (settingT == 0.5 and gear > 0.9 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0)) {
|
||||
setprop("/sim/model/lights/nose-lights", 0.85);
|
||||
} else if (settingT == 1 and gear > 0.9 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0)) {
|
||||
setprop("/sim/model/lights/nose-lights", 1);
|
||||
if (settingT == 0.5 and gear > 0.9 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0)) {
|
||||
setprop("sim/model/lights/nose-lights", 0.85);
|
||||
} else if (settingT == 1 and gear > 0.9 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0)) {
|
||||
setprop("sim/model/lights/nose-lights", 1);
|
||||
} else {
|
||||
setprop("/sim/model/lights/nose-lights", 0);
|
||||
setprop("sim/model/lights/nose-lights", 0);
|
||||
}
|
||||
|
||||
# turnoff lights
|
||||
settingTurnoff = getprop("/controls/lighting/turnoff-light-switch");
|
||||
left_turnoff_light = props.globals.getNode("/controls/lighting/leftturnoff");
|
||||
right_turnoff_light = props.globals.getNode("/controls/lighting/rightturnoff");
|
||||
settingTurnoff = getprop("controls/lighting/turnoff-light-switch");
|
||||
left_turnoff_light = props.globals.getNode("controls/lighting/leftturnoff");
|
||||
right_turnoff_light = props.globals.getNode("controls/lighting/rightturnoff");
|
||||
|
||||
if (settingTurnoff == 1 and gear > 0.9 and getprop("/systems/electrical/bus/ac-1") > 0) {
|
||||
if (settingTurnoff == 1 and gear > 0.9 and getprop("systems/electrical/bus/ac-1") > 0) {
|
||||
left_turnoff_light.setBoolValue(1);
|
||||
} else {
|
||||
left_turnoff_light.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (settingTurnoff == 1 and gear > 0.9 and getprop("/systems/electrical/bus/ac-2") > 0) {
|
||||
if (settingTurnoff == 1 and gear > 0.9 and getprop("systems/electrical/bus/ac-2") > 0) {
|
||||
right_turnoff_light.setBoolValue(1);
|
||||
} else {
|
||||
right_turnoff_light.setBoolValue(0);
|
||||
}
|
||||
|
||||
# logo and navigation lights
|
||||
setting = getprop("/controls/lighting/nav-lights-switch");
|
||||
nav_lights = props.globals.getNode("/sim/model/lights/nav-lights");
|
||||
logo_lights = props.globals.getNode("/sim/model/lights/logo-lights");
|
||||
wow = getprop("/gear/gear[2]/wow");
|
||||
slats = getprop("/controls/flight/slats");
|
||||
setting = getprop("controls/lighting/nav-lights-switch");
|
||||
nav_lights = props.globals.getNode("sim/model/lights/nav-lights");
|
||||
logo_lights = props.globals.getNode("sim/model/lights/logo-lights");
|
||||
wow = getprop("gear/gear[2]/wow");
|
||||
slats = getprop("controls/flight/slats");
|
||||
|
||||
if (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0 or getprop("/systems/electrical/bus/dc-1") > 0 or getprop("/systems/electrical/bus/dc-2") > 0) {
|
||||
setprop("/systems/electrical/nav-lights-power", 1);
|
||||
if (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0 or getprop("systems/electrical/bus/dc-1") > 0 or getprop("systems/electrical/bus/dc-2") > 0) {
|
||||
setprop("systems/electrical/nav-lights-power", 1);
|
||||
} else {
|
||||
setprop("/systems/electrical/nav-lights-power", 0);
|
||||
setprop("systems/electrical/nav-lights-power", 0);
|
||||
}
|
||||
|
||||
if (setting == 0 and logo_lights == 1) {
|
||||
logo_lights.setBoolValue(0);
|
||||
} else if (setting == 1 or setting == 2 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0)) {
|
||||
} else if (setting == 1 or setting == 2 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0)) {
|
||||
if ((wow) or (!wow and slats > 0)) {
|
||||
logo_lights.setBoolValue(1);
|
||||
} else {
|
||||
|
@ -544,15 +544,15 @@ var lightsLoop = maketimer(0.2, func {
|
|||
logo_lights.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (setting == 1 or setting == 2 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0 or getprop("/systems/electrical/bus/dc-1") > 0 or getprop("/systems/electrical/bus/dc-2") > 0)) {
|
||||
if (setting == 1 or setting == 2 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0 or getprop("systems/electrical/bus/dc-1") > 0 or getprop("systems/electrical/bus/dc-2") > 0)) {
|
||||
nav_lights.setBoolValue(1);
|
||||
} else {
|
||||
nav_lights.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (domeSetting == 0.5 and getprop("/systems/electrical/bus/dc-ess") > 0) {
|
||||
if (domeSetting == 0.5 and getprop("systems/electrical/bus/dc-ess") > 0) {
|
||||
dome_light.setValue(0.5);
|
||||
} elsif (domeSetting == 1 and getprop("/systems/electrical/bus/dc-ess") > 0) {
|
||||
} elsif (domeSetting == 1 and getprop("systems/electrical/bus/dc-ess") > 0) {
|
||||
dome_light.setValue(1);
|
||||
} else {
|
||||
dome_light.setValue(0);
|
||||
|
@ -561,9 +561,9 @@ var lightsLoop = maketimer(0.2, func {
|
|||
# strobe
|
||||
strobe_sw = strobe_switch.getValue();
|
||||
|
||||
if (strobe_sw == 1 and getprop("/systems/electrical/bus/ac-2") > 0) {
|
||||
if (strobe_sw == 1 and getprop("systems/electrical/bus/ac-2") > 0) {
|
||||
strobe_light.setValue(1);
|
||||
} elsif (strobe_sw == 0.5 and getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/systems/electrical/bus/ac-2") > 0) {
|
||||
} elsif (strobe_sw == 0.5 and getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0 and getprop("systems/electrical/bus/ac-2") > 0) {
|
||||
# todo: use lgciu output 5
|
||||
strobe_light.setValue(1);
|
||||
} else {
|
||||
|
@ -572,7 +572,7 @@ var lightsLoop = maketimer(0.2, func {
|
|||
|
||||
# beacon
|
||||
|
||||
if (beacon_switch.getValue() == 1 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0)) {
|
||||
if (beacon_switch.getValue() == 1 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0)) {
|
||||
beacon_ctl.setValue(1);
|
||||
} else {
|
||||
beacon_ctl.setValue(0);
|
||||
|
@ -580,7 +580,7 @@ var lightsLoop = maketimer(0.2, func {
|
|||
|
||||
# wing
|
||||
|
||||
if (wing_switch.getValue() == 1 and (getprop("/systems/electrical/bus/ac-1") > 0 or getprop("/systems/electrical/bus/ac-2") > 0)) {
|
||||
if (wing_switch.getValue() == 1 and (getprop("systems/electrical/bus/ac-1") > 0 or getprop("systems/electrical/bus/ac-2") > 0)) {
|
||||
wing_ctl.setValue(1);
|
||||
} else {
|
||||
wing_ctl.setValue(0);
|
||||
|
@ -588,13 +588,13 @@ var lightsLoop = maketimer(0.2, func {
|
|||
|
||||
# landL
|
||||
|
||||
if (landlSw.getValue() == 1 and getprop("/systems/electrical/bus/ac-1") > 0) {
|
||||
if (landlSw.getValue() == 1 and getprop("systems/electrical/bus/ac-1") > 0) {
|
||||
landL.setValue(1);
|
||||
} else {
|
||||
landL.setValue(0);
|
||||
}
|
||||
|
||||
if (landrSw.getValue() == 1 and getprop("/systems/electrical/bus/ac-2") > 0) {
|
||||
if (landrSw.getValue() == 1 and getprop("systems/electrical/bus/ac-2") > 0) {
|
||||
landR.setValue(1);
|
||||
} else {
|
||||
landR.setValue(0);
|
||||
|
@ -602,48 +602,48 @@ var lightsLoop = maketimer(0.2, func {
|
|||
|
||||
# signs
|
||||
|
||||
if (getprop("/systems/pressurization/cabinalt-norm") > 11300) {
|
||||
setprop("/controls/lighting/seatbelt-sign", 1);
|
||||
setprop("/controls/lighting/no-smoking-sign", 1);
|
||||
if (getprop("systems/pressurization/cabinalt-norm") > 11300) {
|
||||
setprop("controls/lighting/seatbelt-sign", 1);
|
||||
setprop("controls/lighting/no-smoking-sign", 1);
|
||||
} else {
|
||||
if (getprop("controls/switches/seatbelt-sign") == 1) {
|
||||
if (getprop("/controls/lighting/seatbelt-sign") == 0) {
|
||||
setprop("/controls/lighting/seatbelt-sign", 1);
|
||||
if (getprop("controls/lighting/seatbelt-sign") == 0) {
|
||||
setprop("controls/lighting/seatbelt-sign", 1);
|
||||
}
|
||||
} elsif (getprop("controls/switches/seatbelt-sign") == 0) {
|
||||
if (getprop("/controls/lighting/seatbelt-sign") == 1) {
|
||||
setprop("/controls/lighting/seatbelt-sign", 0);
|
||||
if (getprop("controls/lighting/seatbelt-sign") == 1) {
|
||||
setprop("controls/lighting/seatbelt-sign", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("controls/switches/no-smoking-sign") == 1) {
|
||||
if (getprop("/controls/lighting/no-smoking-sign") == 0) {
|
||||
setprop("/controls/lighting/no-smoking-sign", 1);
|
||||
if (getprop("controls/lighting/no-smoking-sign") == 0) {
|
||||
setprop("controls/lighting/no-smoking-sign", 1);
|
||||
}
|
||||
} elsif (getprop("controls/switches/no-smoking-sign") == 0.5 and getprop("gear/gear[0]/position-norm") != 0) { # todo: should be when uplocks not engaged
|
||||
if (getprop("/controls/lighting/no-smoking-sign") == 0) {
|
||||
setprop("/controls/lighting/no-smoking-sign", 1);
|
||||
if (getprop("controls/lighting/no-smoking-sign") == 0) {
|
||||
setprop("controls/lighting/no-smoking-sign", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("/controls/lighting/no-smoking-sign", 0); # sign stays on in cabin but sound still occurs
|
||||
setprop("controls/lighting/no-smoking-sign", 0); # sign stays on in cabin but sound still occurs
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("controls/lighting/landing-lights[1]") >= 0.5) {
|
||||
setprop("/fdm/jsbsim/rubbish/landL", 1);
|
||||
setprop("fdm/jsbsim/rubbish/landL", 1);
|
||||
} else {
|
||||
setprop("/fdm/jsbsim/rubbish/landL", 0);
|
||||
setprop("fdm/jsbsim/rubbish/landL", 0);
|
||||
}
|
||||
|
||||
if (getprop("controls/lighting/landing-lights[2]") >= 0.5) {
|
||||
setprop("/fdm/jsbsim/rubbish/landR", 1);
|
||||
setprop("fdm/jsbsim/rubbish/landR", 1);
|
||||
} else {
|
||||
setprop("/fdm/jsbsim/rubbish/landR", 0);
|
||||
setprop("fdm/jsbsim/rubbish/landR", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var lTray = func {
|
||||
var lTrayCMD = getprop("/controls/tray/lefttrayext");
|
||||
var lTrayCMD = getprop("controls/tray/lefttrayext");
|
||||
if (lTrayCMD < 0.5) {
|
||||
interpolate("/controls/tray/lefttrayext", 0.5, 0.5);
|
||||
} else if (lTrayCMD == 0.5) {
|
||||
|
@ -654,7 +654,7 @@ var lTray = func {
|
|||
}
|
||||
|
||||
var rTray = func {
|
||||
var rTrayCMD = getprop("/controls/tray/righttrayext");
|
||||
var rTrayCMD = getprop("controls/tray/righttrayext");
|
||||
if (rTrayCMD < 0.5) {
|
||||
interpolate("/controls/tray/righttrayext", 0.5, 0.5);
|
||||
} else if (rTrayCMD == 0.5) {
|
||||
|
@ -665,7 +665,7 @@ var rTray = func {
|
|||
}
|
||||
|
||||
var l1Pedal = func {
|
||||
var lPedalCMD = getprop("/controls/footrest-cpt[0]");
|
||||
var lPedalCMD = getprop("controls/footrest-cpt[0]");
|
||||
if (lPedalCMD < 1.0) {
|
||||
interpolate("/controls/footrest-cpt[0]", 1.0, 0.5);
|
||||
} else {
|
||||
|
@ -674,7 +674,7 @@ var l1Pedal = func {
|
|||
}
|
||||
|
||||
var l2Pedal = func {
|
||||
var l2PedalCMD = getprop("/controls/footrest-cpt[1]");
|
||||
var l2PedalCMD = getprop("controls/footrest-cpt[1]");
|
||||
if (l2PedalCMD < 1.0) {
|
||||
interpolate("/controls/footrest-cpt[1]", 1.0, 0.5);
|
||||
} else {
|
||||
|
@ -683,7 +683,7 @@ var l2Pedal = func {
|
|||
}
|
||||
|
||||
var r1Pedal = func {
|
||||
var rPedalCMD = getprop("/controls/footrest-fo[0]");
|
||||
var rPedalCMD = getprop("controls/footrest-fo[0]");
|
||||
if (rPedalCMD < 1.0) {
|
||||
interpolate("/controls/footrest-fo[0]", 1.0, 0.5);
|
||||
} else {
|
||||
|
@ -692,7 +692,7 @@ var r1Pedal = func {
|
|||
}
|
||||
|
||||
var r2Pedal = func {
|
||||
var r2PedalCMD = getprop("/controls/footrest-fo[1]");
|
||||
var r2PedalCMD = getprop("controls/footrest-fo[1]");
|
||||
if (r2PedalCMD < 1.0) {
|
||||
interpolate("/controls/footrest-fo[1]", 1.0, 0.5);
|
||||
} else {
|
||||
|
@ -700,13 +700,13 @@ var r2Pedal = func {
|
|||
}
|
||||
}
|
||||
|
||||
if (getprop("/controls/flight/auto-coordination") == 1) {
|
||||
setprop("/controls/flight/auto-coordination", 0);
|
||||
if (getprop("controls/flight/auto-coordination") == 1) {
|
||||
setprop("controls/flight/auto-coordination", 0);
|
||||
print("System: Auto Coordination has been turned off as it is not compatible with the fly-by-wire of this aircraft.");
|
||||
screen.log.write("Auto Coordination has been disabled as it is not compatible with the fly-by-wire of this aircraft", 1, 0, 0);
|
||||
}
|
||||
|
||||
setprop("/controls/flight/aileron-drives-tiller", 0);
|
||||
setprop("controls/flight/aileron-drives-tiller", 0);
|
||||
|
||||
var APPanel = {
|
||||
APDisc: func() {
|
||||
|
@ -719,9 +719,9 @@ var APPanel = {
|
|||
|
||||
var resetView = func() {
|
||||
if (getprop("sim/current-view/view-number") == 0) {
|
||||
if (getprop("/sim/rendering/headshake/enabled")) {
|
||||
if (getprop("sim/rendering/headshake/enabled")) {
|
||||
var _shakeFlag = 1;
|
||||
setprop("/sim/rendering/headshake/enabled", 0);
|
||||
setprop("sim/rendering/headshake/enabled", 0);
|
||||
} else {
|
||||
var _shakeFlag = 0;
|
||||
}
|
||||
|
@ -741,9 +741,9 @@ var resetView = func() {
|
|||
interpolate("sim/current-view/z-offset-m", -13.75, 0.66);
|
||||
|
||||
if (_shakeFlag) {
|
||||
setprop("/sim/rendering/headshake/enabled", 1);
|
||||
setprop("sim/rendering/headshake/enabled", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setprop("/systems/acconfig/libraries-loaded", 1);
|
||||
setprop("systems/acconfig/libraries-loaded", 1);
|
||||
|
|
|
@ -6,35 +6,35 @@
|
|||
# Usage Example: pts.Class.SubClass.node.getValue()
|
||||
|
||||
var APU = {
|
||||
masterSw: props.globals.getNode("/controls/APU/master"),
|
||||
rpm: props.globals.getNode("/systems/apu/rpm"),
|
||||
masterSw: props.globals.getNode("controls/APU/master"),
|
||||
rpm: props.globals.getNode("systems/apu/rpm"),
|
||||
};
|
||||
|
||||
var Consumables = {
|
||||
Fuel: {
|
||||
totalFuelLbs: props.globals.getNode("/consumables/fuel/total-fuel-lbs"),
|
||||
totalFuelLbs: props.globals.getNode("consumables/fuel/total-fuel-lbs"),
|
||||
},
|
||||
};
|
||||
|
||||
var Controls = {
|
||||
Engines: {
|
||||
startSw: props.globals.getNode("/controls/engines/engine-start-switch"),
|
||||
startSw: props.globals.getNode("controls/engines/engine-start-switch"),
|
||||
Engine1: {
|
||||
cutoffSw: props.globals.getNode("/controls/engines/engine[0]/cutoff-switch"),
|
||||
firePb: props.globals.getNode("/controls/engines/engine[0]/fire-btn"),
|
||||
throttle: props.globals.getNode("/controls/engines/engine[0]/throttle"),
|
||||
cutoffSw: props.globals.getNode("controls/engines/engine[0]/cutoff-switch"),
|
||||
firePb: props.globals.getNode("controls/engines/engine[0]/fire-btn"),
|
||||
throttle: props.globals.getNode("controls/engines/engine[0]/throttle"),
|
||||
},
|
||||
Engine2: {
|
||||
cutoffSw: props.globals.getNode("/controls/engines/engine[1]/cutoff-switch"),
|
||||
firePb: props.globals.getNode("/controls/engines/engine[1]/fire-btn"),
|
||||
throttle: props.globals.getNode("/controls/engines/engine[1]/throttle"),
|
||||
cutoffSw: props.globals.getNode("controls/engines/engine[1]/cutoff-switch"),
|
||||
firePb: props.globals.getNode("controls/engines/engine[1]/fire-btn"),
|
||||
throttle: props.globals.getNode("controls/engines/engine[1]/throttle"),
|
||||
},
|
||||
},
|
||||
Flight: {
|
||||
aileron: props.globals.getNode("/controls/flight/aileron"),
|
||||
aileron: props.globals.getNode("controls/flight/aileron"),
|
||||
},
|
||||
Gear: {
|
||||
gearDown: props.globals.getNode("/controls/gear/gear-down"),
|
||||
gearDown: props.globals.getNode("controls/gear/gear-down"),
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -44,98 +44,98 @@ var ECAM = {
|
|||
|
||||
var Engines = {
|
||||
Engine1: {
|
||||
epractual: props.globals.getNode("/engines/engine[0]/epr-actual"),
|
||||
n1actual: props.globals.getNode("/engines/engine[0]/n1-actual"),
|
||||
n2actual: props.globals.getNode("/engines/engine[0]/n2-actual"),
|
||||
state: props.globals.getNode("/engines/engine[0]/state"),
|
||||
epractual: props.globals.getNode("engines/engine[0]/epr-actual"),
|
||||
n1actual: props.globals.getNode("engines/engine[0]/n1-actual"),
|
||||
n2actual: props.globals.getNode("engines/engine[0]/n2-actual"),
|
||||
state: props.globals.getNode("engines/engine[0]/state"),
|
||||
},
|
||||
Engine2: {
|
||||
epractual: props.globals.getNode("/engines/engine[1]/epr-actual"),
|
||||
n1actual: props.globals.getNode("/engines/engine[1]/n1-actual"),
|
||||
n2actual: props.globals.getNode("/engines/engine[1]/n2-actual"),
|
||||
state: props.globals.getNode("/engines/engine[1]/state"),
|
||||
epractual: props.globals.getNode("engines/engine[1]/epr-actual"),
|
||||
n1actual: props.globals.getNode("engines/engine[1]/n1-actual"),
|
||||
n2actual: props.globals.getNode("engines/engine[1]/n2-actual"),
|
||||
state: props.globals.getNode("engines/engine[1]/state"),
|
||||
},
|
||||
};
|
||||
|
||||
var FMGC = {
|
||||
CasCompare: {
|
||||
rejectAll: props.globals.getNode("/systems/fmgc/cas-compare/cas-reject-all"),
|
||||
rejectAll: props.globals.getNode("systems/fmgc/cas-compare/cas-reject-all"),
|
||||
},
|
||||
};
|
||||
|
||||
var Gear = {
|
||||
compression: [props.globals.getNode("/gear/gear[0]/compression-norm"),props.globals.getNode("/gear/gear[1]/compression-norm"),props.globals.getNode("/gear/gear[2]/compression-norm")],
|
||||
wow: [props.globals.getNode("/gear/gear[0]/wow"),props.globals.getNode("/gear/gear[1]/wow"),props.globals.getNode("/gear/gear[2]/wow")],
|
||||
position: [props.globals.getNode("/gear/gear[0]/position-norm"),props.globals.getNode("/gear/gear[1]/position-norm"),props.globals.getNode("/gear/gear[2]/position-norm")],
|
||||
compression: [props.globals.getNode("gear/gear[0]/compression-norm"),props.globals.getNode("gear/gear[1]/compression-norm"),props.globals.getNode("gear/gear[2]/compression-norm")],
|
||||
wow: [props.globals.getNode("gear/gear[0]/wow"),props.globals.getNode("gear/gear[1]/wow"),props.globals.getNode("gear/gear[2]/wow")],
|
||||
position: [props.globals.getNode("gear/gear[0]/position-norm"),props.globals.getNode("gear/gear[1]/position-norm"),props.globals.getNode("gear/gear[2]/position-norm")],
|
||||
};
|
||||
|
||||
var Instrumentation = {
|
||||
AirspeedIndicator: {
|
||||
indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"),
|
||||
indicatedSpdKt: props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt"),
|
||||
},
|
||||
TCAS: {
|
||||
Inputs: {
|
||||
mode: props.globals.getNode("/instrumentation/tcas/inputs/mode"),
|
||||
mode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var JSBSIM = {
|
||||
FCS: {
|
||||
flapDeg: props.globals.getNode("/fdm/jsbsim/fcs/flap-pos-deg"),
|
||||
slatDeg: props.globals.getNode("/fdm/jsbsim/fcs/slat-pos-deg"),
|
||||
flapDeg: props.globals.getNode("fdm/jsbsim/fcs/flap-pos-deg"),
|
||||
slatDeg: props.globals.getNode("fdm/jsbsim/fcs/slat-pos-deg"),
|
||||
},
|
||||
};
|
||||
|
||||
var JSBSim = {
|
||||
FBW: {
|
||||
aileron: props.globals.getNode("/fdm/jsbsim/fbw/aileron-sidestick"),
|
||||
elevator: props.globals.getNode("/fdm/jsbsim/fbw/elevator-sidestick"),
|
||||
aileron: props.globals.getNode("fdm/jsbsim/fbw/aileron-sidestick"),
|
||||
elevator: props.globals.getNode("fdm/jsbsim/fbw/elevator-sidestick"),
|
||||
},
|
||||
Propulsion: {
|
||||
Engine1: {
|
||||
fuelUsed: props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs"),
|
||||
fuelUsed: props.globals.getNode("fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs"),
|
||||
},
|
||||
Engine2: {
|
||||
fuelUsed: props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs"),
|
||||
fuelUsed: props.globals.getNode("fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs"),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var Options = {
|
||||
eng: props.globals.getNode("/options/eng"),
|
||||
eng: props.globals.getNode("options/eng"),
|
||||
};
|
||||
|
||||
var Orientation = {
|
||||
pitch: props.globals.getNode("/orientation/pitch-deg"),
|
||||
roll: props.globals.getNode("/orientation/roll-deg"),
|
||||
yaw: props.globals.getNode("/orientation/yaw-deg"),
|
||||
pitch: props.globals.getNode("orientation/pitch-deg"),
|
||||
roll: props.globals.getNode("orientation/roll-deg"),
|
||||
yaw: props.globals.getNode("orientation/yaw-deg"),
|
||||
};
|
||||
|
||||
var Position = {
|
||||
gearAglFt: props.globals.getNode("/position/gear-agl-ft"),
|
||||
latitude: props.globals.getNode("/position/latitude-deg"),
|
||||
longitude: props.globals.getNode("/position/longitude-deg"),
|
||||
gearAglFt: props.globals.getNode("position/gear-agl-ft"),
|
||||
latitude: props.globals.getNode("position/latitude-deg"),
|
||||
longitude: props.globals.getNode("position/longitude-deg"),
|
||||
};
|
||||
|
||||
var Sim = {
|
||||
aero: props.globals.getNode("/sim/aero"),
|
||||
aero: props.globals.getNode("sim/aero"),
|
||||
Replay: {
|
||||
replayActive: props.globals.getNode("/sim/replay/replay-state"),
|
||||
replayActive: props.globals.getNode("sim/replay/replay-state"),
|
||||
},
|
||||
Time: {
|
||||
elapsedSec: props.globals.getNode("/sim/time/elapsed-sec"),
|
||||
elapsedSec: props.globals.getNode("sim/time/elapsed-sec"),
|
||||
},
|
||||
};
|
||||
|
||||
var PTSSystems = {
|
||||
Thrust: {
|
||||
flex: props.globals.getNode("/systems/thrust/lim-flex"),
|
||||
flex: props.globals.getNode("systems/thrust/lim-flex"),
|
||||
},
|
||||
};
|
||||
|
||||
var Velocities = {
|
||||
groundspeed: props.globals.getNode("/velocities/groundspeed-kt"),
|
||||
groundspeed: props.globals.getNode("velocities/groundspeed-kt"),
|
||||
};
|
||||
|
||||
setprop("/systems/acconfig/property-tree-setup-loaded", 1);
|
||||
setprop("systems/acconfig/property-tree-setup-loaded", 1);
|
||||
|
|
|
@ -11,10 +11,10 @@ var n_g_l = 0;
|
|||
var n_g_r = 0;
|
||||
|
||||
var theShakeEffect = func {
|
||||
n_g_c = getprop("/gear/gear[0]/compression-norm") or 0;
|
||||
n_g_l = getprop("/gear/gear[1]/compression-norm") or 0;
|
||||
n_g_r = getprop("/gear/gear[2]/compression-norm") or 0;
|
||||
rSpeed = getprop("/gear/gear[0]/rollspeed-ms") or 0;
|
||||
n_g_c = getprop("gear/gear[0]/compression-norm") or 0;
|
||||
n_g_l = getprop("gear/gear[1]/compression-norm") or 0;
|
||||
n_g_r = getprop("gear/gear[2]/compression-norm") or 0;
|
||||
rSpeed = getprop("gear/gear[0]/rollspeed-ms") or 0;
|
||||
sf = rSpeed / 94000;
|
||||
|
||||
if (shakeEffectA3XX.getBoolValue() and (n_g_c > 0 or n_g_l > 0 or n_g_r > 0)) {
|
||||
|
@ -27,8 +27,8 @@ var theShakeEffect = func {
|
|||
}, 0.12);
|
||||
settimer(theShakeEffect, 0.09);
|
||||
} else {
|
||||
setprop("/systems/shake/shaking", 0);
|
||||
setprop("/systems/shake/effect", 0);
|
||||
setprop("systems/shake/shaking", 0);
|
||||
setprop("systems/shake/effect", 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,16 +11,16 @@ var incStep = 5;
|
|||
var viewName = "XX";
|
||||
|
||||
var fovZoom = func(d) {
|
||||
viewName = getprop("/sim/current-view/name");
|
||||
canChangeZOffset = getprop("/sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View";
|
||||
viewName = getprop("sim/current-view/name");
|
||||
canChangeZOffset = getprop("sim/current-view/type") == "lookat" and viewName != "Tower View" and viewName != "Fly-By View" and viewName != "Chase View" and viewName != "Chase View Without Yaw" and viewName != "Walk View";
|
||||
|
||||
if (getprop("/sim/current-view/z-offset-m") <= -50) {
|
||||
if (getprop("sim/current-view/z-offset-m") <= -50) {
|
||||
decStep = -10;
|
||||
} else {
|
||||
decStep = -5;
|
||||
}
|
||||
|
||||
if (getprop("/sim/current-view/z-offset-m") < -50) { # Not a typo, the conditions are different
|
||||
if (getprop("sim/current-view/z-offset-m") < -50) { # Not a typo, the conditions are different
|
||||
incStep = 10;
|
||||
} else {
|
||||
incStep = 5;
|
||||
|
@ -28,11 +28,11 @@ var fovZoom = func(d) {
|
|||
|
||||
if (d == -1) {
|
||||
if (canChangeZOffset) {
|
||||
distance = getprop("/sim/current-view/z-offset-m");
|
||||
min_dist = getprop("/sim/current-view/z-offset-min-m");
|
||||
distance = getprop("sim/current-view/z-offset-m");
|
||||
min_dist = getprop("sim/current-view/z-offset-min-m");
|
||||
|
||||
distance = math.round(std.min(-min_dist, distance + incStep) / incStep, 0.1) * incStep;
|
||||
setprop("/sim/current-view/z-offset-m", distance);
|
||||
setprop("sim/current-view/z-offset-m", distance);
|
||||
|
||||
gui.popupTip(sprintf("%d meters", abs(distance)));
|
||||
} else {
|
||||
|
@ -40,11 +40,11 @@ var fovZoom = func(d) {
|
|||
}
|
||||
} else if (d == 1) {
|
||||
if (canChangeZOffset) {
|
||||
distance = getprop("/sim/current-view/z-offset-m");
|
||||
max_dist = getprop("/sim/current-view/z-offset-max-m");
|
||||
distance = getprop("sim/current-view/z-offset-m");
|
||||
max_dist = getprop("sim/current-view/z-offset-max-m");
|
||||
|
||||
distance = math.round(std.max(-max_dist, distance + decStep) / decStep, 0.1) * decStep;
|
||||
setprop("/sim/current-view/z-offset-m", distance);
|
||||
setprop("sim/current-view/z-offset-m", distance);
|
||||
|
||||
gui.popupTip(sprintf("%d meters", abs(distance)));
|
||||
} else {
|
||||
|
@ -52,11 +52,11 @@ var fovZoom = func(d) {
|
|||
}
|
||||
} else if (d == 0) {
|
||||
if (canChangeZOffset) {
|
||||
setprop("/sim/current-view/z-offset-m", getprop("/sim/current-view/z-offset-default") * -1);
|
||||
gui.popupTip(sprintf("%d meters", getprop("/sim/current-view/z-offset-default")));
|
||||
setprop("sim/current-view/z-offset-m", getprop("sim/current-view/z-offset-default") * -1);
|
||||
gui.popupTip(sprintf("%d meters", getprop("sim/current-view/z-offset-default")));
|
||||
} else {
|
||||
setprop("/sim/current-view/field-of-view", getprop("/sim/view/config/default-field-of-view-deg"));
|
||||
gui.popupTip(sprintf("FOV: %.1f", getprop("/sim/current-view/field-of-view")))
|
||||
setprop("sim/current-view/field-of-view", getprop("sim/view/config/default-field-of-view-deg"));
|
||||
gui.popupTip(sprintf("FOV: %.1f", getprop("sim/current-view/field-of-view")))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
var ADIRS = {
|
||||
init: func() {
|
||||
setprop("/controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank)
|
||||
setprop("/controls/adirs/mcdu/mode2", "");
|
||||
setprop("/controls/adirs/mcdu/mode3", "");
|
||||
setprop("/controls/adirs/mcdu/status1", ""); # see smith thales p487
|
||||
setprop("/controls/adirs/mcdu/status2", "");
|
||||
setprop("/controls/adirs/mcdu/status3", "");
|
||||
setprop("/controls/adirs/mcdu/hdg", ""); # only shown if in ATT mode
|
||||
setprop("/controls/adirs/mcdu/avgdrift1", "");
|
||||
setprop("/controls/adirs/mcdu/avgdrift2", "");
|
||||
setprop("/controls/adirs/mcdu/avgdrift3", "");
|
||||
setprop("/controls/adirs/mcducbtn", 0);
|
||||
setprop("controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank)
|
||||
setprop("controls/adirs/mcdu/mode2", "");
|
||||
setprop("controls/adirs/mcdu/mode3", "");
|
||||
setprop("controls/adirs/mcdu/status1", ""); # see smith thales p487
|
||||
setprop("controls/adirs/mcdu/status2", "");
|
||||
setprop("controls/adirs/mcdu/status3", "");
|
||||
setprop("controls/adirs/mcdu/hdg", ""); # only shown if in ATT mode
|
||||
setprop("controls/adirs/mcdu/avgdrift1", "");
|
||||
setprop("controls/adirs/mcdu/avgdrift2", "");
|
||||
setprop("controls/adirs/mcdu/avgdrift3", "");
|
||||
setprop("controls/adirs/mcducbtn", 0);
|
||||
},
|
||||
};
|
|
@ -240,19 +240,19 @@ var ADIRSnew = {
|
|||
|
||||
# PTS
|
||||
Lights: {
|
||||
adrFault: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-fault")],
|
||||
adrOff: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-off")],
|
||||
irFault: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-fault")],
|
||||
irOff: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-off")],
|
||||
onBat: props.globals.getNode("/controls/navigation/adirscp/lights/on-bat"),
|
||||
adrFault: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-fault")],
|
||||
adrOff: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-off")],
|
||||
irFault: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-fault")],
|
||||
irOff: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-off")],
|
||||
onBat: props.globals.getNode("controls/navigation/adirscp/lights/on-bat"),
|
||||
},
|
||||
Switches: {
|
||||
adrSw: [props.globals.getNode("/controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-3")],
|
||||
irModeSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3-mode")],
|
||||
irSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3")],
|
||||
adrSw: [props.globals.getNode("controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("controls/navigation/adirscp/switches/adr-3")],
|
||||
irModeSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3-mode")],
|
||||
irSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3")],
|
||||
},
|
||||
Operating: {
|
||||
adr: [props.globals.getNode("/systems/navigation/adr/operating-1"), props.globals.getNode("/systems/navigation/adr/operating-2"), props.globals.getNode("/systems/navigation/adr/operating-3")],
|
||||
adr: [props.globals.getNode("systems/navigation/adr/operating-1"), props.globals.getNode("systems/navigation/adr/operating-2"), props.globals.getNode("systems/navigation/adr/operating-3")],
|
||||
},
|
||||
|
||||
# Nodes
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
var SwitchingPanel = {
|
||||
Switches: {
|
||||
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"),
|
||||
airData: props.globals.getNode("/controls/navigation/switching/air-data"),
|
||||
eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"),
|
||||
attHdg: props.globals.getNode("controls/navigation/switching/att-hdg"),
|
||||
airData: props.globals.getNode("controls/navigation/switching/air-data"),
|
||||
eisDmc: props.globals.getNode("controls/navigation/switching/eis-dmc"),
|
||||
},
|
||||
|
||||
doAirData: func(newAirData) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# Initializing Vars #
|
||||
#####################
|
||||
|
||||
var engines = props.globals.getNode("/engines").getChildren("engine");
|
||||
var engines = props.globals.getNode("engines").getChildren("engine");
|
||||
var egt_min = 434;
|
||||
var egt_start = 587;
|
||||
var egt_max = 712;
|
||||
|
@ -17,34 +17,34 @@ var egt_lightdn_time = 10;
|
|||
var shutdown_time = 20;
|
||||
var egt_shutdown_time = 20;
|
||||
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
setprop("controls/engines/engine[0]/reverser", 0);
|
||||
setprop("controls/engines/engine[1]/reverser", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("controls/engines/engine[1]/last-igniter", "B");
|
||||
|
||||
var eng_init = func {
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
setprop("controls/engines/engine[0]/man-start", 0);
|
||||
setprop("controls/engines/engine[1]/man-start", 0);
|
||||
eng_common_init();
|
||||
}
|
||||
|
||||
# Trigger Startups and Stops
|
||||
setlistener("/controls/engines/engine[0]/cutoff-switch", func {
|
||||
if (getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
|
||||
if (getprop("controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") == 1) {
|
||||
fast_start_one();
|
||||
} else {
|
||||
if (getprop("/controls/engines/engine[0]/man-start") == 0) {
|
||||
if (getprop("controls/engines/engine[0]/man-start") == 0) {
|
||||
start_one_check();
|
||||
} else if (getprop("/controls/engines/engine[0]/man-start") == 1) {
|
||||
} else if (getprop("controls/engines/engine[0]/man-start") == 1) {
|
||||
eng_one_man_start.start();
|
||||
}
|
||||
}
|
||||
} else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
|
||||
} else if (getprop("controls/engines/engine[0]/cutoff-switch") == 1) {
|
||||
cutoff_one();
|
||||
}
|
||||
});
|
||||
|
@ -53,29 +53,29 @@ var cutoff_one = func {
|
|||
eng_one_auto_start.stop();
|
||||
eng_one_man_start.stop();
|
||||
eng_one_n2_check.stop();
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/man-start", 0);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
eng_one_n2_check.stop();
|
||||
}
|
||||
|
||||
var fast_start_one = func {
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("/engines/engine[0]/out-of-fuel", 0);
|
||||
setprop("/engines/engine[0]/run", 1);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("engines/engine[0]/out-of-fuel", 0);
|
||||
setprop("engines/engine[0]/run", 1);
|
||||
|
||||
setprop("/engines/engine[0]/cutoff", 0);
|
||||
setprop("/engines/engine[0]/starter", 0);
|
||||
setprop("engines/engine[0]/cutoff", 0);
|
||||
setprop("engines/engine[0]/starter", 0);
|
||||
|
||||
setprop("/fdm/jsbsim/propulsion/set-running", 0);
|
||||
setprop("fdm/jsbsim/propulsion/set-running", 0);
|
||||
|
||||
setprop("/engines/engine[0]/state", 3);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 3);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[0]/man-start", func {
|
||||
|
@ -83,52 +83,52 @@ setlistener("/controls/engines/engine[0]/man-start", func {
|
|||
});
|
||||
|
||||
var start_one_mancheck = func {
|
||||
if (getprop("/controls/engines/engine[0]/man-start") == 1) {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[0]/cutoff-switch") == 1)) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 1);
|
||||
if (getprop("controls/engines/engine[0]/man-start") == 1) {
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and (getprop("controls/engines/engine[0]/cutoff-switch") == 1)) {
|
||||
setprop("systems/pneumatic/eng1-starter", 1);
|
||||
settimer(start_one_mancheck_b, 0.5);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_mancheck_b = func {
|
||||
if (getprop("/systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("/engines/engine[0]/state", 1);
|
||||
setprop("/controls/engines/engine[0]/starter", 1);
|
||||
if (getprop("systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("engines/engine[0]/state", 1);
|
||||
setprop("controls/engines/engine[0]/starter", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_check = func {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 1);
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and getprop("controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
setprop("systems/pneumatic/eng1-starter", 1);
|
||||
settimer(start_one_check_b, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_check_b = func {
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[0]/cutoff-switch") == 0)) {
|
||||
if ((getprop("controls/engines/engine-start-switch") == 2) and (getprop("systems/pneumatic/total-psi") >= 28) and (getprop("controls/engines/engine[0]/cutoff-switch") == 0)) {
|
||||
auto_start_one();
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[1]/cutoff-switch", func {
|
||||
if (getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
|
||||
if (getprop("controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") == 1) {
|
||||
fast_start_two();
|
||||
} else {
|
||||
if (getprop("/controls/engines/engine[1]/man-start") == 0) {
|
||||
if (getprop("controls/engines/engine[1]/man-start") == 0) {
|
||||
start_two_check();
|
||||
} else if (getprop("/controls/engines/engine[1]/man-start") == 1) {
|
||||
} else if (getprop("controls/engines/engine[1]/man-start") == 1) {
|
||||
eng_two_man_start.start();
|
||||
}
|
||||
}
|
||||
} else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
|
||||
} else if (getprop("controls/engines/engine[1]/cutoff-switch") == 1) {
|
||||
cutoff_two();
|
||||
}
|
||||
});
|
||||
|
@ -137,28 +137,28 @@ var cutoff_two = func {
|
|||
eng_two_auto_start.stop();
|
||||
eng_two_man_start.stop();
|
||||
eng_two_n2_check.stop();
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/man-start", 0);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
|
||||
var fast_start_two = func {
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("/engines/engine[1]/out-of-fuel", 0);
|
||||
setprop("/engines/engine[1]/run", 1);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("engines/engine[1]/out-of-fuel", 0);
|
||||
setprop("engines/engine[1]/run", 1);
|
||||
|
||||
setprop("/engines/engine[1]/cutoff", 0);
|
||||
setprop("/engines/engine[1]/starter", 0);
|
||||
setprop("engines/engine[1]/cutoff", 0);
|
||||
setprop("engines/engine[1]/starter", 0);
|
||||
|
||||
setprop("/fdm/jsbsim/propulsion/set-running", 1);
|
||||
setprop("fdm/jsbsim/propulsion/set-running", 1);
|
||||
|
||||
setprop("/engines/engine[1]/state", 3);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 3);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[1]/man-start", func {
|
||||
|
@ -166,60 +166,60 @@ setlistener("/controls/engines/engine[1]/man-start", func {
|
|||
});
|
||||
|
||||
var start_two_mancheck = func {
|
||||
if (getprop("/controls/engines/engine[1]/man-start") == 1) {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[1]/cutoff-switch") == 1)) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 1);
|
||||
if (getprop("controls/engines/engine[1]/man-start") == 1) {
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and (getprop("controls/engines/engine[1]/cutoff-switch") == 1)) {
|
||||
setprop("systems/pneumatic/eng2-starter", 1);
|
||||
settimer(start_two_mancheck_b, 0.5);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_mancheck_b = func {
|
||||
if (getprop("/systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("/engines/engine[1]/state", 1);
|
||||
setprop("/controls/engines/engine[1]/starter", 1);
|
||||
if (getprop("systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("engines/engine[1]/state", 1);
|
||||
setprop("controls/engines/engine[1]/starter", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_check = func {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 1);
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and getprop("controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
setprop("systems/pneumatic/eng2-starter", 1);
|
||||
settimer(start_two_check_b, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_check_b = func {
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[1]/cutoff-switch") == 0)) {
|
||||
if ((getprop("controls/engines/engine-start-switch") == 2) and (getprop("systems/pneumatic/total-psi") >= 28) and (getprop("controls/engines/engine[1]/cutoff-switch") == 0)) {
|
||||
auto_start_two();
|
||||
}
|
||||
}
|
||||
|
||||
# Start Engine One
|
||||
var auto_start_one = func {
|
||||
setprop("/engines/engine[0]/state", 1);
|
||||
setprop("/controls/engines/engine[0]/starter", 1);
|
||||
setprop("engines/engine[0]/state", 1);
|
||||
setprop("controls/engines/engine[0]/starter", 1);
|
||||
eng_one_auto_start.start();
|
||||
}
|
||||
|
||||
var eng_one_auto_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 22) {
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 22) {
|
||||
eng_one_auto_start.stop();
|
||||
setprop("/engines/engine[0]/state", 2);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
if (getprop("/controls/engines/engine[0]/last-igniter") == "B") {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "A");
|
||||
} else if (getprop("/controls/engines/engine[0]/last-igniter") == "A") {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("engines/engine[0]/state", 2);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
if (getprop("controls/engines/engine[0]/last-igniter") == "B") {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "A");
|
||||
} else if (getprop("controls/engines/engine[0]/last-igniter") == "A") {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "B");
|
||||
}
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_one_egt_check.start();
|
||||
|
@ -228,12 +228,12 @@ var eng_one_auto_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_one_man_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 16.7) {
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 16.7) {
|
||||
eng_one_man_start.stop();
|
||||
setprop("/engines/engine[0]/state", 2);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("engines/engine[0]/state", 2);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 1);
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_one_egt_check.start();
|
||||
eng_one_n2_check.start();
|
||||
|
@ -241,48 +241,48 @@ var eng_one_man_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_one_egt_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/egt-actual") >= egt_start) {
|
||||
if (getprop("engines/engine[0]/egt-actual") >= egt_start) {
|
||||
eng_one_egt_check.stop();
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_min, egt_lightdn_time);
|
||||
}
|
||||
});
|
||||
|
||||
var eng_one_n2_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 43.0) {
|
||||
if (getprop("/controls/engines/engine[0]/igniter-a") != 0) {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 43.0) {
|
||||
if (getprop("controls/engines/engine[0]/igniter-a") != 0) {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
}
|
||||
if (getprop("/controls/engines/engine[0]/igniter-b") != 0) {
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
if (getprop("controls/engines/engine[0]/igniter-b") != 0) {
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
}
|
||||
}
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 57.0) {
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 57.0) {
|
||||
eng_one_n2_check.stop();
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 3);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 3);
|
||||
}
|
||||
});
|
||||
|
||||
# Start Engine Two
|
||||
var auto_start_two = func {
|
||||
setprop("/engines/engine[1]/state", 1);
|
||||
setprop("/controls/engines/engine[1]/starter", 1);
|
||||
setprop("engines/engine[1]/state", 1);
|
||||
setprop("controls/engines/engine[1]/starter", 1);
|
||||
eng_two_auto_start.start();
|
||||
}
|
||||
|
||||
var eng_two_auto_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 22) {
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 22) {
|
||||
eng_two_auto_start.stop();
|
||||
setprop("/engines/engine[1]/state", 2);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
if (getprop("/controls/engines/engine[1]/last-igniter") == "B") {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "A");
|
||||
} else if (getprop("/controls/engines/engine[1]/last-igniter") == "A") {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
setprop("engines/engine[1]/state", 2);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
if (getprop("controls/engines/engine[1]/last-igniter") == "B") {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/last-igniter", "A");
|
||||
} else if (getprop("controls/engines/engine[1]/last-igniter") == "A") {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("controls/engines/engine[1]/last-igniter", "B");
|
||||
}
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_two_egt_check.start();
|
||||
|
@ -291,12 +291,12 @@ var eng_two_auto_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_two_man_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 16.7) {
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 16.7) {
|
||||
eng_two_man_start.stop();
|
||||
setprop("/engines/engine[1]/state", 2);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("engines/engine[1]/state", 2);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 1);
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_two_egt_check.start();
|
||||
eng_two_n2_check.start();
|
||||
|
@ -304,70 +304,70 @@ var eng_two_man_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_two_egt_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/egt-actual") >= egt_start) {
|
||||
if (getprop("engines/engine[1]/egt-actual") >= egt_start) {
|
||||
eng_two_egt_check.stop();
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_min, egt_lightdn_time);
|
||||
}
|
||||
});
|
||||
|
||||
var eng_two_n2_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 50.0) {
|
||||
if (getprop("/controls/engines/engine[1]/igniter-a") != 0) {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 50.0) {
|
||||
if (getprop("controls/engines/engine[1]/igniter-a") != 0) {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
}
|
||||
if (getprop("/controls/engines/engine[1]/igniter-b") != 0) {
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
if (getprop("controls/engines/engine[1]/igniter-b") != 0) {
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
}
|
||||
}
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 57.0) {
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 57.0) {
|
||||
eng_two_n2_check.stop();
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 3);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 3);
|
||||
}
|
||||
});
|
||||
|
||||
# Various Other Stuff
|
||||
setlistener("/controls/engines/engine-start-switch", func {
|
||||
if (getprop("/engines/engine[0]/state") == 0) {
|
||||
if (getprop("engines/engine[0]/state") == 0) {
|
||||
start_one_check();
|
||||
start_one_mancheck();
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 0) {
|
||||
if (getprop("engines/engine[1]/state") == 0) {
|
||||
start_two_check();
|
||||
start_two_mancheck();
|
||||
}
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 0) or (getprop("/controls/engines/engine-start-switch") == 1)) {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
if ((getprop("controls/engines/engine-start-switch") == 0) or (getprop("controls/engines/engine-start-switch") == 1)) {
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/systems/pneumatic/start-psi", func {
|
||||
if (getprop("/systems/pneumatic/total-psi") < 12) {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
if (getprop("systems/pneumatic/total-psi") < 12) {
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
if (getprop("/options/eng") == "IAE") {
|
||||
if (getprop("options/eng") == "IAE") {
|
||||
io.include("engines-iae.nas");
|
||||
} else {
|
||||
io.include("engines-cfm.nas");
|
||||
|
@ -13,36 +13,36 @@ var spinup_time = 49;
|
|||
var apu_max = 100;
|
||||
var apu_egt_min = 352;
|
||||
var apu_egt_max = 704;
|
||||
setprop("/systems/apu/rpm", 0);
|
||||
setprop("/systems/apu/egt", 42);
|
||||
setprop("/systems/apu/bleed-used", 0);
|
||||
setprop("/systems/apu/bleed-counting", 0);
|
||||
setprop("/systems/apu/bleed-time", 0);
|
||||
setprop("systems/apu/rpm", 0);
|
||||
setprop("systems/apu/egt", 42);
|
||||
setprop("systems/apu/bleed-used", 0);
|
||||
setprop("systems/apu/bleed-counting", 0);
|
||||
setprop("systems/apu/bleed-time", 0);
|
||||
|
||||
var eng_common_init = func {
|
||||
setprop("/systems/apu/bleed-used", 0);
|
||||
setprop("systems/apu/bleed-used", 0);
|
||||
}
|
||||
|
||||
# Start APU
|
||||
setlistener("/controls/APU/start", func {
|
||||
if (getprop("/controls/APU/master") == 1 and getprop("/controls/APU/start") == 1) {
|
||||
if (getprop("controls/APU/master") == 1 and getprop("controls/APU/start") == 1) {
|
||||
apuBleedChk.stop();
|
||||
setprop("/systems/apu/bleed-counting", 0);
|
||||
if (getprop("/systems/acconfig/autoconfig-running") == 0) {
|
||||
setprop("systems/apu/bleed-counting", 0);
|
||||
if (getprop("systems/acconfig/autoconfig-running") == 0) {
|
||||
interpolate("/systems/apu/rpm", apu_max, spinup_time);
|
||||
apu_egt_check.start();
|
||||
} else if (getprop("/systems/acconfig/autoconfig-running") == 1) {
|
||||
} else if (getprop("systems/acconfig/autoconfig-running") == 1) {
|
||||
interpolate("/systems/apu/rpm", apu_max, 5);
|
||||
interpolate("/systems/apu/egt", apu_egt_min, 5);
|
||||
}
|
||||
} else if (getprop("/controls/APU/master") == 0) {
|
||||
} else if (getprop("controls/APU/master") == 0) {
|
||||
apu_egt_check.stop();
|
||||
apu_stop();
|
||||
}
|
||||
});
|
||||
|
||||
var apu_egt_check = maketimer(0.5, func {
|
||||
if (getprop("/systems/apu/rpm") >= 28) {
|
||||
if (getprop("systems/apu/rpm") >= 28) {
|
||||
apu_egt_check.stop();
|
||||
interpolate("/systems/apu/egt", apu_egt_max, 5);
|
||||
apu_egt2_check.start();
|
||||
|
@ -50,7 +50,7 @@ var apu_egt_check = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var apu_egt2_check = maketimer(0.5, func {
|
||||
if (getprop("/systems/apu/egt") >= 701) {
|
||||
if (getprop("systems/apu/egt") >= 701) {
|
||||
apu_egt2_check.stop();
|
||||
interpolate("/systems/apu/egt", apu_egt_min, 30);
|
||||
}
|
||||
|
@ -58,128 +58,128 @@ var apu_egt2_check = maketimer(0.5, func {
|
|||
|
||||
# Stop APU
|
||||
setlistener("/controls/APU/master", func {
|
||||
if (getprop("/controls/APU/master") == 0) {
|
||||
setprop("/controls/APU/start", 0);
|
||||
if (getprop("controls/APU/master") == 0) {
|
||||
setprop("controls/APU/start", 0);
|
||||
apu_egt_check.stop();
|
||||
apu_egt2_check.stop();
|
||||
apu_stop();
|
||||
} else if (getprop("/controls/APU/master") == 1) {
|
||||
} else if (getprop("controls/APU/master") == 1) {
|
||||
apuBleedChk.stop();
|
||||
setprop("/systems/apu/bleed-counting", 0);
|
||||
setprop("/systems/apu/bleed-used", 0);
|
||||
setprop("systems/apu/bleed-counting", 0);
|
||||
setprop("systems/apu/bleed-used", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var apu_stop = func {
|
||||
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") != 1 and getprop("/systems/acconfig/autoconfig-running") != 1) {
|
||||
setprop("/systems/apu/bleed-counting", 1);
|
||||
setprop("/systems/apu/bleed-time", getprop("/sim/time/elapsed-sec"));
|
||||
if (getprop("systems/apu/bleed-used") == 1 and getprop("systems/apu/bleed-counting") != 1 and getprop("systems/acconfig/autoconfig-running") != 1) {
|
||||
setprop("systems/apu/bleed-counting", 1);
|
||||
setprop("systems/apu/bleed-time", getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1 and getprop("/systems/acconfig/autoconfig-running") != 1) {
|
||||
if (getprop("systems/apu/bleed-used") == 1 and getprop("systems/apu/bleed-counting") == 1 and getprop("systems/acconfig/autoconfig-running") != 1) {
|
||||
apuBleedChk.start();
|
||||
} else {
|
||||
apuBleedChk.stop();
|
||||
interpolate("/systems/apu/rpm", 0, 30);
|
||||
interpolate("/systems/apu/egt", 42, 40);
|
||||
setprop("/systems/apu/bleed-counting", 0);
|
||||
setprop("/systems/apu/bleed-used", 0);
|
||||
setprop("systems/apu/bleed-counting", 0);
|
||||
setprop("systems/apu/bleed-used", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var apuBleedChk = maketimer(0.1, func {
|
||||
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1) {
|
||||
if (getprop("/systems/apu/bleed-time") + 60 <= getprop("/sim/time/elapsed-sec")) {
|
||||
if (getprop("systems/apu/bleed-used") == 1 and getprop("systems/apu/bleed-counting") == 1) {
|
||||
if (getprop("systems/apu/bleed-time") + 60 <= getprop("sim/time/elapsed-sec")) {
|
||||
apuBleedChk.stop();
|
||||
interpolate("/systems/apu/rpm", 0, 30);
|
||||
interpolate("/systems/apu/egt", 42, 40);
|
||||
setprop("/systems/apu/bleed-counting", 0);
|
||||
setprop("/systems/apu/bleed-used", 0);
|
||||
setprop("systems/apu/bleed-counting", 0);
|
||||
setprop("systems/apu/bleed-used", 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
# Various Other Stuff
|
||||
var doIdleThrust = func {
|
||||
setprop("/controls/engines/engine[0]/throttle", 0.0);
|
||||
setprop("/controls/engines/engine[1]/throttle", 0.0);
|
||||
setprop("controls/engines/engine[0]/throttle", 0.0);
|
||||
setprop("controls/engines/engine[1]/throttle", 0.0);
|
||||
}
|
||||
|
||||
var doCLThrust = func {
|
||||
setprop("/controls/engines/engine[0]/throttle", 0.63);
|
||||
setprop("/controls/engines/engine[1]/throttle", 0.63);
|
||||
setprop("controls/engines/engine[0]/throttle", 0.63);
|
||||
setprop("controls/engines/engine[1]/throttle", 0.63);
|
||||
}
|
||||
|
||||
var doMCTThrust = func {
|
||||
setprop("/controls/engines/engine[0]/throttle", 0.8);
|
||||
setprop("/controls/engines/engine[1]/throttle", 0.8);
|
||||
setprop("controls/engines/engine[0]/throttle", 0.8);
|
||||
setprop("controls/engines/engine[1]/throttle", 0.8);
|
||||
}
|
||||
|
||||
var doTOGAThrust = func {
|
||||
setprop("/controls/engines/engine[0]/throttle", 1.0);
|
||||
setprop("/controls/engines/engine[1]/throttle", 1.0);
|
||||
setprop("controls/engines/engine[0]/throttle", 1.0);
|
||||
setprop("controls/engines/engine[1]/throttle", 1.0);
|
||||
}
|
||||
|
||||
# Reverse Thrust System
|
||||
var toggleFastRevThrust = func {
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
if (state1 == "IDLE" and state2 == "IDLE" and getprop("/controls/engines/engine[0]/reverser") == "0" and getprop("/controls/engines/engine[1]/reverser") == "0" and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
|
||||
var state1 = getprop("systems/thrust/state1");
|
||||
var state2 = getprop("systems/thrust/state2");
|
||||
if (state1 == "IDLE" and state2 == "IDLE" and getprop("controls/engines/engine[0]/reverser") == "0" and getprop("controls/engines/engine[1]/reverser") == "0" and getprop("gear/gear[1]/wow") == 1 and getprop("gear/gear[2]/wow") == 1) {
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 1, 1.4);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[0]/reverser", 1);
|
||||
setprop("/controls/engines/engine[1]/reverser", 1);
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0.65);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0.65);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
} else if ((getprop("/controls/engines/engine[0]/reverser") == "1") or (getprop("/controls/engines/engine[1]/reverser") == "1") and (getprop("/gear/gear[1]/wow") == 1) and (getprop("/gear/gear[2]/wow") == 1)) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0);
|
||||
setprop("controls/engines/engine[0]/reverser", 1);
|
||||
setprop("controls/engines/engine[1]/reverser", 1);
|
||||
setprop("controls/engines/engine[0]/throttle-rev", 0.65);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", 0.65);
|
||||
setprop("fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
setprop("fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
} else if ((getprop("controls/engines/engine[0]/reverser") == "1") or (getprop("controls/engines/engine[1]/reverser") == "1") and (getprop("gear/gear[1]/wow") == 1) and (getprop("gear/gear[2]/wow") == 1)) {
|
||||
setprop("controls/engines/engine[0]/throttle-rev", 0);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", 0);
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 0, 1.0);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 0, 1.0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("controls/engines/engine[0]/reverser", 0);
|
||||
setprop("controls/engines/engine[1]/reverser", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var doRevThrust = func {
|
||||
if (getprop("/controls/engines/engine[0]/reverser") == "1" and getprop("/controls/engines/engine[1]/reverser") == "1" and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
|
||||
var pos1 = getprop("/controls/engines/engine[0]/throttle-rev");
|
||||
var pos2 = getprop("/controls/engines/engine[1]/throttle-rev");
|
||||
if (getprop("controls/engines/engine[0]/reverser") == "1" and getprop("controls/engines/engine[1]/reverser") == "1" and getprop("gear/gear[1]/wow") == 1 and getprop("gear/gear[2]/wow") == 1) {
|
||||
var pos1 = getprop("controls/engines/engine[0]/throttle-rev");
|
||||
var pos2 = getprop("controls/engines/engine[1]/throttle-rev");
|
||||
if (pos1 < 0.649) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", pos1 + 0.15);
|
||||
setprop("controls/engines/engine[0]/throttle-rev", pos1 + 0.15);
|
||||
}
|
||||
if (pos2 < 0.649) {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", pos2 + 0.15);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", pos2 + 0.15);
|
||||
}
|
||||
}
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
if (state1 == "IDLE" and state2 == "IDLE" and getprop("/controls/engines/engine[0]/reverser") == "0" and getprop("/controls/engines/engine[1]/reverser") == "0" and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0.05);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0.05);
|
||||
var state1 = getprop("systems/thrust/state1");
|
||||
var state2 = getprop("systems/thrust/state2");
|
||||
if (state1 == "IDLE" and state2 == "IDLE" and getprop("controls/engines/engine[0]/reverser") == "0" and getprop("controls/engines/engine[1]/reverser") == "0" and getprop("gear/gear[1]/wow") == 1 and getprop("gear/gear[2]/wow") == 1) {
|
||||
setprop("controls/engines/engine[0]/throttle-rev", 0.05);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", 0.05);
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 1, 1.4);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[0]/reverser", 1);
|
||||
setprop("/controls/engines/engine[1]/reverser", 1);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
setprop("controls/engines/engine[0]/reverser", 1);
|
||||
setprop("controls/engines/engine[1]/reverser", 1);
|
||||
setprop("fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
setprop("fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
}
|
||||
}
|
||||
|
||||
var unRevThrust = func {
|
||||
if (getprop("/controls/engines/engine[0]/reverser") == "1" or getprop("/controls/engines/engine[1]/reverser") == "1") {
|
||||
var pos1 = getprop("/controls/engines/engine[0]/throttle-rev");
|
||||
var pos2 = getprop("/controls/engines/engine[1]/throttle-rev");
|
||||
if (getprop("controls/engines/engine[0]/reverser") == "1" or getprop("controls/engines/engine[1]/reverser") == "1") {
|
||||
var pos1 = getprop("controls/engines/engine[0]/throttle-rev");
|
||||
var pos2 = getprop("controls/engines/engine[1]/throttle-rev");
|
||||
if (pos1 > 0.051) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", pos1 - 0.15);
|
||||
setprop("controls/engines/engine[0]/throttle-rev", pos1 - 0.15);
|
||||
} else {
|
||||
unRevThrust_b();
|
||||
}
|
||||
if (pos2 > 0.051) {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", pos2 - 0.15);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", pos2 - 0.15);
|
||||
} else {
|
||||
unRevThrust_b();
|
||||
}
|
||||
|
@ -187,12 +187,12 @@ var unRevThrust = func {
|
|||
}
|
||||
|
||||
var unRevThrust_b = func {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0);
|
||||
setprop("controls/engines/engine[0]/throttle-rev", 0);
|
||||
setprop("controls/engines/engine[1]/throttle-rev", 0);
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 0, 1.0);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 0, 1.0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("controls/engines/engine[0]/reverser", 0);
|
||||
setprop("controls/engines/engine[1]/reverser", 0);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# Initializing Vars #
|
||||
#####################
|
||||
|
||||
var engines = props.globals.getNode("/engines").getChildren("engine");
|
||||
var engines = props.globals.getNode("engines").getChildren("engine");
|
||||
var egt_min = 434;
|
||||
var egt_start = 587;
|
||||
var egt_max = 712;
|
||||
|
@ -17,34 +17,34 @@ var egt_lightdn_time = 10;
|
|||
var shutdown_time = 20;
|
||||
var egt_shutdown_time = 20;
|
||||
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
setprop("controls/engines/engine[0]/reverser", 0);
|
||||
setprop("controls/engines/engine[1]/reverser", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("controls/engines/engine[1]/last-igniter", "B");
|
||||
|
||||
var eng_init = func {
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
setprop("controls/engines/engine[0]/man-start", 0);
|
||||
setprop("controls/engines/engine[1]/man-start", 0);
|
||||
eng_common_init();
|
||||
}
|
||||
|
||||
# Trigger Startups and Stops
|
||||
setlistener("/controls/engines/engine[0]/cutoff-switch", func {
|
||||
if (getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
|
||||
if (getprop("controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") == 1) {
|
||||
fast_start_one();
|
||||
} else {
|
||||
if (getprop("/controls/engines/engine[0]/man-start") == 0) {
|
||||
if (getprop("controls/engines/engine[0]/man-start") == 0) {
|
||||
start_one_check();
|
||||
} else if (getprop("/controls/engines/engine[0]/man-start") == 1) {
|
||||
} else if (getprop("controls/engines/engine[0]/man-start") == 1) {
|
||||
eng_one_man_start.start();
|
||||
}
|
||||
}
|
||||
} else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
|
||||
} else if (getprop("controls/engines/engine[0]/cutoff-switch") == 1) {
|
||||
cutoff_one();
|
||||
}
|
||||
});
|
||||
|
@ -53,29 +53,29 @@ var cutoff_one = func {
|
|||
eng_one_auto_start.stop();
|
||||
eng_one_man_start.stop();
|
||||
eng_one_n2_check.stop();
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/man-start", 0);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
eng_one_n2_check.stop();
|
||||
}
|
||||
|
||||
var fast_start_one = func {
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("/engines/engine[0]/out-of-fuel", 0);
|
||||
setprop("/engines/engine[0]/run", 1);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("engines/engine[0]/out-of-fuel", 0);
|
||||
setprop("engines/engine[0]/run", 1);
|
||||
|
||||
setprop("/engines/engine[0]/cutoff", 0);
|
||||
setprop("/engines/engine[0]/starter", 0);
|
||||
setprop("engines/engine[0]/cutoff", 0);
|
||||
setprop("engines/engine[0]/starter", 0);
|
||||
|
||||
setprop("/fdm/jsbsim/propulsion/set-running", 0);
|
||||
setprop("fdm/jsbsim/propulsion/set-running", 0);
|
||||
|
||||
setprop("/engines/engine[0]/state", 3);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 3);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[0]/man-start", func {
|
||||
|
@ -83,52 +83,52 @@ setlistener("/controls/engines/engine[0]/man-start", func {
|
|||
});
|
||||
|
||||
var start_one_mancheck = func {
|
||||
if (getprop("/controls/engines/engine[0]/man-start") == 1) {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[0]/cutoff-switch") == 1)) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 1);
|
||||
if (getprop("controls/engines/engine[0]/man-start") == 1) {
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and (getprop("controls/engines/engine[0]/cutoff-switch") == 1)) {
|
||||
setprop("systems/pneumatic/eng1-starter", 1);
|
||||
settimer(start_one_mancheck_b, 0.5);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_mancheck_b = func {
|
||||
if (getprop("/systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("/engines/engine[0]/state", 1);
|
||||
setprop("/controls/engines/engine[0]/starter", 1);
|
||||
if (getprop("systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("engines/engine[0]/state", 1);
|
||||
setprop("controls/engines/engine[0]/starter", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_check = func {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
setprop("/systems/pneumatic/eng1-starter", 1);
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and getprop("controls/engines/engine[0]/cutoff-switch") == 0) {
|
||||
setprop("systems/pneumatic/eng1-starter", 1);
|
||||
settimer(start_one_check_b, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
var start_one_check_b = func {
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[0]/cutoff-switch") == 0)) {
|
||||
if ((getprop("controls/engines/engine-start-switch") == 2) and (getprop("systems/pneumatic/total-psi") >= 28) and (getprop("controls/engines/engine[0]/cutoff-switch") == 0)) {
|
||||
auto_start_one();
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[1]/cutoff-switch", func {
|
||||
if (getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
|
||||
if (getprop("controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") == 1) {
|
||||
fast_start_two();
|
||||
} else {
|
||||
if (getprop("/controls/engines/engine[1]/man-start") == 0) {
|
||||
if (getprop("controls/engines/engine[1]/man-start") == 0) {
|
||||
start_two_check();
|
||||
} else if (getprop("/controls/engines/engine[1]/man-start") == 1) {
|
||||
} else if (getprop("controls/engines/engine[1]/man-start") == 1) {
|
||||
eng_two_man_start.start();
|
||||
}
|
||||
}
|
||||
} else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
|
||||
} else if (getprop("controls/engines/engine[1]/cutoff-switch") == 1) {
|
||||
cutoff_two();
|
||||
}
|
||||
});
|
||||
|
@ -137,28 +137,28 @@ var cutoff_two = func {
|
|||
eng_two_auto_start.stop();
|
||||
eng_two_man_start.stop();
|
||||
eng_two_n2_check.stop();
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/man-start", 0);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
|
||||
var fast_start_two = func {
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("/engines/engine[1]/out-of-fuel", 0);
|
||||
setprop("/engines/engine[1]/run", 1);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("engines/engine[1]/out-of-fuel", 0);
|
||||
setprop("engines/engine[1]/run", 1);
|
||||
|
||||
setprop("/engines/engine[1]/cutoff", 0);
|
||||
setprop("/engines/engine[1]/starter", 0);
|
||||
setprop("engines/engine[1]/cutoff", 0);
|
||||
setprop("engines/engine[1]/starter", 0);
|
||||
|
||||
setprop("/fdm/jsbsim/propulsion/set-running", 1);
|
||||
setprop("fdm/jsbsim/propulsion/set-running", 1);
|
||||
|
||||
setprop("/engines/engine[1]/state", 3);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 3);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
}
|
||||
|
||||
setlistener("/controls/engines/engine[1]/man-start", func {
|
||||
|
@ -166,60 +166,60 @@ setlistener("/controls/engines/engine[1]/man-start", func {
|
|||
});
|
||||
|
||||
var start_two_mancheck = func {
|
||||
if (getprop("/controls/engines/engine[1]/man-start") == 1) {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and (getprop("/controls/engines/engine[1]/cutoff-switch") == 1)) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 1);
|
||||
if (getprop("controls/engines/engine[1]/man-start") == 1) {
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and (getprop("controls/engines/engine[1]/cutoff-switch") == 1)) {
|
||||
setprop("systems/pneumatic/eng2-starter", 1);
|
||||
settimer(start_two_mancheck_b, 0.5);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_mancheck_b = func {
|
||||
if (getprop("/systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("/engines/engine[1]/state", 1);
|
||||
setprop("/controls/engines/engine[1]/starter", 1);
|
||||
if (getprop("systems/pneumatic/total-psi") >= 28) {
|
||||
setprop("engines/engine[1]/state", 1);
|
||||
setprop("controls/engines/engine[1]/starter", 1);
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_check = func {
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
setprop("/systems/pneumatic/eng2-starter", 1);
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and getprop("controls/engines/engine[1]/cutoff-switch") == 0) {
|
||||
setprop("systems/pneumatic/eng2-starter", 1);
|
||||
settimer(start_two_check_b, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
var start_two_check_b = func {
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[1]/cutoff-switch") == 0)) {
|
||||
if ((getprop("controls/engines/engine-start-switch") == 2) and (getprop("systems/pneumatic/total-psi") >= 28) and (getprop("controls/engines/engine[1]/cutoff-switch") == 0)) {
|
||||
auto_start_two();
|
||||
}
|
||||
}
|
||||
|
||||
# Start Engine One
|
||||
var auto_start_one = func {
|
||||
setprop("/engines/engine[0]/state", 1);
|
||||
setprop("/controls/engines/engine[0]/starter", 1);
|
||||
setprop("engines/engine[0]/state", 1);
|
||||
setprop("controls/engines/engine[0]/starter", 1);
|
||||
eng_one_auto_start.start();
|
||||
}
|
||||
|
||||
var eng_one_auto_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n1-actual") >= 4.7) {
|
||||
if (getprop("engines/engine[0]/n1-actual") >= 4.7) {
|
||||
eng_one_auto_start.stop();
|
||||
setprop("/engines/engine[0]/state", 2);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
if (getprop("/controls/engines/engine[0]/last-igniter") == "B") {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "A");
|
||||
} else if (getprop("/controls/engines/engine[0]/last-igniter") == "A") {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("engines/engine[0]/state", 2);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
if (getprop("controls/engines/engine[0]/last-igniter") == "B") {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "A");
|
||||
} else if (getprop("controls/engines/engine[0]/last-igniter") == "A") {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("controls/engines/engine[0]/last-igniter", "B");
|
||||
}
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_one_egt_check.start();
|
||||
|
@ -228,12 +228,12 @@ var eng_one_auto_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_one_man_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 16.7) {
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 16.7) {
|
||||
eng_one_man_start.stop();
|
||||
setprop("/engines/engine[0]/state", 2);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 1);
|
||||
setprop("engines/engine[0]/state", 2);
|
||||
setprop("controls/engines/engine[0]/cutoff", 0);
|
||||
setprop("controls/engines/engine[0]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[0]/igniter-b", 1);
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_one_egt_check.start();
|
||||
eng_one_n2_check.start();
|
||||
|
@ -241,48 +241,48 @@ var eng_one_man_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_one_egt_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/egt-actual") >= egt_start) {
|
||||
if (getprop("engines/engine[0]/egt-actual") >= egt_start) {
|
||||
eng_one_egt_check.stop();
|
||||
interpolate(engines[0].getNode("egt-actual"), egt_min, egt_lightdn_time);
|
||||
}
|
||||
});
|
||||
|
||||
var eng_one_n2_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 43.0) {
|
||||
if (getprop("/controls/engines/engine[0]/igniter-a") != 0) {
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 43.0) {
|
||||
if (getprop("controls/engines/engine[0]/igniter-a") != 0) {
|
||||
setprop("controls/engines/engine[0]/igniter-a", 0);
|
||||
}
|
||||
if (getprop("/controls/engines/engine[0]/igniter-b") != 0) {
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
if (getprop("controls/engines/engine[0]/igniter-b") != 0) {
|
||||
setprop("controls/engines/engine[0]/igniter-b", 0);
|
||||
}
|
||||
}
|
||||
if (getprop("/engines/engine[0]/n2-actual") >= 57.0) {
|
||||
if (getprop("engines/engine[0]/n2-actual") >= 57.0) {
|
||||
eng_one_n2_check.stop();
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 3);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 3);
|
||||
}
|
||||
});
|
||||
|
||||
# Start Engine Two
|
||||
var auto_start_two = func {
|
||||
setprop("/engines/engine[1]/state", 1);
|
||||
setprop("/controls/engines/engine[1]/starter", 1);
|
||||
setprop("engines/engine[1]/state", 1);
|
||||
setprop("controls/engines/engine[1]/starter", 1);
|
||||
eng_two_auto_start.start();
|
||||
}
|
||||
|
||||
var eng_two_auto_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n1-actual") >= 4.7) {
|
||||
if (getprop("engines/engine[1]/n1-actual") >= 4.7) {
|
||||
eng_two_auto_start.stop();
|
||||
setprop("/engines/engine[1]/state", 2);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
if (getprop("/controls/engines/engine[1]/last-igniter") == "B") {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "A");
|
||||
} else if (getprop("/controls/engines/engine[1]/last-igniter") == "A") {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
setprop("engines/engine[1]/state", 2);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
if (getprop("controls/engines/engine[1]/last-igniter") == "B") {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("controls/engines/engine[1]/last-igniter", "A");
|
||||
} else if (getprop("controls/engines/engine[1]/last-igniter") == "A") {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("controls/engines/engine[1]/last-igniter", "B");
|
||||
}
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_two_egt_check.start();
|
||||
|
@ -291,12 +291,12 @@ var eng_two_auto_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_two_man_start = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 16.7) {
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 16.7) {
|
||||
eng_two_man_start.stop();
|
||||
setprop("/engines/engine[1]/state", 2);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 1);
|
||||
setprop("engines/engine[1]/state", 2);
|
||||
setprop("controls/engines/engine[1]/cutoff", 0);
|
||||
setprop("controls/engines/engine[1]/igniter-a", 1);
|
||||
setprop("controls/engines/engine[1]/igniter-b", 1);
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_start, egt_lightup_time);
|
||||
eng_two_egt_check.start();
|
||||
eng_two_n2_check.start();
|
||||
|
@ -304,70 +304,70 @@ var eng_two_man_start = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var eng_two_egt_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/egt-actual") >= egt_start) {
|
||||
if (getprop("engines/engine[1]/egt-actual") >= egt_start) {
|
||||
eng_two_egt_check.stop();
|
||||
interpolate(engines[1].getNode("egt-actual"), egt_min, egt_lightdn_time);
|
||||
}
|
||||
});
|
||||
|
||||
var eng_two_n2_check = maketimer(0.5, func {
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 43.0) {
|
||||
if (getprop("/controls/engines/engine[1]/igniter-a") != 0) {
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 43.0) {
|
||||
if (getprop("controls/engines/engine[1]/igniter-a") != 0) {
|
||||
setprop("controls/engines/engine[1]/igniter-a", 0);
|
||||
}
|
||||
if (getprop("/controls/engines/engine[1]/igniter-b") != 0) {
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
if (getprop("controls/engines/engine[1]/igniter-b") != 0) {
|
||||
setprop("controls/engines/engine[1]/igniter-b", 0);
|
||||
}
|
||||
}
|
||||
if (getprop("/engines/engine[1]/n2-actual") >= 57.0) {
|
||||
if (getprop("engines/engine[1]/n2-actual") >= 57.0) {
|
||||
eng_two_n2_check.stop();
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 3);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 3);
|
||||
}
|
||||
});
|
||||
|
||||
# Various Other Stuff
|
||||
setlistener("/controls/engines/engine-start-switch", func {
|
||||
if (getprop("/engines/engine[0]/state") == 0) {
|
||||
if (getprop("engines/engine[0]/state") == 0) {
|
||||
start_one_check();
|
||||
start_one_mancheck();
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 0) {
|
||||
if (getprop("engines/engine[1]/state") == 0) {
|
||||
start_two_check();
|
||||
start_two_mancheck();
|
||||
}
|
||||
if ((getprop("/controls/engines/engine-start-switch") == 0) or (getprop("/controls/engines/engine-start-switch") == 1)) {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
if ((getprop("controls/engines/engine-start-switch") == 0) or (getprop("controls/engines/engine-start-switch") == 1)) {
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/systems/pneumatic/start-psi", func {
|
||||
if (getprop("/systems/pneumatic/total-psi") < 12) {
|
||||
if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) {
|
||||
setprop("/controls/engines/engine[0]/starter", 0);
|
||||
setprop("/controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/engines/engine[0]/state", 0);
|
||||
if (getprop("systems/pneumatic/total-psi") < 12) {
|
||||
if (getprop("engines/engine[0]/state") == 1 or getprop("engines/engine[0]/state") == 2) {
|
||||
setprop("controls/engines/engine[0]/starter", 0);
|
||||
setprop("controls/engines/engine[0]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("engines/engine[0]/state", 0);
|
||||
interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) {
|
||||
setprop("/controls/engines/engine[1]/starter", 0);
|
||||
setprop("/controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/engines/engine[1]/state", 0);
|
||||
if (getprop("engines/engine[1]/state") == 1 or getprop("engines/engine[1]/state") == 2) {
|
||||
setprop("controls/engines/engine[1]/starter", 0);
|
||||
setprop("controls/engines/engine[1]/cutoff", 1);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("engines/engine[1]/state", 0);
|
||||
interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,139 +2,139 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
setprop("/systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("/systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered-time", -300);
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
setprop("systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered-time", -300);
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
|
||||
var FADEC = {
|
||||
init: func() {
|
||||
setprop("/systems/fadec/powered-time", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
setprop("systems/fadec/powered-time", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
},
|
||||
loop: func() {
|
||||
var ac1 = getprop("/systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("/systems/electrical/bus/ac-2");
|
||||
var acess = getprop("/systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("/engines/engine[0]/state");
|
||||
var state2 = getprop("/engines/engine[1]/state");
|
||||
var master1 = getprop("/controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("/controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("/controls/engines/engine-start-switch");
|
||||
var elapsedSec = getprop("/sim/time/elapsed-sec");
|
||||
var ac1 = getprop("systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("systems/electrical/bus/ac-2");
|
||||
var acess = getprop("systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("engines/engine[0]/state");
|
||||
var state2 = getprop("engines/engine[1]/state");
|
||||
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("controls/engines/engine-start-switch");
|
||||
var elapsedSec = getprop("sim/time/elapsed-sec");
|
||||
|
||||
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
|
||||
if (getprop("/systems/fadec/power-avail") != 1) {
|
||||
setprop("/systems/fadec/powered-time", elapsedSec);
|
||||
setprop("/systems/fadec/power-avail", 1);
|
||||
if (getprop("systems/fadec/power-avail") != 1) {
|
||||
setprop("systems/fadec/powered-time", elapsedSec);
|
||||
setprop("systems/fadec/power-avail", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/power-avail") != 0) {
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
if (getprop("systems/fadec/power-avail") != 0) {
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var powerAvail = getprop("/systems/fadec/power-avail");
|
||||
var powerAvail = getprop("systems/fadec/power-avail");
|
||||
|
||||
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/powerup", 1);
|
||||
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/powerup", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
}
|
||||
|
||||
if (master1 == 1) {
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng1-master-count", 1);
|
||||
if (getprop("systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng1-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
if (getprop("systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng1-off-power", 1);
|
||||
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng1-off-power", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
}
|
||||
|
||||
if (master2 == 1) {
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng2-master-count", 1);
|
||||
if (getprop("systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng2-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
if (getprop("systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng2-off-power", 1);
|
||||
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng2-off-power", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
}
|
||||
|
||||
if (state1 == 3) {
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
}
|
||||
|
||||
if (state2 == 3) {
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
}
|
||||
|
||||
var powered1 = getprop("/systems/fadec/powered1");
|
||||
var powered2 = getprop("/systems/fadec/powered2");
|
||||
var powered1 = getprop("systems/fadec/powered1");
|
||||
var powered2 = getprop("systems/fadec/powered2");
|
||||
|
||||
if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
if (powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) {
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1/n1", 0);
|
||||
setprop("/systems/fadec/eng1/egt", 0);
|
||||
setprop("/systems/fadec/eng1/n2", 0);
|
||||
setprop("/systems/fadec/eng1/ff", 0);
|
||||
setprop("systems/fadec/eng1/n1", 0);
|
||||
setprop("systems/fadec/eng1/egt", 0);
|
||||
setprop("systems/fadec/eng1/n2", 0);
|
||||
setprop("systems/fadec/eng1/ff", 0);
|
||||
}
|
||||
|
||||
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
if (powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) {
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2/n1", 0);
|
||||
setprop("/systems/fadec/eng2/egt", 0);
|
||||
setprop("/systems/fadec/eng2/n2", 0);
|
||||
setprop("/systems/fadec/eng2/ff", 0);
|
||||
setprop("systems/fadec/eng2/n1", 0);
|
||||
setprop("systems/fadec/eng2/egt", 0);
|
||||
setprop("systems/fadec/eng2/n2", 0);
|
||||
setprop("systems/fadec/eng2/ff", 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
if (getprop("/options/eng") == "IAE") {
|
||||
if (getprop("options/eng") == "IAE") {
|
||||
io.include("fadec-iae.nas");
|
||||
} else {
|
||||
io.include("fadec-cfm.nas");
|
||||
|
@ -27,36 +27,36 @@ var flaps = 0;
|
|||
var alphaProt = 0;
|
||||
var togaLock = 0;
|
||||
var gs = 0;
|
||||
setprop("/systems/thrust/alpha-floor", 0);
|
||||
setprop("/systems/thrust/toga-lk", 0);
|
||||
setprop("/systems/thrust/epr/toga-lim", 0.0);
|
||||
setprop("/systems/thrust/epr/mct-lim", 0.0);
|
||||
setprop("/systems/thrust/epr/flx-lim", 0.0);
|
||||
setprop("/systems/thrust/epr/clb-lim", 0.0);
|
||||
setprop("/systems/thrust/n1/toga-lim", 0.0);
|
||||
setprop("/systems/thrust/n1/mct-lim", 0.0);
|
||||
setprop("/systems/thrust/n1/flx-lim", 0.0);
|
||||
setprop("/systems/thrust/n1/clb-lim", 0.0);
|
||||
setprop("/engines/flx-thr", 0.0);
|
||||
setprop("/controls/engines/thrust-limit", "TOGA");
|
||||
setprop("/controls/engines/epr-limit", 0.0);
|
||||
setprop("/controls/engines/n1-limit", 0.0);
|
||||
setprop("/systems/thrust/state1", "IDLE");
|
||||
setprop("/systems/thrust/state2", "IDLE");
|
||||
setprop("/systems/thrust/lvrclb", 0);
|
||||
setprop("/systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/systems/thrust/toga-lim", 0.0);
|
||||
setprop("/systems/thrust/mct-lim", 0.0);
|
||||
setprop("/systems/thrust/clb-lim", 0.0);
|
||||
setprop("/systems/thrust/lim-flex", 0);
|
||||
setprop("/engines/flex-derate", 0);
|
||||
setprop("/systems/thrust/eng-out", 0);
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-lock-cmd[0]", 0);
|
||||
setprop("/systems/thrust/thr-lock-cmd[1]", 0);
|
||||
setprop("systems/thrust/alpha-floor", 0);
|
||||
setprop("systems/thrust/toga-lk", 0);
|
||||
setprop("systems/thrust/epr/toga-lim", 0.0);
|
||||
setprop("systems/thrust/epr/mct-lim", 0.0);
|
||||
setprop("systems/thrust/epr/flx-lim", 0.0);
|
||||
setprop("systems/thrust/epr/clb-lim", 0.0);
|
||||
setprop("systems/thrust/n1/toga-lim", 0.0);
|
||||
setprop("systems/thrust/n1/mct-lim", 0.0);
|
||||
setprop("systems/thrust/n1/flx-lim", 0.0);
|
||||
setprop("systems/thrust/n1/clb-lim", 0.0);
|
||||
setprop("engines/flx-thr", 0.0);
|
||||
setprop("controls/engines/thrust-limit", "TOGA");
|
||||
setprop("controls/engines/epr-limit", 0.0);
|
||||
setprop("controls/engines/n1-limit", 0.0);
|
||||
setprop("systems/thrust/state1", "IDLE");
|
||||
setprop("systems/thrust/state2", "IDLE");
|
||||
setprop("systems/thrust/lvrclb", 0);
|
||||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("systems/thrust/toga-lim", 0.0);
|
||||
setprop("systems/thrust/mct-lim", 0.0);
|
||||
setprop("systems/thrust/clb-lim", 0.0);
|
||||
setprop("systems/thrust/lim-flex", 0);
|
||||
setprop("engines/flex-derate", 0);
|
||||
setprop("systems/thrust/eng-out", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-lock-cmd[0]", 0);
|
||||
setprop("systems/thrust/thr-lock-cmd[1]", 0);
|
||||
|
||||
setlistener("/sim/signals/fdm-initialized", func {
|
||||
thrust_loop.start();
|
||||
|
@ -64,142 +64,142 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
});
|
||||
|
||||
setlistener("/controls/engines/engine[0]/throttle-pos", func {
|
||||
engstate1 = getprop("/engines/engine[0]/state");
|
||||
engstate2 = getprop("/engines/engine[1]/state");
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
if (getprop("/systems/thrust/alpha-floor") == 0 and getprop("/systems/thrust/toga-lk") == 0) {
|
||||
engstate1 = getprop("engines/engine[0]/state");
|
||||
engstate2 = getprop("engines/engine[1]/state");
|
||||
thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
if (getprop("systems/thrust/alpha-floor") == 0 and getprop("systems/thrust/toga-lk") == 0) {
|
||||
if (thr1 < 0.01) {
|
||||
setprop("/systems/thrust/state1", "IDLE");
|
||||
setprop("systems/thrust/state1", "IDLE");
|
||||
unflex();
|
||||
atoff_request();
|
||||
} else if (thr1 >= 0.01 and thr1 < 0.60) {
|
||||
setprop("/systems/thrust/state1", "MAN");
|
||||
setprop("systems/thrust/state1", "MAN");
|
||||
unflex();
|
||||
} else if (thr1 >= 0.60 and thr1 < 0.65) {
|
||||
setprop("/systems/thrust/state1", "CL");
|
||||
setprop("systems/thrust/state1", "CL");
|
||||
unflex();
|
||||
} else if (thr1 >= 0.65 and thr1 < 0.78) {
|
||||
setprop("/systems/thrust/state1", "MAN THR");
|
||||
setprop("systems/thrust/state1", "MAN THR");
|
||||
unflex();
|
||||
} else if (thr1 >= 0.78 and thr1 < 0.83) {
|
||||
if (getprop("/systems/thrust/eng-out") != 1) {
|
||||
if (getprop("/controls/engines/thrust-limit") == "FLX") {
|
||||
if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
if (getprop("systems/thrust/eng-out") != 1) {
|
||||
if (getprop("controls/engines/thrust-limit") == "FLX") {
|
||||
if (getprop("gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
}
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
} else {
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.95);
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.95);
|
||||
}
|
||||
}
|
||||
setprop("/systems/thrust/state1", "MCT");
|
||||
setprop("systems/thrust/state1", "MCT");
|
||||
} else if (thr1 >= 0.83 and thr1 < 0.95) {
|
||||
setprop("/systems/thrust/state1", "MAN THR");
|
||||
setprop("systems/thrust/state1", "MAN THR");
|
||||
unflex();
|
||||
} else if (thr1 >= 0.95) {
|
||||
if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
if (getprop("gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
}
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("/systems/thrust/state1", "TOGA");
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("systems/thrust/state1", "TOGA");
|
||||
unflex();
|
||||
}
|
||||
} else {
|
||||
if (thr1 < 0.01) {
|
||||
setprop("/systems/thrust/state1", "IDLE");
|
||||
setprop("systems/thrust/state1", "IDLE");
|
||||
} else if (thr1 >= 0.01 and thr1 < 0.60) {
|
||||
setprop("/systems/thrust/state1", "MAN");
|
||||
setprop("systems/thrust/state1", "MAN");
|
||||
} else if (thr1 >= 0.60 and thr1 < 0.65) {
|
||||
setprop("/systems/thrust/state1", "CL");
|
||||
setprop("systems/thrust/state1", "CL");
|
||||
} else if (thr1 >= 0.65 and thr1 < 0.78) {
|
||||
setprop("/systems/thrust/state1", "MAN THR");
|
||||
setprop("systems/thrust/state1", "MAN THR");
|
||||
} else if (thr1 >= 0.78 and thr1 < 0.83) {
|
||||
setprop("/systems/thrust/state1", "MCT");
|
||||
setprop("systems/thrust/state1", "MCT");
|
||||
} else if (thr1 >= 0.83 and thr1 < 0.95) {
|
||||
setprop("/systems/thrust/state1", "MAN THR");
|
||||
setprop("systems/thrust/state1", "MAN THR");
|
||||
} else if (thr1 >= 0.95) {
|
||||
setprop("/systems/thrust/state1", "TOGA");
|
||||
setprop("systems/thrust/state1", "TOGA");
|
||||
}
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/engines/engine[1]/throttle-pos", func {
|
||||
engstate1 = getprop("/engines/engine[0]/state");
|
||||
engstate2 = getprop("/engines/engine[1]/state");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
if (getprop("/systems/thrust/alpha-floor") == 0 and getprop("/systems/thrust/toga-lk") == 0) {
|
||||
engstate1 = getprop("engines/engine[0]/state");
|
||||
engstate2 = getprop("engines/engine[1]/state");
|
||||
thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
if (getprop("systems/thrust/alpha-floor") == 0 and getprop("systems/thrust/toga-lk") == 0) {
|
||||
if (thr2 < 0.01) {
|
||||
setprop("/systems/thrust/state2", "IDLE");
|
||||
setprop("systems/thrust/state2", "IDLE");
|
||||
unflex();
|
||||
atoff_request();
|
||||
} else if (thr2 >= 0.01 and thr2 < 0.60) {
|
||||
setprop("/systems/thrust/state2", "MAN");
|
||||
setprop("systems/thrust/state2", "MAN");
|
||||
unflex();
|
||||
} else if (thr2 >= 0.60 and thr2 < 0.65) {
|
||||
setprop("/systems/thrust/state2", "CL");
|
||||
setprop("systems/thrust/state2", "CL");
|
||||
unflex();
|
||||
} else if (thr2 >= 0.65 and thr2 < 0.78) {
|
||||
setprop("/systems/thrust/state2", "MAN THR");
|
||||
setprop("systems/thrust/state2", "MAN THR");
|
||||
unflex();
|
||||
} else if (thr2 >= 0.78 and thr2 < 0.83) {
|
||||
if (getprop("/systems/thrust/eng-out") != 1) {
|
||||
if (getprop("/controls/engines/thrust-limit") == "FLX") {
|
||||
if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
if (getprop("systems/thrust/eng-out") != 1) {
|
||||
if (getprop("controls/engines/thrust-limit") == "FLX") {
|
||||
if (getprop("gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
}
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
} else {
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.95);
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.95);
|
||||
}
|
||||
}
|
||||
setprop("/systems/thrust/state2", "MCT");
|
||||
setprop("systems/thrust/state2", "MCT");
|
||||
} else if (thr2 >= 0.83 and thr2 < 0.95) {
|
||||
setprop("/systems/thrust/state2", "MAN THR");
|
||||
setprop("systems/thrust/state2", "MAN THR");
|
||||
unflex();
|
||||
} else if (thr2 >= 0.95) {
|
||||
if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
if (getprop("gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) {
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
}
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
setprop("/systems/thrust/state2", "TOGA");
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
setprop("systems/thrust/state2", "TOGA");
|
||||
unflex();
|
||||
}
|
||||
} else {
|
||||
if (thr2 < 0.01) {
|
||||
setprop("/systems/thrust/state2", "IDLE");
|
||||
setprop("systems/thrust/state2", "IDLE");
|
||||
} else if (thr2 >= 0.01 and thr2 < 0.60) {
|
||||
setprop("/systems/thrust/state2", "MAN");
|
||||
setprop("systems/thrust/state2", "MAN");
|
||||
} else if (thr2 >= 0.60 and thr2 < 0.65) {
|
||||
setprop("/systems/thrust/state2", "CL");
|
||||
setprop("systems/thrust/state2", "CL");
|
||||
} else if (thr2 >= 0.65 and thr2 < 0.78) {
|
||||
setprop("/systems/thrust/state2", "MAN THR");
|
||||
setprop("systems/thrust/state2", "MAN THR");
|
||||
} else if (thr2 >= 0.78 and thr2 < 0.83) {
|
||||
setprop("/systems/thrust/state2", "MCT");
|
||||
setprop("systems/thrust/state2", "MCT");
|
||||
} else if (thr2 >= 0.83 and thr2 < 0.95) {
|
||||
setprop("/systems/thrust/state2", "MAN THR");
|
||||
setprop("systems/thrust/state2", "MAN THR");
|
||||
} else if (thr2 >= 0.95) {
|
||||
setprop("/systems/thrust/state2", "TOGA");
|
||||
setprop("systems/thrust/state2", "TOGA");
|
||||
}
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
# Alpha Floor and Toga Lock
|
||||
setlistener("/it-autoflight/input/athr", func {
|
||||
if (getprop("/systems/thrust/alpha-floor") == 1) {
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
if (getprop("systems/thrust/alpha-floor") == 1) {
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
} else {
|
||||
setprop("/systems/thrust/toga-lk", 0);
|
||||
setprop("systems/thrust/toga-lk", 0);
|
||||
}
|
||||
});
|
||||
|
||||
# Checks if all throttles are in the IDLE position, before tuning off the A/THR.
|
||||
var atoff_request = func {
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
if ((state1 == "IDLE") and (state2 == "IDLE") and (getprop("/systems/thrust/alpha-floor") == 0) and (getprop("/systems/thrust/toga-lk") == 0)) {
|
||||
if (getprop("/it-autoflight/input/athr") == 1 and pts.Position.gearAglFt.getValue() > 50) {
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
if ((state1 == "IDLE") and (state2 == "IDLE") and (getprop("systems/thrust/alpha-floor") == 0) and (getprop("systems/thrust/toga-lk") == 0)) {
|
||||
if (getprop("it-autoflight/input/athr") == 1 and pts.Position.gearAglFt.getValue() > 50) {
|
||||
fcu.athrOff("soft");
|
||||
} elsif (pts.Position.gearAglFt.getValue() < 50) {
|
||||
fcu.athrOff("none");
|
||||
|
@ -208,66 +208,66 @@ var atoff_request = func {
|
|||
}
|
||||
|
||||
var thrust_loop = maketimer(0.04, func {
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
engstate1 = getprop("/engines/engine[0]/state");
|
||||
engstate2 = getprop("/engines/engine[1]/state");
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
eprtoga = getprop("/systems/thrust/epr/toga-lim");
|
||||
eprmct = getprop("/systems/thrust/epr/mct-lim");
|
||||
eprflx = getprop("/systems/thrust/epr/flx-lim");
|
||||
eprclb = getprop("/systems/thrust/epr/clb-lim");
|
||||
n1toga = getprop("/systems/thrust/n1/toga-lim");
|
||||
n1mct = getprop("/systems/thrust/n1/mct-lim");
|
||||
n1flx = getprop("/systems/thrust/n1/flx-lim");
|
||||
n1clb = getprop("/systems/thrust/n1/clb-lim");
|
||||
gs = getprop("/velocities/groundspeed-kt");
|
||||
if (getprop("/FMGC/internal/flex-set") == 1 and getprop("/systems/fadec/n1mode1") == 0 and getprop("/systems/fadec/n1mode2") == 0 and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1 and gs < 40) {
|
||||
setprop("/systems/thrust/lim-flex", 1);
|
||||
} else if (getprop("/FMGC/internal/flex-set") == 0 or engstate1 != 3 or engstate2 != 3) {
|
||||
setprop("/systems/thrust/lim-flex", 0);
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
engstate1 = getprop("engines/engine[0]/state");
|
||||
engstate2 = getprop("engines/engine[1]/state");
|
||||
thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
eprtoga = getprop("systems/thrust/epr/toga-lim");
|
||||
eprmct = getprop("systems/thrust/epr/mct-lim");
|
||||
eprflx = getprop("systems/thrust/epr/flx-lim");
|
||||
eprclb = getprop("systems/thrust/epr/clb-lim");
|
||||
n1toga = getprop("systems/thrust/n1/toga-lim");
|
||||
n1mct = getprop("systems/thrust/n1/mct-lim");
|
||||
n1flx = getprop("systems/thrust/n1/flx-lim");
|
||||
n1clb = getprop("systems/thrust/n1/clb-lim");
|
||||
gs = getprop("velocities/groundspeed-kt");
|
||||
if (getprop("FMGC/internal/flex-set") == 1 and getprop("systems/fadec/n1mode1") == 0 and getprop("systems/fadec/n1mode2") == 0 and getprop("gear/gear[1]/wow") == 1 and getprop("gear/gear[2]/wow") == 1 and gs < 40) {
|
||||
setprop("systems/thrust/lim-flex", 1);
|
||||
} else if (getprop("FMGC/internal/flex-set") == 0 or engstate1 != 3 or engstate2 != 3) {
|
||||
setprop("systems/thrust/lim-flex", 0);
|
||||
}
|
||||
if (getprop("/controls/engines/engine[0]/reverser") == "1" or getprop("/controls/engines/engine[1]/reverser") == "1") {
|
||||
setprop("/controls/engines/thrust-limit", "MREV");
|
||||
setprop("/controls/engines/epr-limit", 1.000);
|
||||
setprop("/controls/engines/n1-limit", 0.0);
|
||||
} else if (getprop("/gear/gear[1]/wow") == 0 or getprop("/gear/gear[2]/wow") == 0 or (engstate1 != 3 and engstate2 != 3)) {
|
||||
if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("/systems/thrust/alpha-floor") == 1 or getprop("/systems/thrust/toga-lk") == 1) {
|
||||
setprop("/controls/engines/thrust-limit", "TOGA");
|
||||
setprop("/controls/engines/epr-limit", eprtoga);
|
||||
setprop("/controls/engines/n1-limit", n1toga);
|
||||
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 0) {
|
||||
setprop("/controls/engines/thrust-limit", "MCT");
|
||||
setprop("/controls/engines/epr-limit", eprmct);
|
||||
setprop("/controls/engines/n1-limit", n1mct);
|
||||
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/lim-flex") == 1) {
|
||||
setprop("/controls/engines/thrust-limit", "FLX");
|
||||
setprop("/controls/engines/epr-limit", eprflx);
|
||||
setprop("/controls/engines/n1-limit", n1flx);
|
||||
if (getprop("controls/engines/engine[0]/reverser") == "1" or getprop("controls/engines/engine[1]/reverser") == "1") {
|
||||
setprop("controls/engines/thrust-limit", "MREV");
|
||||
setprop("controls/engines/epr-limit", 1.000);
|
||||
setprop("controls/engines/n1-limit", 0.0);
|
||||
} else if (getprop("gear/gear[1]/wow") == 0 or getprop("gear/gear[2]/wow") == 0 or (engstate1 != 3 and engstate2 != 3)) {
|
||||
if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("systems/thrust/alpha-floor") == 1 or getprop("systems/thrust/toga-lk") == 1) {
|
||||
setprop("controls/engines/thrust-limit", "TOGA");
|
||||
setprop("controls/engines/epr-limit", eprtoga);
|
||||
setprop("controls/engines/n1-limit", n1toga);
|
||||
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("systems/thrust/lim-flex") == 0) {
|
||||
setprop("controls/engines/thrust-limit", "MCT");
|
||||
setprop("controls/engines/epr-limit", eprmct);
|
||||
setprop("controls/engines/n1-limit", n1mct);
|
||||
} else if ((state1 == "MCT" or state2 == "MCT" or (state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("systems/thrust/lim-flex") == 1) {
|
||||
setprop("controls/engines/thrust-limit", "FLX");
|
||||
setprop("controls/engines/epr-limit", eprflx);
|
||||
setprop("controls/engines/n1-limit", n1flx);
|
||||
} else if (state1 == "CL" or state2 == "CL" or state1 == "MAN" or state2 == "MAN" or state1 == "IDLE" or state2 == "IDLE") {
|
||||
setprop("/controls/engines/thrust-limit", "CLB");
|
||||
setprop("/controls/engines/epr-limit", eprclb);
|
||||
setprop("/controls/engines/n1-limit", n1clb);
|
||||
setprop("controls/engines/thrust-limit", "CLB");
|
||||
setprop("controls/engines/epr-limit", eprclb);
|
||||
setprop("controls/engines/n1-limit", n1clb);
|
||||
}
|
||||
} else if (getprop("/FMGC/internal/flex-set") == 1 and getprop("/systems/fadec/n1mode1") == 0 and getprop("/systems/fadec/n1mode2") == 0) {
|
||||
if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("/systems/thrust/alpha-floor") == 1 or getprop("/systems/thrust/toga-lk") == 1) {
|
||||
setprop("/controls/engines/thrust-limit", "TOGA");
|
||||
setprop("/controls/engines/epr-limit", eprtoga);
|
||||
setprop("/controls/engines/n1-limit", n1toga);
|
||||
} else if (getprop("FMGC/internal/flex-set") == 1 and getprop("systems/fadec/n1mode1") == 0 and getprop("systems/fadec/n1mode2") == 0) {
|
||||
if ((state1 == "TOGA" or state2 == "TOGA" or (state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) or getprop("systems/thrust/alpha-floor") == 1 or getprop("systems/thrust/toga-lk") == 1) {
|
||||
setprop("controls/engines/thrust-limit", "TOGA");
|
||||
setprop("controls/engines/epr-limit", eprtoga);
|
||||
setprop("controls/engines/n1-limit", n1toga);
|
||||
} else {
|
||||
setprop("/controls/engines/thrust-limit", "FLX");
|
||||
setprop("/controls/engines/epr-limit", eprflx);
|
||||
setprop("/controls/engines/n1-limit", n1flx);
|
||||
setprop("controls/engines/thrust-limit", "FLX");
|
||||
setprop("controls/engines/epr-limit", eprflx);
|
||||
setprop("controls/engines/n1-limit", n1flx);
|
||||
}
|
||||
} else {
|
||||
setprop("/controls/engines/thrust-limit", "TOGA");
|
||||
setprop("/controls/engines/epr-limit", eprtoga);
|
||||
setprop("/controls/engines/n1-limit", n1toga);
|
||||
setprop("controls/engines/thrust-limit", "TOGA");
|
||||
setprop("controls/engines/epr-limit", eprtoga);
|
||||
setprop("controls/engines/n1-limit", n1toga);
|
||||
}
|
||||
|
||||
alpha = getprop("/fdm/jsbsim/aero/alpha-deg");
|
||||
flaps = getprop("/controls/flight/flap-pos");
|
||||
alpha = getprop("fdm/jsbsim/aero/alpha-deg");
|
||||
flaps = getprop("controls/flight/flap-pos");
|
||||
if (flaps == 0) {
|
||||
alphaProt = 9.5;
|
||||
} else if (flaps == 1 or flaps == 2 or flaps == 3) {
|
||||
|
@ -278,115 +278,115 @@ var thrust_loop = maketimer(0.04, func {
|
|||
alphaProt = 13.0;
|
||||
}
|
||||
togaLock = alphaProt - 1;
|
||||
if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/it-fbw/law") == 0 and (getprop("/systems/thrust/eng-out") == 0 or (getprop("/systems/thrust/eng-out") == 1 and flaps == 0)) and getprop("/systems/fadec/n1mode1") == 0
|
||||
and getprop("/systems/fadec/n1mode2") == 0) {
|
||||
if (getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0 and getprop("it-fbw/law") == 0 and (getprop("systems/thrust/eng-out") == 0 or (getprop("systems/thrust/eng-out") == 1 and flaps == 0)) and getprop("systems/fadec/n1mode1") == 0
|
||||
and getprop("systems/fadec/n1mode2") == 0) {
|
||||
if (alpha > alphaProt and pts.Position.gearAglFt.getValue() >= 100) {
|
||||
setprop("/systems/thrust/alpha-floor", 1);
|
||||
setprop("/systems/thrust/toga-lk", 0);
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
} else if (getprop("/systems/thrust/alpha-floor") == 1 and alpha < togaLock) {
|
||||
setprop("/systems/thrust/alpha-floor", 0);
|
||||
setprop("/it-autoflight/input/athr", 1);
|
||||
setprop("/systems/thrust/toga-lk", 1);
|
||||
setprop("/controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("/controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
setprop("systems/thrust/alpha-floor", 1);
|
||||
setprop("systems/thrust/toga-lk", 0);
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
} else if (getprop("systems/thrust/alpha-floor") == 1 and alpha < togaLock) {
|
||||
setprop("systems/thrust/alpha-floor", 0);
|
||||
setprop("it-autoflight/input/athr", 1);
|
||||
setprop("systems/thrust/toga-lk", 1);
|
||||
setprop("controls/engines/engine[0]/throttle-fdm", 0.99);
|
||||
setprop("controls/engines/engine[1]/throttle-fdm", 0.99);
|
||||
}
|
||||
} else {
|
||||
setprop("/systems/thrust/alpha-floor", 0);
|
||||
setprop("/systems/thrust/toga-lk", 0);
|
||||
setprop("systems/thrust/alpha-floor", 0);
|
||||
setprop("systems/thrust/toga-lk", 0);
|
||||
}
|
||||
});
|
||||
|
||||
var unflex = func {
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
if (state1 != "MCT" and state2 != "MCT" and getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0) {
|
||||
setprop("/systems/thrust/lim-flex", 0);
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
if (state1 != "MCT" and state2 != "MCT" and getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0) {
|
||||
setprop("systems/thrust/lim-flex", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var thrust_flash = maketimer(0.5, func {
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
|
||||
if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and (getprop("/engines/engine[0]/state") != 3 or getprop("/engines/engine[1]/state") != 3)) {
|
||||
setprop("/systems/thrust/eng-out", 1);
|
||||
if (getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0 and (getprop("engines/engine[0]/state") != 3 or getprop("engines/engine[1]/state") != 3)) {
|
||||
setprop("systems/thrust/eng-out", 1);
|
||||
} else {
|
||||
setprop("/systems/thrust/eng-out", 0);
|
||||
setprop("systems/thrust/eng-out", 0);
|
||||
}
|
||||
|
||||
if (state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") != 1) {
|
||||
setprop("/systems/thrust/lvrclb", 0);
|
||||
} else if (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/lim-flex") != 1 and getprop("/systems/thrust/eng-out") == 1) {
|
||||
setprop("/systems/thrust/lvrclb", 0);
|
||||
if (state1 == "CL" and state2 == "CL" and getprop("systems/thrust/eng-out") != 1) {
|
||||
setprop("systems/thrust/lvrclb", 0);
|
||||
} else if (state1 == "MCT" and state2 == "MCT" and getprop("systems/thrust/lim-flex") != 1 and getprop("systems/thrust/eng-out") == 1) {
|
||||
setprop("systems/thrust/lvrclb", 0);
|
||||
} else {
|
||||
var status = getprop("/systems/thrust/lvrclb");
|
||||
var status = getprop("systems/thrust/lvrclb");
|
||||
if (status == 0) {
|
||||
if (getprop("/gear/gear[0]/wow") == 0) {
|
||||
if (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN") {
|
||||
setprop("/systems/thrust/lvrclb", 1);
|
||||
if (getprop("gear/gear[0]/wow") == 0) {
|
||||
if (getprop("systems/thrust/state1") == "MAN" or getprop("systems/thrust/state2") == "MAN") {
|
||||
setprop("systems/thrust/lvrclb", 1);
|
||||
} else {
|
||||
if (getprop("/instrumentation/altimeter/indicated-altitude-ft") >= getprop("/systems/thrust/clbreduc-ft") and getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0) {
|
||||
setprop("/systems/thrust/lvrclb", 1);
|
||||
} else if ((state1 == "CL" and state2 != "CL") or (state1 != "CL" and state2 == "CL") and getprop("/systems/thrust/eng-out") != 1) {
|
||||
setprop("/systems/thrust/lvrclb", 1);
|
||||
if (getprop("instrumentation/altimeter/indicated-altitude-ft") >= getprop("systems/thrust/clbreduc-ft") and getprop("gear/gear[1]/wow") == 0 and getprop("gear/gear[2]/wow") == 0) {
|
||||
setprop("systems/thrust/lvrclb", 1);
|
||||
} else if ((state1 == "CL" and state2 != "CL") or (state1 != "CL" and state2 == "CL") and getprop("systems/thrust/eng-out") != 1) {
|
||||
setprop("systems/thrust/lvrclb", 1);
|
||||
} else {
|
||||
setprop("/systems/thrust/lvrclb", 0);
|
||||
setprop("systems/thrust/lvrclb", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (status == 1) {
|
||||
setprop("/systems/thrust/lvrclb", 0);
|
||||
setprop("systems/thrust/lvrclb", 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var lockThr = func() {
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
if ((state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
|
||||
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("/systems/thrust/thr-locked", 1);
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
if ((state1 == "CL" and state2 == "CL" and getprop("systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("systems/thrust/eng-out") == 1)) {
|
||||
setprop("systems/thrust/thr-lock-time", getprop("sim/time/elapsed-sec"));
|
||||
setprop("systems/thrust/thr-locked", 1);
|
||||
lockTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
var checkLockThr = func() {
|
||||
if (getprop("/systems/thrust/thr-lock-time") + 5 > getprop("/sim/time/elapsed-sec")) { return; }
|
||||
if (getprop("systems/thrust/thr-lock-time") + 5 > getprop("sim/time/elapsed-sec")) { return; }
|
||||
|
||||
if (fmgc.Output.athr.getBoolValue()) {
|
||||
lockTimer.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getprop("/systems/thrust/thr-locked") == 0) {
|
||||
if (getprop("systems/thrust/thr-locked") == 0) {
|
||||
lockTimer.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
|
||||
if ((state1 != "CL" and state2 != "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
|
||||
if ((state1 != "CL" and state2 != "CL" and getprop("systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("systems/thrust/eng-out") == 1)) {
|
||||
lockTimer.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
} elsif ((state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
|
||||
setprop("/systems/thrust/thr-locked-alert", 1);
|
||||
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("/systems/thrust/thr-locked-flash", 1);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
} elsif ((state1 == "CL" and state2 == "CL" and getprop("systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("systems/thrust/eng-out") == 1)) {
|
||||
setprop("systems/thrust/thr-locked-alert", 1);
|
||||
setprop("systems/thrust/thr-lock-time", getprop("sim/time/elapsed-sec"));
|
||||
setprop("systems/thrust/thr-locked-flash", 1);
|
||||
lockTimer.stop();
|
||||
lockTimer2.start();
|
||||
}
|
||||
|
@ -395,49 +395,49 @@ var checkLockThr = func() {
|
|||
var checkLockThr2 = func() {
|
||||
if (fmgc.Output.athr.getBoolValue()) {
|
||||
lockTimer2.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getprop("/systems/thrust/thr-locked") == 0) {
|
||||
if (getprop("systems/thrust/thr-locked") == 0) {
|
||||
lockTimer2.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getprop("/systems/thrust/thr-lock-time") + 5 < getprop("/sim/time/elapsed-sec")) {
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
if (getprop("systems/thrust/thr-lock-time") + 5 < getprop("sim/time/elapsed-sec")) {
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
settimer(func() {
|
||||
setprop("/systems/thrust/thr-locked-flash", 1);
|
||||
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("systems/thrust/thr-locked-flash", 1);
|
||||
setprop("systems/thrust/thr-lock-time", getprop("sim/time/elapsed-sec"));
|
||||
ecam.athr_lock.noRepeat = 0;
|
||||
ecam.athr_lock.noRepeat2 = 0;
|
||||
}, 0.2);
|
||||
}
|
||||
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
|
||||
|
||||
if ((state1 != "CL" and state2 != "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
|
||||
if ((state1 != "CL" and state2 != "CL" and getprop("systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("systems/thrust/eng-out") == 1)) {
|
||||
lockTimer2.stop();
|
||||
setprop("/systems/thrust/thr-locked", 0);
|
||||
setprop("/systems/thrust/thr-locked-alert", 0);
|
||||
setprop("/systems/thrust/thr-lock-time", 0);
|
||||
setprop("/systems/thrust/thr-locked-flash", 0);
|
||||
setprop("systems/thrust/thr-locked", 0);
|
||||
setprop("systems/thrust/thr-locked-alert", 0);
|
||||
setprop("systems/thrust/thr-lock-time", 0);
|
||||
setprop("systems/thrust/thr-locked-flash", 0);
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/systems/thrust/thr-locked", func {
|
||||
if (getprop("/systems/thrust/thr-locked") == 1) {
|
||||
setprop("/systems/thrust/thr-lock-cmd[0]", getprop("/controls/engines/engine[0]/throttle-output"));
|
||||
setprop("/systems/thrust/thr-lock-cmd[1]", getprop("/controls/engines/engine[1]/throttle-output"));
|
||||
if (getprop("systems/thrust/thr-locked") == 1) {
|
||||
setprop("systems/thrust/thr-lock-cmd[0]", getprop("controls/engines/engine[0]/throttle-output"));
|
||||
setprop("systems/thrust/thr-lock-cmd[1]", getprop("controls/engines/engine[1]/throttle-output"));
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
|
|
|
@ -2,191 +2,191 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
setprop("/controls/fadec/n1mode1", 0);
|
||||
setprop("/controls/fadec/n1mode2", 0);
|
||||
setprop("/systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("/systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("/systems/fadec/eng1/epr", 1);
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
setprop("/systems/fadec/eng2/epr", 1);
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered-time", -300);
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
setprop("controls/fadec/n1mode1", 0);
|
||||
setprop("controls/fadec/n1mode2", 0);
|
||||
setprop("systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("systems/fadec/eng1/epr", 1);
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
setprop("systems/fadec/eng2/epr", 1);
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered-time", -300);
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
|
||||
var FADEC = {
|
||||
init: func() {
|
||||
setprop("/systems/fadec/powered-time", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
setprop("systems/fadec/powered-time", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
},
|
||||
loop: func() {
|
||||
var ac1 = getprop("/systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("/systems/electrical/bus/ac-2");
|
||||
var acess = getprop("/systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("/engines/engine[0]/state");
|
||||
var state2 = getprop("/engines/engine[1]/state");
|
||||
var master1 = getprop("/controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("/controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("/controls/engines/engine-start-switch");
|
||||
var N1Mode1_sw = getprop("/controls/fadec/n1mode1");
|
||||
var N1Mode2_sw = getprop("/controls/fadec/n1mode2");
|
||||
var elapsedSec = getprop("/sim/time/elapsed-sec");
|
||||
var ac1 = getprop("systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("systems/electrical/bus/ac-2");
|
||||
var acess = getprop("systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("engines/engine[0]/state");
|
||||
var state2 = getprop("engines/engine[1]/state");
|
||||
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("controls/engines/engine-start-switch");
|
||||
var N1Mode1_sw = getprop("controls/fadec/n1mode1");
|
||||
var N1Mode2_sw = getprop("controls/fadec/n1mode2");
|
||||
var elapsedSec = getprop("sim/time/elapsed-sec");
|
||||
|
||||
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
|
||||
if (getprop("/systems/fadec/power-avail") != 1) {
|
||||
setprop("/systems/fadec/powered-time", elapsedSec);
|
||||
setprop("/systems/fadec/power-avail", 1);
|
||||
if (getprop("systems/fadec/power-avail") != 1) {
|
||||
setprop("systems/fadec/powered-time", elapsedSec);
|
||||
setprop("systems/fadec/power-avail", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/power-avail") != 0) {
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
if (getprop("systems/fadec/power-avail") != 0) {
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var powerAvail = getprop("/systems/fadec/power-avail");
|
||||
var powerAvail = getprop("systems/fadec/power-avail");
|
||||
|
||||
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/powerup", 1);
|
||||
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/powerup", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
}
|
||||
|
||||
if (master1 == 1) {
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng1-master-count", 1);
|
||||
if (getprop("systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng1-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
if (getprop("systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng1-off-power", 1);
|
||||
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng1-off-power", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
}
|
||||
|
||||
if (master2 == 1) {
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng2-master-count", 1);
|
||||
if (getprop("systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng2-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
if (getprop("systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng2-off-power", 1);
|
||||
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng2-off-power", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
}
|
||||
|
||||
if (state1 == 3) {
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
}
|
||||
|
||||
if (state2 == 3) {
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
}
|
||||
|
||||
if (N1Mode1_sw == 1) {
|
||||
setprop("/systems/fadec/n1mode1", 1);
|
||||
setprop("systems/fadec/n1mode1", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/n1mode1", 0);
|
||||
setprop("systems/fadec/n1mode1", 0);
|
||||
}
|
||||
|
||||
if (N1Mode2_sw == 1) {
|
||||
setprop("/systems/fadec/n1mode2", 1);
|
||||
setprop("systems/fadec/n1mode2", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/n1mode2", 0);
|
||||
setprop("systems/fadec/n1mode2", 0);
|
||||
}
|
||||
|
||||
var powered1 = getprop("/systems/fadec/powered1");
|
||||
var powered2 = getprop("/systems/fadec/powered2");
|
||||
var N1Mode1 = getprop("/systems/fadec/n1mode1");
|
||||
var N1Mode2 = getprop("/systems/fadec/n1mode2");
|
||||
var N11 = getprop("/engines/engine[0]/n1-actual");
|
||||
var N12 = getprop("/engines/engine[1]/n1-actual");
|
||||
var N21 = getprop("/engines/engine[0]/n2-actual");
|
||||
var N22 = getprop("/engines/engine[1]/n2-actual");
|
||||
var powered1 = getprop("systems/fadec/powered1");
|
||||
var powered2 = getprop("systems/fadec/powered2");
|
||||
var N1Mode1 = getprop("systems/fadec/n1mode1");
|
||||
var N1Mode2 = getprop("systems/fadec/n1mode2");
|
||||
var N11 = getprop("engines/engine[0]/n1-actual");
|
||||
var N12 = getprop("engines/engine[1]/n1-actual");
|
||||
var N21 = getprop("engines/engine[0]/n2-actual");
|
||||
var N22 = getprop("engines/engine[1]/n2-actual");
|
||||
|
||||
if ((powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
|
||||
setprop("/systems/fadec/eng1/epr", 1);
|
||||
if ((powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
|
||||
setprop("systems/fadec/eng1/epr", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1/epr", 0);
|
||||
setprop("systems/fadec/eng1/epr", 0);
|
||||
}
|
||||
|
||||
if ((powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
|
||||
setprop("/systems/fadec/eng2/epr", 1);
|
||||
if ((powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
|
||||
setprop("systems/fadec/eng2/epr", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2/epr", 0);
|
||||
setprop("systems/fadec/eng2/epr", 0);
|
||||
}
|
||||
|
||||
if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
if (powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) {
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1/egt", 0);
|
||||
setprop("/systems/fadec/eng1/ff", 0);
|
||||
setprop("systems/fadec/eng1/egt", 0);
|
||||
setprop("systems/fadec/eng1/ff", 0);
|
||||
}
|
||||
|
||||
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
if (powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) {
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2/egt", 0);
|
||||
setprop("/systems/fadec/eng2/ff", 0);
|
||||
setprop("systems/fadec/eng2/egt", 0);
|
||||
setprop("systems/fadec/eng2/ff", 0);
|
||||
}
|
||||
|
||||
if (powered1 and N11 >= 3.5) {
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1/n1", 0);
|
||||
setprop("systems/fadec/eng1/n1", 0);
|
||||
}
|
||||
|
||||
if (powered2 and N12 >= 3.5) {
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2/n1", 0);
|
||||
setprop("systems/fadec/eng2/n1", 0);
|
||||
}
|
||||
|
||||
if (powered1 and N21 >= 3.5) {
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng1/n2", 0);
|
||||
setprop("systems/fadec/eng1/n2", 0);
|
||||
}
|
||||
|
||||
if (powered2 and N22 >= 3.5) {
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
} else {
|
||||
setprop("/systems/fadec/eng2/n2", 0);
|
||||
setprop("systems/fadec/eng2/n2", 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -7,18 +7,18 @@ var thr1 = 0;
|
|||
var thr2 = 0;
|
||||
var wow0 = 0;
|
||||
var gnd_speed = 0;
|
||||
setprop("/controls/autobrake/active", 0);
|
||||
setprop("/controls/autobrake/mode", 0);
|
||||
setprop("/controls/autobrake/decel-rate", 0);
|
||||
setprop("controls/autobrake/active", 0);
|
||||
setprop("controls/autobrake/mode", 0);
|
||||
setprop("controls/autobrake/decel-rate", 0);
|
||||
|
||||
var autobrake_init = func {
|
||||
setprop("/controls/autobrake/active", 0);
|
||||
setprop("/controls/autobrake/mode", 0);
|
||||
setprop("controls/autobrake/active", 0);
|
||||
setprop("controls/autobrake/mode", 0);
|
||||
}
|
||||
|
||||
# Override FG's generic brake
|
||||
controls.applyBrakes = func(v, which = 0) {
|
||||
if (getprop("/systems/acconfig/autoconfig-running") != 1) {
|
||||
if (getprop("systems/acconfig/autoconfig-running") != 1) {
|
||||
if (which <= 0) {
|
||||
interpolate("/controls/gear/brake-left", v, 0.5);
|
||||
}
|
||||
|
@ -30,51 +30,51 @@ controls.applyBrakes = func(v, which = 0) {
|
|||
|
||||
# Set autobrake mode
|
||||
var arm_autobrake = func(mode) {
|
||||
wow0 = getprop("/gear/gear[0]/wow");
|
||||
gnd_speed = getprop("/velocities/groundspeed-kt");
|
||||
wow0 = getprop("gear/gear[0]/wow");
|
||||
gnd_speed = getprop("velocities/groundspeed-kt");
|
||||
if (mode == 0) { # OFF
|
||||
absChk.stop();
|
||||
if (getprop("/controls/autobrake/active") == 1) {
|
||||
setprop("/controls/autobrake/active", 0);
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
if (getprop("controls/autobrake/active") == 1) {
|
||||
setprop("controls/autobrake/active", 0);
|
||||
setprop("controls/gear/brake-left", 0);
|
||||
setprop("controls/gear/brake-right", 0);
|
||||
}
|
||||
setprop("/controls/autobrake/decel-rate", 0);
|
||||
setprop("/controls/autobrake/mode", 0);
|
||||
setprop("controls/autobrake/decel-rate", 0);
|
||||
setprop("controls/autobrake/mode", 0);
|
||||
} else if (mode == 1 and wow0 != 1) { # LO
|
||||
setprop("/controls/autobrake/decel-rate", 1.7);
|
||||
setprop("/controls/autobrake/mode", 1);
|
||||
setprop("controls/autobrake/decel-rate", 1.7);
|
||||
setprop("controls/autobrake/mode", 1);
|
||||
absChk.start();
|
||||
} else if (mode == 2 and wow0 != 1) { # MED
|
||||
setprop("/controls/autobrake/decel-rate", 3);
|
||||
setprop("/controls/autobrake/mode", 2);
|
||||
setprop("controls/autobrake/decel-rate", 3);
|
||||
setprop("controls/autobrake/mode", 2);
|
||||
absChk.start();
|
||||
} else if (mode == 3 and wow0 == 1 and gnd_speed < 40) { # MAX
|
||||
setprop("/controls/autobrake/decel-rate", 6);
|
||||
setprop("/controls/autobrake/mode", 3);
|
||||
setprop("controls/autobrake/decel-rate", 6);
|
||||
setprop("controls/autobrake/mode", 3);
|
||||
absChk.start();
|
||||
}
|
||||
}
|
||||
|
||||
# Autobrake loop
|
||||
var absChk = maketimer(0.2, func {
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle");
|
||||
wow0 = getprop("/gear/gear[0]/wow");
|
||||
gnd_speed = getprop("/velocities/groundspeed-kt");
|
||||
thr1 = getprop("controls/engines/engine[0]/throttle");
|
||||
thr2 = getprop("controls/engines/engine[1]/throttle");
|
||||
wow0 = getprop("gear/gear[0]/wow");
|
||||
gnd_speed = getprop("velocities/groundspeed-kt");
|
||||
if (gnd_speed > 72) {
|
||||
if (getprop("/controls/autobrake/mode") != 0 and thr1 < 0.15 and thr2 < 0.15 and wow0 == 1) {
|
||||
setprop("/controls/autobrake/active", 1);
|
||||
if (getprop("controls/autobrake/mode") != 0 and thr1 < 0.15 and thr2 < 0.15 and wow0 == 1) {
|
||||
setprop("controls/autobrake/active", 1);
|
||||
} else {
|
||||
setprop("/controls/autobrake/active", 0);
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
setprop("controls/autobrake/active", 0);
|
||||
setprop("controls/gear/brake-left", 0);
|
||||
setprop("controls/gear/brake-right", 0);
|
||||
}
|
||||
}
|
||||
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/gear/gear-down") == 0) {
|
||||
if (getprop("controls/autobrake/mode") == 3 and getprop("controls/gear/gear-down") == 0) {
|
||||
arm_autobrake(0);
|
||||
}
|
||||
if (getprop("/controls/autobrake/mode") != 0 and wow0 == 1 and getprop("/controls/autobrake/active") == 1 and (getprop("/controls/gear/brake-left") > 0.05 or getprop("/controls/gear/brake-right") > 0.05)) {
|
||||
if (getprop("controls/autobrake/mode") != 0 and wow0 == 1 and getprop("controls/autobrake/active") == 1 and (getprop("controls/gear/brake-left") > 0.05 or getprop("controls/gear/brake-right") > 0.05)) {
|
||||
arm_autobrake(0);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -77,7 +77,7 @@ var BrakeSystem =
|
|||
|
||||
var atemp = getprop("environment/temperature-degc") or 0;
|
||||
var vmach = getprop("velocities/mach") or 0;
|
||||
var tatdegc = getprop("/systems/navigation/probes/tat-1/compute-tat");
|
||||
var tatdegc = getprop("systems/navigation/probes/tat-1/compute-tat");
|
||||
|
||||
setprop("gear/gear[1]/L1brake-temp-degc",tatdegc+getprop("gear/gear[1]/L1error-temp-degc"));
|
||||
setprop("gear/gear[1]/L2brake-temp-degc",tatdegc+getprop("gear/gear[1]/L2error-temp-degc"));
|
||||
|
|
|
@ -3,98 +3,98 @@
|
|||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
setlistener("sim/signals/fdm-initialized", func {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
setprop("/instrumentation/efis[0]/inputs/range-nm", 20);
|
||||
setprop("/instrumentation/efis[0]/inputs/tfc", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
setprop("/instrumentation/efis[1]/inputs/range-nm", 20);
|
||||
setprop("/instrumentation/efis[1]/inputs/tfc", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[0]/inputs/range-nm", 20);
|
||||
setprop("instrumentation/efis[0]/inputs/tfc", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[1]/inputs/range-nm", 20);
|
||||
setprop("instrumentation/efis[1]/inputs/tfc", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
});
|
||||
|
||||
var setCptND = func(d) {
|
||||
var mode = getprop("/instrumentation/efis[0]/nd/display-mode");
|
||||
var mode = getprop("instrumentation/efis[0]/nd/display-mode");
|
||||
|
||||
if (d == 1) {
|
||||
if (mode == "ILS") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "VOR");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "VOR");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 1);
|
||||
} else if (mode == "VOR") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
} else if (mode == "NAV") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "ARC");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "ARC");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 3);
|
||||
} else if (mode == "ARC") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "PLAN");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 4);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "PLAN");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 4);
|
||||
}
|
||||
} else if (d == -1) {
|
||||
if (mode == "PLAN") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "ARC");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "ARC");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 3);
|
||||
} else if (mode == "ARC") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 2);
|
||||
} else if (mode == "NAV") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "VOR");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "VOR");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 1);
|
||||
} else if (mode == "VOR") {
|
||||
setprop("/instrumentation/efis[0]/nd/display-mode", "ILS");
|
||||
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 0);
|
||||
setprop("instrumentation/efis[0]/nd/display-mode", "ILS");
|
||||
setprop("instrumentation/efis[0]/mfd/pnl_mode-num", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var setFoND = func(d) {
|
||||
var mode = getprop("/instrumentation/efis[1]/nd/display-mode");
|
||||
var mode = getprop("instrumentation/efis[1]/nd/display-mode");
|
||||
|
||||
if (d == 1) {
|
||||
if (mode == "ILS") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "VOR");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 1);
|
||||
} else if (mode == "VOR") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
} else if (mode == "NAV") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "ARC");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 3);
|
||||
} else if (mode == "ARC") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "PLAN");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 4);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "PLAN");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 4);
|
||||
}
|
||||
} else if (d == -1) {
|
||||
if (mode == "PLAN") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "ARC");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 3);
|
||||
} else if (mode == "ARC") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "NAV");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 2);
|
||||
} else if (mode == "NAV") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "VOR");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 1);
|
||||
} else if (mode == "VOR") {
|
||||
setprop("/instrumentation/efis[1]/nd/display-mode", "ILS");
|
||||
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 0);
|
||||
setprop("instrumentation/efis[1]/nd/display-mode", "ILS");
|
||||
setprop("instrumentation/efis[1]/mfd/pnl_mode-num", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var setNDRange = func(n, d) {
|
||||
var rng = getprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm");
|
||||
var rng = getprop("instrumentation/efis[" ~ n ~ "]/inputs/range-nm");
|
||||
if (d == 1) {
|
||||
rng = rng * 2;
|
||||
if (rng > 320) {
|
||||
|
@ -106,111 +106,111 @@ var setNDRange = func(n, d) {
|
|||
rng = 10;
|
||||
}
|
||||
}
|
||||
setprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm", rng);
|
||||
setprop("instrumentation/efis[" ~ n ~ "]/inputs/range-nm", rng);
|
||||
}
|
||||
|
||||
var cpt_efis_btns = func(i) {
|
||||
if (i == "cstr") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 1);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
} else if (i == "wpt") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 1);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
} else if (i == "vord") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 1);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 1);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
} else if (i == "ndb") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 1);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
} else if (i == "arpt") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 1);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 1);
|
||||
} else if (i == "off") {
|
||||
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[0]/inputs/arpt", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var fo_efis_btns = func(i) {
|
||||
if (i == "cstr") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 1);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
} else if (i == "wpt") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 1);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
} else if (i == "vord") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 1);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 1);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
} else if (i == "ndb") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 1);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
} else if (i == "arpt") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 1);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 1);
|
||||
} else if (i == "off") {
|
||||
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/CSTR", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/wpt", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/VORD", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/DME", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/NDB", 0);
|
||||
setprop("instrumentation/efis[1]/inputs/arpt", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var toggleSTD = func {
|
||||
var Std = getprop("/modes/altimeter/std");
|
||||
var Std = getprop("modes/altimeter/std");
|
||||
if (Std == 1) {
|
||||
var oldqnh = getprop("/modes/altimeter/oldqnh");
|
||||
setprop("/instrumentation/altimeter/setting-inhg", oldqnh);
|
||||
setprop("/modes/altimeter/std", 0);
|
||||
var oldqnh = getprop("modes/altimeter/oldqnh");
|
||||
setprop("instrumentation/altimeter/setting-inhg", oldqnh);
|
||||
setprop("modes/altimeter/std", 0);
|
||||
} else if (Std == 0) {
|
||||
var qnh = getprop("/instrumentation/altimeter/setting-inhg");
|
||||
setprop("/modes/altimeter/oldqnh", qnh);
|
||||
setprop("/instrumentation/altimeter/setting-inhg", 29.92);
|
||||
setprop("/modes/altimeter/std", 1);
|
||||
var qnh = getprop("instrumentation/altimeter/setting-inhg");
|
||||
setprop("modes/altimeter/oldqnh", qnh);
|
||||
setprop("instrumentation/altimeter/setting-inhg", 29.92);
|
||||
setprop("modes/altimeter/std", 1);
|
||||
}
|
||||
}
|
|
@ -16,38 +16,38 @@ var ELEC = {
|
|||
_timer1On: 0,
|
||||
_timer2On: 0,
|
||||
Bus: {
|
||||
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
|
||||
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
|
||||
ac1: props.globals.getNode("/systems/electrical/bus/ac-1"),
|
||||
ac2: props.globals.getNode("/systems/electrical/bus/ac-2"),
|
||||
dcBat: props.globals.getNode("/systems/electrical/bus/dc-bat"),
|
||||
dcEss: props.globals.getNode("/systems/electrical/bus/dc-ess"),
|
||||
dcEssShed: props.globals.getNode("/systems/electrical/bus/dc-ess-shed"),
|
||||
dc1: props.globals.getNode("/systems/electrical/bus/dc-1"),
|
||||
dc2: props.globals.getNode("/systems/electrical/bus/dc-2"),
|
||||
dcHot1: props.globals.getNode("/systems/electrical/bus/dc-hot-1"),
|
||||
dcHot2: props.globals.getNode("/systems/electrical/bus/dc-hot-2"),
|
||||
acEss: props.globals.getNode("systems/electrical/bus/ac-ess"),
|
||||
acEssShed: props.globals.getNode("systems/electrical/bus/ac-ess-shed"),
|
||||
ac1: props.globals.getNode("systems/electrical/bus/ac-1"),
|
||||
ac2: props.globals.getNode("systems/electrical/bus/ac-2"),
|
||||
dcBat: props.globals.getNode("systems/electrical/bus/dc-bat"),
|
||||
dcEss: props.globals.getNode("systems/electrical/bus/dc-ess"),
|
||||
dcEssShed: props.globals.getNode("systems/electrical/bus/dc-ess-shed"),
|
||||
dc1: props.globals.getNode("systems/electrical/bus/dc-1"),
|
||||
dc2: props.globals.getNode("systems/electrical/bus/dc-2"),
|
||||
dcHot1: props.globals.getNode("systems/electrical/bus/dc-hot-1"),
|
||||
dcHot2: props.globals.getNode("systems/electrical/bus/dc-hot-2"),
|
||||
},
|
||||
Fail: {
|
||||
acEssBusFault: props.globals.getNode("/systems/failures/electrical/ac-ess-bus"),
|
||||
ac1BusFault: props.globals.getNode("/systems/failures/electrical/ac-1-bus"),
|
||||
ac2BusFault: props.globals.getNode("/systems/failures/electrical/ac-2-bus"),
|
||||
bat1Fault: props.globals.getNode("/systems/failures/electrical/bat-1"),
|
||||
bat2Fault: props.globals.getNode("/systems/failures/electrical/bat-2"),
|
||||
dcBatBusFault: props.globals.getNode("/systems/failures/electrical/dc-bat-bus"),
|
||||
dcEssBusFault: props.globals.getNode("/systems/failures/electrical/dc-ess-bus"),
|
||||
dc1BusFault: props.globals.getNode("/systems/failures/electrical/dc-1-bus"),
|
||||
dc2BusFault: props.globals.getNode("/systems/failures/electrical/dc-2-bus"),
|
||||
emerGenFault: props.globals.getNode("/systems/failures/electrical/emer-gen"),
|
||||
essTrFault: props.globals.getNode("/systems/failures/electrical/ess-tr"),
|
||||
gen1Fault: props.globals.getNode("/systems/failures/electrical/gen-1"),
|
||||
gen2Fault: props.globals.getNode("/systems/failures/electrical/gen-2"),
|
||||
genApuFault: props.globals.getNode("/systems/failures/electrical/apu"),
|
||||
idg1Fault: props.globals.getNode("/systems/failures/electrical/idg-1"), # oil leak or low press
|
||||
idg2Fault: props.globals.getNode("/systems/failures/electrical/idg-2"),
|
||||
statInvFault: props.globals.getNode("/systems/failures/electrical/stat-inv"),
|
||||
tr1Fault: props.globals.getNode("/systems/failures/electrical/tr-1"),
|
||||
tr2Fault: props.globals.getNode("/systems/failures/electrical/tr-2"),
|
||||
acEssBusFault: props.globals.getNode("systems/failures/electrical/ac-ess-bus"),
|
||||
ac1BusFault: props.globals.getNode("systems/failures/electrical/ac-1-bus"),
|
||||
ac2BusFault: props.globals.getNode("systems/failures/electrical/ac-2-bus"),
|
||||
bat1Fault: props.globals.getNode("systems/failures/electrical/bat-1"),
|
||||
bat2Fault: props.globals.getNode("systems/failures/electrical/bat-2"),
|
||||
dcBatBusFault: props.globals.getNode("systems/failures/electrical/dc-bat-bus"),
|
||||
dcEssBusFault: props.globals.getNode("systems/failures/electrical/dc-ess-bus"),
|
||||
dc1BusFault: props.globals.getNode("systems/failures/electrical/dc-1-bus"),
|
||||
dc2BusFault: props.globals.getNode("systems/failures/electrical/dc-2-bus"),
|
||||
emerGenFault: props.globals.getNode("systems/failures/electrical/emer-gen"),
|
||||
essTrFault: props.globals.getNode("systems/failures/electrical/ess-tr"),
|
||||
gen1Fault: props.globals.getNode("systems/failures/electrical/gen-1"),
|
||||
gen2Fault: props.globals.getNode("systems/failures/electrical/gen-2"),
|
||||
genApuFault: props.globals.getNode("systems/failures/electrical/apu"),
|
||||
idg1Fault: props.globals.getNode("systems/failures/electrical/idg-1"), # oil leak or low press
|
||||
idg2Fault: props.globals.getNode("systems/failures/electrical/idg-2"),
|
||||
statInvFault: props.globals.getNode("systems/failures/electrical/stat-inv"),
|
||||
tr1Fault: props.globals.getNode("systems/failures/electrical/tr-1"),
|
||||
tr2Fault: props.globals.getNode("systems/failures/electrical/tr-2"),
|
||||
},
|
||||
Generic: {
|
||||
adf: props.globals.initNode("/systems/electrical/outputs/adf", 0, "DOUBLE"),
|
||||
|
@ -72,50 +72,50 @@ var ELEC = {
|
|||
Misc: {
|
||||
},
|
||||
Relay: {
|
||||
essTrContactor: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/contact-pos"),
|
||||
essTrContactor: props.globals.getNode("systems/electrical/relay/dc-ess-feed-tr/contact-pos"),
|
||||
},
|
||||
SomeThing: {
|
||||
emerGenSignal: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-gen-operate"),
|
||||
emerGenSignal: props.globals.getNode("systems/electrical/some-electric-thingie/emer-gen-operate"),
|
||||
},
|
||||
Source: {
|
||||
Bat1: {
|
||||
amps: props.globals.getNode("/systems/electrical/sources/bat-1/amp"),
|
||||
limiter: props.globals.getNode("/systems/electrical/sources/bat-1/limiter"),
|
||||
percent: props.globals.getNode("/systems/electrical/sources/bat-1/percent"),
|
||||
time: props.globals.getNode("/systems/electrical/sources/bat-1/time"),
|
||||
amps: props.globals.getNode("systems/electrical/sources/bat-1/amp"),
|
||||
limiter: props.globals.getNode("systems/electrical/sources/bat-1/limiter"),
|
||||
percent: props.globals.getNode("systems/electrical/sources/bat-1/percent"),
|
||||
time: props.globals.getNode("systems/electrical/sources/bat-1/time"),
|
||||
},
|
||||
Bat2: {
|
||||
amps: props.globals.getNode("/systems/electrical/sources/bat-2/amp"),
|
||||
limiter: props.globals.getNode("/systems/electrical/sources/bat-2/limiter"),
|
||||
percent: props.globals.getNode("/systems/electrical/sources/bat-2/percent"),
|
||||
time: props.globals.getNode("/systems/electrical/sources/bat-2/time"),
|
||||
amps: props.globals.getNode("systems/electrical/sources/bat-2/amp"),
|
||||
limiter: props.globals.getNode("systems/electrical/sources/bat-2/limiter"),
|
||||
percent: props.globals.getNode("systems/electrical/sources/bat-2/percent"),
|
||||
time: props.globals.getNode("systems/electrical/sources/bat-2/time"),
|
||||
},
|
||||
trEss: {
|
||||
outputVolt: props.globals.getNode("/systems/electrical/sources/tr-ess/output-volt"),
|
||||
outputAmp: props.globals.getNode("/systems/electrical/sources/tr-ess/output-amp"),
|
||||
outputVolt: props.globals.getNode("systems/electrical/sources/tr-ess/output-volt"),
|
||||
outputAmp: props.globals.getNode("systems/electrical/sources/tr-ess/output-amp"),
|
||||
},
|
||||
IDG1: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
||||
gcrRelay: props.globals.getNode("systems/electrical/sources/idg-1/gcr-relay"),
|
||||
},
|
||||
IDG2: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
||||
gcrRelay: props.globals.getNode("systems/electrical/sources/idg-1/gcr-relay"),
|
||||
},
|
||||
},
|
||||
Switch: {
|
||||
acEssFeed: props.globals.getNode("/controls/electrical/switches/ac-ess-feed"),
|
||||
busTie: props.globals.getNode("/controls/electrical/switches/bus-tie"),
|
||||
bat1: props.globals.getNode("/controls/electrical/switches/bat-1"),
|
||||
bat2: props.globals.getNode("/controls/electrical/switches/bat-2"),
|
||||
emerGenTest: props.globals.getNode("/controls/electrical/switches/emer-gen-test"),
|
||||
extPwr: props.globals.getNode("/controls/electrical/switches/ext-pwr"),
|
||||
galley: props.globals.getNode("/controls/electrical/switches/galley"),
|
||||
gen1: props.globals.getNode("/controls/electrical/switches/gen-1"),
|
||||
gen2: props.globals.getNode("/controls/electrical/switches/gen-2"),
|
||||
genApu: props.globals.getNode("/controls/electrical/switches/apu"),
|
||||
gen1Line: props.globals.getNode("/controls/electrical/switches/gen-1-line-contactor"),
|
||||
idg1Disc: props.globals.getNode("/controls/electrical/switches/idg-1-disc"),
|
||||
idg2Disc: props.globals.getNode("/controls/electrical/switches/idg-2-disc"),
|
||||
emerElecManOn: props.globals.getNode("/controls/electrical/switches/emer-elec-man-on"), # non-reset
|
||||
acEssFeed: props.globals.getNode("controls/electrical/switches/ac-ess-feed"),
|
||||
busTie: props.globals.getNode("controls/electrical/switches/bus-tie"),
|
||||
bat1: props.globals.getNode("controls/electrical/switches/bat-1"),
|
||||
bat2: props.globals.getNode("controls/electrical/switches/bat-2"),
|
||||
emerGenTest: props.globals.getNode("controls/electrical/switches/emer-gen-test"),
|
||||
extPwr: props.globals.getNode("controls/electrical/switches/ext-pwr"),
|
||||
galley: props.globals.getNode("controls/electrical/switches/galley"),
|
||||
gen1: props.globals.getNode("controls/electrical/switches/gen-1"),
|
||||
gen2: props.globals.getNode("controls/electrical/switches/gen-2"),
|
||||
genApu: props.globals.getNode("controls/electrical/switches/apu"),
|
||||
gen1Line: props.globals.getNode("controls/electrical/switches/gen-1-line-contactor"),
|
||||
idg1Disc: props.globals.getNode("controls/electrical/switches/idg-1-disc"),
|
||||
idg2Disc: props.globals.getNode("controls/electrical/switches/idg-2-disc"),
|
||||
emerElecManOn: props.globals.getNode("controls/electrical/switches/emer-elec-man-on"), # non-reset
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
|
@ -172,64 +172,64 @@ var ELEC = {
|
|||
dcbat = me.Bus.dcBat.getValue();
|
||||
|
||||
if (battery1_percent < 100 and dcbat > 25 and battery1_sw and !batt1_fail) {
|
||||
if (battery1_time + 5 < getprop("/sim/time/elapsed-sec")) {
|
||||
if (battery1_time + 5 < getprop("sim/time/elapsed-sec")) {
|
||||
battery1_percent_calc = battery1_percent + 0.75; # Roughly 90 percent every 10 mins
|
||||
if (battery1_percent_calc > 100) {
|
||||
battery1_percent_calc = 100;
|
||||
}
|
||||
me.Source.Bat1.limiter.setBoolValue(1);
|
||||
me.Source.Bat1.percent.setValue(battery1_percent_calc);
|
||||
me.Source.Bat1.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
} else if (battery1_percent == 100 and dcbat > 25 and battery1_sw and !batt1_fail) {
|
||||
me.Source.Bat1.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.limiter.setBoolValue(0);
|
||||
} else if (battery1_amps > 0 and battery1_sw and !batt1_fail) {
|
||||
if (battery1_time + 5 < getprop("/sim/time/elapsed-sec")) {
|
||||
if (battery1_time + 5 < getprop("sim/time/elapsed-sec")) {
|
||||
battery1_percent_calc = battery1_percent - 0.25; # Roughly 90 percent every 30 mins
|
||||
if (battery1_percent_calc < 5) {
|
||||
battery1_percent_calc = 5;
|
||||
}
|
||||
me.Source.Bat1.limiter.setBoolValue(1);
|
||||
me.Source.Bat1.percent.setValue(battery1_percent_calc);
|
||||
me.Source.Bat1.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
} else {
|
||||
me.Source.Bat1.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
me.Source.Bat1.limiter.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (battery2_percent < 100 and dcbat > 25 and battery2_sw and !batt2_fail) {
|
||||
if (battery2_time + 5 < getprop("/sim/time/elapsed-sec")) {
|
||||
if (battery2_time + 5 < getprop("sim/time/elapsed-sec")) {
|
||||
battery2_percent_calc = battery2_percent + 0.75; # Roughly 90 percent every 10 mins
|
||||
if (battery2_percent_calc > 100) {
|
||||
battery2_percent_calc = 100;
|
||||
}
|
||||
me.Source.Bat2.limiter.setBoolValue(1);
|
||||
me.Source.Bat2.percent.setValue(battery2_percent_calc);
|
||||
me.Source.Bat2.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
} else if (battery2_percent == 100 and dcbat > 25 and battery2_sw and !batt2_fail) {
|
||||
me.Source.Bat2.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.limiter.setBoolValue(0);
|
||||
} else if (battery2_amps > 0 and battery2_sw and !batt1_fail) {
|
||||
if (battery2_time + 5 < getprop("/sim/time/elapsed-sec")) {
|
||||
if (battery2_time + 5 < getprop("sim/time/elapsed-sec")) {
|
||||
battery2_percent_calc = battery2_percent - 0.25; # Roughly 90 percent every 30 mins
|
||||
if (battery2_percent_calc < 5) {
|
||||
battery2_percent_calc = 5;
|
||||
}
|
||||
me.Source.Bat2.limiter.setBoolValue(1);
|
||||
me.Source.Bat2.percent.setValue(battery2_percent_calc);
|
||||
me.Source.Bat2.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
}
|
||||
} else {
|
||||
me.Source.Bat2.time.setValue(getprop("/sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
|
||||
me.Source.Bat2.limiter.setBoolValue(0);
|
||||
}
|
||||
|
||||
# Autopilot Disconnection routines
|
||||
if (me.Bus.dcEssShed.getValue() < 25) {
|
||||
if (getprop("/it-autoflight/output/ap1") == 1 and !me._timer1On) {
|
||||
if (getprop("it-autoflight/output/ap1") == 1 and !me._timer1On) {
|
||||
me._timer1On = 1;
|
||||
settimer(func() {
|
||||
if (me.Bus.dcEssShed.getValue() < 25) {
|
||||
|
@ -244,7 +244,7 @@ var ELEC = {
|
|||
}
|
||||
|
||||
if (me.Bus.dc2.getValue() < 25) {
|
||||
if (getprop("/it-autoflight/output/ap2") == 1 and !me._timer2On) {
|
||||
if (getprop("it-autoflight/output/ap2") == 1 and !me._timer2On) {
|
||||
me._timer2On = 1;
|
||||
settimer(func() {
|
||||
if (me.Bus.dc2.getValue() < 25) {
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
|
||||
var elapsedTime = props.globals.getNode("/sim/time/elapsed-sec");
|
||||
var apuTestBtn = props.globals.getNode("/controls/fire/apu-test-btn", 1);
|
||||
var testBtn = props.globals.getNode("/controls/fire/test-btn-1", 1);
|
||||
var testBtn2 = props.globals.getNode("/controls/fire/test-btn-2", 1);
|
||||
var elapsedTime = props.globals.getNode("sim/time/elapsed-sec");
|
||||
var apuTestBtn = props.globals.getNode("controls/fire/apu-test-btn", 1);
|
||||
var testBtn = props.globals.getNode("controls/fire/test-btn-1", 1);
|
||||
var testBtn2 = props.globals.getNode("controls/fire/test-btn-2", 1);
|
||||
var dischTest = props.globals.initNode("/systems/fire/cargo/disch-test", 0, "BOOL");
|
||||
var cargoTestBtn = props.globals.initNode("/controls/fire/cargo/test", 0, "BOOL");
|
||||
var cargoTestTime = props.globals.initNode("/controls/fire/cargo/test-time", 0, "DOUBLE");
|
||||
|
@ -22,7 +22,7 @@ var eng2Inop = props.globals.initNode("/systems/fire/engine2/det-inop", 0, "BOOL
|
|||
var apuInop = props.globals.initNode("/systems/fire/apu/det-inop", 0, "BOOL");
|
||||
var aftCargoFireWarn = props.globals.initNode("/systems/fire/cargo/aft/warning-active", 0, "BOOL");
|
||||
var fwdCargoFireWarn = props.globals.initNode("/systems/fire/cargo/fwd/warning-active", 0, "BOOL");
|
||||
var apuEmerShutdown = props.globals.getNode("/systems/apu/emer-shutdown", 1);
|
||||
var apuEmerShutdown = props.globals.getNode("systems/apu/emer-shutdown", 1);
|
||||
var eng1AgentTimer = props.globals.initNode("/systems/fire/engine1/agent1-timer", 99, "INT");
|
||||
var eng2AgentTimer = props.globals.initNode("/systems/fire/engine2/agent1-timer", 99, "INT");
|
||||
var eng1Agent2Timer = props.globals.initNode("/systems/fire/engine1/agent2-timer", 99, "INT");
|
||||
|
@ -33,20 +33,20 @@ var eng2AgentTimerTime = props.globals.initNode("/systems/fire/engine2/agent1-ti
|
|||
var eng1Agent2TimerTime = props.globals.initNode("/systems/fire/engine1/agent2-timer-time", 0, "INT");
|
||||
var eng2Agent2TimerTime = props.globals.initNode("/systems/fire/engine2/agent2-timer-time", 0, "INT");
|
||||
var apuAgentTimerTime = props.globals.initNode("/systems/fire/apu/agent-timer-time", 0, "INT");
|
||||
var wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
|
||||
var wow = props.globals.getNode("fdm/jsbsim/position/wow", 1);
|
||||
var dcbatNode = props.globals.getNode("systems/electrical/bus/dc-bat", 1);
|
||||
var dcessNode = props.globals.getNode("systems/electrical/bus/dc-ess", 1);
|
||||
var apuBleedNode = props.globals.getNode("/systems/apu/bleed-used", 1);
|
||||
var apuMaster = props.globals.getNode("/controls/APU/master", 1);
|
||||
var apuBleedNode = props.globals.getNode("systems/apu/bleed-used", 1);
|
||||
var apuMaster = props.globals.getNode("controls/APU/master", 1);
|
||||
|
||||
var fire_init = func {
|
||||
setprop("/controls/OH/protectors/fwddisch", 0);
|
||||
setprop("/controls/OH/protectors/aftdisch", 0);
|
||||
setprop("/controls/fire/cargo/fwddisch", 0);
|
||||
setprop("/controls/fire/cargo/aftdisch", 0);
|
||||
setprop("/systems/failures/cargo-fwd-fire", 0);
|
||||
setprop("/systems/failures/cargo-aft-fire", 0);
|
||||
setprop("/controls/fire/cargo/test", 0);
|
||||
setprop("controls/OH/protectors/fwddisch", 0);
|
||||
setprop("controls/OH/protectors/aftdisch", 0);
|
||||
setprop("controls/fire/cargo/fwddisch", 0);
|
||||
setprop("controls/fire/cargo/aftdisch", 0);
|
||||
setprop("systems/failures/cargo-fwd-fire", 0);
|
||||
setprop("systems/failures/cargo-aft-fire", 0);
|
||||
setprop("controls/fire/cargo/test", 0);
|
||||
fire_timer.start();
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ var engFireDetectorUnit = {
|
|||
eF.loopTwo = 0;
|
||||
eF.fireProp = props.globals.getNode(fireProp, 1);
|
||||
eF.testProp = props.globals.getNode(testProp, 1);
|
||||
eF.wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
|
||||
eF.wow = props.globals.getNode("fdm/jsbsim/position/wow", 1);
|
||||
eF.condition = 100;
|
||||
return eF;
|
||||
},
|
||||
|
@ -292,9 +292,9 @@ var detectorLoop = {
|
|||
}
|
||||
},
|
||||
sendSignal: func(system, typeLoop) {
|
||||
if (system == 0 and !getprop("/systems/failures/engine-left-fire")) { return; }
|
||||
elsif (system == 1 and !getprop("/systems/failures/engine-right-fire")) { return; }
|
||||
elsif (system == 2 and !getprop("/systems/failures/apu-fire")) { return; }
|
||||
if (system == 0 and !getprop("systems/failures/engine-left-fire")) { return; }
|
||||
elsif (system == 1 and !getprop("systems/failures/engine-right-fire")) { return; }
|
||||
elsif (system == 2 and !getprop("systems/failures/apu-fire")) { return; }
|
||||
engFireDetectorUnits.vector[system].receiveSignal(typeLoop);
|
||||
}
|
||||
};
|
||||
|
@ -319,8 +319,8 @@ var cargoDetectorLoop = {
|
|||
}
|
||||
},
|
||||
sendSignal: func(system, typeLoop) {
|
||||
if ((system == 0 or system == 1) and !getprop("/systems/failures/cargo-aft-fire")) { return; }
|
||||
elsif (system == 2 and !getprop("/systems/failures/cargo-fwd-fire")) { return; }
|
||||
if ((system == 0 or system == 1) and !getprop("systems/failures/cargo-aft-fire")) { return; }
|
||||
elsif (system == 2 and !getprop("systems/failures/cargo-fwd-fire")) { return; }
|
||||
|
||||
cargoSmokeDetectorUnits.vector[system].receiveSignal(typeLoop);
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ var createCargoFireBottleListener = func(prop, index) {
|
|||
|
||||
# Listeners
|
||||
setlistener("/controls/engines/engine[0]/fire-btn", func() {
|
||||
if (getprop("/controls/engines/engine[0]/fire-btn") == 1) {
|
||||
if (getprop("controls/engines/engine[0]/fire-btn") == 1) {
|
||||
ecam.shutUpYou();
|
||||
eng1AgentTimerMakeTimer.stop();
|
||||
eng1AgentTimer.setValue(10);
|
||||
|
@ -570,7 +570,7 @@ setlistener("/controls/engines/engine[0]/fire-btn", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/systems/fire/engine1/disch1", func() {
|
||||
if (getprop("/systems/fire/engine1/disch1") == 1) {
|
||||
if (getprop("systems/fire/engine1/disch1") == 1) {
|
||||
eng1Agent2TimerMakeTimer.stop();
|
||||
eng1Agent2Timer.setValue(30);
|
||||
eng1Agent2TimerTime.setValue(elapsedTime.getValue() + 31);
|
||||
|
@ -603,7 +603,7 @@ eng1Agent2TimerMakeTimerFunc = func() {
|
|||
}
|
||||
|
||||
setlistener("/controls/engines/engine[1]/fire-btn", func() {
|
||||
if (getprop("/controls/engines/engine[1]/fire-btn") == 1) {
|
||||
if (getprop("controls/engines/engine[1]/fire-btn") == 1) {
|
||||
ecam.shutUpYou();
|
||||
eng2AgentTimerMakeTimer.stop();
|
||||
eng2AgentTimer.setValue(10);
|
||||
|
@ -613,7 +613,7 @@ setlistener("/controls/engines/engine[1]/fire-btn", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/systems/fire/engine2/disch1", func() {
|
||||
if (getprop("/systems/fire/engine2/disch1") == 1) {
|
||||
if (getprop("systems/fire/engine2/disch1") == 1) {
|
||||
eng2Agent2TimerMakeTimer.stop();
|
||||
eng2Agent2Timer.setValue(30);
|
||||
eng2Agent2TimerTime.setValue(elapsedTime.getValue() + 31);
|
||||
|
@ -646,7 +646,7 @@ eng2Agent2TimerMakeTimerFunc = func() {
|
|||
}
|
||||
|
||||
setlistener("/controls/APU/fire-btn", func() {
|
||||
if (getprop("/controls/APU/fire-btn") == 1) {
|
||||
if (getprop("controls/APU/fire-btn") == 1) {
|
||||
ecam.shutUpYou();
|
||||
apuAgentTimerMakeTimer.stop();
|
||||
apuAgentTimer.setValue(10);
|
||||
|
@ -667,7 +667,7 @@ apuAgentTimerMakeTimerFunc = func() {
|
|||
}
|
||||
|
||||
setlistener("/controls/fire/test-btn-1", func() {
|
||||
if (getprop("/systems/failures/engine-left-fire")) { return; }
|
||||
if (getprop("systems/failures/engine-left-fire")) { return; }
|
||||
|
||||
if (testBtn.getValue() == 1) {
|
||||
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
|
||||
|
@ -680,7 +680,7 @@ setlistener("/controls/fire/test-btn-1", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/fire/test-btn-2", func() {
|
||||
if (getprop("/systems/failures/engine-right-fire")) { return; }
|
||||
if (getprop("systems/failures/engine-right-fire")) { return; }
|
||||
if (testBtn2.getValue() == 1) {
|
||||
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
|
||||
eng2FireWarn.setBoolValue(1);
|
||||
|
@ -692,7 +692,7 @@ setlistener("/controls/fire/test-btn-2", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/fire/apu-test-btn", func() {
|
||||
if (getprop("/systems/failures/apu-fire")) { return; }
|
||||
if (getprop("systems/failures/apu-fire")) { return; }
|
||||
if (apuTestBtn.getValue() == 1) {
|
||||
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
|
||||
apuFireWarn.setBoolValue(1);
|
||||
|
@ -704,7 +704,7 @@ setlistener("/controls/fire/apu-test-btn", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/fire/cargo/test", func() {
|
||||
if (getprop("/systems/failures/aft-cargo-fire") or getprop("/systems/failures/fwd-cargo-fire") or dcbatNode.getValue() < 25 or dcessNode.getValue() < 25) { return; }
|
||||
if (getprop("systems/failures/aft-cargo-fire") or getprop("systems/failures/fwd-cargo-fire") or dcbatNode.getValue() < 25 or dcessNode.getValue() < 25) { return; }
|
||||
if (cargoTestBtn.getBoolValue()) {
|
||||
cargoTestTime.setValue(elapsedTime.getValue());
|
||||
cargoTestChecker.start();
|
||||
|
|
|
@ -7,48 +7,48 @@ var FUEL = {
|
|||
offset1: 0,
|
||||
offset2: 0,
|
||||
timeEngStart: 0,
|
||||
cmdCtrOn: props.globals.getNode("/systems/fuel/ctr-pump-cmd-on-eng-start"),
|
||||
refuelling: props.globals.getNode("/systems/fuel/refuel/refuelling"),
|
||||
cmdCtrOn: props.globals.getNode("systems/fuel/ctr-pump-cmd-on-eng-start"),
|
||||
refuelling: props.globals.getNode("systems/fuel/refuel/refuelling"),
|
||||
|
||||
Fail: {
|
||||
},
|
||||
Switches: {
|
||||
centerTkMode: props.globals.getNode("/controls/fuel/switches/center-mode"),
|
||||
crossfeed: props.globals.getNode("/controls/fuel/switches/crossfeed"),
|
||||
pumpLeft1: props.globals.getNode("/controls/fuel/switches/pump-left-1"),
|
||||
pumpLeft2: props.globals.getNode("/controls/fuel/switches/pump-left-2"),
|
||||
pumpCenter1: props.globals.getNode("/controls/fuel/switches/pump-center-1"),
|
||||
pumpCenter2: props.globals.getNode("/controls/fuel/switches/pump-center-2"),
|
||||
pumpRight1: props.globals.getNode("/controls/fuel/switches/pump-right-1"),
|
||||
pumpRight2: props.globals.getNode("/controls/fuel/switches/pump-right-2"),
|
||||
centerTkMode: props.globals.getNode("controls/fuel/switches/center-mode"),
|
||||
crossfeed: props.globals.getNode("controls/fuel/switches/crossfeed"),
|
||||
pumpLeft1: props.globals.getNode("controls/fuel/switches/pump-left-1"),
|
||||
pumpLeft2: props.globals.getNode("controls/fuel/switches/pump-left-2"),
|
||||
pumpCenter1: props.globals.getNode("controls/fuel/switches/pump-center-1"),
|
||||
pumpCenter2: props.globals.getNode("controls/fuel/switches/pump-center-2"),
|
||||
pumpRight1: props.globals.getNode("controls/fuel/switches/pump-right-1"),
|
||||
pumpRight2: props.globals.getNode("controls/fuel/switches/pump-right-2"),
|
||||
},
|
||||
Pumps: {
|
||||
apu: props.globals.getNode("/systems/fuel/pumps/apu-operate"),
|
||||
allOff: props.globals.getNode("/systems/fuel/pumps/all-eng-pump-off"),
|
||||
apu: props.globals.getNode("systems/fuel/pumps/apu-operate"),
|
||||
allOff: props.globals.getNode("systems/fuel/pumps/all-eng-pump-off"),
|
||||
},
|
||||
Valves: {
|
||||
crossfeed: props.globals.getNode("/systems/fuel/valves/crossfeed-valve"),
|
||||
lpValve1: props.globals.getNode("/systems/fuel/valves/engine-1-lp-valve"),
|
||||
lpValve2: props.globals.getNode("/systems/fuel/valves/engine-2-lp-valve"),
|
||||
transfer1: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-1"),
|
||||
transfer2: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-2"),
|
||||
refuelLeft: props.globals.getNode("/systems/fuel/refuel/left-valve"),
|
||||
refuelCenter: props.globals.getNode("/systems/fuel/refuel/center-valve"),
|
||||
refuelRight: props.globals.getNode("/systems/fuel/refuel/right-valve"),
|
||||
crossfeed: props.globals.getNode("systems/fuel/valves/crossfeed-valve"),
|
||||
lpValve1: props.globals.getNode("systems/fuel/valves/engine-1-lp-valve"),
|
||||
lpValve2: props.globals.getNode("systems/fuel/valves/engine-2-lp-valve"),
|
||||
transfer1: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-1"),
|
||||
transfer2: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-2"),
|
||||
refuelLeft: props.globals.getNode("systems/fuel/refuel/left-valve"),
|
||||
refuelCenter: props.globals.getNode("systems/fuel/refuel/center-valve"),
|
||||
refuelRight: props.globals.getNode("systems/fuel/refuel/right-valve"),
|
||||
},
|
||||
Quantity: {
|
||||
leftOuter: props.globals.getNode("/consumables/fuel/tank[0]/level-lbs"),
|
||||
leftOuterPct: props.globals.getNode("/consumables/fuel/tank[0]/level-norm"),
|
||||
leftInner: props.globals.getNode("/consumables/fuel/tank[1]/level-lbs"),
|
||||
leftInnerPct: props.globals.getNode("/consumables/fuel/tank[1]/level-norm"),
|
||||
center: props.globals.getNode("/consumables/fuel/tank[2]/level-lbs"),
|
||||
centerPct: props.globals.getNode("/consumables/fuel/tank[2]/level-norm"),
|
||||
rightInner: props.globals.getNode("/consumables/fuel/tank[3]/level-lbs"),
|
||||
rightInnerPct: props.globals.getNode("/consumables/fuel/tank[3]/level-norm"),
|
||||
rightOuter: props.globals.getNode("/consumables/fuel/tank[4]/level-lbs"),
|
||||
rightOuterPct: props.globals.getNode("/consumables/fuel/tank[4]/level-norm"),
|
||||
usedLeft: props.globals.getNode("/systems/fuel/fuel-used-1"),
|
||||
usedRight: props.globals.getNode("/systems/fuel/fuel-used-2"),
|
||||
leftOuter: props.globals.getNode("consumables/fuel/tank[0]/level-lbs"),
|
||||
leftOuterPct: props.globals.getNode("consumables/fuel/tank[0]/level-norm"),
|
||||
leftInner: props.globals.getNode("consumables/fuel/tank[1]/level-lbs"),
|
||||
leftInnerPct: props.globals.getNode("consumables/fuel/tank[1]/level-norm"),
|
||||
center: props.globals.getNode("consumables/fuel/tank[2]/level-lbs"),
|
||||
centerPct: props.globals.getNode("consumables/fuel/tank[2]/level-norm"),
|
||||
rightInner: props.globals.getNode("consumables/fuel/tank[3]/level-lbs"),
|
||||
rightInnerPct: props.globals.getNode("consumables/fuel/tank[3]/level-norm"),
|
||||
rightOuter: props.globals.getNode("consumables/fuel/tank[4]/level-lbs"),
|
||||
rightOuterPct: props.globals.getNode("consumables/fuel/tank[4]/level-norm"),
|
||||
usedLeft: props.globals.getNode("systems/fuel/fuel-used-1"),
|
||||
usedRight: props.globals.getNode("systems/fuel/fuel-used-2"),
|
||||
},
|
||||
resetFail: func() {
|
||||
|
||||
|
@ -84,162 +84,162 @@ setlistener("/engines/engine[1]/state", func() {
|
|||
|
||||
var FUELx = {
|
||||
init: func() {
|
||||
setprop("/systems/fuel/gravityfeedL", 0);
|
||||
setprop("/systems/fuel/gravityfeedR", 0);
|
||||
setprop("/systems/fuel/gravityfeedL-output", 0);
|
||||
setprop("/systems/fuel/gravityfeedR-output", 0);
|
||||
setprop("/controls/fuel/x-feed", 0);
|
||||
setprop("/controls/fuel/tank0pump1", 0);
|
||||
setprop("/controls/fuel/tank0pump2", 0);
|
||||
setprop("/controls/fuel/tank1pump1", 0);
|
||||
setprop("/controls/fuel/tank1pump2", 0);
|
||||
setprop("/controls/fuel/tank2pump1", 0);
|
||||
setprop("/controls/fuel/tank2pump2", 0);
|
||||
setprop("/controls/fuel/mode", 1);
|
||||
setprop("/systems/fuel/valves/crossfeed-valve", 0);
|
||||
setprop("/systems/fuel/tank[0]/feed", 0);
|
||||
setprop("/systems/fuel/tank[1]/feed", 0);
|
||||
setprop("/systems/fuel/tank[2]/feed", 0);
|
||||
setprop("/systems/fuel/only-use-ctr-tank", 0);
|
||||
setprop("/systems/fuel/tank0pump1-fault", 0);
|
||||
setprop("/systems/fuel/tank0pump2-fault", 0);
|
||||
setprop("/systems/fuel/tank1pump1-fault", 0);
|
||||
setprop("/systems/fuel/tank1pump2-fault", 0);
|
||||
setprop("/systems/fuel/tank2pump1-fault", 0);
|
||||
setprop("/systems/fuel/tank2pump2-fault", 0);
|
||||
setprop("/systems/fuel/mode-fault", 0);
|
||||
setprop("systems/fuel/gravityfeedL", 0);
|
||||
setprop("systems/fuel/gravityfeedR", 0);
|
||||
setprop("systems/fuel/gravityfeedL-output", 0);
|
||||
setprop("systems/fuel/gravityfeedR-output", 0);
|
||||
setprop("controls/fuel/x-feed", 0);
|
||||
setprop("controls/fuel/tank0pump1", 0);
|
||||
setprop("controls/fuel/tank0pump2", 0);
|
||||
setprop("controls/fuel/tank1pump1", 0);
|
||||
setprop("controls/fuel/tank1pump2", 0);
|
||||
setprop("controls/fuel/tank2pump1", 0);
|
||||
setprop("controls/fuel/tank2pump2", 0);
|
||||
setprop("controls/fuel/mode", 1);
|
||||
setprop("systems/fuel/valves/crossfeed-valve", 0);
|
||||
setprop("systems/fuel/tank[0]/feed", 0);
|
||||
setprop("systems/fuel/tank[1]/feed", 0);
|
||||
setprop("systems/fuel/tank[2]/feed", 0);
|
||||
setprop("systems/fuel/only-use-ctr-tank", 0);
|
||||
setprop("systems/fuel/tank0pump1-fault", 0);
|
||||
setprop("systems/fuel/tank0pump2-fault", 0);
|
||||
setprop("systems/fuel/tank1pump1-fault", 0);
|
||||
setprop("systems/fuel/tank1pump2-fault", 0);
|
||||
setprop("systems/fuel/tank2pump1-fault", 0);
|
||||
setprop("systems/fuel/tank2pump2-fault", 0);
|
||||
setprop("systems/fuel/mode-fault", 0);
|
||||
},
|
||||
loop: func() {
|
||||
xfeed_sw = getprop("/controls/fuel/x-feed");
|
||||
tank0pump1_sw = getprop("/controls/fuel/tank0pump1");
|
||||
tank0pump2_sw = getprop("/controls/fuel/tank0pump2");
|
||||
tank1pump1_sw = getprop("/controls/fuel/tank1pump1");
|
||||
tank1pump2_sw = getprop("/controls/fuel/tank1pump2");
|
||||
tank2pump1_sw = getprop("/controls/fuel/tank2pump1");
|
||||
tank2pump2_sw = getprop("/controls/fuel/tank2pump2");
|
||||
mode_sw = getprop("/controls/fuel/mode");
|
||||
xfeed = getprop("/systems/fuel/valves/crossfeed-valve");
|
||||
ac1 = getprop("/systems/electrical/bus/ac-1");
|
||||
ac2 = getprop("/systems/electrical/bus/ac-2");
|
||||
gravityfeedL = getprop("/systems/fuel/gravityfeedL");
|
||||
gravityfeedR = getprop("/systems/fuel/gravityfeedR");
|
||||
gload = getprop("/accelerations/pilot-gdamped");
|
||||
tank0pump1_fail = getprop("/systems/failures/tank0pump1");
|
||||
tank0pump2_fail = getprop("/systems/failures/tank0pump2");
|
||||
tank1pump1_fail = getprop("/systems/failures/tank1pump1");
|
||||
tank1pump2_fail = getprop("/systems/failures/tank1pump2");
|
||||
tank2pump1_fail = getprop("/systems/failures/tank2pump1");
|
||||
tank2pump2_fail = getprop("/systems/failures/tank2pump2");
|
||||
xfeed_sw = getprop("controls/fuel/x-feed");
|
||||
tank0pump1_sw = getprop("controls/fuel/tank0pump1");
|
||||
tank0pump2_sw = getprop("controls/fuel/tank0pump2");
|
||||
tank1pump1_sw = getprop("controls/fuel/tank1pump1");
|
||||
tank1pump2_sw = getprop("controls/fuel/tank1pump2");
|
||||
tank2pump1_sw = getprop("controls/fuel/tank2pump1");
|
||||
tank2pump2_sw = getprop("controls/fuel/tank2pump2");
|
||||
mode_sw = getprop("controls/fuel/mode");
|
||||
xfeed = getprop("systems/fuel/valves/crossfeed-valve");
|
||||
ac1 = getprop("systems/electrical/bus/ac-1");
|
||||
ac2 = getprop("systems/electrical/bus/ac-2");
|
||||
gravityfeedL = getprop("systems/fuel/gravityfeedL");
|
||||
gravityfeedR = getprop("systems/fuel/gravityfeedR");
|
||||
gload = getprop("accelerations/pilot-gdamped");
|
||||
tank0pump1_fail = getprop("systems/failures/tank0pump1");
|
||||
tank0pump2_fail = getprop("systems/failures/tank0pump2");
|
||||
tank1pump1_fail = getprop("systems/failures/tank1pump1");
|
||||
tank1pump2_fail = getprop("systems/failures/tank1pump2");
|
||||
tank2pump1_fail = getprop("systems/failures/tank2pump1");
|
||||
tank2pump2_fail = getprop("systems/failures/tank2pump2");
|
||||
|
||||
if (gload >= 0.7 and gravityfeedL) {
|
||||
setprop("/systems/fuel/gravityfeedL-output", 1);
|
||||
setprop("systems/fuel/gravityfeedL-output", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/gravityfeedL-output", 0);
|
||||
setprop("systems/fuel/gravityfeedL-output", 0);
|
||||
}
|
||||
|
||||
if (gload >= 0.7 and gravityfeedR) {
|
||||
setprop("/systems/fuel/gravityfeedR-output", 1);
|
||||
setprop("systems/fuel/gravityfeedR-output", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/gravityfeedR-output", 0);
|
||||
setprop("systems/fuel/gravityfeedR-output", 0);
|
||||
}
|
||||
|
||||
gravityfeedL_output = getprop("/systems/fuel/gravityfeedL-output");
|
||||
gravityfeedR_output = getprop("/systems/fuel/gravityfeedR-output");
|
||||
gravityfeedL_output = getprop("systems/fuel/gravityfeedL-output");
|
||||
gravityfeedR_output = getprop("systems/fuel/gravityfeedR-output");
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and tank0pump1_sw and !tank0pump1_fail) {
|
||||
setprop("/systems/fuel/tank[0]/feed", 1);
|
||||
setprop("systems/fuel/tank[0]/feed", 1);
|
||||
} else if ((ac1 >= 110 or ac2 >= 110) and tank0pump2_sw and !tank0pump2_fail) {
|
||||
setprop("/systems/fuel/tank[0]/feed", 1);
|
||||
setprop("systems/fuel/tank[0]/feed", 1);
|
||||
} else if (gravityfeedL_output) {
|
||||
setprop("/systems/fuel/tank[0]/feed", 1);
|
||||
setprop("systems/fuel/tank[0]/feed", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank[0]/feed", 0);
|
||||
setprop("systems/fuel/tank[0]/feed", 0);
|
||||
}
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and tank1pump1_sw and !tank1pump1_fail) {
|
||||
setprop("/systems/fuel/tank[1]/feed", 1);
|
||||
setprop("systems/fuel/tank[1]/feed", 1);
|
||||
} else if ((ac1 >= 110 or ac2 >= 110) and tank1pump2_sw and !tank1pump2_fail) {
|
||||
setprop("/systems/fuel/tank[1]/feed", 1);
|
||||
setprop("systems/fuel/tank[1]/feed", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank[1]/feed", 0);
|
||||
setprop("systems/fuel/tank[1]/feed", 0);
|
||||
}
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and tank2pump1_sw and !tank2pump1_fail) {
|
||||
setprop("/systems/fuel/tank[2]/feed", 1);
|
||||
setprop("systems/fuel/tank[2]/feed", 1);
|
||||
} else if ((ac1 >= 110 or ac2 >= 110) and tank2pump2_sw and !tank2pump2_fail) {
|
||||
setprop("/systems/fuel/tank[2]/feed", 1);
|
||||
setprop("systems/fuel/tank[2]/feed", 1);
|
||||
} else if (gravityfeedR_output) {
|
||||
setprop("/systems/fuel/tank[2]/feed", 1);
|
||||
setprop("systems/fuel/tank[2]/feed", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank[2]/feed", 0);
|
||||
setprop("systems/fuel/tank[2]/feed", 0);
|
||||
}
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and xfeed_sw) {
|
||||
setprop("/systems/fuel/valves/crossfeed-valve", 1);
|
||||
setprop("systems/fuel/valves/crossfeed-valve", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/valves/crossfeed-valve", 0);
|
||||
setprop("systems/fuel/valves/crossfeed-valve", 0);
|
||||
}
|
||||
|
||||
tank0 = getprop("/systems/fuel/tank[0]/feed");
|
||||
tank1 = getprop("/systems/fuel/tank[1]/feed");
|
||||
tank2 = getprop("/systems/fuel/tank[2]/feed");
|
||||
tank0 = getprop("systems/fuel/tank[0]/feed");
|
||||
tank1 = getprop("systems/fuel/tank[1]/feed");
|
||||
tank2 = getprop("systems/fuel/tank[2]/feed");
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and (tank0pump1_sw or tank0pump2_sw)) {
|
||||
setprop("/systems/fuel/gravityfeedL", 0);
|
||||
setprop("systems/fuel/gravityfeedL", 0);
|
||||
} else {
|
||||
setprop("/systems/fuel/gravityfeedL", 1);
|
||||
setprop("systems/fuel/gravityfeedL", 1);
|
||||
}
|
||||
|
||||
if ((ac1 >= 110 or ac2 >= 110) and (tank2pump1_sw or tank2pump2_sw)) {
|
||||
setprop("/systems/fuel/gravityfeedR", 0);
|
||||
setprop("systems/fuel/gravityfeedR", 0);
|
||||
} else {
|
||||
setprop("/systems/fuel/gravityfeedR", 1);
|
||||
setprop("systems/fuel/gravityfeedR", 1);
|
||||
}
|
||||
|
||||
gravityfeedL = getprop("/systems/fuel/gravityfeedL");
|
||||
gravityfeedR = getprop("/systems/fuel/gravityfeedR");
|
||||
gravityfeedL = getprop("systems/fuel/gravityfeedL");
|
||||
gravityfeedR = getprop("systems/fuel/gravityfeedR");
|
||||
|
||||
if ((getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") >= 50) and (tank1pump1_sw or tank1pump2_sw) and !gravityfeedL and !gravityfeedR) {
|
||||
setprop("/systems/fuel/only-use-ctr-tank", 1);
|
||||
if ((getprop("fdm/jsbsim/propulsion/tank[1]/contents-lbs") >= 50) and (tank1pump1_sw or tank1pump2_sw) and !gravityfeedL and !gravityfeedR) {
|
||||
setprop("systems/fuel/only-use-ctr-tank", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/only-use-ctr-tank", 0);
|
||||
setprop("systems/fuel/only-use-ctr-tank", 0);
|
||||
}
|
||||
|
||||
# Fault lights
|
||||
if (tank0pump1_sw and tank0pump1_fail) {
|
||||
setprop("/systems/fuel/tank0pump1-fault", 1);
|
||||
setprop("systems/fuel/tank0pump1-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank0pump1-fault", 0);
|
||||
setprop("systems/fuel/tank0pump1-fault", 0);
|
||||
}
|
||||
|
||||
if (tank0pump2_sw and tank0pump2_fail) {
|
||||
setprop("/systems/fuel/tank0pump2-fault", 1);
|
||||
setprop("systems/fuel/tank0pump2-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank0pump2-fault", 0);
|
||||
setprop("systems/fuel/tank0pump2-fault", 0);
|
||||
}
|
||||
|
||||
if (tank1pump1_sw and tank1pump1_fail) {
|
||||
setprop("/systems/fuel/tank1pump1-fault", 1);
|
||||
setprop("systems/fuel/tank1pump1-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank1pump1-fault", 0);
|
||||
setprop("systems/fuel/tank1pump1-fault", 0);
|
||||
}
|
||||
|
||||
if (tank1pump2_sw and tank1pump2_fail) {
|
||||
setprop("/systems/fuel/tank1pump2-fault", 1);
|
||||
setprop("systems/fuel/tank1pump2-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank1pump2-fault", 0);
|
||||
setprop("systems/fuel/tank1pump2-fault", 0);
|
||||
}
|
||||
|
||||
if (tank2pump1_sw and tank2pump1_fail) {
|
||||
setprop("/systems/fuel/tank2pump1-fault", 1);
|
||||
setprop("systems/fuel/tank2pump1-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank2pump1-fault", 0);
|
||||
setprop("systems/fuel/tank2pump1-fault", 0);
|
||||
}
|
||||
|
||||
if (tank2pump2_sw and tank2pump2_fail) {
|
||||
setprop("/systems/fuel/tank2pump2-fault", 1);
|
||||
setprop("systems/fuel/tank2pump2-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/fuel/tank2pump2-fault", 0);
|
||||
setprop("systems/fuel/tank2pump2-fault", 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -11,33 +11,33 @@ var ground_services = {
|
|||
me.ice_time = 0;
|
||||
|
||||
# Catering Truck
|
||||
setprop("/services/catering/scissor-deg", 0);
|
||||
setprop("/services/catering/position-norm", 0);
|
||||
setprop("services/catering/scissor-deg", 0);
|
||||
setprop("services/catering/position-norm", 0);
|
||||
|
||||
# De-icing Truck
|
||||
setprop("/services/deicing_truck/enable", 0);
|
||||
setprop("/services/deicing_truck/de-ice", 0);
|
||||
setprop("services/deicing_truck/enable", 0);
|
||||
setprop("services/deicing_truck/de-ice", 0);
|
||||
|
||||
# Set them all to 0 if the aircraft is not stationary
|
||||
if (getprop("/velocities/groundspeed-kt") >= 2) {
|
||||
setprop("/services/chocks/nose", 0);
|
||||
setprop("/services/chocks/left", 0);
|
||||
setprop("/services/chocks/right", 0);
|
||||
setprop("/services/fuel-truck/enable", 0);
|
||||
setprop("/services/deicing_truck/enable", 0);
|
||||
setprop("/services/catering/enable", 0);
|
||||
if (getprop("velocities/groundspeed-kt") >= 2) {
|
||||
setprop("services/chocks/nose", 0);
|
||||
setprop("services/chocks/left", 0);
|
||||
setprop("services/chocks/right", 0);
|
||||
setprop("services/fuel-truck/enable", 0);
|
||||
setprop("services/deicing_truck/enable", 0);
|
||||
setprop("services/catering/enable", 0);
|
||||
}
|
||||
|
||||
me.reset();
|
||||
},
|
||||
update : func {
|
||||
# Catering Truck Controls
|
||||
var cater_pos = getprop("/services/catering/position-norm");
|
||||
var cater_pos = getprop("services/catering/position-norm");
|
||||
var scissor_deg = 3.325 * (1/D2R) * math.asin(cater_pos / (2 * 3.6612));
|
||||
setprop("/services/catering/scissor-deg", scissor_deg);
|
||||
setprop("services/catering/scissor-deg", scissor_deg);
|
||||
|
||||
# De-icing Truck
|
||||
if (getprop("/services/deicing_truck/enable") and getprop("/services/deicing_truck/de-ice")) {
|
||||
if (getprop("services/deicing_truck/enable") and getprop("services/deicing_truck/de-ice")) {
|
||||
if (me.ice_time == 2) {
|
||||
door.move(1);
|
||||
ground_message ("Lifting De-icing Crane...");
|
||||
|
@ -60,7 +60,7 @@ var ground_services = {
|
|||
|
||||
if (me.ice_time == 900) {
|
||||
ground_message("De-icing Completed!", 1, 1, 1);
|
||||
setprop("/services/deicing_truck/de-ice", 0);
|
||||
setprop("services/deicing_truck/de-ice", 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -81,7 +81,7 @@ var ground_services = {
|
|||
};
|
||||
|
||||
var ground_message = func (string) {
|
||||
setprop("/sim/messages/ground", string);
|
||||
setprop("sim/messages/ground", string);
|
||||
}
|
||||
|
||||
setlistener("sim/signals/fdm-initialized", func {
|
||||
|
|
|
@ -22,23 +22,23 @@ var HYD = {
|
|||
counter: props.globals.initNode("/systems/hydraulic/brakes/counter", 0, "INT"),
|
||||
},
|
||||
Fail: {
|
||||
blueElec: props.globals.getNode("/systems/failures/hydraulic/blue-elec"),
|
||||
blueLeak: props.globals.getNode("/systems/failures/hydraulic/blue-leak"),
|
||||
greenEng: props.globals.getNode("/systems/failures/hydraulic/green-edp"),
|
||||
greenLeak: props.globals.getNode("/systems/failures/hydraulic/green-leak"),
|
||||
ptuFault: props.globals.getNode("/systems/failures/hydraulic/ptu"),
|
||||
yellowEng: props.globals.getNode("/systems/failures/hydraulic/yellow-edp"),
|
||||
yellowElec: props.globals.getNode("/systems/failures/hydraulic/yellow-elec"),
|
||||
yellowLeak: props.globals.getNode("/systems/failures/hydraulic/yellow-leak"),
|
||||
blueElec: props.globals.getNode("systems/failures/hydraulic/blue-elec"),
|
||||
blueLeak: props.globals.getNode("systems/failures/hydraulic/blue-leak"),
|
||||
greenEng: props.globals.getNode("systems/failures/hydraulic/green-edp"),
|
||||
greenLeak: props.globals.getNode("systems/failures/hydraulic/green-leak"),
|
||||
ptuFault: props.globals.getNode("systems/failures/hydraulic/ptu"),
|
||||
yellowEng: props.globals.getNode("systems/failures/hydraulic/yellow-edp"),
|
||||
yellowElec: props.globals.getNode("systems/failures/hydraulic/yellow-elec"),
|
||||
yellowLeak: props.globals.getNode("systems/failures/hydraulic/yellow-leak"),
|
||||
},
|
||||
Psi: {
|
||||
blue: props.globals.getNode("/systems/hydraulic/blue-psi"),
|
||||
green: props.globals.getNode("/systems/hydraulic/green-psi"),
|
||||
yellow: props.globals.getNode("/systems/hydraulic/yellow-psi"),
|
||||
blue: props.globals.getNode("systems/hydraulic/blue-psi"),
|
||||
green: props.globals.getNode("systems/hydraulic/green-psi"),
|
||||
yellow: props.globals.getNode("systems/hydraulic/yellow-psi"),
|
||||
},
|
||||
Ptu: {
|
||||
active: props.globals.getNode("/systems/hydraulic/sources/ptu/ptu-active"),
|
||||
diff: props.globals.getNode("/systems/hydraulic/yellow-psi-diff"),
|
||||
active: props.globals.getNode("systems/hydraulic/sources/ptu/ptu-active"),
|
||||
diff: props.globals.getNode("systems/hydraulic/yellow-psi-diff"),
|
||||
},
|
||||
Qty: {
|
||||
blueInput: props.globals.initNode("/systems/hydraulic/blue-qty-input", 0, "INT"),
|
||||
|
@ -46,20 +46,20 @@ var HYD = {
|
|||
yellowInput: props.globals.initNode("/systems/hydraulic/yellow-qty-input", 0, "INT"),
|
||||
},
|
||||
Rat: {
|
||||
position: props.globals.getNode("/systems/hydraulic/sources/rat/position"),
|
||||
position: props.globals.getNode("systems/hydraulic/sources/rat/position"),
|
||||
},
|
||||
Switch: {
|
||||
blueElec: props.globals.getNode("/controls/hydraulic/switches/blue-elec"),
|
||||
blueElecOvrd: props.globals.getNode("/controls/hydraulic/switches/blue-elec-ovrd"),
|
||||
greenEDP: props.globals.getNode("/controls/hydraulic/switches/green-edp"),
|
||||
ptu: props.globals.getNode("/controls/hydraulic/switches/ptu"),
|
||||
rat: props.globals.getNode("/controls/hydraulic/switches/rat-man"),
|
||||
yellowEDP: props.globals.getNode("/controls/hydraulic/switches/yellow-edp"),
|
||||
yellowElec: props.globals.getNode("/controls/hydraulic/switches/yellow-elec"),
|
||||
blueElec: props.globals.getNode("controls/hydraulic/switches/blue-elec"),
|
||||
blueElecOvrd: props.globals.getNode("controls/hydraulic/switches/blue-elec-ovrd"),
|
||||
greenEDP: props.globals.getNode("controls/hydraulic/switches/green-edp"),
|
||||
ptu: props.globals.getNode("controls/hydraulic/switches/ptu"),
|
||||
rat: props.globals.getNode("controls/hydraulic/switches/rat-man"),
|
||||
yellowEDP: props.globals.getNode("controls/hydraulic/switches/yellow-edp"),
|
||||
yellowElec: props.globals.getNode("controls/hydraulic/switches/yellow-elec"),
|
||||
},
|
||||
Valve: {
|
||||
yellowFire: props.globals.getNode("/systems/hydraulic/sources/yellow-edp/fire-valve"),
|
||||
greenFire: props.globals.getNode("/systems/hydraulic/sources/green-edp/fire-valve"),
|
||||
yellowFire: props.globals.getNode("systems/hydraulic/sources/yellow-edp/fire-valve"),
|
||||
greenFire: props.globals.getNode("systems/hydraulic/sources/green-edp/fire-valve"),
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
|
@ -86,7 +86,7 @@ var HYD = {
|
|||
},
|
||||
loop: func() {
|
||||
accum = me.Brakes.accumPressPsi.getValue();
|
||||
parking = getprop("/controls/gear/brake-parking");
|
||||
parking = getprop("controls/gear/brake-parking");
|
||||
askidnws_sw = me.Brakes.askidSw.getBoolValue();
|
||||
|
||||
if (!parking and askidnws_sw and me.Psi.green.getValue() > 2500) {
|
||||
|
@ -107,8 +107,8 @@ var HYD = {
|
|||
};
|
||||
|
||||
setlistener("/controls/gear/gear-down", func {
|
||||
down = getprop("/controls/gear/gear-down");
|
||||
if (!down and (getprop("/gear/gear[0]/wow") or getprop("/gear/gear[1]/wow") or getprop("/gear/gear[2]/wow"))) {
|
||||
setprop("/controls/gear/gear-down", 1);
|
||||
down = getprop("controls/gear/gear-down");
|
||||
if (!down and (getprop("gear/gear[0]/wow") or getprop("gear/gear[1]/wow") or getprop("gear/gear[2]/wow"))) {
|
||||
setprop("controls/gear/gear-down", 1);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -60,186 +60,186 @@ var stateL = 0;
|
|||
var stateR = 0;
|
||||
|
||||
var icingInit = func {
|
||||
setprop("/systems/icing/severity", "0"); # maximum severity: we will make it random
|
||||
setprop("/systems/icing/factor", 0.0); # the factor is how many inches we add per second
|
||||
setprop("/systems/icing/max-spread-degc", 0.0);
|
||||
setprop("/systems/icing/melt-w-heat-factor", -0.00005000);
|
||||
setprop("/systems/icing/icingcond", 0);
|
||||
setprop("/controls/switches/windowprobeheat", 0);
|
||||
setprop("/controls/switches/wing", 0);
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("/controls/switches/leng", 0);
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/switches/reng", 0);
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("/controls/deice/lengine", 0);
|
||||
setprop("/controls/deice/rengine", 0);
|
||||
setprop("/controls/deice/windowprobeheat", 0);
|
||||
setprop("/systems/pitot/icing", 0.0);
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
setprop("/controls/deice/WingHasBeenTurnedOff", 0);
|
||||
setprop("/controls/deice/GroundModeFinished", 0);
|
||||
setprop("systems/icing/severity", "0"); # maximum severity: we will make it random
|
||||
setprop("systems/icing/factor", 0.0); # the factor is how many inches we add per second
|
||||
setprop("systems/icing/max-spread-degc", 0.0);
|
||||
setprop("systems/icing/melt-w-heat-factor", -0.00005000);
|
||||
setprop("systems/icing/icingcond", 0);
|
||||
setprop("controls/switches/windowprobeheat", 0);
|
||||
setprop("controls/switches/wing", 0);
|
||||
setprop("controls/switches/wingfault", 0);
|
||||
setprop("controls/switches/leng", 0);
|
||||
setprop("controls/switches/lengfault", 0);
|
||||
setprop("controls/switches/reng", 0);
|
||||
setprop("controls/switches/rengfault", 0);
|
||||
setprop("controls/deice/wing", 0);
|
||||
setprop("controls/deice/lengine", 0);
|
||||
setprop("controls/deice/rengine", 0);
|
||||
setprop("controls/deice/windowprobeheat", 0);
|
||||
setprop("systems/pitot/icing", 0.0);
|
||||
setprop("systems/pitot/failed", 1);
|
||||
setprop("controls/deice/WingHasBeenTurnedOff", 0);
|
||||
setprop("controls/deice/GroundModeFinished", 0);
|
||||
icing_timer.start();
|
||||
}
|
||||
|
||||
var icingModel = func {
|
||||
dewpoint = getprop("/environment/dewpoint-degc");
|
||||
temperature = getprop("/environment/temperature-degc");
|
||||
speed = getprop("/velocities/airspeed-kt");
|
||||
visibility = getprop("/environment/effective-visibility-m");
|
||||
visibLclWx = getprop("/environment/visibility-m");
|
||||
severity = getprop("/systems/icing/severity");
|
||||
factor = getprop("/systems/icing/factor");
|
||||
maxSpread = getprop("/systems/icing/max-spread-degc");
|
||||
icingCond = getprop("/systems/icing/icingcond");
|
||||
pause = getprop("/sim/freeze/master");
|
||||
melt = getprop("/systems/icing/melt-w-heat-factor");
|
||||
windowprobe = getprop("/controls/deice/windowprobeheat");
|
||||
wingBtn = getprop("/controls/switches/wing");
|
||||
wingFault = getprop("/controls/switches/wingfault");
|
||||
wingAnti = getprop("/controls/deice/wing");
|
||||
PSI = getprop("/systems/pneumatic/total-psi");
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
PitotIcing = getprop("/systems/pitot/icing");
|
||||
PitotFailed = getprop("/systems/pitot/failed");
|
||||
lengBtn = getprop("/controls/switches/leng");
|
||||
lengFault = getprop("/controls/switches/lengfault");
|
||||
rengBtn = getprop("/controls/switches/reng");
|
||||
rengFault = getprop("/controls/switches/rengfault");
|
||||
lengAnti = getprop("/controls/deice/lengine");
|
||||
rengAnti = getprop("/controls/deice/rengine");
|
||||
WingHasBeenTurnedOff = getprop("/controls/deice/WingHasBeenTurnedOff");
|
||||
GroundModeFinished = getprop("/controls/deice/GroundModeFinished");
|
||||
dewpoint = getprop("environment/dewpoint-degc");
|
||||
temperature = getprop("environment/temperature-degc");
|
||||
speed = getprop("velocities/airspeed-kt");
|
||||
visibility = getprop("environment/effective-visibility-m");
|
||||
visibLclWx = getprop("environment/visibility-m");
|
||||
severity = getprop("systems/icing/severity");
|
||||
factor = getprop("systems/icing/factor");
|
||||
maxSpread = getprop("systems/icing/max-spread-degc");
|
||||
icingCond = getprop("systems/icing/icingcond");
|
||||
pause = getprop("sim/freeze/master");
|
||||
melt = getprop("systems/icing/melt-w-heat-factor");
|
||||
windowprobe = getprop("controls/deice/windowprobeheat");
|
||||
wingBtn = getprop("controls/switches/wing");
|
||||
wingFault = getprop("controls/switches/wingfault");
|
||||
wingAnti = getprop("controls/deice/wing");
|
||||
PSI = getprop("systems/pneumatic/total-psi");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
PitotIcing = getprop("systems/pitot/icing");
|
||||
PitotFailed = getprop("systems/pitot/failed");
|
||||
lengBtn = getprop("controls/switches/leng");
|
||||
lengFault = getprop("controls/switches/lengfault");
|
||||
rengBtn = getprop("controls/switches/reng");
|
||||
rengFault = getprop("controls/switches/rengfault");
|
||||
lengAnti = getprop("controls/deice/lengine");
|
||||
rengAnti = getprop("controls/deice/rengine");
|
||||
WingHasBeenTurnedOff = getprop("controls/deice/WingHasBeenTurnedOff");
|
||||
GroundModeFinished = getprop("controls/deice/GroundModeFinished");
|
||||
|
||||
if (temperature >= 0 or !icingCond) {
|
||||
setprop("/systems/icing/severity", "0");
|
||||
setprop("systems/icing/severity", "0");
|
||||
} else if (temperature < 0 and temperature >= -2 and icingCond) {
|
||||
setprop("/systems/icing/severity", "1");
|
||||
setprop("systems/icing/severity", "1");
|
||||
} else if (temperature < -2 and temperature >= -12 and icingCond) {
|
||||
setprop("/systems/icing/severity", "3");
|
||||
setprop("systems/icing/severity", "3");
|
||||
} else if (temperature < -12 and temperature >= -30 and icingCond) {
|
||||
setprop("/systems/icing/severity", "5");
|
||||
setprop("systems/icing/severity", "5");
|
||||
} else if (temperature < -30 and temperature >= -40 and icingCond) {
|
||||
setprop("/systems/icing/severity", "3");
|
||||
setprop("systems/icing/severity", "3");
|
||||
} else if (temperature < -40 and temperature >= -99 and icingCond) {
|
||||
setprop("/systems/icing/severity", "1");
|
||||
setprop("systems/icing/severity", "1");
|
||||
}
|
||||
|
||||
icing1 = getprop("/sim/model/icing/iceable[0]/ice-inches");
|
||||
sensitive1 = getprop("/sim/model/icing/iceable[0]/sensitivity");
|
||||
icing1 = getprop("sim/model/icing/iceable[0]/ice-inches");
|
||||
sensitive1 = getprop("sim/model/icing/iceable[0]/sensitivity");
|
||||
v = icing1 + (factor * sensitive1);
|
||||
a = icing1 + melt;
|
||||
if (icing1 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[0]/ice-inches", 0.0);
|
||||
} else if (wingAnti) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", a);
|
||||
setprop("sim/model/icing/iceable[0]/ice-inches", a);
|
||||
} else if (!pause and !wingAnti) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", v);
|
||||
setprop("sim/model/icing/iceable[0]/ice-inches", v);
|
||||
}
|
||||
|
||||
icing2 = getprop("/sim/model/icing/iceable[1]/ice-inches");
|
||||
sensitive2 = getprop("/sim/model/icing/iceable[1]/sensitivity");
|
||||
icing2 = getprop("sim/model/icing/iceable[1]/ice-inches");
|
||||
sensitive2 = getprop("sim/model/icing/iceable[1]/sensitivity");
|
||||
u = icing2 + (factor * sensitive2);
|
||||
b = icing2 + melt;
|
||||
if (icing2 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[1]/ice-inches", 0.0);
|
||||
} else if (lengAnti) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", b);
|
||||
setprop("sim/model/icing/iceable[1]/ice-inches", b);
|
||||
} else if (!pause and !lengAnti) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", u);
|
||||
setprop("sim/model/icing/iceable[1]/ice-inches", u);
|
||||
}
|
||||
|
||||
icing3 = getprop("/sim/model/icing/iceable[2]/ice-inches");
|
||||
sensitive3 = getprop("/sim/model/icing/iceable[2]/sensitivity");
|
||||
icing3 = getprop("sim/model/icing/iceable[2]/ice-inches");
|
||||
sensitive3 = getprop("sim/model/icing/iceable[2]/sensitivity");
|
||||
t = icing3 + (factor * sensitive3);
|
||||
c = icing3 + melt;
|
||||
if (icing3 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[2]/ice-inches", 0.0);
|
||||
} else if (rengAnti) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", c);
|
||||
setprop("sim/model/icing/iceable[2]/ice-inches", c);
|
||||
} else if (!pause and !rengAnti) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", t);
|
||||
setprop("sim/model/icing/iceable[2]/ice-inches", t);
|
||||
}
|
||||
|
||||
icing4 = getprop("/sim/model/icing/iceable[3]/ice-inches");
|
||||
sensitive4 = getprop("/sim/model/icing/iceable[3]/sensitivity");
|
||||
icing4 = getprop("sim/model/icing/iceable[3]/ice-inches");
|
||||
sensitive4 = getprop("sim/model/icing/iceable[3]/sensitivity");
|
||||
s = icing4 + (factor * sensitive4);
|
||||
d = icing4 + melt;
|
||||
if (icing4 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[3]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[3]/ice-inches", 0.0);
|
||||
} else if (windowprobe) {
|
||||
setprop("/sim/model/icing/iceable[3]/ice-inches", d);
|
||||
setprop("sim/model/icing/iceable[3]/ice-inches", d);
|
||||
} else if (!pause and !windowprobe) {
|
||||
setprop("/sim/model/icing/iceable[3]/ice-inches", s);
|
||||
setprop("sim/model/icing/iceable[3]/ice-inches", s);
|
||||
}
|
||||
|
||||
icing5 = getprop("/sim/model/icing/iceable[4]/ice-inches");
|
||||
sensitive5 = getprop("/sim/model/icing/iceable[4]/sensitivity");
|
||||
icing5 = getprop("sim/model/icing/iceable[4]/ice-inches");
|
||||
sensitive5 = getprop("sim/model/icing/iceable[4]/sensitivity");
|
||||
r = icing5 + (factor * sensitive5);
|
||||
if (icing5 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[4]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[4]/ice-inches", 0.0);
|
||||
} else if (!pause) {
|
||||
setprop("/sim/model/icing/iceable[4]/ice-inches", r);
|
||||
setprop("sim/model/icing/iceable[4]/ice-inches", r);
|
||||
}
|
||||
|
||||
icing6 = getprop("/sim/model/icing/iceable[5]/ice-inches");
|
||||
sensitive6 = getprop("/sim/model/icing/iceable[5]/sensitivity");
|
||||
icing6 = getprop("sim/model/icing/iceable[5]/ice-inches");
|
||||
sensitive6 = getprop("sim/model/icing/iceable[5]/sensitivity");
|
||||
q = icing6 + (factor * sensitive6);
|
||||
e = icing6 + melt;
|
||||
if (icing6 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[5]/ice-inches", 0.0);
|
||||
setprop("sim/model/icing/iceable[5]/ice-inches", 0.0);
|
||||
} else if (windowprobe) {
|
||||
setprop("/sim/model/icing/iceable[5]/ice-inches", e);
|
||||
setprop("sim/model/icing/iceable[5]/ice-inches", e);
|
||||
} else if (!pause and !windowprobe) {
|
||||
setprop("/sim/model/icing/iceable[5]/ice-inches", q);
|
||||
setprop("sim/model/icing/iceable[5]/ice-inches", q);
|
||||
}
|
||||
|
||||
# Do we create ice?
|
||||
spread = temperature - dewpoint;
|
||||
# freezing fog or low temp and below dp or in advanced wx cloud
|
||||
if ((spread < maxSpread and temperature < 0) or (temperature < 0 and visibility < 1000) or (visibLclWx < 5000 and temperature < 0)) {
|
||||
setprop("/systems/icing/icingcond", 1);
|
||||
setprop("systems/icing/icingcond", 1);
|
||||
} else {
|
||||
setprop("/systems/icing/icingcond", 0);
|
||||
setprop("systems/icing/icingcond", 0);
|
||||
}
|
||||
|
||||
if (WingHasBeenTurnedOff and !wowl and !wowr and GroundModeFinished) {
|
||||
setprop("/controls/deice/wing", 1);
|
||||
setprop("/controls/switches/WingHasBeenTurnedOff", 0);
|
||||
setprop("controls/deice/wing", 1);
|
||||
setprop("controls/switches/WingHasBeenTurnedOff", 0);
|
||||
}
|
||||
|
||||
# If we have low pressure we have a fault
|
||||
if (PSI < 10) {
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("controls/switches/wingfault", 1);
|
||||
setprop("controls/deice/wing", 0);
|
||||
}
|
||||
|
||||
if (PSI > 10 and wingFault) {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("controls/switches/wingfault", 0);
|
||||
if (wingBtn) {
|
||||
setprop("/controls/deice/wing", 1);
|
||||
setprop("controls/deice/wing", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (PitotIcing > 0.03) {
|
||||
if (!PitotFailed) {
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
setprop("systems/pitot/failed", 1);
|
||||
}
|
||||
} else if (PitotIcing < 0.03) {
|
||||
if (PitotFailed) {
|
||||
setprop("/systems/pitot/failed", 0);
|
||||
setprop("systems/pitot/failed", 0);
|
||||
}
|
||||
}
|
||||
|
||||
# if ((getprop("/systems/electrical/bus/dc-1") == 0 or getprop("/systems/electrical/bus/dc-2") == 0) and getprop("/fdm/jsbsim/position/wow") == 0) {
|
||||
# setprop("/controls/switches/leng", 1);
|
||||
# setprop("/controls/switches/reng", 1);
|
||||
# if ((getprop("systems/electrical/bus/dc-1") == 0 or getprop("systems/electrical/bus/dc-2") == 0) and getprop("fdm/jsbsim/position/wow") == 0) {
|
||||
# setprop("controls/switches/leng", 1);
|
||||
# setprop("controls/switches/reng", 1);
|
||||
# }
|
||||
|
||||
#if (getprop("/systems/electrical/bus/dc-ess-shed") == 0) {
|
||||
# setprop("/controls/switches/wing", 0);
|
||||
#if (getprop("systems/electrical/bus/dc-ess-shed") == 0) {
|
||||
# setprop("controls/switches/wing", 0);
|
||||
#}
|
||||
}
|
||||
|
||||
|
@ -248,24 +248,24 @@ var icingModel = func {
|
|||
#################
|
||||
|
||||
setlistener("/controls/switches/leng", func {
|
||||
if (getprop("/controls/switches/leng") == 1 and getprop("/engines/engine[0]/state") == 3) {
|
||||
setprop("/controls/switches/lengfault", 1);
|
||||
if (getprop("controls/switches/leng") == 1 and getprop("engines/engine[0]/state") == 3) {
|
||||
setprop("controls/switches/lengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/deice/lengine", 1);
|
||||
setprop("controls/switches/lengfault", 0);
|
||||
setprop("controls/deice/lengine", 1);
|
||||
}, 0.5);
|
||||
} else if (getprop("/controls/switches/leng") == 0) {
|
||||
setprop("/controls/switches/lengfault", 1);
|
||||
} else if (getprop("controls/switches/leng") == 0) {
|
||||
setprop("controls/switches/lengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/deice/lengine", 0);
|
||||
setprop("controls/switches/lengfault", 0);
|
||||
setprop("controls/deice/lengine", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/engines/engine[0]/state", func {
|
||||
if (getprop("/engines/engine[0]/state") != 3) {
|
||||
setprop("/controls/switches/leng", 0);
|
||||
if (getprop("engines/engine[0]/state") != 3) {
|
||||
setprop("controls/switches/leng", 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -274,24 +274,24 @@ setlistener("/engines/engine[0]/state", func {
|
|||
#################
|
||||
|
||||
setlistener("/controls/switches/reng", func {
|
||||
if (getprop("/controls/switches/reng") == 1 and getprop("/engines/engine[1]/state") == 3) {
|
||||
setprop("/controls/switches/rengfault", 1);
|
||||
if (getprop("controls/switches/reng") == 1 and getprop("engines/engine[1]/state") == 3) {
|
||||
setprop("controls/switches/rengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/rengine", 1);
|
||||
setprop("controls/switches/rengfault", 0);
|
||||
setprop("controls/deice/rengine", 1);
|
||||
}, 0.5);
|
||||
} else if (getprop("/controls/switches/reng") == 0) {
|
||||
setprop("/controls/switches/rengfault", 1);
|
||||
} else if (getprop("controls/switches/reng") == 0) {
|
||||
setprop("controls/switches/rengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/rengine", 0);
|
||||
setprop("controls/switches/rengfault", 0);
|
||||
setprop("controls/deice/rengine", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/engines/engine[1]/state", func {
|
||||
if (getprop("/engines/engine[1]/state") != 3) {
|
||||
setprop("/controls/switches/reng", 0);
|
||||
if (getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("controls/switches/reng", 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -300,21 +300,21 @@ setlistener("/engines/engine[1]/state", func {
|
|||
##################
|
||||
|
||||
setlistener("/controls/switches/windowprobeheat", func {
|
||||
windowprb = getprop("/controls/switches/windowprobeheat");
|
||||
windowprb = getprop("controls/switches/windowprobeheat");
|
||||
if (windowprb == 0.5) { # if in auto
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
stateL = getprop("engines/engine[0]/state");
|
||||
stateR = getprop("engines/engine[1]/state");
|
||||
if (!wowl or !wowr) {
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
setprop("controls/deice/windowprobeheat", 1);
|
||||
} else if (stateL == 3 or stateR == 3) {
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
setprop("controls/deice/windowprobeheat", 1);
|
||||
}
|
||||
} else if (windowprb == 1) { # if in ON
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
setprop("controls/deice/windowprobeheat", 1);
|
||||
} else {
|
||||
setprop("/controls/deice/windowprobeheat", 0);
|
||||
setprop("controls/deice/windowprobeheat", 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -324,33 +324,33 @@ setlistener("/controls/switches/windowprobeheat", func {
|
|||
|
||||
# Switching on the wing anti-ice
|
||||
setlistener("/controls/switches/wing", func {
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
wingBtn = getprop("/controls/switches/wing");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
wingBtn = getprop("controls/switches/wing");
|
||||
if (wowl and wowr and wingBtn) {
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
setprop("controls/switches/wingfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("/controls/deice/wing", 1);
|
||||
setprop("controls/switches/wingfault", 0);
|
||||
setprop("controls/deice/wing", 1);
|
||||
}, 0.5);
|
||||
settimer(func() {
|
||||
setprop("/controls/deice/WingHasBeenTurnedOff", 1);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("controls/deice/WingHasBeenTurnedOff", 1);
|
||||
setprop("controls/deice/wing", 0);
|
||||
}, 30.5);
|
||||
settimer(func() {
|
||||
setprop("/controls/deice/GroundModeFinished", 1);
|
||||
setprop("controls/deice/GroundModeFinished", 1);
|
||||
}, 31);
|
||||
} else if (wingBtn and !wowl and !wowr) { # In the air
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
setprop("controls/switches/wingfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("/controls/deice/wing", 1);
|
||||
setprop("controls/switches/wingfault", 0);
|
||||
setprop("controls/deice/wing", 1);
|
||||
}, 0.5);
|
||||
} else if (!wingBtn) {
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
setprop("controls/switches/wingfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("controls/switches/wingfault", 0);
|
||||
setprop("controls/deice/wing", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
var fuelSvc = {
|
||||
_needCenter: 0,
|
||||
enable: props.globals.getNode("/services/fuel-truck/enable"),
|
||||
connect: props.globals.getNode("/services/fuel-truck/connect"),
|
||||
operate: props.globals.getNode("/services/fuel-truck/operate"),
|
||||
enable: props.globals.getNode("services/fuel-truck/enable"),
|
||||
connect: props.globals.getNode("services/fuel-truck/connect"),
|
||||
operate: props.globals.getNode("services/fuel-truck/operate"),
|
||||
Nodes: {
|
||||
requestLbs: props.globals.getNode("/services/fuel-truck/request-lbs"),
|
||||
requestTotalLbs: props.globals.getNode("/services/fuel-truck/request-total-lbs"),
|
||||
requestLbs: props.globals.getNode("services/fuel-truck/request-lbs"),
|
||||
requestTotalLbs: props.globals.getNode("services/fuel-truck/request-total-lbs"),
|
||||
},
|
||||
|
||||
newRequest: func() {
|
||||
|
|
|
@ -6,37 +6,37 @@
|
|||
# Main class
|
||||
var PNEU = {
|
||||
Fail: {
|
||||
apu: props.globals.getNode("/systems/failures/pneumatics/apu-valve");
|
||||
bleed1: props.globals.getNode("/systems/failures/pneumatics/bleed-1-valve");
|
||||
bleed2: props.globals.getNode("/systems/failures/pneumatics/bleed-2-valve");
|
||||
cabinFans: props.globals.getNode("/systems/failures/pneumatics/cabin-fans");
|
||||
hotAir: props.globals.getNode("/systems/failures/pneumatics/hot-air");
|
||||
pack1: props.globals.getNode("/systems/failures/pneumatics/pack-1-valve");
|
||||
pack2: props.globals.getNode("/systems/failures/pneumatics/pack-2-valve");
|
||||
ramAir: props.globals.getNode("/systems/failures/pneumatics/ram-air");
|
||||
trimValveCockpit: props.globals.getNode("/systems/failures/pneumatics/trim-valve-cockpit");
|
||||
trimValveAft: props.globals.getNode("/systems/failures/pneumatics/trim-valve-cabin-aft");
|
||||
trimValveFwd: props.globals.getNode("/systems/failures/pneumatics/trim-valve-cabin-fwd");
|
||||
xbleed: props.globals.getNode("/systems/failures/pneumatics/x-bleed-valve");
|
||||
apu: props.globals.getNode("systems/failures/pneumatics/apu-valve");
|
||||
bleed1: props.globals.getNode("systems/failures/pneumatics/bleed-1-valve");
|
||||
bleed2: props.globals.getNode("systems/failures/pneumatics/bleed-2-valve");
|
||||
cabinFans: props.globals.getNode("systems/failures/pneumatics/cabin-fans");
|
||||
hotAir: props.globals.getNode("systems/failures/pneumatics/hot-air");
|
||||
pack1: props.globals.getNode("systems/failures/pneumatics/pack-1-valve");
|
||||
pack2: props.globals.getNode("systems/failures/pneumatics/pack-2-valve");
|
||||
ramAir: props.globals.getNode("systems/failures/pneumatics/ram-air");
|
||||
trimValveCockpit: props.globals.getNode("systems/failures/pneumatics/trim-valve-cockpit");
|
||||
trimValveAft: props.globals.getNode("systems/failures/pneumatics/trim-valve-cabin-aft");
|
||||
trimValveFwd: props.globals.getNode("systems/failures/pneumatics/trim-valve-cabin-fwd");
|
||||
xbleed: props.globals.getNode("systems/failures/pneumatics/x-bleed-valve");
|
||||
}
|
||||
Psi: {
|
||||
},
|
||||
Switch: {
|
||||
apu: props.globals.getNode("/controls/pneumatics/switches/apu");
|
||||
bleed1: props.globals.getNode("/controls/pneumatics/switches/bleed-1");
|
||||
bleed2: props.globals.getNode("/controls/pneumatics/switches/bleed-2");
|
||||
blower: props.globals.getNode("/controls/pneumatics/switches/blower");
|
||||
cabinFans: props.globals.getNode("/controls/pneumatics/switches/cabin-fans");
|
||||
extract: props.globals.getNode("/controls/pneumatics/switches/extract");
|
||||
hotAir: props.globals.getNode("/controls/pneumatics/switches/hot-air");
|
||||
pack1: props.globals.getNode("/controls/pneumatics/switches/pack-1");
|
||||
pack2: props.globals.getNode("/controls/pneumatics/switches/pack-2");
|
||||
packFlow: props.globals.getNode("/controls/pneumatics/switches/pack-flow");
|
||||
ramAir: props.globals.getNode("/controls/pneumatics/switches/ram-air");
|
||||
tempCockpit: props.globals.getNode("/controls/pneumatics/switches/temp-cockpit");
|
||||
tempAft: props.globals.getNode("/controls/pneumatics/switches/temp-cabin-aft");
|
||||
tempFwd: props.globals.getNode("/controls/pneumatics/switches/temp-cabin-fwd");
|
||||
xbleed: props.globals.getNode("/controls/pneumatics/switches/x-bleed");
|
||||
apu: props.globals.getNode("controls/pneumatics/switches/apu");
|
||||
bleed1: props.globals.getNode("controls/pneumatics/switches/bleed-1");
|
||||
bleed2: props.globals.getNode("controls/pneumatics/switches/bleed-2");
|
||||
blower: props.globals.getNode("controls/pneumatics/switches/blower");
|
||||
cabinFans: props.globals.getNode("controls/pneumatics/switches/cabin-fans");
|
||||
extract: props.globals.getNode("controls/pneumatics/switches/extract");
|
||||
hotAir: props.globals.getNode("controls/pneumatics/switches/hot-air");
|
||||
pack1: props.globals.getNode("controls/pneumatics/switches/pack-1");
|
||||
pack2: props.globals.getNode("controls/pneumatics/switches/pack-2");
|
||||
packFlow: props.globals.getNode("controls/pneumatics/switches/pack-flow");
|
||||
ramAir: props.globals.getNode("controls/pneumatics/switches/ram-air");
|
||||
tempCockpit: props.globals.getNode("controls/pneumatics/switches/temp-cockpit");
|
||||
tempAft: props.globals.getNode("controls/pneumatics/switches/temp-cabin-aft");
|
||||
tempFwd: props.globals.getNode("controls/pneumatics/switches/temp-cabin-fwd");
|
||||
xbleed: props.globals.getNode("controls/pneumatics/switches/x-bleed");
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
|
|
|
@ -74,418 +74,418 @@ var guard = 0;
|
|||
|
||||
var PNEU = {
|
||||
init: func() {
|
||||
setprop("/controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("/controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("/controls/pneumatic/switches/bleedapu", 0);
|
||||
setprop("/controls/pneumatic/switches/groundair", 0);
|
||||
setprop("/controls/pneumatic/switches/pack1", 1);
|
||||
setprop("/controls/pneumatic/switches/pack2", 1);
|
||||
setprop("/controls/pneumatic/switches/hot-air", 1);
|
||||
setprop("/controls/pneumatic/switches/ram-air", 0);
|
||||
setprop("/controls/pneumatic/switches/pack-flo", 9); # LO: 7, NORM: 9, HI: 11.
|
||||
setprop("/controls/pneumatic/switches/xbleed", 1); # SHUT: 0, AUTO: 1, OPEN: 2.
|
||||
setprop("/systems/pneumatic/bleed1", 0);
|
||||
setprop("/systems/pneumatic/bleed2", 0);
|
||||
setprop("/systems/pneumatic/bleedapu", 0);
|
||||
setprop("/systems/pneumatic/groundair", 0);
|
||||
setprop("/systems/pneumatic/total-psi", 0);
|
||||
setprop("/systems/pneumatic/start-psi", 0);
|
||||
setprop("/systems/pneumatic/pack-psi", 0);
|
||||
setprop("/systems/pneumatic/pack1", 0);
|
||||
setprop("/systems/pneumatic/pack2", 0);
|
||||
setprop("/systems/pneumatic/start-psi", 0);
|
||||
setprop("/systems/pneumatic/eng1-starter", 0);
|
||||
setprop("/systems/pneumatic/eng2-starter", 0);
|
||||
setprop("/systems/pneumatic/bleed1-fault", 0);
|
||||
setprop("/systems/pneumatic/bleed2-fault", 0);
|
||||
setprop("/systems/pneumatic/bleedapu-fault", 0);
|
||||
setprop("/systems/pneumatic/hotair-fault", 0);
|
||||
setprop("/systems/pneumatic/pack1-fault", 0);
|
||||
setprop("/systems/pneumatic/pack2-fault", 0);
|
||||
setprop("/systems/pneumatic/xbleed", 0);
|
||||
setprop("/systems/pneumatic/xbleed-state", "closed");
|
||||
setprop("/systems/pneumatic/starting", 0);
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
setprop("/systems/pressurization/mode", "GN");
|
||||
setprop("/systems/pressurization/vs", "0");
|
||||
setprop("/systems/pressurization/targetvs", "0");
|
||||
setprop("/systems/pressurization/vs-norm", "0");
|
||||
setprop("/systems/pressurization/auto", 1);
|
||||
setprop("/systems/pressurization/deltap", "0");
|
||||
setprop("/systems/pressurization/outflowpos", "0");
|
||||
setprop("/systems/pressurization/deltap-norm", "0");
|
||||
setprop("/systems/pressurization/outflowpos-norm", "0");
|
||||
setprop("/systems/pressurization/outflowpos-man", "0.5");
|
||||
setprop("/systems/pressurization/outflowpos-man-sw", "0");
|
||||
setprop("/systems/pressurization/outflowpos-norm-cmd", "0");
|
||||
setprop("/systems/pressurization/cabinalt", altitude);
|
||||
setprop("/systems/pressurization/targetalt", altitude);
|
||||
setprop("/systems/pressurization/diff-to-target", "0");
|
||||
setprop("/systems/pressurization/ditchingpb", 0);
|
||||
setprop("/systems/pressurization/targetvs", "0");
|
||||
setprop("/systems/pressurization/ambientpsi", "0");
|
||||
setprop("/systems/pressurization/cabinpsi", "0");
|
||||
setprop("/systems/pressurization/manvs-cmd", "0");
|
||||
setprop("/systems/pressurization/pack-1-out-temp", 0);
|
||||
setprop("/systems/pressurization/pack-2-out-temp", 0);
|
||||
setprop("/systems/pressurization/pack-1-bypass", 0);
|
||||
setprop("/systems/pressurization/pack-2-bypass", 0);
|
||||
setprop("/systems/pressurization/pack-1-flow", 0);
|
||||
setprop("/systems/pressurization/pack-2-flow", 0);
|
||||
setprop("/systems/pressurization/pack-1-comp-out-temp", 0);
|
||||
setprop("/systems/pressurization/pack-2-comp-out-temp", 0);
|
||||
setprop("/systems/pressurization/pack-1-valve", 0);
|
||||
setprop("/systems/pressurization/pack-2-valve", 0);
|
||||
setprop("/systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("/systems/ventilation/avionics/fan", 0);
|
||||
setprop("/systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("/systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("/systems/ventilation/lavatory/extractvalve", "0");
|
||||
setprop("/controls/deice/eng1-on", 0);
|
||||
setprop("/controls/deice/eng2-on", 0);
|
||||
setprop("/controls/oxygen/masksDeploy", 0);
|
||||
setprop("/controls/oxygen/masksDeployMan", 0);
|
||||
setprop("/controls/oxygen/masksReset", 0); # this is the TMR RESET pb on the maintenance panel, needs 3D model
|
||||
setprop("/controls/oxygen/masksSys", 0);
|
||||
setprop("/systems/pneumatic/hp-valve-1-state", 0);
|
||||
setprop("/systems/pneumatic/hp-valve-2-state", 0);
|
||||
setprop("/systems/pneumatic/hp-valve-1", 0);
|
||||
setprop("/systems/pneumatic/hp-valve-2", 0);
|
||||
setprop("/systems/pneumatic/eng-valve-1-state", 0);
|
||||
setprop("/systems/pneumatic/eng-valve-2-state", 0);
|
||||
setprop("/systems/pneumatic/eng-valve-1", 0);
|
||||
setprop("/systems/pneumatic/eng-valve-2", 0);
|
||||
setprop("/systems/pneumatic/precooler-1-psi", 0);
|
||||
setprop("/systems/pneumatic/precooler-2-psi", 0);
|
||||
setprop("/systems/pneumatic/precooler-1-temp", 0);
|
||||
setprop("/systems/pneumatic/precooler-2-temp", 0);
|
||||
setprop("/systems/pneumatic/precooler-1-ovht", 0);
|
||||
setprop("/systems/pneumatic/precooler-2-ovht", 0);
|
||||
setprop("controls/pneumatic/switches/bleed1", 1);
|
||||
setprop("controls/pneumatic/switches/bleed2", 1);
|
||||
setprop("controls/pneumatic/switches/bleedapu", 0);
|
||||
setprop("controls/pneumatic/switches/groundair", 0);
|
||||
setprop("controls/pneumatic/switches/pack1", 1);
|
||||
setprop("controls/pneumatic/switches/pack2", 1);
|
||||
setprop("controls/pneumatic/switches/hot-air", 1);
|
||||
setprop("controls/pneumatic/switches/ram-air", 0);
|
||||
setprop("controls/pneumatic/switches/pack-flo", 9); # LO: 7, NORM: 9, HI: 11.
|
||||
setprop("controls/pneumatic/switches/xbleed", 1); # SHUT: 0, AUTO: 1, OPEN: 2.
|
||||
setprop("systems/pneumatic/bleed1", 0);
|
||||
setprop("systems/pneumatic/bleed2", 0);
|
||||
setprop("systems/pneumatic/bleedapu", 0);
|
||||
setprop("systems/pneumatic/groundair", 0);
|
||||
setprop("systems/pneumatic/total-psi", 0);
|
||||
setprop("systems/pneumatic/start-psi", 0);
|
||||
setprop("systems/pneumatic/pack-psi", 0);
|
||||
setprop("systems/pneumatic/pack1", 0);
|
||||
setprop("systems/pneumatic/pack2", 0);
|
||||
setprop("systems/pneumatic/start-psi", 0);
|
||||
setprop("systems/pneumatic/eng1-starter", 0);
|
||||
setprop("systems/pneumatic/eng2-starter", 0);
|
||||
setprop("systems/pneumatic/bleed1-fault", 0);
|
||||
setprop("systems/pneumatic/bleed2-fault", 0);
|
||||
setprop("systems/pneumatic/bleedapu-fault", 0);
|
||||
setprop("systems/pneumatic/hotair-fault", 0);
|
||||
setprop("systems/pneumatic/pack1-fault", 0);
|
||||
setprop("systems/pneumatic/pack2-fault", 0);
|
||||
setprop("systems/pneumatic/xbleed", 0);
|
||||
setprop("systems/pneumatic/xbleed-state", "closed");
|
||||
setprop("systems/pneumatic/starting", 0);
|
||||
setprop("FMGC/internal/dep-arpt", "");
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
setprop("systems/pressurization/mode", "GN");
|
||||
setprop("systems/pressurization/vs", "0");
|
||||
setprop("systems/pressurization/targetvs", "0");
|
||||
setprop("systems/pressurization/vs-norm", "0");
|
||||
setprop("systems/pressurization/auto", 1);
|
||||
setprop("systems/pressurization/deltap", "0");
|
||||
setprop("systems/pressurization/outflowpos", "0");
|
||||
setprop("systems/pressurization/deltap-norm", "0");
|
||||
setprop("systems/pressurization/outflowpos-norm", "0");
|
||||
setprop("systems/pressurization/outflowpos-man", "0.5");
|
||||
setprop("systems/pressurization/outflowpos-man-sw", "0");
|
||||
setprop("systems/pressurization/outflowpos-norm-cmd", "0");
|
||||
setprop("systems/pressurization/cabinalt", altitude);
|
||||
setprop("systems/pressurization/targetalt", altitude);
|
||||
setprop("systems/pressurization/diff-to-target", "0");
|
||||
setprop("systems/pressurization/ditchingpb", 0);
|
||||
setprop("systems/pressurization/targetvs", "0");
|
||||
setprop("systems/pressurization/ambientpsi", "0");
|
||||
setprop("systems/pressurization/cabinpsi", "0");
|
||||
setprop("systems/pressurization/manvs-cmd", "0");
|
||||
setprop("systems/pressurization/pack-1-out-temp", 0);
|
||||
setprop("systems/pressurization/pack-2-out-temp", 0);
|
||||
setprop("systems/pressurization/pack-1-bypass", 0);
|
||||
setprop("systems/pressurization/pack-2-bypass", 0);
|
||||
setprop("systems/pressurization/pack-1-flow", 0);
|
||||
setprop("systems/pressurization/pack-2-flow", 0);
|
||||
setprop("systems/pressurization/pack-1-comp-out-temp", 0);
|
||||
setprop("systems/pressurization/pack-2-comp-out-temp", 0);
|
||||
setprop("systems/pressurization/pack-1-valve", 0);
|
||||
setprop("systems/pressurization/pack-2-valve", 0);
|
||||
setprop("systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("systems/ventilation/avionics/fan", 0);
|
||||
setprop("systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("systems/ventilation/lavatory/extractvalve", "0");
|
||||
setprop("controls/deice/eng1-on", 0);
|
||||
setprop("controls/deice/eng2-on", 0);
|
||||
setprop("controls/oxygen/masksDeploy", 0);
|
||||
setprop("controls/oxygen/masksDeployMan", 0);
|
||||
setprop("controls/oxygen/masksReset", 0); # this is the TMR RESET pb on the maintenance panel, needs 3D model
|
||||
setprop("controls/oxygen/masksSys", 0);
|
||||
setprop("systems/pneumatic/hp-valve-1-state", 0);
|
||||
setprop("systems/pneumatic/hp-valve-2-state", 0);
|
||||
setprop("systems/pneumatic/hp-valve-1", 0);
|
||||
setprop("systems/pneumatic/hp-valve-2", 0);
|
||||
setprop("systems/pneumatic/eng-valve-1-state", 0);
|
||||
setprop("systems/pneumatic/eng-valve-2-state", 0);
|
||||
setprop("systems/pneumatic/eng-valve-1", 0);
|
||||
setprop("systems/pneumatic/eng-valve-2", 0);
|
||||
setprop("systems/pneumatic/precooler-1-psi", 0);
|
||||
setprop("systems/pneumatic/precooler-2-psi", 0);
|
||||
setprop("systems/pneumatic/precooler-1-temp", 0);
|
||||
setprop("systems/pneumatic/precooler-2-temp", 0);
|
||||
setprop("systems/pneumatic/precooler-1-ovht", 0);
|
||||
setprop("systems/pneumatic/precooler-2-ovht", 0);
|
||||
},
|
||||
loop: func() {
|
||||
bleed1_sw = getprop("/controls/pneumatic/switches/bleed1");
|
||||
bleed2_sw = getprop("/controls/pneumatic/switches/bleed2");
|
||||
bleedapu_sw = getprop("/controls/pneumatic/switches/bleedapu");
|
||||
pack1_sw = getprop("/controls/pneumatic/switches/pack1");
|
||||
pack2_sw = getprop("/controls/pneumatic/switches/pack2");
|
||||
hot_air_sw = getprop("/controls/pneumatic/switches/hot-air");
|
||||
ram_air_sw = getprop("/controls/pneumatic/switches/ram-air");
|
||||
pack_flo_sw = getprop("/controls/pneumatic/switches/pack-flo");
|
||||
xbleed_sw = getprop("/controls/pneumatic/switches/xbleed");
|
||||
eng1_starter = getprop("/systems/pneumatic/eng1-starter");
|
||||
eng2_starter = getprop("/systems/pneumatic/eng2-starter");
|
||||
groundair = getprop("/systems/pneumatic/groundair");
|
||||
groundair_supp = getprop("/controls/pneumatic/switches/groundair");
|
||||
rpmapu = getprop("/systems/apu/rpm");
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
bleedapu_fail = getprop("/systems/failures/bleed-apu");
|
||||
bleedext_fail = getprop("/systems/failures/bleed-ext");
|
||||
bleedeng1_fail = getprop("/systems/failures/bleed-eng1");
|
||||
bleedeng2_fail = getprop("/systems/failures/bleed-eng2");
|
||||
pack1_fail = getprop("/systems/failures/pack1");
|
||||
pack2_fail = getprop("/systems/failures/pack2");
|
||||
engantiice1 = getprop("/controls/deice/eng1-on");
|
||||
engantiice2 = getprop("/controls/deice/eng2-on");
|
||||
wowc = getprop("/gear/gear[0]/wow");
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
bleed1_sw = getprop("controls/pneumatic/switches/bleed1");
|
||||
bleed2_sw = getprop("controls/pneumatic/switches/bleed2");
|
||||
bleedapu_sw = getprop("controls/pneumatic/switches/bleedapu");
|
||||
pack1_sw = getprop("controls/pneumatic/switches/pack1");
|
||||
pack2_sw = getprop("controls/pneumatic/switches/pack2");
|
||||
hot_air_sw = getprop("controls/pneumatic/switches/hot-air");
|
||||
ram_air_sw = getprop("controls/pneumatic/switches/ram-air");
|
||||
pack_flo_sw = getprop("controls/pneumatic/switches/pack-flo");
|
||||
xbleed_sw = getprop("controls/pneumatic/switches/xbleed");
|
||||
eng1_starter = getprop("systems/pneumatic/eng1-starter");
|
||||
eng2_starter = getprop("systems/pneumatic/eng2-starter");
|
||||
groundair = getprop("systems/pneumatic/groundair");
|
||||
groundair_supp = getprop("controls/pneumatic/switches/groundair");
|
||||
rpmapu = getprop("systems/apu/rpm");
|
||||
stateL = getprop("engines/engine[0]/state");
|
||||
stateR = getprop("engines/engine[1]/state");
|
||||
bleedapu_fail = getprop("systems/failures/bleed-apu");
|
||||
bleedext_fail = getprop("systems/failures/bleed-ext");
|
||||
bleedeng1_fail = getprop("systems/failures/bleed-eng1");
|
||||
bleedeng2_fail = getprop("systems/failures/bleed-eng2");
|
||||
pack1_fail = getprop("systems/failures/pack1");
|
||||
pack2_fail = getprop("systems/failures/pack2");
|
||||
engantiice1 = getprop("controls/deice/eng1-on");
|
||||
engantiice2 = getprop("controls/deice/eng2-on");
|
||||
wowc = getprop("gear/gear[0]/wow");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
|
||||
# Air Sources/PSI
|
||||
if (rpmapu >= 94.9 and bleedapu_sw and !bleedapu_fail) {
|
||||
setprop("/systems/pneumatic/bleedapu", 34);
|
||||
if (getprop("/controls/APU/master") == 1) {
|
||||
setprop("/systems/apu/bleed-used", 1);
|
||||
setprop("systems/pneumatic/bleedapu", 34);
|
||||
if (getprop("controls/APU/master") == 1) {
|
||||
setprop("systems/apu/bleed-used", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleedapu", 0);
|
||||
setprop("systems/pneumatic/bleedapu", 0);
|
||||
}
|
||||
|
||||
if (groundair_supp and !bleedext_fail) {
|
||||
setprop("/systems/pneumatic/groundair", 39);
|
||||
setprop("systems/pneumatic/groundair", 39);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/groundair", 0);
|
||||
setprop("systems/pneumatic/groundair", 0);
|
||||
}
|
||||
|
||||
ground = getprop("/systems/pneumatic/groundair");
|
||||
bleedapu = getprop("/systems/pneumatic/bleedapu");
|
||||
ground = getprop("systems/pneumatic/groundair");
|
||||
bleedapu = getprop("systems/pneumatic/bleedapu");
|
||||
|
||||
if (xbleed_sw == 0) {
|
||||
setprop("/systems/pneumatic/xbleed", 0);
|
||||
setprop("systems/pneumatic/xbleed", 0);
|
||||
} else if (xbleed_sw == 1) {
|
||||
if (bleedapu >= 11) {
|
||||
setprop("/systems/pneumatic/xbleed", 1);
|
||||
setprop("systems/pneumatic/xbleed", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/xbleed", 0);
|
||||
setprop("systems/pneumatic/xbleed", 0);
|
||||
}
|
||||
} else if (xbleed_sw == 2) {
|
||||
setprop("/systems/pneumatic/xbleed", 1);
|
||||
setprop("systems/pneumatic/xbleed", 1);
|
||||
}
|
||||
|
||||
xbleed = getprop("/systems/pneumatic/xbleed", 0);
|
||||
xbleed = getprop("systems/pneumatic/xbleed", 0);
|
||||
|
||||
if (stateL == 3 and bleed1_sw and !bleedeng1_fail) {
|
||||
setprop("/systems/pneumatic/bleed1", 31);
|
||||
setprop("systems/pneumatic/bleed1", 31);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleed1", 0);
|
||||
setprop("systems/pneumatic/bleed1", 0);
|
||||
}
|
||||
|
||||
if (stateR == 3 and bleed2_sw and !bleedeng2_fail) {
|
||||
setprop("/systems/pneumatic/bleed2", 32);
|
||||
setprop("systems/pneumatic/bleed2", 32);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleed2", 0);
|
||||
setprop("systems/pneumatic/bleed2", 0);
|
||||
}
|
||||
|
||||
bleed1 = getprop("/systems/pneumatic/bleed1");
|
||||
bleed2 = getprop("/systems/pneumatic/bleed2");
|
||||
bleed1 = getprop("systems/pneumatic/bleed1");
|
||||
bleed2 = getprop("systems/pneumatic/bleed2");
|
||||
|
||||
if (bleed1 >= 11 and (stateR != 3 or !bleed2_sw or bleedeng2_fail) and xbleed == 1) {
|
||||
setprop("/systems/pneumatic/bleed2", 31);
|
||||
setprop("systems/pneumatic/bleed2", 31);
|
||||
}
|
||||
|
||||
if (bleed2 >= 11 and (stateL != 3 or !bleed1_sw or bleedeng1_fail) and xbleed == 1) {
|
||||
setprop("/systems/pneumatic/bleed1", 32);
|
||||
setprop("systems/pneumatic/bleed1", 32);
|
||||
}
|
||||
|
||||
bleed1 = getprop("/systems/pneumatic/bleed1");
|
||||
bleed2 = getprop("/systems/pneumatic/bleed2");
|
||||
bleed1 = getprop("systems/pneumatic/bleed1");
|
||||
bleed2 = getprop("systems/pneumatic/bleed2");
|
||||
|
||||
if (stateL == 1 or stateR == 1 or stateL == 2 or stateR == 2) {
|
||||
setprop("/systems/pneumatic/start-psi", 18);
|
||||
setprop("systems/pneumatic/start-psi", 18);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/start-psi", 0);
|
||||
setprop("systems/pneumatic/start-psi", 0);
|
||||
}
|
||||
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and wowc == 1 and (stateL != 3 or stateR != 3)) {
|
||||
setprop("/systems/pneumatic/starting", 1);
|
||||
if (getprop("controls/engines/engine-start-switch") == 2 and wowc == 1 and (stateL != 3 or stateR != 3)) {
|
||||
setprop("systems/pneumatic/starting", 1);
|
||||
} else if (wowc == 1 and eng1_starter == 1 or eng2_starter == 1) {
|
||||
setprop("/systems/pneumatic/starting", 1);
|
||||
setprop("systems/pneumatic/starting", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/starting", 0);
|
||||
setprop("systems/pneumatic/starting", 0);
|
||||
}
|
||||
|
||||
starting = getprop("/systems/pneumatic/starting");
|
||||
starting = getprop("systems/pneumatic/starting");
|
||||
|
||||
if (pack1_sw == 1 and (bleed1 >= 11 or bleedapu >= 11 or ground >= 11) and starting == 0 and !pack1_fail) {
|
||||
setprop("/systems/pneumatic/pack1", pack_flo_sw);
|
||||
setprop("systems/pneumatic/pack1", pack_flo_sw);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/pack1", 0);
|
||||
setprop("systems/pneumatic/pack1", 0);
|
||||
}
|
||||
|
||||
if (pack2_sw == 1 and (bleed2 >= 11 or (bleedapu >= 11 and xbleed == 1)) and starting == 0 and !pack2_fail) {
|
||||
setprop("/systems/pneumatic/pack2", pack_flo_sw);
|
||||
setprop("systems/pneumatic/pack2", pack_flo_sw);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/pack2", 0);
|
||||
setprop("systems/pneumatic/pack2", 0);
|
||||
}
|
||||
|
||||
pack1 = getprop("/systems/pneumatic/pack1");
|
||||
pack2 = getprop("/systems/pneumatic/pack2");
|
||||
pack1 = getprop("systems/pneumatic/pack1");
|
||||
pack2 = getprop("systems/pneumatic/pack2");
|
||||
|
||||
if (pack1_sw == 1 and pack2_sw == 1) {
|
||||
setprop("/systems/pneumatic/pack-psi", pack1 + pack2);
|
||||
setprop("systems/pneumatic/pack-psi", pack1 + pack2);
|
||||
} else if (pack1_sw == 0 and pack2_sw == 0) {
|
||||
setprop("/systems/pneumatic/pack-psi", 0);
|
||||
setprop("systems/pneumatic/pack-psi", 0);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/pack-psi", pack1 + pack2 + 5);
|
||||
setprop("systems/pneumatic/pack-psi", pack1 + pack2 + 5);
|
||||
}
|
||||
|
||||
pack_psi = getprop("/systems/pneumatic/pack-psi");
|
||||
start_psi = getprop("/systems/pneumatic/start-psi");
|
||||
pack_psi = getprop("systems/pneumatic/pack-psi");
|
||||
start_psi = getprop("systems/pneumatic/start-psi");
|
||||
|
||||
if ((bleed1 + bleed2 + bleedapu) > 42) {
|
||||
setprop("/systems/pneumatic/total-psi", 42);
|
||||
setprop("systems/pneumatic/total-psi", 42);
|
||||
} else {
|
||||
total_psi_calc = ((bleed1 + bleed2 + bleedapu + ground) - start_psi - pack_psi);
|
||||
setprop("/systems/pneumatic/total-psi", total_psi_calc);
|
||||
setprop("systems/pneumatic/total-psi", total_psi_calc);
|
||||
}
|
||||
|
||||
if (engantiice1 and bleed1 > 20) { # shut down anti-ice if bleed is lost else turn it on
|
||||
setprop("/controls/deice/lengine", 0);
|
||||
setprop("/controls/deice/eng1-on", 0);
|
||||
setprop("controls/deice/lengine", 0);
|
||||
setprop("controls/deice/eng1-on", 0);
|
||||
}
|
||||
|
||||
if (engantiice1) { # else turn it on
|
||||
setprop("/controls/deice/lengine", 1);
|
||||
setprop("controls/deice/lengine", 1);
|
||||
}
|
||||
|
||||
if (engantiice2 and bleed2 > 20) {
|
||||
setprop("/controls/deice/rengine", 0);
|
||||
setprop("/controls/deice/eng2-on", 0);
|
||||
setprop("controls/deice/rengine", 0);
|
||||
setprop("controls/deice/eng2-on", 0);
|
||||
}
|
||||
|
||||
if (engantiice2) {
|
||||
setprop("/controls/deice/rengine", 1);
|
||||
setprop("controls/deice/rengine", 1);
|
||||
}
|
||||
|
||||
total_psi = getprop("/systems/pneumatic/total-psi");
|
||||
phase = getprop("/FMGC/status/phase");
|
||||
pressmode = getprop("/systems/pressurization/mode");
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
deltap = getprop("/systems/pressurization/deltap");
|
||||
outflow = getprop("/systems/pressurization/outflowpos");
|
||||
speed = getprop("/velocities/groundspeed-kt");
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
total_psi = getprop("systems/pneumatic/total-psi");
|
||||
phase = getprop("FMGC/status/phase");
|
||||
pressmode = getprop("systems/pressurization/mode");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
deltap = getprop("systems/pressurization/deltap");
|
||||
outflow = getprop("systems/pressurization/outflowpos");
|
||||
speed = getprop("velocities/groundspeed-kt");
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
airport_arr_elev_ft = getprop("autopilot/route-manager/destination/field-elevation-ft");
|
||||
vs = getprop("/systems/pressurization/vs-norm");
|
||||
manvs = getprop("/systems/pressurization/manvs-cmd");
|
||||
ditch = getprop("/systems/pressurization/ditchingpb");
|
||||
outflowpos = getprop("/systems/pressurization/outflowpos");
|
||||
cabinalt = getprop("/systems/pressurization/cabinalt");
|
||||
targetalt = getprop("/systems/pressurization/targetalt");
|
||||
targetvs = getprop("/systems/pressurization/targetvs");
|
||||
ambient = getprop("/systems/pressurization/ambientpsi");
|
||||
cabinpsi = getprop("/systems/pressurization/cabinpsi");
|
||||
pause = getprop("/sim/freeze/master");
|
||||
auto = getprop("/systems/pressurization/auto");
|
||||
vs = getprop("systems/pressurization/vs-norm");
|
||||
manvs = getprop("systems/pressurization/manvs-cmd");
|
||||
ditch = getprop("systems/pressurization/ditchingpb");
|
||||
outflowpos = getprop("systems/pressurization/outflowpos");
|
||||
cabinalt = getprop("systems/pressurization/cabinalt");
|
||||
targetalt = getprop("systems/pressurization/targetalt");
|
||||
targetvs = getprop("systems/pressurization/targetvs");
|
||||
ambient = getprop("systems/pressurization/ambientpsi");
|
||||
cabinpsi = getprop("systems/pressurization/cabinpsi");
|
||||
pause = getprop("sim/freeze/master");
|
||||
auto = getprop("systems/pressurization/auto");
|
||||
|
||||
setprop("/systems/pressurization/diff-to-target", targetalt - cabinalt);
|
||||
setprop("/systems/pressurization/deltap", cabinpsi - ambient);
|
||||
setprop("systems/pressurization/diff-to-target", targetalt - cabinalt);
|
||||
setprop("systems/pressurization/deltap", cabinpsi - ambient);
|
||||
|
||||
if ((pressmode == "GN") and (pressmode != "CL") and (wowl and wowr) and ((state1 == "MCT") or (state1 == "TOGA")) and ((state2 == "MCT") or (state2 == "TOGA"))) {
|
||||
setprop("/systems/pressurization/mode", "TO");
|
||||
setprop("systems/pressurization/mode", "TO");
|
||||
} else if (((!wowl) or (!wowr)) and (speed > 100) and (pressmode == "TO")) {
|
||||
setprop("/systems/pressurization/mode", "CL");
|
||||
setprop("systems/pressurization/mode", "CL");
|
||||
}
|
||||
|
||||
if (vs != targetvs and !wowl and !wowr) {
|
||||
setprop("/systems/pressurization/vs", targetvs);
|
||||
setprop("systems/pressurization/vs", targetvs);
|
||||
}
|
||||
|
||||
if (cabinalt != targetalt and !wowl and !wowr and !pause and auto) {
|
||||
setprop("/systems/pressurization/cabinalt", cabinalt + ((vs / 60) / 10));
|
||||
setprop("systems/pressurization/cabinalt", cabinalt + ((vs / 60) / 10));
|
||||
} else if (!auto and !pause) {
|
||||
setprop("/systems/pressurization/cabinalt", cabinalt + ((manvs / 60) / 10));
|
||||
setprop("systems/pressurization/cabinalt", cabinalt + ((manvs / 60) / 10));
|
||||
}
|
||||
|
||||
if (ditch and auto) {
|
||||
setprop("/systems/pressurization/outflowpos", "1");
|
||||
setprop("/systems/ventilation/avionics/extractvalve", "1");
|
||||
setprop("/systems/ventilation/avionics/inletvalve", "1");
|
||||
setprop("systems/pressurization/outflowpos", "1");
|
||||
setprop("systems/ventilation/avionics/extractvalve", "1");
|
||||
setprop("systems/ventilation/avionics/inletvalve", "1");
|
||||
}
|
||||
|
||||
dcess = getprop("/systems/electrical/bus/dc-ess");
|
||||
acess = getprop("/systems/electrical/bus/ac-ess");
|
||||
fanon = getprop("/systems/ventilation/avionics/fan");
|
||||
dcess = getprop("systems/electrical/bus/dc-ess");
|
||||
acess = getprop("systems/electrical/bus/ac-ess");
|
||||
fanon = getprop("systems/ventilation/avionics/fan");
|
||||
|
||||
if (dcess > 25 or acess > 110) {
|
||||
setprop("/systems/ventilation/avionics/fan", 1);
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 1);
|
||||
setprop("systems/ventilation/avionics/fan", 1);
|
||||
setprop("systems/ventilation/lavatory/extractfan", 1);
|
||||
} else if (dcess == 0 and acess == 0) {
|
||||
setprop("/systems/ventilation/avionics/fan", 0);
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("systems/ventilation/avionics/fan", 0);
|
||||
setprop("systems/ventilation/lavatory/extractfan", 0);
|
||||
}
|
||||
|
||||
# Fault lights
|
||||
if (bleedeng1_fail and bleed1_sw) {
|
||||
setprop("/systems/pneumatic/bleed1-fault", 1);
|
||||
setprop("systems/pneumatic/bleed1-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleed1-fault", 0);
|
||||
setprop("systems/pneumatic/bleed1-fault", 0);
|
||||
}
|
||||
|
||||
if (bleedeng2_fail and bleed2_sw) {
|
||||
setprop("/systems/pneumatic/bleed2-fault", 1);
|
||||
setprop("systems/pneumatic/bleed2-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleed2-fault", 0);
|
||||
setprop("systems/pneumatic/bleed2-fault", 0);
|
||||
}
|
||||
|
||||
if (bleedapu_fail and bleedapu_sw) {
|
||||
setprop("/systems/pneumatic/bleedapu-fault", 1);
|
||||
setprop("systems/pneumatic/bleedapu-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/bleedapu-fault", 0);
|
||||
setprop("systems/pneumatic/bleedapu-fault", 0);
|
||||
}
|
||||
|
||||
if ((pack1_fail and pack1_sw) or (pack1_sw and pack1 <= 5)) {
|
||||
setprop("/systems/pneumatic/pack1-fault", 1);
|
||||
setprop("systems/pneumatic/pack1-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/pack1-fault", 0);
|
||||
setprop("systems/pneumatic/pack1-fault", 0);
|
||||
}
|
||||
|
||||
if ((pack2_fail and pack2_sw) or (pack2_sw and pack2 <= 5)) {
|
||||
setprop("/systems/pneumatic/pack2-fault", 1);
|
||||
setprop("systems/pneumatic/pack2-fault", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatic/pack2-fault", 0);
|
||||
setprop("systems/pneumatic/pack2-fault", 0);
|
||||
}
|
||||
|
||||
# Oxygen
|
||||
if (cabinalt > 13500) {
|
||||
setprop("/controls/oxygen/masksDeploy", 1);
|
||||
setprop("/controls/oxygen/masksSys", 1);
|
||||
setprop("controls/oxygen/masksDeploy", 1);
|
||||
setprop("controls/oxygen/masksSys", 1);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
setlistener("/controls/pneumatic/switches/pack1", func {
|
||||
pack1_sw = getprop("/controls/pneumatic/switches/pack1");
|
||||
pack1_sw = getprop("controls/pneumatic/switches/pack1");
|
||||
if (pack1_sw) {
|
||||
setprop("/systems/pneumatic/pack1-fault", 1);
|
||||
setprop("systems/pneumatic/pack1-fault", 1);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/controls/pneumatic/switches/pack2", func {
|
||||
pack2_sw = getprop("/controls/pneumatic/switches/pack2");
|
||||
pack2_sw = getprop("controls/pneumatic/switches/pack2");
|
||||
if (pack2_sw) {
|
||||
setprop("/systems/pneumatic/pack2-fault", 1);
|
||||
setprop("systems/pneumatic/pack2-fault", 1);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/controls/deice/eng1-on", func {
|
||||
eng1on = getprop("/controls/deice/eng1-on");
|
||||
eng1on = getprop("controls/deice/eng1-on");
|
||||
if (eng1on) {
|
||||
flashfault1();
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/controls/deice/eng2-on", func {
|
||||
eng2on = getprop("/controls/deice/eng2-on");
|
||||
eng2on = getprop("controls/deice/eng2-on");
|
||||
if (eng2on) {
|
||||
flashfault2();
|
||||
}
|
||||
});
|
||||
|
||||
var flashfault1 = func {
|
||||
setprop("/controls/deice/eng1-fault", 1);
|
||||
setprop("controls/deice/eng1-fault", 1);
|
||||
settimer(func {
|
||||
setprop("/controls/deice/eng1-fault", 0);
|
||||
setprop("controls/deice/eng1-fault", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
|
||||
var flashfault2 = func {
|
||||
setprop("/controls/deice/eng2-fault", 1);
|
||||
setprop("controls/deice/eng2-fault", 1);
|
||||
settimer(func {
|
||||
setprop("/controls/deice/eng2-fault", 0);
|
||||
setprop("controls/deice/eng2-fault", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
|
||||
# Oxygen (Cabin)
|
||||
|
||||
setlistener("/controls/oxygen/masksDeployMan", func {
|
||||
guard = getprop("/controls/oxygen/masksGuard");
|
||||
masks = getprop("/controls/oxygen/masksDeployMan");
|
||||
guard = getprop("controls/oxygen/masksGuard");
|
||||
masks = getprop("controls/oxygen/masksDeployMan");
|
||||
|
||||
if (guard and masks) {
|
||||
setprop("/controls/oxygen/masksDeployMan", 0);
|
||||
setprop("controls/oxygen/masksDeployMan", 0);
|
||||
} else if (!guard and masks) {
|
||||
setprop("/controls/oxygen/masksDeployMan", 1);
|
||||
setprop("/controls/oxygen/masksDeploy", 1);
|
||||
setprop("/controls/oxygen/masksSys", 1);
|
||||
setprop("controls/oxygen/masksDeployMan", 1);
|
||||
setprop("controls/oxygen/masksDeploy", 1);
|
||||
setprop("controls/oxygen/masksSys", 1);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/controls/oxygen/masksDeployMan", func {
|
||||
masks = getprop("/controls/oxygen/masksDeployMan");
|
||||
autoMasks = getprop("/controls/oxygen/masksDeploy");
|
||||
masks = getprop("controls/oxygen/masksDeployMan");
|
||||
autoMasks = getprop("controls/oxygen/masksDeploy");
|
||||
if (!masks) {
|
||||
setprop("/controls/oxygen/masksDeployMan", 1);
|
||||
setprop("controls/oxygen/masksDeployMan", 1);
|
||||
}
|
||||
});
|
||||
|
||||
setlistener("/controls/oxygen/masksDeploy", func {
|
||||
masks = getprop("/controls/oxygen/masksDeployMan");
|
||||
autoMasks = getprop("/controls/oxygen/masksDeploy");
|
||||
masks = getprop("controls/oxygen/masksDeployMan");
|
||||
autoMasks = getprop("controls/oxygen/masksDeploy");
|
||||
if (!autoMasks) {
|
||||
setprop("/controls/oxygen/masksDeploy", 1);
|
||||
setprop("controls/oxygen/masksDeploy", 1);
|
||||
}
|
||||
});
|
|
@ -17,17 +17,17 @@ if (pts.Sim.aero.getValue() == "A320-200-CFM") {
|
|||
}
|
||||
|
||||
# Get nodes
|
||||
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
|
||||
var valve_l_guard = props.globals.getNode("/controls/fuel/refuel/valve-l-guard", 1);
|
||||
var valve_c_guard = props.globals.getNode("/controls/fuel/refuel/valve-c-guard", 1);
|
||||
var valve_r_guard = props.globals.getNode("/controls/fuel/refuel/valve-r-guard", 1);
|
||||
var mode_guard = props.globals.getNode("/controls/fuel/refuel/mode-guard", 1);
|
||||
var valve_l = props.globals.getNode("/controls/fuel/refuel/valve-l", 1);
|
||||
var valve_c = props.globals.getNode("/controls/fuel/refuel/valve-c", 1);
|
||||
var valve_r = props.globals.getNode("/controls/fuel/refuel/valve-r", 1);
|
||||
var power = props.globals.getNode("/controls/fuel/refuel/power", 1);
|
||||
var test = props.globals.getNode("/controls/fuel/refuel/test", 1);
|
||||
var amount = props.globals.getNode("/controls/fuel/refuel/amount", 1);
|
||||
var acconfig_weight_kgs = props.globals.getNode("systems/acconfig/options/weight-kgs", 1);
|
||||
var valve_l_guard = props.globals.getNode("controls/fuel/refuel/valve-l-guard", 1);
|
||||
var valve_c_guard = props.globals.getNode("controls/fuel/refuel/valve-c-guard", 1);
|
||||
var valve_r_guard = props.globals.getNode("controls/fuel/refuel/valve-r-guard", 1);
|
||||
var mode_guard = props.globals.getNode("controls/fuel/refuel/mode-guard", 1);
|
||||
var valve_l = props.globals.getNode("controls/fuel/refuel/valve-l", 1);
|
||||
var valve_c = props.globals.getNode("controls/fuel/refuel/valve-c", 1);
|
||||
var valve_r = props.globals.getNode("controls/fuel/refuel/valve-r", 1);
|
||||
var power = props.globals.getNode("controls/fuel/refuel/power", 1);
|
||||
var test = props.globals.getNode("controls/fuel/refuel/test", 1);
|
||||
var amount = props.globals.getNode("controls/fuel/refuel/amount", 1);
|
||||
|
||||
var refuelClass = {
|
||||
_fuelLeftAmount: nil,
|
||||
|
|
|
@ -34,8 +34,8 @@ var rmpClass = {
|
|||
m._prop_vhf2_stby = props.globals.getNode("systems/radio/rmp[" ~ (instance - 1) ~ "]/vhf2-standby");
|
||||
m._prop_vhf3_stby = props.globals.getNode("systems/radio/rmp[" ~ (instance - 1) ~ "]/vhf3-standby");
|
||||
|
||||
m._prop_display_active = props.globals.getNode("/controls/radio/rmp[" ~ (instance - 1) ~ "]/active-display");
|
||||
m._prop_display_standby = props.globals.getNode("/controls/radio/rmp[" ~ (instance - 1) ~ "]/standby-display");
|
||||
m._prop_display_active = props.globals.getNode("controls/radio/rmp[" ~ (instance - 1) ~ "]/active-display");
|
||||
m._prop_display_standby = props.globals.getNode("controls/radio/rmp[" ~ (instance - 1) ~ "]/standby-display");
|
||||
|
||||
# Power source depending on RMP number
|
||||
if (instance == 1) {
|
||||
|
|
Loading…
Reference in a new issue