This commit is contained in:
legoboyvdlp R 2019-05-02 16:03:57 +01:00
parent 0292b48767
commit 655762a461
3 changed files with 25 additions and 34 deletions

View file

@ -73,7 +73,9 @@ var warning = {
}, },
sound: func() { sound: func() {
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;} if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
aural[me.aural].setBoolValue(0); if (me.aural != 0) {
aural[me.aural].setBoolValue(0);
}
me.noRepeat2 = 1; me.noRepeat2 = 1;
settimer(func() { settimer(func() {
aural[me.aural].setBoolValue(1); aural[me.aural].setBoolValue(1);
@ -174,23 +176,12 @@ var ECAM_controller = {
if (counter >= 9) { break; } if (counter >= 9) { break; }
if (w.active == 1) { if (w.active == 1) {
w.write(); w.write();
w.warnlight();
w.sound();
counter += 1; counter += 1;
} }
} }
foreach (var w2; warnings.vector) {
if (w2.active == 1) {
if (w2.noRepeat == 0) {
w2.warnlight();
}
if (w2.noRepeat2 == 0) {
w2.sound();
}
w2.callPage();
break
}
}
if (lines[0].getValue() == "" and flash == 0) { # disable left memos if a warning exists. Warnings are processed first, so this stops leftmemos if line1 is not empty if (lines[0].getValue() == "" and flash == 0) { # disable left memos if a warning exists. Warnings are processed first, so this stops leftmemos if line1 is not empty
foreach (var l; leftmemos.vector) { foreach (var l; leftmemos.vector) {
l.write(); l.write();

View file

@ -424,35 +424,35 @@ var messages_priority_3 = func {
if (eng2Fire.active == 1) { if (eng2Fire.active == 1) {
if (phaseVar >= 5 and phaseVar <= 7) { if (phaseVar >= 5 and phaseVar <= 7) {
if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) {
eng2FireFllever.active = 1; eng2FireFllever.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFllever); ECAM_controller.warningReset(eng2FireFllever);
} }
if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
eng2FireFlmaster.active = 1; eng2FireFlmaster.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFlmaster); ECAM_controller.warningReset(eng2FireFlmaster);
} }
if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) {
eng2FireFlPB.active = 1; eng2FireFlPB.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFlPB); ECAM_controller.warningReset(eng2FireFlPB);
} }
if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { if (getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) {
eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine2/agent1-timer") ~ " S...DISCH";
} }
if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 1 and !getprop("/systems/fire/engine2/disch1") and getprop("/systems/fire/engine2agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) {
eng2FireFlAgent1Timer.active = 1; eng2FireFlAgent1Timer.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFlAgent1Timer); ECAM_controller.warningReset(eng2FireFlAgent1Timer);
} }
if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1") and (getprop("/systems/fire/engine2/agent1-timer") == 0 or getprop("/systems/fire/engine2/agent1-timer") == 99)) {
eng2FireFlAgent1.active = 1; eng2FireFlAgent1.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFlAgent1); ECAM_controller.warningReset(eng2FireFlAgent1);
@ -464,17 +464,17 @@ var messages_priority_3 = func {
ECAM_controller.warningReset(eng2FireFlATC); ECAM_controller.warningReset(eng2FireFlATC);
} }
if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { if (getprop("/systems/fire/engine2/agent2-timer") != 0 and getprop("/systems/fire/engine2/agent2-timer") != 99) {
eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine2/agent2-timer") ~ " S:";
} }
if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2") and getprop("/systems/fire/engine2/agent2-timer") > 0) {
eng2FireFl30Sec.active = 1; eng2FireFl30Sec.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFl30Sec); ECAM_controller.warningReset(eng2FireFl30Sec);
} }
if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2")) {
eng2FireFlAgent2.active = 1; eng2FireFlAgent2.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireFlAgent2); ECAM_controller.warningReset(eng2FireFlAgent2);
@ -504,31 +504,31 @@ var messages_priority_3 = func {
ECAM_controller.warningReset(eng2FireGnparkbrk); ECAM_controller.warningReset(eng2FireGnparkbrk);
} }
if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
eng2FireGnmaster.active = 1; eng2FireGnmaster.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireGnmaster); ECAM_controller.warningReset(eng2FireGnmaster);
} }
if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) {
eng2FireGnPB.active = 1; eng2FireGnPB.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireGnPB); ECAM_controller.warningReset(eng2FireGnPB);
} }
if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1")) {
eng2FireGnAgent1.active = 1; eng2FireGnAgent1.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireGnAgent1); ECAM_controller.warningReset(eng2FireGnAgent1);
} }
if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine2/disch2")) {
eng2FireGnAgent2.active = 1; eng2FireGnAgent2.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireGnAgent2); ECAM_controller.warningReset(eng2FireGnAgent2);
} }
if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
eng2FireGnmaster2.active = 1; eng2FireGnmaster2.active = 1;
} else { } else {
ECAM_controller.warningReset(eng2FireGnmaster2); ECAM_controller.warningReset(eng2FireGnmaster2);

View file

@ -439,8 +439,8 @@ var checkTimeFire2 = func() {
if (engFireDetectorUnits.vector[1].loopOne == 9 and engFireDetectorUnits.vector[1].loopTwo == 9) { if (engFireDetectorUnits.vector[1].loopOne == 9 and engFireDetectorUnits.vector[1].loopTwo == 9) {
fireTimer2.stop(); fireTimer2.stop();
engFireDetectorUnits.vector[1].TriggerWarning(engFireDetectorUnits.vector[1].sys); engFireDetectorUnits.vector[1].TriggerWarning(engFireDetectorUnits.vector[1].sys);
loop3.setValue(0); propsNasFireTime.vector[2].setValue(0);
loop4.setValue(0); propsNasFireTime.vector[3].setValue(0);
} }
} }
@ -458,8 +458,8 @@ var checkTimeFire3 = func() {
if (engFireDetectorUnits.vector[2].loopOne == 9 and engFireDetectorUnits.vector[2].loopTwo == 9) { if (engFireDetectorUnits.vector[2].loopOne == 9 and engFireDetectorUnits.vector[2].loopTwo == 9) {
fireTimer3.stop(); fireTimer3.stop();
engFireDetectorUnits.vector[2].TriggerWarning(engFireDetectorUnits.vector[2].sys); engFireDetectorUnits.vector[2].TriggerWarning(engFireDetectorUnits.vector[2].sys);
loop4.setValue(0); propsNasFireTime.vector[4].setValue(0);
loop5.setValue(0); propsNasFireTime.vector[5].setValue(0);
} }
} }