diff --git a/A320-main.xml b/A320-main.xml
index 5f0a80e9..48e88f30 100644
--- a/A320-main.xml
+++ b/A320-main.xml
@@ -1956,20 +1956,37 @@
Del
CLR
+ true
/FMGC/keyboard-left
nasal
-
+
/FMGC/keyboard-right
nasal
-
+
+
+
+
+ /FMGC/keyboard-left
+
+ nasal
+
+
+
+
+ /FMGC/keyboard-right
+
+ nasal
+
+
+
Disable MCDU keyboard mode
@@ -4680,7 +4697,7 @@
Aircraft/A320-family/Nasal/MCDU/ARRIVAL.nas
Aircraft/A320-family/Nasal/MCDU/AIRWAYS.nas
Aircraft/A320-family/Nasal/MCDU/CLOSESTAIRPORT.nas
- Aircraft/A320-family/Nasal/MCDU/RECEIVEDMESSAGES.nas
+ Aircraft/A320-family/Nasal/MCDU/RECEIVEDMESSAGES.nas
Aircraft/A320-family/Nasal/MCDU/PILOTWAYPOINT.nas
Aircraft/A320-family/Nasal/MCDU/HOLD.nas
Aircraft/A320-family/Nasal/MCDU/F-PLN.nas
@@ -4688,7 +4705,8 @@
Aircraft/A320-family/Nasal/MCDU/WINDCRZ.nas
Aircraft/A320-family/Nasal/MCDU/WINDDES.nas
Aircraft/A320-family/Nasal/MCDU/WINDHIST.nas
- Aircraft/A320-family/Nasal/MCDU/ATIS.nas
+ Aircraft/A320-family/Nasal/MCDU/ATIS.nas
+ Aircraft/A320-family/Nasal/MCDU/FLIGHTLOG.nas
Aircraft/A320-family/Nasal/MCDU/MCDU.nas
Aircraft/A320-family/Nasal/MCDU/INITA.nas
Aircraft/A320-family/Nasal/MCDU/IRSINIT.nas
diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas
index 1439b8e6..f20d49d6 100644
--- a/AircraftConfig/acconfig.nas
+++ b/AircraftConfig/acconfig.nas
@@ -197,10 +197,10 @@ var renderingSettings = {
check: func() {
var rembrandt = getprop("/sim/rendering/rembrandt/enabled");
var ALS = getprop("/sim/rendering/shaders/skydome");
- var customSettings = getprop("/sim/rendering/shaders/custom-settings") == 1;
+
var landmass = getprop("/sim/rendering/shaders/landmass") >= 4;
var model = getprop("/sim/rendering/shaders/model") >= 2;
- if (!rembrandt and (!ALS or !customSettings or !landmass or !model)) {
+ if (!rembrandt and (!ALS or !landmass or !model)) {
rendering_dlg.open();
}
},
@@ -256,6 +256,15 @@ var writeSettings = func {
# Panel States #
################
+# Abort auto-config and close dialog
+var abortPanelStates = func {
+ if (getprop("/systems/acconfig/autoconfig-running") == 1) {
+ setprop("/systems/acconfig/autoconfig-running", 0);
+ }
+ ps_load_dlg.close();
+ spinning.stop();
+}
+
# Cold and Dark
var colddark = func {
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
@@ -352,6 +361,10 @@ var beforestart = func {
}
}
var beforestart_b = func {
+ if (getprop("/systems/acconfig/autoconfig-running") == 0) {
+ colddark();
+ return 0; # auto-config aborted
+ }
# Continue with engine start prep.
systems.FUEL.Switches.pumpLeft1.setValue(1);
systems.FUEL.Switches.pumpLeft2.setValue(1);
@@ -439,6 +452,10 @@ var taxi = func {
}
}
var taxi_b = func {
+ if (getprop("/systems/acconfig/autoconfig-running") == 0) {
+ colddark();
+ return 0; # auto-config aborted
+ }
# Continue with engine start prep, and start engines.
systems.FUEL.Switches.pumpLeft1.setValue(1);
systems.FUEL.Switches.pumpLeft2.setValue(1);
@@ -492,6 +509,10 @@ var taxi_b = func {
settimer(taxi_c, 2);
}
var taxi_c = func {
+ if (getprop("/systems/acconfig/autoconfig-running") == 0) {
+ colddark();
+ return 0; # auto-config aborted
+ }
setprop("/controls/engines/engine-start-switch", 2);
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
@@ -500,6 +521,10 @@ var taxi_c = func {
}, 10);
}
var taxi_d = func {
+ if (getprop("/systems/acconfig/autoconfig-running") == 0) {
+ colddark();
+ return 0; # auto-config aborted
+ }
# After Start items.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/apu/master", 0);
diff --git a/AircraftConfig/psload.xml b/AircraftConfig/psload.xml
index 8245b84e..64cb9823 100644
--- a/AircraftConfig/psload.xml
+++ b/AircraftConfig/psload.xml
@@ -15,6 +15,16 @@
left
+
@@ -36,7 +46,7 @@
center
/systems/acconfig/spin
1
-
+
diff --git a/Models/A320-common.xml b/Models/A320-common.xml
index f125727e..3ec1feed 100644
--- a/Models/A320-common.xml
+++ b/Models/A320-common.xml
@@ -309,6 +309,33 @@
+
+ select
+ Left nav light
+ Left nav light ALS
+
+ sim/multiplay/generic/int[12]
+
+
+
+
+ Left nav light ALS sharklet
+ Aircraft/A320-family/Models/Lights/ALS/rednav.xml
+
+ 1.54364
+ -16.38
+ 0.317012
+
+
+
+
+ select
+ Left nav light ALS sharklet
+
+ sim/multiplay/generic/int[12]
+
+
+
Right nav light
Aircraft/A320-family/Models/Lights/greennav.xml
@@ -328,6 +355,33 @@
0.317018
+
+
+ select
+ Right nav light
+ Right nav light ALS
+
+ sim/multiplay/generic/int[12]
+
+
+
+
+ Right nav light ALS sharklet
+ Aircraft/A320-family/Models/Lights/ALS/greennav.xml
+
+ 1.54364
+ 16.38
+ 0.317012
+
+
+
+
+ select
+ Right nav light ALS sharklet
+
+ sim/multiplay/generic/int[12]
+
+
Tail nav light
@@ -369,6 +423,33 @@
+
+ select
+ Left strobe light
+ Left strobe light ALS
+
+ sim/multiplay/generic/int[12]
+
+
+
+
+ Left strobe light ALS sharklet
+ Aircraft/A320-family/Models/Lights/ALS/right-strobe.xml
+
+ 2.31
+ -17.1
+ 0.66
+
+
+
+
+ select
+ Left strobe light ALS sharklet
+
+ sim/multiplay/generic/int[12]
+
+
+
Right strobe light
Aircraft/A320-family/Models/Lights/strobe.xml
@@ -388,6 +469,33 @@
0.319218
+
+
+ select
+ Right strobe light
+ Right strobe light ALS
+
+ sim/multiplay/generic/int[12]
+
+
+
+
+ Right strobe light ALS sharklet
+ Aircraft/A320-family/Models/Lights/ALS/right-strobe.xml
+
+ 2.31
+ 17.1
+ 0.66
+
+
+
+
+ select
+ Right strobe light ALS sharklet
+
+ sim/multiplay/generic/int[12]
+
+
Tail strobe light
diff --git a/Models/Effects/reflection.eff b/Models/Effects/reflection.eff
index 39a79c91..7f92469a 100644
--- a/Models/Effects/reflection.eff
+++ b/Models/Effects/reflection.eff
@@ -3,93 +3,14 @@
reflection
Effects/model-combined-deferred
- 1
- 1
+ 0
+ 0
0
2
- 1
+ 0
0
- 1
-
- Aircraft/A320-family/Models/Effects/res/Fuse-Main-Normal.png
- linear-mipmap-linear
- clamp
- clamp
-
-
- 1.0 1.0 1.0
-
- Aircraft/A320-family/Models/Effects/res/fin-lightmap.png
- linear-mipmap-linear
- clamp
- clamp
- normalized
-
-
- cubemap
-
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/1.png
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/4.png
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/2.png
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/3.png
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/6.png
- Aircraft/Generic/Effects/CubeMaps/fgfs-sky/5.png
-
-
+ 0
-
-
-
- 6
- 7
-
-
-
-
-
- tangent
- 6
-
-
- binormal
- 7
-
-
-
-
-
-
-
-
- tangent
- 6
-
-
- binormal
- 7
-
-
-
-
-
-
-
-
- tangent
- 6
-
-
- binormal
- 7
-
-
-
-
-
diff --git a/Models/Engines/XMLs/a320.v2500.xml b/Models/Engines/XMLs/a320.v2500.xml
index 746b016f..afb1923b 100644
--- a/Models/Engines/XMLs/a320.v2500.xml
+++ b/Models/Engines/XMLs/a320.v2500.xml
@@ -406,7 +406,7 @@
-
+
diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml
index b594743f..41f089d6 100644
--- a/Models/FlightDeck/a320.flightdeck.xml
+++ b/Models/FlightDeck/a320.flightdeck.xml
@@ -1,4 +1,4 @@
-
+
@@ -138,86 +138,68 @@
- pick
+ knob
ddrmi_vor_adf_select_1
+ instrumentation/ddrmi/vor-adf-1
+
+ ddrmi_vor_adf_select_1.axis
+
-
- false
- property-cycle
+ property-adjust
instrumentation/ddrmi/vor-adf-1
- 0
- 1
- -1
-
-
-
-
- false
-
- property-cycle
- instrumentation/ddrmi/vor-adf-1
- -1
- 1
- 0
+ -1
+ 1
+
- Knob 1 rotate
- ddrmi_vor_adf_select_1
+ DDRMI vor-adf knob 1
rotate
+ ddrmi_vor_adf_select_1
instrumentation/ddrmi/vor-adf-1
- -190
- 045
- 1 0
+ -190
+ 045
+ 1 0
ddrmi_vor_adf_select_1.axis
-
+
- pick
+ knob
ddrmi_vor_adf_select_2
+ instrumentation/ddrmi/vor-adf-2
+
+ ddrmi_vor_adf_select_2.axis
+
-
- false
- property-cycle
+ property-adjust
instrumentation/ddrmi/vor-adf-2
- 0
- 1
- -1
-
-
-
-
- false
-
- property-cycle
- instrumentation/ddrmi/vor-adf-2
- -1
- 1
- 0
+ -1
+ 1
+
- Knob 2 rotate
- ddrmi_vor_adf_select_2
+ DDRMI vor-adf knob 2
rotate
+ ddrmi_vor_adf_select_2
instrumentation/ddrmi/vor-adf-2
- -1-90
- 0-45
- 1 0
+ -1-90
+ 0-45
+ 1 0
ddrmi_vor_adf_select_2.axis
-
+
@@ -227,7 +209,7 @@
rotate
instrumentation/ddrmi/flag-1
- 045
+ 0-45
1 0
@@ -241,7 +223,7 @@
rotate
instrumentation/ddrmi/flag-2
- 0-45
+ 045
1 0
@@ -8347,30 +8329,21 @@
+
- UTC selector rotate
- pick
+ UTC selector animation
+ knob
clock_knob
+ instrumentation/clock/utc-selector
+
+ clock_knob.axis
+
-
- false
- property-cycle
+ property-adjust
instrumentation/clock/utc-selector
- 0
- 1
- 2
-
-
-
-
- false
-
- property-cycle
- instrumentation/clock/utc-selector
- 2
- 1
- 0
+ 0
+ 2
@@ -8381,9 +8354,9 @@
clock_knob
instrumentation/clock/utc-selector
- 00
- 145
- 290
+ 290
+ 145
+ 0 0
clock_knob.axis
diff --git a/Models/FlightDeck/res/fcu_labels.png b/Models/FlightDeck/res/fcu_labels.png
index cffa850b..06a0d3e4 100644
Binary files a/Models/FlightDeck/res/fcu_labels.png and b/Models/FlightDeck/res/fcu_labels.png differ
diff --git a/Models/Fuselages/A320/fuselage.xml b/Models/Fuselages/A320/fuselage.xml
index fe922d30..bda76920 100644
--- a/Models/Fuselages/A320/fuselage.xml
+++ b/Models/Fuselages/A320/fuselage.xml
@@ -34,7 +34,7 @@
OutflowValveDoor2
GPUServiceDoor
-
+
diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas
index b44bdaae..8193260d 100644
--- a/Models/Instruments/MCDU/MCDU.nas
+++ b/Models/Instruments/MCDU/MCDU.nas
@@ -152,10 +152,20 @@ var baro = props.globals.getNode("/FMGC/internal/baro", 1);
# GA PERF
+# AOC - SENSORS
+var parking_brake = props.globals.getNode("/controls/gear/brake-parking", 1);
+var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
+var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); #FWD door
+var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); #FWD door
+var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); #AFT door
+var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1); #AFT door
+
# Fetch nodes into vectors
var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode("/MCDU[1]/page", 1)];
var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode("/MCDU[1]/active", 1)];
var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.globals.getNode("/MCDU[1]/atsu-active", 1)];
+props.globals.initNode("/MCDU[0]/active-system", "", "STRING");
+props.globals.initNode("/MCDU[1]/active-system", "", "STRING");
# Conversion factor pounds to kilogram
var LBS2KGS = 0.4535924;
@@ -200,23 +210,23 @@ var canvas_MCDU_base = {
me["PERFTO_FE"].setFont(symbol);
me["PERFTO_SE"].setFont(symbol);
me["PERFTO_OE"].setFont(symbol);
- me["PERFTO_FE"].setColor(0.8078,0.8039,0.8078);
- me["PERFTO_SE"].setColor(0.8078,0.8039,0.8078);
- me["PERFTO_OE"].setColor(0.8078,0.8039,0.8078);
+ me["PERFTO_FE"].setColor(BLUE);
+ me["PERFTO_SE"].setColor(BLUE);
+ me["PERFTO_OE"].setColor(BLUE);
me["PERFAPPR_FE"].setFont(symbol);
me["PERFAPPR_SE"].setFont(symbol);
me["PERFAPPR_OE"].setFont(symbol);
- me["PERFAPPR_FE"].setColor(0.8078,0.8039,0.8078);
- me["PERFAPPR_SE"].setColor(0.8078,0.8039,0.8078);
- me["PERFAPPR_OE"].setColor(0.8078,0.8039,0.8078);
+ me["PERFAPPR_FE"].setColor(BLUE);
+ me["PERFAPPR_SE"].setColor(BLUE);
+ me["PERFAPPR_OE"].setColor(BLUE);
me["PERFGA_FE"].setFont(symbol);
me["PERFGA_SE"].setFont(symbol);
me["PERFGA_OE"].setFont(symbol);
- me["PERFGA_FE"].setColor(0.8078,0.8039,0.8078);
- me["PERFGA_SE"].setColor(0.8078,0.8039,0.8078);
- me["PERFGA_OE"].setColor(0.8078,0.8039,0.8078);
+ me["PERFGA_FE"].setColor(BLUE);
+ me["PERFGA_SE"].setColor(BLUE);
+ me["PERFGA_OE"].setColor(BLUE);
me.page = canvas_group;
@@ -282,12 +292,25 @@ var canvas_MCDU_base = {
me["PERFTO"].hide();
},
defaultPageNumbers: func() {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
},
+ showPageNumbers: func(pagno=0,pagcnt=0) {
+ if (pagno == 0) return me.defaultPageNumbers();
+ me["Simple_PageNum"].show();
+ me["Simple_PageNum"].setText((pagcnt>0) ? pagno ~ "/" ~ pagcnt : pagno);
+ me["ArrowLeft"].show();
+ me["ArrowRight"].show();
+ },
+ showPageNumbersOnly: func(pagno,pagcnt) {
+ me["Simple_PageNum"].show();
+ me["Simple_PageNum"].setText(sprintf("%9s",pagno ~ "/" ~ pagcnt));
+ me["ArrowLeft"].hide();
+ me["ArrowRight"].hide();
+ },
hideAllArrows: func() {
me["Simple_L1_Arrow"].hide();
me["Simple_L2_Arrow"].hide();
@@ -421,7 +444,7 @@ var canvas_MCDU_base = {
} else {
me["FPLN_Callsign"].hide();
}
-
+
me.dynamicPageFunc(myFpln[i].L1, "Simple_L1");
me.dynamicPageFunc(myFpln[i].L2, "Simple_L2");
me.dynamicPageFunc(myFpln[i].L3, "Simple_L3");
@@ -499,29 +522,36 @@ var canvas_MCDU_base = {
me.standardFontColour();
me["Simple_L3"].setText(" AIDS");
me["Simple_L4"].setText(" CFDS");
+
pageSwitch[i].setBoolValue(1);
}
if (active[i].getValue() == 0) {
me["Simple_L1"].setText(" FMGC");
- me["Simple_L1"].setColor(1,1,1);
+ me["Simple_L1"].setColor(WHITE);
+ me["Simple_L1_Arrow"].setColor(WHITE);
} else if (active[i].getValue() == 1) {
- me["Simple_L1"].setText(" FMGC(SEL)");
- me["Simple_L1"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L1"].setText(" FMGC (SEL)");
+ me["Simple_L1"].setColor(BLUE);
+ me["Simple_L1_Arrow"].setColor(BLUE);
} else if (active[i].getValue() == 2) {
me["Simple_L1"].setText(" FMGC");
- me["Simple_L1"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_L1"].setColor(GREEN);
+ me["Simple_L1_Arrow"].setColor(GREEN);
}
if (activeAtsu[i].getValue() == 0) {
me["Simple_L2"].setText(" ATSU");
- me["Simple_L2"].setColor(1,1,1);
+ me["Simple_L2"].setColor(WHITE);
+ me["Simple_L2_Arrow"].setColor(WHITE);
} else if (activeAtsu[i].getValue() == 1) {
- me["Simple_L2"].setText(" ATSU(SEL)");
- me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L2"].setText(" ATSU (SEL)");
+ me["Simple_L2"].setColor(BLUE);
+ me["Simple_L2_Arrow"].setColor(BLUE);
} else if (activeAtsu[i].getValue() == 2) {
me["Simple_L2"].setText(" ATSU");
- me["Simple_L2"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_L2"].setColor(GREEN);
+ me["Simple_L2_Arrow"].setColor(GREEN);
}
} else if (page == "ATSUDLINK") {
if (!pageSwitch[i].getBoolValue()) {
@@ -590,6 +620,178 @@ var canvas_MCDU_base = {
me["Simple_R6"].hide();
me["Simple_R6_Arrow"].hide();
}
+ } else if (page == "FLTLOG") {
+ if (!pageSwitch[i].getBoolValue()) {
+ me.defaultHideWithCenter();
+
+ me["Simple_L0S"].hide();
+ me["ArrowLeft"].hide();
+ me["ArrowRight"].hide();
+
+ me.showLeft(1, 1, 1, 1, 1, -1);
+ me.showLeftS(1, -1, 1, 1, 1, -1);
+ me.showLeftArrow(-1, -1, -1, -1, -1, -1);
+ me.showCenter(-1, 1, 1, 1, 1, -1);
+ me.showCenterS(-1, 1, 1, 1, 1, -1);
+ me.showRight(1, 1, 1, 1, 1, -1);
+ me.showRightS(1, 1, 1, 1, 1, -1);
+ me.showRightArrow(-1, -1, -1, -1, 1, -1);
+ me["Simple_C3B"].hide();
+ me["Simple_C4B"].hide();
+
+ me.standardFontSize();
+ me.standardFontColour();
+ me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
+ me.colorCenter("wht", "wht", "wht", "wht", "wht", "wht");
+
+ #me["PRINTPAGE"] - TODO missing asterisk at 5L - only useful when printing available
+
+ me["Simple_L1S"].setText(" FLT NUM-DATE");
+ me["Simple_R1S"].setText("ORIG-DEST ");
+ me["Simple_L1"].setFontSize(small);
+ me["Simple_R1"].setFontSize(small);
+ me["Simple_L2"].setFontSize(small);
+ me["Simple_C2"].setFontSize(small);
+ me["Simple_R2"].setFontSize(small);
+ me["Simple_L3"].setFontSize(small);
+ me["Simple_C3"].setFontSize(small);
+ me["Simple_R3"].setFontSize(small);
+
+ me["Simple_L5"].setText(" PRINT");
+ me["Simple_L5"].setColor(BLUE);
+
+ me["Simple_R5"].setText("SENSORS ");
+ me["Simple_R5"].setColor(WHITE);
+
+ me["Simple_L4"].setFontSize(small);
+ me["Simple_L4"].setText(" FLIGHT");
+ me["Simple_C4"].setFontSize(small);
+ me["Simple_C4"].setText("--TIMES--");
+ me["Simple_R4"].setFontSize(small);
+ me["Simple_R4"].setText("BLOCK ");
+
+ me["Simple_C2S"].setText("TIME");
+ me["Simple_R2S"].setText("FOB ");
+
+ me["Simple_L2"].setText( " OUT -");
+ me["Simple_L3S"].setText(" OFF -");
+ me["Simple_L3"].setText( " ON -");
+ me["Simple_L4S"].setText(" IN -");
+
+ me["Simple_C5"].setFontSize(small);
+
+ pageSwitch[i].setBoolValue(1);
+ }
+
+ var logid = 1; #mcdu.FlightLogDatabase.getPageSize(); - one page only - TODO: multi pages
+ if (logid == 0) logid = 1;
+
+ me.showPageNumbersOnly(1,1);
+ me["Simple_Title"].setText(sprintf("FLT LOG.%04d",logid));
+
+ me["Simple_C2"].setText( "--.--"); #TODO - missing ":" char on fontset
+ me["Simple_C3S"].setText("--.--");
+ me["Simple_C3"].setText( "--.--");
+ me["Simple_C4S"].setText("--.--");
+ me["Simple_R2"].setText( "---.- ");
+ me["Simple_R3S"].setText("---.- ");
+ me["Simple_R3"].setText( "---.- ");
+ me["Simple_R4S"].setText("---.- ");
+ me.colorCenter("wht", "grn", "grn", "wht", "wht", "wht");
+ me.colorRight("wht", "grn", "grn", "wht", "wht", "wht");
+ me.colorLeftS("wht", "wht", "wht", "wht", "grn", "wht");
+ me.colorCenterS("wht", "wht", "grn", "grn", "grn", "wht");
+ me.colorRightS("wht", "wht", "grn", "grn", "grn", "wht");
+
+ var rowsC = ["Simple_C2","Simple_C3S","Simple_C3","Simple_C4S"];
+ var rowsR = ["Simple_R2","Simple_R3S","Simple_R3","Simple_R4S"];
+ var logs = mcdu.FlightLogDatabase.getLogByPage(logid);
+ var len = size(logs);
+ var flgtime = 0;
+ var blktime = 0;
+ for ( var i = 0; i < len; i = i + 1 ) {
+ if (logs[i] != nil) { # only valid reports
+ var p = logs[i].state;
+ if (p == 4) p = 3; # RETURN-IN
+ me[rowsC[p]].setText(logs[i].time);
+ me[rowsR[p]].setText(sprintf("%3.1f ",logs[i].fob));
+ }
+ }
+
+ var logpage = mcdu.FlightLogDatabase.getPage(logid);
+
+ me["Simple_L1"].setText(sprintf("%8s - ",logpage.fltnum) ~ logpage.date);
+ me["Simple_R1"].setText(logpage.tofrom ~ " ");
+
+ me["Simple_L5S"].setText( " " ~ logpage.flttime );
+ me["Simple_C5S"].setText(sprintf("%02.0f", getprop("/sim/time/utc/hour")) ~ "." ~ sprintf("%02.0f", getprop("/sim/time/utc/minute")) ~ "." ~ sprintf("%02.0f", getprop("/sim/time/utc/second")));
+ me["Simple_R5S"].setText( logpage.blktime ~ " " );
+
+ var fltstate = logpage.fltstate;
+ if (fltstate == "") {
+ fltstate = (fmgc.FMGCInternal.toFromSet) ? "BEGIN" : "RESET"; #CHECKME - my best guess, only ready when plan inserted
+ #TODO Pushback detection -> WPUSH state???
+ }
+ me["Simple_C5"].setText(fltstate);
+
+ } else if (page == "SENSORS") {
+ if (!pageSwitch[i].getBoolValue()) {
+ me.defaultHide();
+ me["Simple_Title"].setText("SENSORS ");
+ me.defaultPageNumbers();
+ me["Simple_L0S"].hide();
+
+ me.showLeft(1, 1, 1, 1, 1, 1);
+ me.showLeftS(1, 1, 1, 1, -1, -1);
+ me.showLeftArrow(-1, -1, -1, -1, -1, 1);
+ me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
+ me.showRight(1, 1, 1, 1, -1, -1);
+ me.showRightS(1, 1, 1, 1, -1, -1);
+ me.showRightArrow(-1, -1, -1, -1, -1, -1);
+
+ #me["PRINTPAGE"] - TODO missing asterisk at 5L - only useful when printing available
+
+ me.standardFontSize();
+ me.standardFontColour();
+
+ me["Simple_L1"].setFontSize(small);
+ me["Simple_R1"].setFontSize(small);
+ me["Simple_L2"].setFontSize(small);
+ me["Simple_R2"].setFontSize(small);
+ me["Simple_L3"].setFontSize(small);
+ me["Simple_R3"].setFontSize(small);
+ me["Simple_L4"].setFontSize(small);
+ me["Simple_R4"].setFontSize(small);
+
+ me.colorRight("grn", "grn", "grn", "grn", "grn", "grn");
+ me.colorRightS("grn", "grn", "grn", "grn", "grn", "grn");
+
+ me["Simple_L1S"].setText(" PARK BRAKE");
+ me["Simple_L1"].setText( " NOSE STRUT");
+ me["Simple_L2S"].setText( " L FWD DOOR");
+ me["Simple_L2"].setText( " R FWD DOOR");
+ me["Simple_L3S"].setText( " L AFT DOOR");
+ me["Simple_L3"].setText( " R AFT DOOR");
+ me["Simple_L4S"].setText( " GND SPEED");
+ me["Simple_L4"].setText( " FOB");
+
+ me["Simple_L5"].setText(" PRINT");
+ me["Simple_L5"].setColor(BLUE);
+
+ me["Simple_L6"].setText(" RETURN");
+
+ pageSwitch[i].setBoolValue(1);
+ }
+
+ me["Simple_R1S"].setText(sprintf("%-10s",(parking_brake.getValue() == 1) ? "SET" : "RELEASED"));
+ me["Simple_R1"].setText(sprintf("%-10s",(gear0_wow.getValue() == 1) ? "GROUND" : "FLIGHT"));
+ me["Simple_R2S"].setText(sprintf("%-10s",(doorL1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
+ me["Simple_R2"].setText(sprintf("%-10s",(doorR1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
+ me["Simple_R3S"].setText(sprintf("%-10s",(doorL4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
+ me["Simple_R3"].setText(sprintf("%-10s",(doorR4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
+ me["Simple_R4S"].setText(sprintf("%-10s",sprintf("%03.3f",pts.Velocities.groundspeed.getValue())));
+ me["Simple_R4"].setText(sprintf("%-10s",sprintf("%03.1f",fmgc.FMGCInternal.fob)));
+
} else if (page == "AOCCONFIG") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@@ -914,7 +1116,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("ATC MENU");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@@ -960,7 +1162,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("TEXT");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@@ -1051,7 +1253,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("ATC MENU");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("2/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@@ -1148,7 +1350,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("ATS623 ATIS MENU");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
@@ -1836,9 +2038,9 @@ var canvas_MCDU_base = {
me["Simple_Title"].setText(sprintf("%s", " " ~ acType.getValue()));
me.defaultPageNumbers();
- me.showLeft(1, 1, 1, -1, 1, 1);
+ me.showLeft(1, 1, 1, -1, -1, 1);
me["Simple_L0S"].hide();
- me.showLeftS(1, 1, 1, -1, 1, 1);
+ me.showLeftS(1, 1, 1, -1, -1, 1);
me.showLeftArrow(-1, -1, 1, -1, -1, -1);
me.showRight(-1, 1, -1, 1, 1, 1);
me.showRightS(-1, -1, -1, 1, 1, 1);
@@ -1861,13 +2063,19 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "grn", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
-
- me["Simple_L5"].setText("[ ]");
+ if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { # only on preflight and done phases
+ me["Simple_L5S"].setText("CHG CODE");
+ me["Simple_L5S"].show();
+ me["Simple_L5"].setText("[ ]");
+ me["Simple_L5"].show();
+ } else {
+ me["Simple_L5"].hide();
+ }
+
me["Simple_L6"].setText(sprintf("%s/%s",idleFactor.getValue(),perfFactor.getValue()));
me["Simple_L1S"].setText(" ENG");
me["Simple_L2S"].setText(" ACTIVE NAV DATA BASE");
- me["Simple_L3S"].setText(" SECOND NAV DATA BASE");
- me["Simple_L5S"].setText("CHG CODE");
+ me["Simple_L3S"].setText(" SECOND NAV DATA BASE");
me["Simple_L6S"].setText("IDLE/PERF");
me["Simple_R6"].setText("STATUS/XLOAD ");
me["Simple_R6S"].setText("SOFTWARE ");
@@ -1918,7 +2126,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("DATA INDEX");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@@ -1958,7 +2166,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("DATA INDEX");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("2/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@@ -2239,7 +2447,7 @@ var canvas_MCDU_base = {
me["PERFGA"].hide();
me["Simple_Title"].show();
me["Simple_Title"].setText("INIT");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
@@ -2283,12 +2491,12 @@ var canvas_MCDU_base = {
if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.costIndexSet) {
me["INITA_CostIndex"].hide();
- me["Simple_L5"].setColor(1,1,1);
+ me["Simple_L5"].setColor(WHITE);
me["Simple_L5"].show();
me["Simple_L5"].setText("---");
} else if (fmgc.FMGCInternal.costIndexSet) {
me["INITA_CostIndex"].hide();
- me["Simple_L5"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L5"].setColor(BLUE);
me["Simple_L5"].show();
me["Simple_L5"].setText(sprintf("%s", fmgc.FMGCInternal.costIndex));
} else {
@@ -2297,28 +2505,40 @@ var canvas_MCDU_base = {
}
if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.crzSet) {
me["INITA_CruiseFLTemp"].hide();
- me["Simple_L6"].setColor(1,1,1);
+ me["Simple_L6"].setColor(WHITE);
me["Simple_L6"].setText("-----/---g");
} else if (fmgc.FMGCInternal.crzSet and fmgc.FMGCInternal.crzTempSet) {
me["INITA_CruiseFLTemp"].hide();
- me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L6"].setColor(BLUE);
me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp));
} else if (fmgc.FMGCInternal.crzSet) {
me["INITA_CruiseFLTemp"].hide();
- me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L6"].setColor(BLUE);
fmgc.FMGCInternal.crzTemp = 15 - (2 * fmgc.FMGCInternal.crzFl / 10);
fmgc.FMGCInternal.crzTempSet = 1;
me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp));
} else {
me["INITA_CruiseFLTemp"].show();
- me["Simple_L6"].setColor(0.7333,0.3803,0);
+ me["Simple_L6"].setColor(AMBER);
me["Simple_L6"].setText(" g");
}
+
+ if (fmgc.FMGCInternal.coRouteSet) { # show coRoute when valid
+ me["INITA_CoRoute"].hide();
+ me["Simple_L1"].setText(fmgc.FMGCInternal.coRoute);
+ me["Simple_L1"].setColor(BLUE);
+ me["Simple_L1"].show();
+ } else {
+ me["Simple_L1"].hide();
+ me["INITA_CoRoute"].show();
+ me["Simple_L1"].setText("NONE");
+ }
+
if (fmgc.FMGCInternal.toFromSet) {
me["INITA_CoRoute"].hide();
me["INITA_FromTo"].hide();
me["Simple_L1"].show();
- me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L2"].setColor(BLUE);
if (fmgc.FMGCInternal.altAirportSet) {
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
} else {
@@ -2331,7 +2551,7 @@ var canvas_MCDU_base = {
me["INITA_CoRoute"].show();
me["INITA_FromTo"].show();
me["Simple_L1"].hide();
- me["Simple_L2"].setColor(1,1,1);
+ me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText("----/----------");
me.showRight(-1, 1, 0, 0, 0, 0);
me["Simple_R2S"].show();
@@ -2375,7 +2595,7 @@ var canvas_MCDU_base = {
me["Simple_L3S"].setText("FLT NBR");
me["Simple_L5S"].setText("COST INDEX");
me["Simple_L6S"].setText("CRZ FL/TEMP");
- me["Simple_L1"].setText("NONE");
+ #me["Simple_L1"].setText("NONE"); # manage before (coRoute)
me["Simple_L3"].setText(sprintf("%s", fmgc.FMGCInternal.flightNum));
me["Simple_R1S"].setText("FROM/TO ");
me["Simple_R2S"].setText("INIT ");
@@ -2677,7 +2897,7 @@ var canvas_MCDU_base = {
me["Simple_R5"].setText(fmgc.FMGCInternal.tripWind);
me["Simple_R6S"].setText("EXTRA/TIME");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
if (!fmgc.FMGCInternal.fuelRequest) {
me["Simple_L2"].setText("---.-/----");
@@ -2717,7 +2937,7 @@ var canvas_MCDU_base = {
me["Simple_R6"].setText("---.-/----");
me["Simple_Title"].setText("INIT");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me.colorLeft("ack", "wht", "wht", "wht", "wht", "wht");
me.colorRight("ack", "blu", "amb", "wht", "ack", "wht");
@@ -3070,7 +3290,7 @@ var canvas_MCDU_base = {
me["PERFGA"].hide();
me["Simple_Title"].show();
me["Simple_Title"].setText("FUEL PRED");
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
@@ -3398,7 +3618,7 @@ var canvas_MCDU_base = {
}
me["Simple_Title"].show();
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
@@ -3581,9 +3801,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 1) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
}
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
@@ -3712,7 +3932,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 2) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
me.showLeft(0, 0, 0, 0, 1, 0);
me.showLeftS(0, 0, 0, 0, 1, 0);
me.showLeftArrow(0, 0, 0, 0, 1, 1);
@@ -3753,7 +3973,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me.showLeft(0, 0, 0, 0, -1, 0);
me.showLeftS(0, 0, 0, 0, -1, 0);
me.showLeftArrow(0, 0, 0, 0, -1, 0);
@@ -3787,10 +4007,10 @@ var canvas_MCDU_base = {
me["Simple_L2S"].setText(" CI");
if (fmgc.FMGCInternal.costIndexSet) {
- me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
} else {
- me["Simple_L2"].setColor(1,1,1);
+ me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@@ -3865,7 +4085,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 3) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
if (managedSpeed.getValue() == 1) {
me.showLeft(0, 0, 0, -1, 0, 0);
@@ -3900,7 +4120,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me.colorLeft("ack", "ack", "ack", "ack", "ack", "wht");
me.colorLeftS("ack", "ack", "ack", "ack", "ack", "wht");
@@ -3927,10 +4147,10 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.costIndexSet) {
- me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
} else {
- me["Simple_L2"].setColor(1,1,1);
+ me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@@ -4003,7 +4223,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 4) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
me.showLeft(0, 0, 0, 0, 1, 0);
me.showRight(0, 1, 0, 1, 0, 0);
me.showRightS(0, 0, 1, 0, 0, 0);
@@ -4043,7 +4263,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
me.showLeft(0, 0, 0, 0, -1, 0);
me.showRight(0, -1, 0, -1, 0, 0);
me.showRightS(0, 0, -1, 0, 0, 0);
@@ -4075,10 +4295,10 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.costIndexSet) {
- me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
+ me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %2.0f", fmgc.FMGCInternal.costIndex));
} else {
- me["Simple_L2"].setColor(1,1,1);
+ me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@@ -4159,9 +4379,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 5) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
}
me["Simple_L0S"].setText("DEST");
@@ -4342,9 +4562,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 6) {
- me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
+ me["Simple_Title"].setColor(GREEN);
} else {
- me["Simple_Title"].setColor(1, 1, 1);
+ me["Simple_Title"].setColor(WHITE);
}
if (thrAccSet.getValue() == 1) {
diff --git a/Models/Instruments/MCDU/MCDU1.xml b/Models/Instruments/MCDU/MCDU1.xml
index 51439c6d..1b7c9182 100644
--- a/Models/Instruments/MCDU/MCDU1.xml
+++ b/Models/Instruments/MCDU/MCDU1.xml
@@ -1705,7 +1705,7 @@
true
nasal
-
+
@@ -1719,6 +1719,24 @@
+
+
+ nasal
+
+
+
+
+ systems/electrical/bus/ac-1
+ 110
+
+
+ controls/lighting/DU/mcdu1
+ 0.01
+
+
+
+
+
diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml
index 38324cf0..78516b3e 100644
--- a/Models/Instruments/MCDU/MCDU2.xml
+++ b/Models/Instruments/MCDU/MCDU2.xml
@@ -1705,7 +1705,7 @@
true
nasal
-
+
@@ -1719,6 +1719,24 @@
+
+
+ nasal
+
+
+
+
+ systems/electrical/bus/ac-2
+ 110
+
+
+ controls/lighting/DU/mcdu2
+ 0.01
+
+
+
+
+
diff --git a/Models/Liveries/A320/CFM/example.xml b/Models/Liveries/A320/CFM/example.xml
deleted file mode 100644
index 6e12cadc..00000000
--- a/Models/Liveries/A320/CFM/example.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
- ICAO Airline Name (Extra Info)
- Liveries/A320/CFM/texture.png
- Liveries/A320/CFM/texture.png
-
-
-
-
-
- CFM56-5B4
- A320-214
- 1
-
- +0.0
- +1.0
-
-
- AB-CDE
- ABC
- DE
- 0
- 0
- 0
-
-
-
diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas
index 5dfef46a..8b36cd6b 100644
--- a/Nasal/FMGC/FMGC.nas
+++ b/Nasal/FMGC/FMGC.nas
@@ -167,6 +167,8 @@ var FMGCInternal = {
altAirportSet: 0,
altSelected: 0,
arrApt: "",
+ coRoute: "",
+ coRouteSet: 0,
costIndex: 0,
costIndexSet: 0,
crzFt: 10000,
@@ -307,6 +309,7 @@ var updateArptLatLon = func {
updateRouteManagerAlt = func() {
setprop("autopilot/route-manager/cruise/altitude-ft", FMGCInternal.crzFt);
+ # TODO - update FMGCInternal.phase when DES to re-enter in CLIMB/CRUIZE
};
########
@@ -968,6 +971,7 @@ var reset_FMGC = func {
mcdu.MCDU_reset(0);
mcdu.MCDU_reset(1);
mcdu.ReceivedMessagesDatabase.clearDatabase();
+ mcdu.FlightLogDatabase.clearDatabase();
Input.fd1.setValue(fd1);
Input.fd2.setValue(fd2);
diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas
index c563d9aa..1dc01602 100644
--- a/Nasal/FMGC/SimbriefParser.nas
+++ b/Nasal/FMGC/SimbriefParser.nas
@@ -1,5 +1,6 @@
# A3XX Simbrief Parser
# Copyright (c) 2020 Jonathan Redpath (legoboyvdlp)
+# enhanceded 12/2020 - parse TOD & TOC psedo waypoints, set computer speeds on fix wps, fake coRoute name
var LBS2KGS = 0.4535924;
@@ -157,12 +158,16 @@ var SimbriefParser = {
if (ident == "TOC") {
_foundTOC = 1;
- continue;
+ #setprop("/autopilot/route-manager/vnav/tc/latitude-deg",ofpFix.getNode("pos_lat").getValue());
+ #setprop("/autopilot/route-manager/vnav/tc/longitude-deg",ofpFix.getNode("pos_long").getValue());
+ #ident = "(T/C)";
}
if (ident == "TOD") {
_foundTOD = 1;
- continue;
+ #setprop("/autopilot/route-manager/vnav/td/latitude-deg",ofpFix.getNode("pos_lat").getValue());
+ #setprop("/autopilot/route-manager/vnav/td/longitude-deg",ofpFix.getNode("pos_long").getValue());
+ #ident = "(T/D)";
}
coords = geo.Coord.new();
@@ -189,6 +194,34 @@ var SimbriefParser = {
fmgc.flightPlanController.flightplans[3].star = _star;
}
fmgc.flightPlanController.destroyTemporaryFlightPlan(3, 1);
+
+ #var idx = 1;
+ #var plan = fmgc.flightPlanController.flightplans[2];
+ #var altitude = "";
+ #var speed = "";
+ #var wpname = "";
+
+ #foreach (var ofpFix; ofpFixes) {
+ # ident = ofpFix.getNode("ident").getValue();
+
+ # if (ident == "TOC") wpname = "(T/C)";
+ # else if (ident == "TOD") wpname = "(T/D)";
+ # else wpname = ident;
+
+ # wp = plan.getWP(idx); # get leg
+ # if (wp != nil) {
+ # if (wp.wp_name == wpname) {
+ # altitude = ofpFix.getNode("altitude_feet").getValue();
+ # speed = ofpFix.getNode("ind_airspeed").getValue();
+
+ # if (speed>0) wp.setSpeed(speed, "computed");
+ # if (altitude>0) wp.setAltitude(math.round(altitude, 10), "computed");
+#
+# idx = idx + 1;
+# }
+# }
+# }
+
fmgc.windController.updatePlans();
fmgc.updateRouteManagerAlt();
@@ -199,6 +232,8 @@ var SimbriefParser = {
if (me.buildFlightplan() == nil) {
return nil;
}
+ #fmgc.FMGCInternal.coRoute = "SB" ~ me.OFP.getNode("origin/iata_code").getValue() ~ me.OFP.getNode("destination/iata_code").getValue() ~ "00";
+ #fmgc.FMGCInternal.coRouteSet = 1;
fmgc.FMGCInternal.flightNum = (me.OFP.getNode("general/icao_airline").getValue() or "") ~ (me.OFP.getNode("general/flight_number").getValue() or "");
fmgc.FMGCInternal.flightNumSet = 1;
fmgc.FMGCInternal.costIndex = me.OFP.getNode("general/costindex").getValue();
diff --git a/Nasal/FMGC/mcdu-messages.nas b/Nasal/FMGC/mcdu-messages.nas
index 8ac87b43..3c036d2c 100644
--- a/Nasal/FMGC/mcdu-messages.nas
+++ b/Nasal/FMGC/mcdu-messages.nas
@@ -69,6 +69,7 @@ var scratchpadController = {
sp.scratchpadColour = "wht";
sp.showTypeIMsg = 0;
sp.showTypeIIMsg = 0;
+ sp.clrmode = 0; # 1 = CLR mode
sp.mcdu = mcdu;
return sp;
},
@@ -88,6 +89,11 @@ var scratchpadController = {
me.clearTypeI();
}
+ if (me.clrmode == 1) { # prevent add chars in CLR mode
+ me.clear();
+ }
+ else if (character == "CLR") me.clrmode = 1;
+
me.scratchpad = me.scratchpad ~ character;
me.scratchpadColour = "wht";
me.update();
@@ -140,6 +146,7 @@ var scratchpadController = {
},
empty: func() {
me.scratchpad = "";
+ me.clrmode = 0;
me.update();
},
clear: func() {
@@ -173,12 +180,16 @@ var MessageController = {
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),TypeIMessage.new("RWY/LS MISMATCH"),
TypeIMessage.new("VHF3 VOICE MSG NOT GEN"),TypeIMessage.new("NO COMM MSG NOT GEN"),TypeIMessage.new("WX UPLINK"),
TypeIMessage.new("SIMBRIEF DOWNLOAD FAILED"),TypeIMessage.new("MISSING USERNAME"),TypeIMessage.new("AOC ACT F-PLN UPLINK"),
- TypeIMessage.new("NO ANSWER TO REQUEST"),TypeIMessage.new("NO D-ATIS AVAILABLE"),TypeIMessage.new("BAD SERVER RESPONSE")
+ TypeIMessage.new("NO ANSWER TO REQUEST"),TypeIMessage.new("NO D-ATIS AVAILABLE"),TypeIMessage.new("BAD SERVER RESPONSE"),
+ TypeIMessage.new("WIND DATA UPLINK"),TypeIMessage.new("CHECK ALT WIND"),TypeIMessage.new("INVALID WIND UPLINK"),TypeIMessage.new("WIND UPLINK EXISTS"), #p.533
+ TypeIMessage.new("FM DATALINK UNAVAIL"),TypeIMessage.new("NOT XMITTED TO ACARS"), #p.559
+ TypeIMessage.new("PRINTER NOT AVAILABLE"),
]),
typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0),
TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0),
+ TypeIIMessage.new("CHECK DEST DATA", "amb", 0), #p.533
]),
# to speed to low - new on a320, margin against vmcg / vs1g
diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas
index f086d6fd..f3cab9a5 100644
--- a/Nasal/MCDU/F-PLN.nas
+++ b/Nasal/MCDU/F-PLN.nas
@@ -68,9 +68,21 @@ var fplnItem = {
me.spd = me.getSpd();
me.alt = me.getAlt();
me.dist = me.getDist();
- me._colour = "wht";
- if (me.spd[1] != "wht" or me.alt[1] != "wht") {
- me._colour = "mag";
+ if (me.colour != "yel") { # not temporary flightplan
+ me._colour = "wht";
+ #if (me.spd[1] != "wht" or me.alt[1] != "wht") {
+ if (me.spd[1] == me.alt[1]) {
+ me._colour = me.spd[1];
+ }
+ else if (me.spd[1] == "mag" or me.alt[1] == "mag") {
+ me._colour = "mag";
+ }
+ else if (me.spd[1] == "grn" or me.alt[1] == "grn") {
+ me._colour = "grn";
+ }
+
+ } else { # temporary flightplan
+ me._colour = "yel";
}
return [me.spd[0] ~ "/" ~ me.alt[0], " " ~ me.dist ~ "NM ", me._colour];
} else {
@@ -95,23 +107,25 @@ var fplnItem = {
},
getSpd: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.FMGCInternal.v1set) {
- return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "mag"];
- } elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr != 0) {
- return [sprintf("%3.0f", me.wp.speed_cstr), "mag"];
+ return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "grn"]; # why "mag"? I think "grn"
+ } elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr > 0) {
+ var tcol = (me.wp.speed_cstr_type == "computed" or me.wp.speed_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
+ return [sprintf("%3.0f", me.wp.speed_cstr), tcol];
} else {
return ["---", "wht"];
}
},
getAlt: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.flightPlanController.flightplans[me.plan].departure != nil) {
- return [" " ~ sprintf("%-5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "mag"];
+ return [" " ~ sprintf("%5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "grn"]; #fixed - aligned to right
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) {
return [" " ~ fmgc.flightPlanController.fromWptAlt, "mag"];
- } elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr != 0) {
+ } elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr > 0) {
+ var tcol = (me.wp.alt_cstr_type == "computed" or me.wp.alt_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) {
- return [" " ~ sprintf("%-5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), "mag"];
+ return [" " ~ sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), tcol]; #fixed - aligned to right
} else {
- return [" " ~ sprintf("%-5.0f", me.wp.alt_cstr), "mag"];
+ return [" " ~ sprintf("%5.0f", me.wp.alt_cstr), tcol]; #fixed - aligned to right
}
} else {
return ["------", "wht"];
@@ -337,7 +351,7 @@ var fplnPage = { # this one is only created once, and then updated - remember th
if (size(me.outputList) >= 1) {
me.L1 = me.outputList[0].updateLeftText();
me.C1 = me.outputList[0].updateCenterText();
- me.C1[1] = "TIME ";
+ me.C1[1] = (fmgc.flightPlanController.fromWptTime != nil) ? "UTC " : "TIME "; # since TO change to UTC time (1 space left to center)
me.R1 = me.outputList[0].updateRightText();
me.R1[1] = "SPD/ALT ";
} else {
diff --git a/Nasal/MCDU/FLIGHTLOG.nas b/Nasal/MCDU/FLIGHTLOG.nas
new file mode 100644
index 00000000..81af304e
--- /dev/null
+++ b/Nasal/MCDU/FLIGHTLOG.nas
@@ -0,0 +1,161 @@
+# AOC Flight Log system
+# Basic OOOI system implementation
+
+var OOOIReport = {
+ new: func(state,fob="",time="") {
+ var report = {parents:[OOOIReport]};
+ report.state = state;
+ report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob;
+ report.time = (time != "") ? time : sprintf("%02d.%02d", getprop("/sim/time/utc/hour"), getprop("/sim/time/utc/minute"));
+ report.elapsed = int(getprop("/sim/time/elapsed-sec"));
+ report.gmt = getprop("/sim/time/gmt-string");
+ report.date = getprop("/sim/time/utc/day");
+ report.fltnum = (fmgc.FMGCInternal.flightNumSet == 1) ? fmgc.FMGCInternal.flightNum : "----";
+ report.tofrom = (fmgc.FMGCInternal.toFromSet) ? fmgc.FMGCInternal.depApt ~ "-" ~ fmgc.FMGCInternal.arrApt : "----/----";
+ return report;
+ },
+};
+
+# Flight phase states: RESET, BEGIN, WPUSH, OUT, OFF, ON, END
+
+var OOOIReportPage = {
+ new: func(index) {
+ var page = {parents:[OOOIReportPage]};
+ page.index = index;
+ page.fltstate = ""; #UNDEF state RESET/BEGIN/WPUSH
+ page.fltnum = (fmgc.FMGCInternal.flightNumSet == 1) ? fmgc.FMGCInternal.flightNum : "";
+ page.date = getprop("/sim/time/utc/day");
+ page.tofrom = (fmgc.FMGCInternal.toFromSet) ? fmgc.FMGCInternal.depApt ~ "-" ~ fmgc.FMGCInternal.arrApt : "";
+ page.fltstart = 0;
+ page.blkstart = 0;
+ page.flttime = "--.--";
+ page.blktime = "--.--";
+ return page;
+ },
+};
+
+var formatSecToHHMM = func(sec) {
+ var mn = int(sec / 60);
+ return sprintf("%02d.%02d",int(mn/60),math.mod(mn,60));
+}
+
+var FlightLogDatabase = {
+ database: std.Vector.new(),
+ pages: std.Vector.new(),
+ addReport: func(report) {
+ if (report.state == 0) me.pages.append( OOOIReportPage.new(me.getSize()) );
+ me.database.append(report);
+ var pg = me.pages.vector[me.pages.size()-1];
+ pg.fltnum = report.fltnum;
+ pg.tofrom = report.tofrom;
+ if (report.state == 0) {
+ pg.fltstate = "OUT";
+ pg.blkstart = report.elapsed;
+ }
+ else if (report.state == 1) {
+ pg.fltstate = "OFF";
+ pg.fltstart = report.elapsed;
+ }
+ else if (report.state == 2) {
+ pg.fltstate = "ON";
+ if (pg.fltstart > 0) pg.flttime = formatSecToHHMM(report.elapsed - pg.fltstart);
+ }
+ else if (report.state > 2) {
+ pg.fltstate = "END";
+ if (pg.blkstart > 0) pg.blktime = formatSecToHHMM(report.elapsed - pg.blkstart);
+ }
+ },
+ getSize: func() {
+ return me.database.size();
+ },
+ getPageSize: func() {
+ return me.pages.size();
+ },
+ clearDatabase: func() {
+ me.database.clear();
+ me.pages.clear();
+ },
+ getLogs: func() {
+ var lst = [];
+ foreach (var log; me.database) {
+ append(lst,log);
+ }
+ return lst;
+ },
+ getPage: func(pg) {
+ return (pg<=me.getPageSize()) ? me.pages.vector[pg-1] : OOOIReportPage.new(0);
+ },
+ getLogByPage: func(no) {
+ var lst = [nil,nil,nil,nil];
+ if (me.getPageSize() == 0) return lst;
+ var i = (me.getPageSize()>=no) ? me.pages.vector[no-1].index : 0;
+ var len = me.getSize();
+ var v = 0;
+ var p = 0;
+ while (i9) { # imho - it's useful few speed tollerance, 10kts min speed on taxiways - CHECKME - better with pushback detection?
+ FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
+ expectedOOOIState = 1;
+ }
+ }
+ } else if (expectedOOOIState == 1) { # OFF
+ if (!gear0) {
+ FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
+ expectedOOOIState = 2;
+ }
+ else if (gs < 1) { # RETURN-IN ?? - rejected takeoff, A/C back to apron - CHECKME
+ if (doorL1_pos.getValue()>0 or doorR1_pos.getValue()>0 or doorL4_pos.getValue()>0 or doorR4_pos.getValue()>0) {
+ FlightLogDatabase.addReport(OOOIReport.new(4)); # RETURN-IN
+ expectedOOOIState = 0;
+ }
+ }
+ } else if (expectedOOOIState == 2) { # ON
+ if (gear0 and (phase == 7 or phase == 0)) { #done or preflight
+ FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
+ expectedOOOIState = 3;
+ }
+ } else if (expectedOOOIState == 3) { # IN
+ if (gear0 and gs < 1) {
+ if (doorL1_pos.getValue()>0 or doorR1_pos.getValue()>0 or doorL4_pos.getValue()>0 or doorR4_pos.getValue()>0) {
+ FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
+ expectedOOOIState = 0;
+ }
+ }
+ }
+
+});
+
+var engine_one_chk_OOOI = setlistener("/engines/engine[0]/state", func {
+ if (getprop("/engines/engine[0]/state") == 3) {
+ removelistener(engine_one_chk_OOOI);
+ waitingOOOIChange.start();
+ }
+},0,0);
\ No newline at end of file
diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas
index e734af23..00e02637 100644
--- a/Nasal/MCDU/INITA.nas
+++ b/Nasal/MCDU/INITA.nas
@@ -5,7 +5,40 @@
var initInputA = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
- if (key == "L2") {
+ if (key == "L1") { #clear coRoute if set
+ if (scratchpad == "CLR") {
+ if (fmgc.FMGCInternal.coRouteSet == 1) {
+ fmgc.FMGCInternal.coRouteSet = 0;
+ fmgc.FMGCInternal.coRoute = "";
+ fmgc.FMGCInternal.depApt = "";
+ fmgc.FMGCInternal.arrApt = "";
+ fmgc.FMGCInternal.toFromSet = 0;
+ fmgc.FMGCNodes.toFromSet.setValue(0);
+ fmgc.windController.resetDesWinds();
+ setprop("/FMGC/internal/align-ref-lat", 0);
+ setprop("/FMGC/internal/align-ref-long", 0);
+ setprop("/FMGC/internal/align-ref-lat-edit", 0);
+ setprop("/FMGC/internal/align-ref-long-edit", 0);
+ if (fmgc.FMGCInternal.blockConfirmed) {
+ fmgc.FMGCInternal.fuelCalculating = 0;
+ fmgc.fuelCalculating.setValue(0);
+ fmgc.FMGCInternal.fuelCalculating = 1;
+ fmgc.fuelCalculating.setValue(1);
+ }
+ fmgc.flightPlanController.reset(2);
+ fmgc.flightPlanController.init();
+ Simbrief.SimbriefParser.inhibit = 0;
+ }
+ mcdu_scratchpad.scratchpads[i].empty();
+ } else {
+ var len = size(scratchpad);
+ if (fmgc.FMGCInternal.coRouteSet == 1 or len != 10) {
+ mcdu_message(i, "NOT ALLOWED");
+ } else {
+ mcdu_message(i, "NOT IN DATA BASE"); # fake message - TODO flightplan loader
+ }
+ }
+ } else if (key == "L2") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.altAirport = "";
fmgc.FMGCInternal.altAirportSet = 0;
@@ -183,7 +216,10 @@ var initInputA = func(key, i) {
}
}
} else if (key == "R1") {
- if (scratchpad == "CLR") {
+ if (fmgc.FMGCInternal.coRouteSet == 1) {
+ mcdu_message(i, "NOT ALLOWED");
+ }
+ else if (scratchpad == "CLR") {
fmgc.FMGCInternal.depApt = "";
fmgc.FMGCInternal.arrApt = "";
fmgc.FMGCInternal.toFromSet = 0;
diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas
index 2a222b81..3d2cdc99 100644
--- a/Nasal/MCDU/MCDU.nas
+++ b/Nasal/MCDU/MCDU.nas
@@ -18,6 +18,7 @@ var MCDU_reset = func(i) {
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK");
+ setprop("/MCDU[" ~ i ~ "]/active-system","");
pageNode[i].setValue("MCDU");
setprop("/FMGC/keyboard-left", 0);
@@ -75,6 +76,8 @@ var MCDU_reset = func(i) {
fmgc.FMGCInternal.gndTempSet = 0;
fmgc.FMGCInternal.toFromSet = 0;
fmgc.FMGCNodes.toFromSet.setValue(0);
+ fmgc.FMGCInternal.coRoute = "";
+ fmgc.FMGCInternal.coRouteSet = 0;
fmgc.FMGCInternal.tropo = 36090;
fmgc.FMGCInternal.tropoSet = 0;
@@ -216,9 +219,11 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/active", 2);
+ setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
}, 2);
- } else {
+ } else {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
+ setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
mcdu_scratchpad.scratchpads[i].empty();
}
}
@@ -372,9 +377,11 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
+ setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
}, 2);
} else {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
+ setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
mcdu_scratchpad.scratchpads[i].empty();
}
}
@@ -795,6 +802,8 @@ var lskbutton = func(btn, i) {
mcdu_scratchpad.scratchpads[i].empty();
} else if (page == "ATCMENU") {
pageNode[i].setValue("NOTIFICATION");
+ } else if (page == "FLTLOG") {
+ mcdu_message(i, "NOT ALLOWED");
} else if (page == "MCDUTEXT") {
atsu.freeTexts[i].selection = 9;
atsu.freeTexts[i].changed = 1;
@@ -857,6 +866,8 @@ var lskbutton = func(btn, i) {
canvas_mcdu.myClosestAirport[i].freeze();
} else if (page == "AOCMENU" or page == "ATCMENU" or page == "ATCMENU2") {
pageNode[i].setValue("ATSUDLINK");
+ } else if (page == "SENSORS") {
+ pageNode[i].setValue("FLTLOG");
} else if (page == "NOTIFICATION" or page == "CONNECTSTATUS" or page == "MCDUTEXT") {
pageNode[i].setValue("ATCMENU");
} else if (page == "WEATHERREQ" or page == "RECEIVEDMSGS") {
@@ -943,6 +954,8 @@ var rskbutton = func(btn, i) {
}
} else if (page == "ATSUDLINK") {
pageNode[i].setValue("AOCMENU");
+ } else if (page == "AOCMENU") {
+ pageNode[i].setValue("FLTLOG");
} else if (page == "WEATHERREQ") {
var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i);
if (result == 1) {
@@ -1210,6 +1223,8 @@ var rskbutton = func(btn, i) {
}
} else if (page == "ATCMENU") {
pageNode[i].setValue("CONNECTSTATUS");
+ } else if (page == "FLTLOG") {
+ pageNode[i].setValue("SENSORS");
} else if (page == "WEATHERREQ") {
var result = atsu.AOC.sendReq(i);
if (result == 1) {
@@ -1402,8 +1417,15 @@ var pagebutton = func(btn, i) {
page = pageNode[i].getValue();
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
if (page != "MCDU") {
+
+ # A more flexible system/page tracking for future system expansion
+ if (getprop("/MCDU[" ~ i ~ "]/active-system") == "fmgc") setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
+ else setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
+ if (btn == "atc") setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
+ else setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
+
if (btn == "radnav") {
- pageNode[i].setValue("RADNAV");
+ pageNode[i].setValue("RADNAV");
} else if (btn == "prog") {
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
pageNode[i].setValue("PROGTO");
@@ -1438,12 +1460,13 @@ var pagebutton = func(btn, i) {
} else if (btn == "data") {
pageNode[i].setValue("DATA");
} else if (btn == "mcdu") {
- var page = page;
- if (page != "ATSUDLINK" and page != "AOCMENU" and page != "AOCCONFIG" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "MCDUTEXT" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT" and page != "ATIS" and page != "ATISDETAIL") {
- setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
- } else {
- setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
- }
+ #var page = page;
+ #if (page != "ATSUDLINK" and page != "AOCMENU" and page != "AOCCONFIG" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "MCDUTEXT" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT" and page != "ATIS" and page != "ATISDETAIL") {
+ #if (getprop("/MCDU[0]/active-system") == "fmgc") {
+ # setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
+ #} else {
+ # #setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
+ #}
mcdu_message(i, "SELECT DESIRED SYSTEM");
pageNode[i].setValue("MCDU");
} else if (btn == "f-pln" or btn == "airport") {
@@ -1482,16 +1505,18 @@ var pagebutton = func(btn, i) {
settimer(func(){
pageNode[i].setValue("ATCMENU");
mcdu_scratchpad.scratchpads[i].empty();
- setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
+ setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
}, 2);
} else {
- pageNode[i].setValue("ATCMENU");
+ pageNode[i].setValue("ATCMENU");
}
}
}
}
-var button = func(btn, i) {
+var buttonCLRDown = [0,0]; # counter for down event
+
+var button = func(btn, i, event = "") {
page = pageNode[i].getValue();
if (page != "MCDU") {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
@@ -1500,11 +1525,24 @@ var button = func(btn, i) {
} else if (btn == "SP") {
mcdu_scratchpad.scratchpads[i].addChar(" ");
} else if (btn == "CLR") {
- var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
- if (size(scratchpad) == 0) {
- mcdu_scratchpad.scratchpads[i].addChar("CLR");
- } else {
- mcdu_scratchpad.scratchpads[i].clear();
+ if (event == "down") {
+ if (size(scratchpad) > 0) {
+ if (buttonCLRDown[i] > 4) {
+ mcdu_scratchpad.scratchpads[i].empty();
+ }
+ buttonCLRDown[i] = buttonCLRDown[i] + 1;
+ }
+ }
+ else if (event == "" or buttonCLRDown[i]<=4) {
+ buttonCLRDown[i] = 0;
+ #var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; <- useless??
+ if (size(scratchpad) == 0) {
+ mcdu_scratchpad.scratchpads[i].addChar("CLR");
+ } else {
+ mcdu_scratchpad.scratchpads[i].clear();
+ }
+ } else { # up with buttonCLRDown[i]>4
+ buttonCLRDown[i] = 0;
}
} else if (btn == "DOT") {
mcdu_scratchpad.scratchpads[i].addChar(".");
@@ -1521,6 +1559,12 @@ var mcdu_message = func(i, string, overrideStr = "") {
mcdu_scratchpad.scratchpads[i].override(overrideStr);
}
+# Messagge Type II - TODO 5 messages queue - remove only on resolve
+var mcdu_messageTypeII = func(i, string, overrideStr = "") {
+ mcdu_scratchpad.scratchpads[i].showTypeII(mcdu_scratchpad.MessageController.getTypeIIMsgByText(string));
+ mcdu_scratchpad.scratchpads[i].override(overrideStr);
+}
+
var screenFlash = func(time, i) {
page = pageNode[i].getValue();
pageNode[i].setValue("NONE");
diff --git a/Nasal/MCDU/PERFTO.nas b/Nasal/MCDU/PERFTO.nas
index fc0d92dc..d4cdcd29 100644
--- a/Nasal/MCDU/PERFTO.nas
+++ b/Nasal/MCDU/PERFTO.nas
@@ -3,6 +3,22 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (mattmaring)
+# VMCA 109.5 at 0ft
+# VMCG 106.5 at 0ft all conf
+
+var standard_VMCA = 109.5; # TODO calculate VMCA/VMCG on altitude (ft) of departure airport (read below)
+var standard_VMCG = 106.5;
+
+# TODO - DepArp elevation or current elevation (on ground only!!) -> math.round(fmgc.flightPlanController.flightplans[2].departure.elevation * M2FT))
+
+var perfTOCheckVSpeeds = func(i) {
+ if (fmgc.FMGCInternal.v1set == 1 and fmgc.FMGCInternal.vrset == 1 and fmgc.FMGCInternal.v2set == 1) { # only when v1/vr/v2 all sets
+ if (fmgc.FMGCInternal.v1>fmgc.FMGCInternal.vr or fmgc.FMGCInternal.vr > fmgc.FMGCInternal.v2) mcdu_messageTypeII(i,"V1/VR/V2 DISAGREE");
+ else if (fmgc.FMGCInternal.v1= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) {
- setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
- setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
- setprop("MCDUC/thracc-set", 1);
- mcdu_scratchpad.scratchpads[i].empty();
+
+ if (thrred<=acc) { # validation
+ setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
+ setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
+ setprop("MCDUC/thracc-set", 1);
+ mcdu_scratchpad.scratchpads[i].empty();
+ } else {
+ mcdu_message(i, "NOT ALLOWED");
+ }
} else if (thrreds == 0 and int(acc) != nil and (accs >= 3 and accs <= 5) and acc >= 400 and acc <= 39000) {
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
mcdu_scratchpad.scratchpads[i].empty();
diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml
index 93036bef..753fd20e 100644
--- a/Systems/a320-fcs.xml
+++ b/Systems/a320-fcs.xml
@@ -1175,6 +1175,7 @@
+ /services/chocks/enable eq 1
/systems/hydraulic/green-psi ge 2500
/systems/hydraulic/yellow-psi ge 1000
/systems/hydraulic/yellow-accumulator-psi gt 0