1
0
Fork 0

Add TCAS stby / NAV TCAS fault warning to A320. NAV TCAS FAULT is implemented according to F9 FWC standard so does not show on powerup, unlike the FSLabs A320.

This commit is contained in:
legoboyvdlp R 2020-11-21 20:38:46 +00:00
parent 8d0b9cb204
commit 1cca50498c
3 changed files with 68 additions and 3 deletions

View file

@ -1314,12 +1314,18 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(athr_lim_1);
}
if (getprop("instrumentation/tcas/serviceable") == 0 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 7 and systems.ELEC.Bus.ac1.getValue() >= 110 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) {
if (getprop("/instrumentation/tcas/serviceable") == 0 and phaseVar2 != 1 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and phaseVar2 != 10 and systems.ELEC.Bus.ac1.getValue() >= 110 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) {
tcasFault.active = 1;
} else {
ECAM_controller.warningReset(tcasFault);
}
if (phaseVar2 == 6 and pts.Instrumentation.TCAS.Inputs.mode.getValue() == 1 and !tcasFault.active and (atc.Transponders.vector[0].condition != 0 and atc.Transponders.vector[1].condition != 0) and tcasStby.clearFlag == 0) {
tcasStby.active = 1;
} else {
ECAM_controller.warningReset(tcasStby);
}
if (gpwsTerrFault.clearFlag == 0 and warningNodes.Timers.navTerrFault.getValue() == 1 and (phaseVar2 == 2 or phaseVar2 == 6 or phaseVar2 == 7 or phaseVar2 == 9)) {
gpwsTerrFault.active = 1;
@ -2552,6 +2558,17 @@ var messages_right_memo = func {
ignition.active = 0;
}
if ((atc.Transponders.vector[0].condition == 0 and atc.Transponders.vector[1].condition == 0) or (!getprop("/systems/navigation/adr/operating-1") and !getprop("/systems/navigation/adr/operating-2") and !getprop("/systems/navigation/adr/operating-3")) or pts.Instrumentation.TCAS.Inputs.mode.getValue() == 1) {
if (phaseVarMemo3 == 6) {
tcas_stby.colour = "a";
} else {
tcas_stby.colour = "g";
}
tcas_stby.active = 1;
} else {
tcas_stby.active = 0;
}
if ((phaseVarMemo3 <= 2 or phaseVarMemo3 == 6 or phaseVarMemo3 >= 9) and atsu.CompanyCall.frequency != 999.99 and !atsu.CompanyCall.received) {
company_call.active = 1;
} else {

View file

@ -275,6 +275,7 @@ var warnings = std.Vector.new([
# TCAS FAULT
var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var tcasStby = warning.new(msg: "NAV TCAS STBY", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var gpwsFault = warning.new(msg: "NAV GPWS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var gpwsFaultOff = warning.new(msg: "-GPWS...............OFF", colour: "c"),
var gpwsTerrFault = warning.new(msg: "NAV GPWS TERR DET FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
@ -542,7 +543,7 @@ var memos = std.Vector.new([
var cabin_ready = memo.new(msg: "CABIN READY" ), # Not yet implemented
var pred_ws_off = memo.new(msg: "PRED W/S OFF"), # Not yet implemented
var terr_stby = memo.new(msg: "TERR STBY" ), # Not yet implemented
var tcas_stby = memo.new(msg: "TCAS STBY" ), # Not yet implemented
var tcas_stby = memo.new(msg: "TCAS STBY" ),
var company_call = memo.new(msg: "COMPANY CALL"),
var satcom_alert = memo.new(msg: "SATCOM ALERT"), # Not yet implemented
var company_msg = memo.new(msg: "COMPANY MSG" ),

View file

@ -17,7 +17,7 @@ var Transponder = {
code: "2000",
selected: 0,
electricalSrc: "",
activeADIRS: 0,
activeADIRS: 1,
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)],
@ -244,6 +244,41 @@ var transponderPanel = {
Transponders.vector[1].switchADIRS(2);
}
}
if (Transponders.vector[me.atcSel - 1].activeADIRS == 1) {
me.updateADR1(systems.ADIRS.Operating.adr[0].getValue());
} elsif (Transponders.vector[me.atcSel - 1].activeADIRS == 2) {
me.updateADR2(systems.ADIRS.Operating.adr[1].getValue());
} elsif (Transponders.vector[me.atcSel - 1].activeADIRS == 3) {
me.updateADR3(systems.ADIRS.Operating.adr[2].getValue());
}
},
updateADR1: func(val) {
if (Transponders.vector[me.atcSel - 1].activeADIRS == 1) {
if (val) {
setprop("/instrumentation/tcas/serviceable", 1);
} else {
setprop("/instrumentation/tcas/serviceable", 0);
}
}
},
updateADR2: func(val) {
if (Transponders.vector[me.atcSel - 1].activeADIRS == 2) {
if (val) {
setprop("/instrumentation/tcas/serviceable", 1);
} else {
setprop("/instrumentation/tcas/serviceable", 0);
}
}
},
updateADR3: func(val) {
if (Transponders.vector[me.atcSel - 1].activeADIRS == 3) {
if (val) {
setprop("/instrumentation/tcas/serviceable", 1);
} else {
setprop("/instrumentation/tcas/serviceable", 0);
}
}
},
};
@ -265,3 +300,15 @@ var Transponders = std.Vector.new([Transponder.new("/systems/electrical/bus/ac-e
var transponderTimer = maketimer(0.1, func() {
Transponders.vector[transponderPanel.atcSel - 1].update();
});
setlistener("/systems/navigation/adr/operating-1", func() {
transponderPanel.updateADR1(systems.ADIRS.Operating.adr[0].getValue());
}, 1, 0);
setlistener("/systems/navigation/adr/operating-2", func() {
transponderPanel.updateADR2(systems.ADIRS.Operating.adr[1].getValue());
}, 1, 0);
setlistener("/systems/navigation/adr/operating-3", func() {
transponderPanel.updateADR3(systems.ADIRS.Operating.adr[2].getValue());
}, 1, 0);