AP warning

This commit is contained in:
Jonathan Redpath 2018-12-05 16:10:33 +00:00
parent 96638bc77c
commit 3f8de94595
7 changed files with 81 additions and 2 deletions

View file

@ -1327,6 +1327,10 @@
}
libraries.apOff("soft","B");
} 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);
}
</script>

View file

@ -5091,6 +5091,24 @@
<property>ECAM/warnings/master-warning-light</property>
<value>0</value>
</binding>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>
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);
}
</script>
</binding>
</action>
</animation>

View file

@ -207,6 +207,10 @@ var ECAM = {
ap_active = 1;
}
if (ap_active == 1 and getprop("/it-autoflight/output/ap-warning") == 1 and getprop("/sim/time/elapsed-sec") > (getprop("/ECAM/ap-off-time") + 3) and getprop("/ECAM/warnings/master-warning-light") == 1) {
setprop("/ECAM/warnings/master-warning-light", 0);
}
if (athr_active == 1 and getprop("/it-autoflight/output/athr-warning") == 0) {
athr_active = 0;
} elsif (athr_active == 1 and getprop("/it-autoflight/output/athr-warning") == 1 and getprop("/sim/time/elapsed-sec") > (getprop("/ECAM/athr-off-time") + 9)) {
@ -288,6 +292,13 @@ var LowerECAM = {
#call status
}
if (b == "clr" and getprop("/it-autoflight/output/ap-warning") == 2) {
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/Lower/light/clr", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
#call status
}
if (getprop("/ECAM/Lower/fault-select") == 0) {
if (b != "clr") {
if (!man_sel) {

View file

@ -17,6 +17,13 @@ var messages_priority_3 = func {
}
var messages_priority_2 = func {
if (getprop("/it-autoflight/output/ap-warning") == 2) {
ap_offw.active = 1;
} else {
ap_offw.active = 0;
ap_offw.noRepeat = 0;
}
if ((getprop("/ECAM/warning-phase") >= 5 and getprop("/ECAM/warning-phase") <= 7) and getprop("/it-autoflight/thr-locked") == 1) {
athr_lock.active = 1;
athr_lock_1.active = 1;

View file

@ -18,10 +18,11 @@ var warningsOld = std.Vector.new([
]);
var warnings = std.Vector.new([
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),var athr_off_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "c", aural: "none", light: "none", noRepeat: 0),
var ap_offw = warning.new(msg: "AUTO FLT AP OFF", active: 0, colour: "r", aural: "calv", light: "warning", noRepeat: 0),
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0)
]);
var leftmemos = std.Vector.new([

View file

@ -261,8 +261,10 @@ var apOff = func(type, side) {
if (type == "soft") {
setprop("/ECAM/ap-off-time", getprop("/sim/time/elapsed-sec"));
setprop("/it-autoflight/output/ap-warning", 1);
setprop("/ECAM/warnings/master-warning-light", 1);
} else {
setprop("/it-autoflight/output/ap-warning", 2);
libraries.LowerECAM.clrLight();
}
}

View file

@ -818,9 +818,45 @@
<apoff>
<name>apoff</name>
<mode>loop</mode>
<path>/Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<condition>
<and>
<equals>
<property>/it-autoflight/output/ap-warning</property>
<value>2</value>
</equals>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/ap2</property>
<value>0</value>
</equals>
<or>
<property>/it-autoflight/sound/apoffsound</property>
<property>/it-autoflight/sound/apoffsound2</property>
</or>
</and>
</condition>
<volume>
<factor>40.0</factor>
</volume>
</apoff>
<apoff>
<name>apoff</name>
<mode>once</mode>
<path>/Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<condition>
<and>
<not>
<equals>
<property>/it-autoflight/output/ap-warning</property>
<value>2</value>
</equals>
</not>
<equals>
<property>/it-autoflight/output/ap1</property>
<value>0</value>