System: AP and A/THR offs coded systemwide, Sim: GUI AP Dialog added DISCs

This commit is contained in:
Joshua Davidson 2019-01-12 11:03:26 -05:00
parent 2cc57667e2
commit af70bf84bf
5 changed files with 63 additions and 13 deletions

View file

@ -682,12 +682,23 @@ var ELEC = {
setprop("/systems/electrical/battery2-volts", math.clamp(battery2_percent * (24) / (10), 0, 24));
}
if (getprop("/systems/electrical/bus/ac-ess") < 110) {
if (getprop("/it-autoflight/output/ap1") == 1) {
setprop("/it-autoflight/input/ap1", 0);
}
dc_ess = getprop("/systems/electrical/bus/dc-ess");
if (dc2 < 25) {
if (getprop("/it-autoflight/output/ap2") == 1) {
setprop("/it-autoflight/input/ap2", 0);
libraries.apOff("hard", 2);
}
}
if (dc_ess < 25 and dc2 < 25) {
if (getprop("/it-autoflight/output/athr") == 1) {
libraries.athrOff("hard");
}
}
if (dc_ess < 25) {
if (getprop("/it-autoflight/output/ap1") == 1) {
libraries.apOff("hard", 1);
}
setprop("systems/electrical/on", 0);
setprop("/systems/thrust/thr-locked", 0);

View file

@ -272,11 +272,8 @@ var fbw_loop = func {
}
if (getprop("/it-fbw/law") != 0) {
if (getprop("/it-autoflight/output/ap1") == 1) {
setprop("/it-autoflight/input/ap1", 0);
}
if (getprop("/it-autoflight/output/ap2") == 1) {
setprop("/it-autoflight/input/ap2", 0);
if (getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) {
libraries.apOff("hard", 0);
}
}
}

View file

@ -815,7 +815,7 @@
<apoff>
<name>apoff-looped</name>
<mode>looped</mode>
<path>/Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<path>Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<condition>
<and>
<equals>
@ -844,7 +844,7 @@
<apoff>
<name>apoff-single</name>
<mode>once</mode>
<path>/Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<path>Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<condition>
<and>
<equals>
@ -872,7 +872,7 @@
<apoff>
<name>athroff</name>
<path>/Aircraft/IDG-A32X/Sounds/Cockpit/chime.wav</path>
<path>Aircraft/IDG-A32X/Sounds/Cockpit/chime.wav</path>
<condition>
<and>
<equals>

Binary file not shown.

View file

@ -33,6 +33,7 @@
<group>
<layout>hbox</layout>
<button>
<legend>A/THR</legend>
<pref-width>43</pref-width>
@ -92,6 +93,47 @@
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<button>
<legend>A/THR DISC</legend>
<pref-width>119</pref-width>
<binding>
<command>nasal</command>
<script>
if (getprop("/it-autoflight/input/athr") == 1) {
libraries.athrOff("soft");
} else {
if (getprop("/it-autoflight/output/athr-warning") == 1) {
setprop("/it-autoflight/output/athr-warning", 0);
setprop("/ECAM/warnings/master-caution-light", 0);
}
}
</script>
</binding>
</button>
<button>
<legend>AP DISC</legend>
<pref-width>119</pref-width>
<binding>
<command>nasal</command>
<script>
if (getprop("/it-autoflight/input/ap1") == 1 or getprop("/it-autoflight/input/ap1") == 2) {
libraries.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);
}
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
}
</script>
</binding>
</button>
</group>
<group>
<layout>vbox</layout>