work of the day
This commit is contained in:
parent
6669becaff
commit
99bdae5ed0
3 changed files with 14 additions and 13 deletions
|
@ -66,6 +66,7 @@ var msgs_priority_1 = std.Vector.new();
|
||||||
var msgs_priority_0 = std.Vector.new();
|
var msgs_priority_0 = std.Vector.new();
|
||||||
var msgs_memo = std.Vector.new();
|
var msgs_memo = std.Vector.new();
|
||||||
var active_messages = std.Vector.new();
|
var active_messages = std.Vector.new();
|
||||||
|
var display_messages = std.Vector.new();
|
||||||
var num_lines = 6;
|
var num_lines = 6;
|
||||||
var msg = nil;
|
var msg = nil;
|
||||||
var spacer = nil;
|
var spacer = nil;
|
||||||
|
@ -77,8 +78,8 @@ var messages_priority_3 = func {
|
||||||
if (getprop("/controls/flight/flap-pos") > 2 and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and getprop("/FMGC/status/phase") == 5) {
|
if (getprop("/controls/flight/flap-pos") > 2 and getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and getprop("/FMGC/status/phase") == 5) {
|
||||||
msgs_priority_3.append("L/G GEAR NOT DOWN");
|
msgs_priority_3.append("L/G GEAR NOT DOWN");
|
||||||
active_messages.append("L/G GEAR NOT DOWN");
|
active_messages.append("L/G GEAR NOT DOWN");
|
||||||
} else if (active_messages.contains("L/G GEAR NOT DOWN")) {
|
} else if (display_messages.contains("L/G GEAR NOT DOWN")) {
|
||||||
active_messages.remove("L/G GEAR NOT DOWN");
|
display_messages.remove("L/G GEAR NOT DOWN");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var messages_priority_2 = func {}
|
var messages_priority_2 = func {}
|
||||||
|
@ -88,8 +89,8 @@ var messages_memo = func {
|
||||||
if (getprop("controls/flight/speedbrake-arm") == 1) {
|
if (getprop("controls/flight/speedbrake-arm") == 1) {
|
||||||
msgs_memo.append("GND SPLRS ARMED");
|
msgs_memo.append("GND SPLRS ARMED");
|
||||||
active_messages.append("GND SPLRS ARMED");
|
active_messages.append("GND SPLRS ARMED");
|
||||||
} else if (active_messages.contains("GND SPLRS ARMED")) {
|
} else if (display_messages.contains("GND SPLRS ARMED")) {
|
||||||
active_messages.remove("GND SPLRS ARMED");
|
display_messages.remove("GND SPLRS ARMED");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,13 +120,17 @@ var ECAM_controller = {
|
||||||
forindex ( var i; active_messages.vector ) {
|
forindex ( var i; active_messages.vector ) {
|
||||||
var line = 1;
|
var line = 1;
|
||||||
if (getprop("/ECAM/msg/line" ~ line) == "") {
|
if (getprop("/ECAM/msg/line" ~ line) == "") {
|
||||||
setprop("/ECAM/msg/line" ~ line, active_messages.vector[i]);
|
display_messages.append(active_messages.vector[i]);
|
||||||
|
active_messages.remove(active_messages.vector[i]);
|
||||||
|
setprop("/ECAM/msg/line" ~ line, display_messages.vector[i]);
|
||||||
} else {
|
} else {
|
||||||
setprop("/ECAM/msg/line" ~ (line + 1), active_messages.vector[i]);
|
display_messages.append(active_messages.vector[i]);
|
||||||
|
active_messages.remove(active_messages.vector[i]);
|
||||||
|
setprop("/ECAM/msg/line" ~ (line + 1), display_messages.vector[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_messages.size() == 0) {
|
if (display_messages.size() == 0) {
|
||||||
setprop("/ECAM/msg/line1", "");
|
setprop("/ECAM/msg/line1", "");
|
||||||
setprop("/ECAM/msg/line2", "");
|
setprop("/ECAM/msg/line2", "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ var ECAM = {
|
||||||
setprop("/ECAM/ldg-memo-enable", 0);
|
setprop("/ECAM/ldg-memo-enable", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ecam.active_messages.size() > 0) {
|
if (ecam.display_messages.size() > 0) {
|
||||||
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");
|
||||||
|
|
|
@ -186,7 +186,6 @@ var systemsInit = func {
|
||||||
libraries.CVR.start();
|
libraries.CVR.start();
|
||||||
icing.icingInit();
|
icing.icingInit();
|
||||||
lightsLoop.start();
|
lightsLoop.start();
|
||||||
ecamLoop.start();
|
|
||||||
var autopilot = gui.Dialog.new("sim/gui/dialogs/autopilot/dialog", "Aircraft/IDG-A32X/Systems/autopilot-dlg.xml");
|
var autopilot = gui.Dialog.new("sim/gui/dialogs/autopilot/dialog", "Aircraft/IDG-A32X/Systems/autopilot-dlg.xml");
|
||||||
setprop("/it-autoflight/input/fd1", 1);
|
setprop("/it-autoflight/input/fd1", 1);
|
||||||
setprop("/it-autoflight/input/fd2", 1);
|
setprop("/it-autoflight/input/fd2", 1);
|
||||||
|
@ -198,10 +197,6 @@ setlistener("/sim/signals/fdm-initialized", func {
|
||||||
systemsInit();
|
systemsInit();
|
||||||
});
|
});
|
||||||
|
|
||||||
var ecamLoop = maketimer(0.5, func {
|
|
||||||
ecam.ECAM_controller.loop();
|
|
||||||
});
|
|
||||||
|
|
||||||
var systemsLoop = maketimer(0.1, func {
|
var systemsLoop = maketimer(0.1, func {
|
||||||
systems.ELEC.loop();
|
systems.ELEC.loop();
|
||||||
systems.PNEU.loop();
|
systems.PNEU.loop();
|
||||||
|
@ -209,6 +204,7 @@ var systemsLoop = maketimer(0.1, func {
|
||||||
systems.FUEL.loop();
|
systems.FUEL.loop();
|
||||||
systems.ADIRS.loop();
|
systems.ADIRS.loop();
|
||||||
libraries.ECAM.loop();
|
libraries.ECAM.loop();
|
||||||
|
ecam.ECAM_controller.loop();
|
||||||
fadec.fadecLoop();
|
fadec.fadecLoop();
|
||||||
|
|
||||||
if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/switches/cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or getprop("/controls/gear/brake-parking") == 0)) {
|
if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/switches/cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or getprop("/controls/gear/brake-parking") == 0)) {
|
||||||
|
|
Reference in a new issue