DU: Fix bugs in ECAM
This commit is contained in:
parent
c8245c7a41
commit
cd0fc2088a
4 changed files with 70 additions and 65 deletions
|
@ -10,6 +10,8 @@ var upperECAM_iae_eis2 = nil;
|
||||||
var upperECAM_test = nil;
|
var upperECAM_test = nil;
|
||||||
var upperECAM_display = nil;
|
var upperECAM_display = nil;
|
||||||
var elapsedtime = 0;
|
var elapsedtime = 0;
|
||||||
|
var leftmsg = "XX";
|
||||||
|
var rightmsg = "XX";
|
||||||
|
|
||||||
# Create Nodes:
|
# Create Nodes:
|
||||||
var fuel_1 = props.globals.initNode("/engines/engine[0]/fuel-flow_actual", 0);
|
var fuel_1 = props.globals.initNode("/engines/engine[0]/fuel-flow_actual", 0);
|
||||||
|
@ -92,6 +94,7 @@ var ECAM_line6c = props.globals.getNode("/ECAM/msg/linec6", 1);
|
||||||
var ECAM_line7c = props.globals.getNode("/ECAM/msg/linec7", 1);
|
var ECAM_line7c = props.globals.getNode("/ECAM/msg/linec7", 1);
|
||||||
var ECAM_line8c = props.globals.getNode("/ECAM/msg/linec8", 1);
|
var ECAM_line8c = props.globals.getNode("/ECAM/msg/linec8", 1);
|
||||||
var ECAMleft = props.globals.getNode("/ECAM/left-msg", 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 rate = props.globals.getNode("/systems/acconfig/options/uecam-rate", 1);
|
||||||
|
|
||||||
var canvas_upperECAM_base = {
|
var canvas_upperECAM_base = {
|
||||||
|
@ -223,6 +226,7 @@ var canvas_upperECAM_base = {
|
||||||
line7c = ECAM_line7c.getValue();
|
line7c = ECAM_line7c.getValue();
|
||||||
line8c = ECAM_line8c.getValue();
|
line8c = ECAM_line8c.getValue();
|
||||||
leftmsg = ECAMleft.getValue();
|
leftmsg = ECAMleft.getValue();
|
||||||
|
rightmsg = ECAMright.getValue();
|
||||||
|
|
||||||
if (leftmsg == "MSG") {
|
if (leftmsg == "MSG") {
|
||||||
me["ECAML1"].setText(sprintf("%s", ECAM_line1.getValue()));
|
me["ECAML1"].setText(sprintf("%s", ECAM_line1.getValue()));
|
||||||
|
@ -434,7 +438,7 @@ var canvas_upperECAM_base = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Right ECAM Messages
|
# Right ECAM Messages
|
||||||
if (getprop("/ECAM/right-msg") == "MSG") {
|
if (rightmsg == "MSG") {
|
||||||
me["ECAMR1"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line1")));
|
me["ECAMR1"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line1")));
|
||||||
me["ECAMR2"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line2")));
|
me["ECAMR2"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line2")));
|
||||||
me["ECAMR3"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line3")));
|
me["ECAMR3"].setText(sprintf("%s", getprop("/ECAM/rightmsg/line3")));
|
||||||
|
@ -559,8 +563,6 @@ var canvas_upperECAM_base = {
|
||||||
me["ECAM_Right"].show();
|
me["ECAM_Right"].show();
|
||||||
} else {
|
} else {
|
||||||
me["ECAM_Right"].hide();
|
me["ECAM_Right"].hide();
|
||||||
me["TO_Memo"].hide();
|
|
||||||
me["LDG_Memo"].hide();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,6 +62,8 @@ var spacer = nil;
|
||||||
var line = nil;
|
var line = nil;
|
||||||
var right_line = nil;
|
var right_line = nil;
|
||||||
var wow = getprop("/gear/gear[1]/wow");
|
var wow = getprop("/gear/gear[1]/wow");
|
||||||
|
setprop("/ECAM/show-left-msg", 0);
|
||||||
|
setprop("/ECAM/show-right-msg", 0);
|
||||||
setprop("/ECAM/warnings/master-warning-light", 0);
|
setprop("/ECAM/warnings/master-warning-light", 0);
|
||||||
setprop("/ECAM/warnings/master-caution-light", 0);
|
setprop("/ECAM/warnings/master-caution-light", 0);
|
||||||
|
|
||||||
|
@ -138,74 +140,75 @@ var memo = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
# messages logic and added to arrays
|
# messages logic and added to arrays
|
||||||
|
|
||||||
var warnings = std.Vector.new([
|
var warnings = std.Vector.new([
|
||||||
var lg_not_dn = warning.new(msg: "L/G GEAR NOT DOWN", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
|
var lg_not_dn = warning.new(msg: "L/G GEAR NOT DOWN", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
|
||||||
var pack1_fault = warning.new(msg: "AIR PACK 1 FAULT ", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
|
var pack1_fault = warning.new(msg: "AIR PACK 1 FAULT ", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
|
||||||
var pack1_fault_subwarn_1 = warning.new(msg: "-PACK 1.............OFF ", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
|
var pack1_fault_subwarn_1 = warning.new(msg: "-PACK 1.............OFF ", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
|
||||||
var pack2_fault = warning.new(msg: "AIR PACK 2 FAULT ", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
|
var pack2_fault = warning.new(msg: "AIR PACK 2 FAULT ", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
|
||||||
var pack2_fault_subwarn_1 = warning.new(msg: "-PACK 2.............OFF ", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
|
var pack2_fault_subwarn_1 = warning.new(msg: "-PACK 2.............OFF ", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
|
||||||
var park_brk_on = warning.new(msg: "PARK BRK ON", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0)
|
var park_brk_on = warning.new(msg: "PARK BRK ON", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var leftmemos = std.Vector.new([
|
var leftmemos = std.Vector.new([
|
||||||
var company_alert = warning.new(msg: "COMPANY ALERT", active: 0, colour: "g", aural: "buzzer", light: "none", noRepeat: 0), # Not yet implemented, buzzer sound
|
var company_alert = warning.new(msg: "COMPANY ALERT", active: 0, colour: "g", aural: "buzzer", light: "none", noRepeat: 0), # Not yet implemented, buzzer sound
|
||||||
var refuelg = warning.new(msg: "REFUELG", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var refuelg = warning.new(msg: "REFUELG", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var irs_in_align = warning.new(msg: "IRS IN ALIGN", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
var irs_in_align = warning.new(msg: "IRS IN ALIGN", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
||||||
var gnd_splrs = warning.new(msg: "GND SPLRS ARMED", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var gnd_splrs = warning.new(msg: "GND SPLRS ARMED", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var seatbelts = warning.new(msg: "SEAT BELTS", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var seatbelts = warning.new(msg: "SEAT BELTS", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var nosmoke = warning.new(msg: "NO SMOKING", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var nosmoke = warning.new(msg: "NO SMOKING", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var strobe_lt_off = warning.new(msg: "STROBE LT OFF", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var strobe_lt_off = warning.new(msg: "STROBE LT OFF", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
||||||
var fob_3T = warning.new(msg: "FOB BELOW 3T", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var fob_3T = warning.new(msg: "FOB BELOW 3T", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0),
|
||||||
var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0), # Not yet implemented
|
||||||
var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0) # Not yet implemented
|
var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY", active: 0, colour: "g", aural: "none", light: "none", noRepeat: 0) # Not yet implemented
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var memos = std.Vector.new([
|
var memos = std.Vector.new([
|
||||||
var to_inhibit = memo.new(msg: "T.O. INHIBIT", active: 0, colour: "m"),
|
var to_inhibit = memo.new(msg: "T.O. INHIBIT", active: 0, colour: "m"),
|
||||||
var ldg_inhibit = memo.new(msg: "LDG INHIBIT", active: 0, colour: "m"),
|
var ldg_inhibit = memo.new(msg: "LDG INHIBIT", active: 0, colour: "m"),
|
||||||
var spd_brk = memo.new(msg: "SPEED BRK", active: 0, colour: "g"),
|
var spd_brk = memo.new(msg: "SPEED BRK", active: 0, colour: "g"),
|
||||||
var park_brk = memo.new(msg: "PARK BRK", active: 0, colour: "g"),
|
var park_brk = memo.new(msg: "PARK BRK", active: 0, colour: "g"),
|
||||||
var ptu = memo.new(msg: "HYD PTU", active: 0, colour: "g"),
|
var ptu = memo.new(msg: "HYD PTU", active: 0, colour: "g"),
|
||||||
var rat = memo.new(msg: "RAT OUT", active: 0, colour: "g"),
|
var rat = memo.new(msg: "RAT OUT", active: 0, colour: "g"),
|
||||||
var emer_gen = memo.new(msg: "EMER GEN", active: 0, colour: "g"),
|
var emer_gen = memo.new(msg: "EMER GEN", active: 0, colour: "g"),
|
||||||
var ram_air = memo.new(msg: "RAM AIR ON", active: 0, colour: "g"),
|
var ram_air = memo.new(msg: "RAM AIR ON", active: 0, colour: "g"),
|
||||||
var nw_strg_disc = memo.new(msg: "NW STRG DISC", active: 0, colour: "g"), # Not yet implemented
|
var nw_strg_disc = memo.new(msg: "NW STRG DISC", active: 0, colour: "g"), # Not yet implemented
|
||||||
var ignition = memo.new(msg: "IGNITION", active: 0, colour: "g"),
|
var ignition = memo.new(msg: "IGNITION", active: 0, colour: "g"),
|
||||||
var cabin_ready = memo.new(msg: "CABIN READY", active: 0, colour: "g"), # Not yet implemented
|
var cabin_ready = memo.new(msg: "CABIN READY", active: 0, colour: "g"), # Not yet implemented
|
||||||
var pred_ws_off = memo.new(msg: "PRED W/S OFF", active: 0, colour: "g"), # Not yet implemented
|
var pred_ws_off = memo.new(msg: "PRED W/S OFF", active: 0, colour: "g"), # Not yet implemented
|
||||||
var terr_stby = memo.new(msg: "TERR STBY", active: 0, colour: "g"), # Not yet implemented
|
var terr_stby = memo.new(msg: "TERR STBY", active: 0, colour: "g"), # Not yet implemented
|
||||||
var tcas_stby = memo.new(msg: "TCAS STBY", active: 0, colour: "g"), # Not yet implemented
|
var tcas_stby = memo.new(msg: "TCAS STBY", active: 0, colour: "g"), # Not yet implemented
|
||||||
var acars_call = memo.new(msg: "ACARS CALL", active: 0, colour: "g"), # Not yet implemented
|
var acars_call = memo.new(msg: "ACARS CALL", active: 0, colour: "g"), # Not yet implemented
|
||||||
var company_call = memo.new(msg: "COMPANY CALL", active: 0, colour: "g"), # Not yet implemented
|
var company_call = memo.new(msg: "COMPANY CALL", active: 0, colour: "g"), # Not yet implemented
|
||||||
var satcom_alert = memo.new(msg: "SATCOM ALERT", active: 0, colour: "g"), # Not yet implemented
|
var satcom_alert = memo.new(msg: "SATCOM ALERT", active: 0, colour: "g"), # Not yet implemented
|
||||||
var acars_msg = memo.new(msg: "ACARS MSG", active: 0, colour: "g"), # Not yet implemented
|
var acars_msg = memo.new(msg: "ACARS MSG", active: 0, colour: "g"), # Not yet implemented
|
||||||
var company_msg = memo.new(msg: "COMPANY MSG", active: 0, colour: "g"), # Not yet implemented
|
var company_msg = memo.new(msg: "COMPANY MSG", active: 0, colour: "g"), # Not yet implemented
|
||||||
var eng_aice = memo.new(msg: "ENG A.ICE", active: 0, colour: "g"),
|
var eng_aice = memo.new(msg: "ENG A.ICE", active: 0, colour: "g"),
|
||||||
var wing_aice = memo.new(msg: "WING A.ICE", active: 0, colour: "g"),
|
var wing_aice = memo.new(msg: "WING A.ICE", active: 0, colour: "g"),
|
||||||
var ice_not_det = memo.new(msg: "ICE NOT DET", active: 0, colour: "g"), # Not yet implemented
|
var ice_not_det = memo.new(msg: "ICE NOT DET", active: 0, colour: "g"), # Not yet implemented
|
||||||
var hi_alt = memo.new(msg: "HI ALT", active: 0, colour: "g"), # Not yet implemented
|
var hi_alt = memo.new(msg: "HI ALT", active: 0, colour: "g"), # Not yet implemented
|
||||||
var apu_avail = memo.new(msg: "APU AVAIL", active: 0, colour: "g"),
|
var apu_avail = memo.new(msg: "APU AVAIL", active: 0, colour: "g"),
|
||||||
var apu_bleed = memo.new(msg: "APU BLEED", active: 0, colour: "g"), # Not yet implemented
|
var apu_bleed = memo.new(msg: "APU BLEED", active: 0, colour: "g"), # Not yet implemented
|
||||||
var ldg_lt = memo.new(msg: "LDG LT", active: 0, colour: "g"),
|
var ldg_lt = memo.new(msg: "LDG LT", active: 0, colour: "g"),
|
||||||
var brk_fan = memo.new(msg: "BRK FAN", active: 0, colour: "g"), # Not yet implemented
|
var brk_fan = memo.new(msg: "BRK FAN", active: 0, colour: "g"), # Not yet implemented
|
||||||
var audio3_xfrd = memo.new(msg: "AUDIO 3 XFRD", active: 0, colour: "g"), # Not yet implemented
|
var audio3_xfrd = memo.new(msg: "AUDIO 3 XFRD", active: 0, colour: "g"), # Not yet implemented
|
||||||
var switchg_pnl = memo.new(msg: "SWITCHG PNL", active: 0, colour: "g"), # Not yet implemented
|
var switchg_pnl = memo.new(msg: "SWITCHG PNL", active: 0, colour: "g"), # Not yet implemented
|
||||||
var gpws_flap3 = memo.new(msg: "GPWS FLAP 3", active: 0, colour: "g"), # Not yet implemented
|
var gpws_flap3 = memo.new(msg: "GPWS FLAP 3", active: 0, colour: "g"), # Not yet implemented
|
||||||
var hf_data_ovrd = memo.new(msg: "HF DATA OVRD", active: 0, colour: "g"), # Not yet implemented
|
var hf_data_ovrd = memo.new(msg: "HF DATA OVRD", active: 0, colour: "g"), # Not yet implemented
|
||||||
var hf_voice = memo.new(msg: "HF VOICE", active: 0, colour: "g"), # Not yet implemented
|
var hf_voice = memo.new(msg: "HF VOICE", active: 0, colour: "g"), # Not yet implemented
|
||||||
var acars_stby = memo.new(msg: "ACARS STBY", active: 0, colour: "g"), # Not yet implemented
|
var acars_stby = memo.new(msg: "ACARS STBY", active: 0, colour: "g"), # Not yet implemented
|
||||||
var vhf3_voice = memo.new(msg: "VHF3 VOICE", active: 0, colour: "g"),
|
var vhf3_voice = memo.new(msg: "VHF3 VOICE", active: 0, colour: "g"),
|
||||||
var auto_brk_lo = memo.new(msg: "AUTO BRK LO", active: 0, colour: "g"),
|
var auto_brk_lo = memo.new(msg: "AUTO BRK LO", active: 0, colour: "g"),
|
||||||
var auto_brk_med = memo.new(msg: "AUTO BRK MED", active: 0, colour: "g"),
|
var auto_brk_med = memo.new(msg: "AUTO BRK MED", active: 0, colour: "g"),
|
||||||
var auto_brk_max = memo.new(msg: "AUTO BRK MAX", active: 0, colour: "g"),
|
var auto_brk_max = memo.new(msg: "AUTO BRK MAX", active: 0, colour: "g"),
|
||||||
var auto_brk_off = memo.new(msg: "AUTO BRK OFF", active: 0, colour: "g"), # Not yet implemented
|
var auto_brk_off = memo.new(msg: "AUTO BRK OFF", active: 0, colour: "g"), # Not yet implemented
|
||||||
var man_ldg_elev = memo.new(msg: "MAN LDG ELEV", active: 0, colour: "g"), # Not yet implemented
|
var man_ldg_elev = memo.new(msg: "MAN LDG ELEV", active: 0, colour: "g"), # Not yet implemented
|
||||||
var ctr_tk_feedg = memo.new(msg: "CTR TK FEEDG", active: 0, colour: "g"), # Not yet implemented
|
var ctr_tk_feedg = memo.new(msg: "CTR TK FEEDG", active: 0, colour: "g"), # Not yet implemented
|
||||||
var fuelx = memo.new(msg: "FUEL X FEED", active: 0, colour: "g")
|
var fuelx = memo.new(msg: "FUEL X FEED", active: 0, colour: "g")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var clearWarnings = std.Vector.new();
|
var clearWarnings = std.Vector.new();
|
||||||
|
|
|
@ -146,7 +146,7 @@ var ECAM = {
|
||||||
setprop("/ECAM/ldg-memo-enable", 0);
|
setprop("/ECAM/ldg-memo-enable", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ecam.warnings.size() > 0) {
|
if (getprop("/ECAM/show-left-msg") == 1) {
|
||||||
setprop("/ECAM/left-msg", "MSG");
|
setprop("/ECAM/left-msg", "MSG");
|
||||||
} else if (getprop("/FMGC/status/phase") == 0 and stateL == 3 and stateR == 3 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec") and getprop("/ECAM/to-memo-enable") == 1 and wow == 1) {
|
} else if (getprop("/FMGC/status/phase") == 0 and stateL == 3 and stateR == 3 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec") and getprop("/ECAM/to-memo-enable") == 1 and wow == 1) {
|
||||||
setprop("/ECAM/left-msg", "TO-MEMO");
|
setprop("/ECAM/left-msg", "TO-MEMO");
|
||||||
|
@ -156,7 +156,7 @@ var ECAM = {
|
||||||
setprop("/ECAM/left-msg", "NONE");
|
setprop("/ECAM/left-msg", "NONE");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ecam.memos.size() > 0) {
|
if (getprop("/ECAM/show-right-msg") == 1) {
|
||||||
setprop("/ECAM/right-msg", "MSG");
|
setprop("/ECAM/right-msg", "MSG");
|
||||||
} else {
|
} else {
|
||||||
setprop("/ECAM/right-msg", "NONE");
|
setprop("/ECAM/right-msg", "NONE");
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
4701
|
4702
|
Reference in a new issue