1
0
Fork 0

Add working INT-B/FUEL PREDICTION pages, trip-fuel calc incomplete

This commit is contained in:
hayden2000 2020-03-22 23:02:25 -04:00 committed by Matthew Maring
parent bfb22883ce
commit 1055c950a0
3 changed files with 297 additions and 59 deletions

View file

@ -65,12 +65,30 @@ var cruiseSet = props.globals.getNode("FMGC/internal/cruise-lvl-set", 1);
var tropo = props.globals.getNode("FMGC/internal/tropo", 1);
var tropoSet = props.globals.getNode("FMGC/internal/tropo-set", 1);
var ADIRSMCDUBTN = props.globals.getNode("controls/adirs/mcducbtn", 1);
# INT-B variables
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
var zfwSet = props.globals.getNode("FMGC/internal/zfw-set", 1);
var block = props.globals.getNode("FMGC/internal/block", 1);
var blockSet = props.globals.getNode("FMGC/internal/block-set", 1);
var taxi_fuel = props.globals.getNode("FMGC/internal/taxi-fuel", 1);
var trip_fuel = props.globals.getNode("FMGC/internal/trip-fuel", 1);
var trip_time = props.globals.getNode("FMGC/internal/trip-time", 1);
var rte_rsv = props.globals.getNode("FMGC/internal/rte-rsv", 1);
var rte_percent = props.globals.getNode("FMGC/internal/rte-percent", 1);
var alt_fuel = props.globals.getNode("FMGC/internal/alt-fuel", 1);
var alt_time = props.globals.getNode("FMGC/internal/alt-time", 1);
var final_fuel = props.globals.getNode("FMGC/internal/final-fuel", 1);
var final_time = props.globals.getNode("FMGC/internal/final-time", 1);
var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
var tow = props.globals.getNode("FMGC/internal/tow", 1);
var lw = props.globals.getNode("FMGC/internal/lw", 1);
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
var state1 = props.globals.getNode("engines/engine[0]/state", 1);
var state2 = props.globals.getNode("engines/engine[1]/state", 1);
var engrdy = props.globals.getNode("engines/ready", 1);
@ -99,6 +117,16 @@ var engOutAccSet = props.globals.getNode("MCDUC/reducacc-set", 1);
var transAlt = props.globals.getNode("FMGC/internal/trans-alt", 1);
var managedSpeed = props.globals.getNode("it-autoflight/input/spd-managed", 1);
# INT-A variables
# PREF
# 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)];
@ -777,6 +805,8 @@ var canvas_MCDU_base = {
me["Simple_Title"].setText("INIT");
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
me["ArrowRight"].show();
me["Simple_L2"].show();
me["Simple_L4"].show();
@ -827,14 +857,6 @@ var canvas_MCDU_base = {
pageSwitch[i].setBoolValue(1);
}
if (state1.getValue() != 3 and state2.getValue() != 3) {
me["ArrowLeft"].show();
me["ArrowRight"].show();
} else {
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
}
if (flightNumSet.getValue() == 1) {
me["INITA_FltNbr"].hide();
me["Simple_L3"].show();
@ -931,7 +953,6 @@ var canvas_MCDU_base = {
me["PERFTO"].hide();
me["PERFAPPR"].hide();
me["PERFGA"].hide();
me["Simple_Title"].setText("INIT");
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
@ -970,19 +991,19 @@ var canvas_MCDU_base = {
me["Simple_C6S"].hide();
me["Simple_R1"].hide();
me["Simple_R2"].show();
me["Simple_R3"].hide();
me["Simple_R3"].show();
me["Simple_R4"].show();
me["Simple_R5"].show();
me["Simple_R6"].hide();
me["Simple_R6"].show();
me["Simple_R1S"].show();
me["Simple_R2S"].show();
me["Simple_R3S"].hide();
me["Simple_R3S"].show();
me["Simple_R4S"].show();
me["Simple_R5S"].show();
me["Simple_R6S"].hide();
me["Simple_R6S"].show();
me["Simple_R1_Arrow"].hide();
me["Simple_R2_Arrow"].hide();
me["Simple_R3_Arrow"].hide();
me["Simple_R3_Arrow"].show();
me["Simple_R4_Arrow"].hide();
me["Simple_R5_Arrow"].hide();
me["Simple_R6_Arrow"].hide();
@ -992,20 +1013,85 @@ var canvas_MCDU_base = {
me.fontRight(default, default, default, default, default, default);
me.fontRightS(default, default, default, default, default, default);
me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
me.fontSizeRight(normal, normal, normal, normal, normal, normal);
me.fontSizeLeft(small, small, small, small, small, small);
me.fontSizeRight(normal, normal, normal, small, small, small);
me.colorLeft("blu", "wht", "wht", "wht", "wht", "wht");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("blu", "wht", "wht", "wht", "wht", "wht");
me.colorRight("blu", "blu", "wht", "wht", "wht", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("blu", "wht", "wht", "grn", "wht", "wht");
me.colorRight("blu", "blu", "amb", "wht", "blu", "wht");
me.colorRightS("wht", "wht", "amb", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "amb", "wht", "wht", "wht");
pageSwitch[i].setBoolValue(1);
}
me["Simple_L1S"].setText("TAXI");
me["Simple_L1"].setText(sprintf("%2.1f", taxi_fuel.getValue()));
me["Simple_L2S"].setText("TRIP/TIME");
me["Simple_L3S"].setText("RTE RSV/PCT");
me["Simple_L4S"].setText("ALTN/TIME");
me["Simple_L5S"].setText("FINAL/TIME");
me["Simple_L6S"].setText("MIN DEST FOB");
me["Simple_R2S"].setText("BLOCK");
me["Simple_R2"].setText(sprintf("%3.1f", block.getValue()));
me["Simple_R3S"].setText("FUEL");
me["Simple_R3"].setText("PLANNING ");
me["Simple_R4S"].setText("TOW/ LW");
me["Simple_R5S"].setText("TRIP WIND");
me["Simple_R5"].setText(trip_wind.getValue());
me["Simple_R6S"].setText("EXTRA/TIME");
if (blockSet.getValue() == 1) {
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
me["Simple_L2"].setText(sprintf("%4.1f/" ~ trip_time.getValue(), trip_fuel.getValue()));
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
me["Simple_R2"].show();
me["Simple_R3S"].hide();
me["Simple_R3"].hide();
me["Simple_R3_Arrow"].hide();
me["Simple_C4"].hide();
me["Simple_R4"].setText(sprintf("%4.1f/", tow.getValue()) ~ sprintf("%4.1f", lw.getValue()));
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
me["Simple_Title"].setText("INIT FUEL PREDICTION ");
me["INITB_Block"].hide();
me.colorLeft("ack", "grn", "blu", "blu", "blu", "blu");
me.colorRight("ack", "ack", "ack", "grn", "ack", "grn");
} else {
me["Simple_L2"].setText("---.-/----");
me["Simple_L3"].setText("---.-/---.-");
me["Simple_L4"].setText("---.-/----");
me["Simple_L5"].setText("---.-/----");
me["Simple_L6"].setText("---.-");
me["Simple_R2"].hide();
me["Simple_R3S"].show();
me["Simple_R3"].show();
me["Simple_R3_Arrow"].show();
me["Simple_R4"].setText("---.-/---.-");
# if (lw.getValue() == 0) {
# me["Simple_R4"].setText("---.-");
# me["Simple_C4"].show();
# me["Simple_C4"].setFontSize(small);
# me["Simple_C4"].setText(" " ~ sprintf("%4.1f/", tow.getValue()));
# }
me["Simple_R6"].setText("---.-/----");
me["Simple_Title"].setText("INIT");
me["INITB_Block"].show();
}
me["Simple_R1S"].setText("ZFWCG/ ZFW");
me["Simple_R1"].setText(sprintf("%3.1f", zfw.getValue()));
if (zfwcgSet.getValue() == 1) {
me["Simple_C1"].setFontSize(normal);
me["Simple_C1"].setText(" " ~ sprintf("%3.1f", zfwcg.getValue()));
@ -1026,34 +1112,6 @@ var canvas_MCDU_base = {
me["Simple_R1"].hide();
}
if (blockSet.getValue() == 1) {
me["INITB_Block"].hide();
me["Simple_R2"].show();
} else {
me["INITB_Block"].show();
me["Simple_R2"].hide();
}
me["Simple_L1"].setText("0.2");
me["Simple_L2"].setText("---.-/----");
me["Simple_L3"].setText("---.-/--.-");
me["Simple_L4"].setText("---.-/----");
me["Simple_L5"].setText("---.-/----");
me["Simple_L6"].setText("---.-/----");
me["Simple_L1S"].setText("TAXI");
me["Simple_L2S"].setText("TRIP/TIME");
me["Simple_L3S"].setText("RTE RSV/");
me["Simple_L4S"].setText("ALTN/TIME");
me["Simple_L5S"].setText("FINAL/TIME");
me["Simple_L6S"].setText("EXTRA/TIME");
me["Simple_R1"].setText(sprintf("%3.1f", zfw.getValue()));
me["Simple_R2"].setText(sprintf("%3.1f", block.getValue()));
me["Simple_R4"].setText("---.-");
me["Simple_R5"].setText("---.-");
me["Simple_R1S"].setText("ZFWCG/ ZFW");
me["Simple_R2S"].setText("BLOCK");
me["Simple_R4S"].setText("TOW");
me["Simple_R5S"].setText("LW");
} else if (page == "FUELPRED") {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].show();
@ -1066,8 +1124,8 @@ var canvas_MCDU_base = {
me["Simple_Title"].setText("FUEL PRED");
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
me["ArrowLeft"].show();
me["ArrowRight"].show();
me["Simple_L1"].show();
me["Simple_L2"].show();

View file

@ -1,10 +1,152 @@
# A3XX mCDU by Joshua Davidson (Octal450) and Jonathan Redpath
# Copyright (c) 2019 Joshua Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (hayden2000)
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
var zfwSet = props.globals.getNode("FMGC/internal/zfw-set", 1);
var block = props.globals.getNode("FMGC/internal/block", 1);
var blockSet = props.globals.getNode("FMGC/internal/block-set", 1);
var taxi_fuel = props.globals.getNode("FMGC/internal/taxi-fuel", 1);
var trip_fuel = props.globals.getNode("FMGC/internal/trip-fuel", 1);
var trip_time = props.globals.getNode("FMGC/internal/trip-time", 1);
var rte_rsv = props.globals.getNode("FMGC/internal/rte-rsv", 1);
var rte_percent = props.globals.getNode("FMGC/internal/rte-percent", 1);
var alt_fuel = props.globals.getNode("FMGC/internal/alt-fuel", 1);
var alt_time = props.globals.getNode("FMGC/internal/alt-time", 1);
var final_fuel = props.globals.getNode("FMGC/internal/final-fuel", 1);
var final_time = props.globals.getNode("FMGC/internal/final-time", 1);
var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
var tow = props.globals.getNode("FMGC/internal/tow", 1);
var lw = props.globals.getNode("FMGC/internal/lw", 1);
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
var initInputB = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
if (key == "R1") {
if (key == "L1") {
if (scratchpad == "CLR") {
notAllowed(i);
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 4) {
if (scratchpad >= 0.0 and scratchpad <= 10.0) {
setprop("FMGC/internal/taxi-fuel", scratchpad);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
}
}
# else if (key == "L2") {
# if (scratchpad == "CLR") {
# notAllowed(i);
# } else if (getprop("FMGC/internal/trip-fuel") != 0) {
# var tfs = size(scratchpad);
# if (tfs >= 1 and tfs <= 4) {
# var temp_rte = num(scratchpad * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100));
# if (scratchpad >= 0.0 and scratchpad <= block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - temp_rte) {
# setprop("FMGC/internal/trip-fuel", scratchpad);
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
#
# setprop("FMGC/internal/rte-rsv", temp_rte);
# setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
# setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
# } else {
# notAllowed(i);
# }
# } else {
# notAllowed(i);
# }
# } else {
# notAllowed(i);
# }
#
# }
else if (key == "L3") {
if (scratchpad == "CLR") {
notAllowed(i);
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
var tfs = size(scratchpad);
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
var perc = split("/", scratchpad)[1];
if (perc >= 0.0 and perc <= 100.0) {
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
setprop("FMGC/internal/rte-percent", perc);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
}
} else if (tfs >= 1 and tfs <= 4) {
if (scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
setprop("FMGC/internal/rte-rsv", scratchpad);
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
} else if (key == "L4") {
if (scratchpad == "CLR") {
notAllowed(i);
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
setprop("FMGC/internal/alt-fuel", scratchpad);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
}
} else if (key == "L5") {
if (scratchpad == "CLR") {
notAllowed(i);
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
setprop("FMGC/internal/final-fuel", scratchpad);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
}
} else if (key == "R1") {
if (scratchpad == "CLR") {
notAllowed(i);
} else {

View file

@ -38,15 +38,35 @@ var MCDU_reset = func(i) {
#setprop("FMGC/internal/vapp-speed", 0);
setprop("FMGC/internal/vr", 0);
setprop("FMGC/internal/v2", 0);
# INT-B
setprop("FMGC/internal/block", 0.0);
setprop("FMGC/internal/block-set", 0);
setprop("FMGC/internal/zfw", 0);
setprop("FMGC/internal/zfwcg", 55.1); # 25KG default
setprop("FMGC/internal/zfw-set", 0);
setprop("FMGC/internal/zfwcg", 55.1);
setprop("FMGC/internal/zfwcg-set", 0);
setprop("FMGC/internal/taxi-fuel", 0.4);
setprop("FMGC/internal/trip-fuel", 0);
setprop("FMGC/internal/trip-time", "0000");
setprop("FMGC/internal/rte-rsv", 0);
setprop("FMGC/internal/rte-percent", 5.0);
setprop("FMGC/internal/alt-fuel", 0);
setprop("FMGC/internal/alt-time", "0000");
setprop("FMGC/internal/final-fuel", 0);
setprop("FMGC/internal/final-time", "0000");
setprop("FMGC/internal/min-dest-fob", 0);
setprop("FMGC/internal/tow", 0);
setprop("FMGC/internal/lw", 0);
setprop("FMGC/internal/trip-wind", "HD000");
setprop("FMGC/internal/extra-fuel", 0);
setprop("FMGC/internal/extra-time", "0000");
setprop("FMGC/internal/v1-set", 0);
setprop("FMGC/internal/vr-set", 0);
setprop("FMGC/internal/v2-set", 0);
setprop("FMGC/internal/block-set", 0);
setprop("FMGC/internal/zfw-set", 0);
setprop("FMGC/internal/zfwcg-set", 0);
setprop("FMGC/internal/to-flap", 0);
setprop("FMGC/internal/to-ths", "0.0");
setprop("FMGC/internal/tofrom-set", 0);
@ -102,6 +122,8 @@ var lskbutton = func(btn, i) {
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
}
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L1",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("L1",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
@ -120,6 +142,8 @@ var lskbutton = func(btn, i) {
} else if (btn == "2") {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
PerfInput("L2",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L2",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("L2",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
@ -144,6 +168,8 @@ var lskbutton = func(btn, i) {
} else if (btn == "3") {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("L3",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L3",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("L3",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
@ -162,6 +188,8 @@ var lskbutton = func(btn, i) {
} else if (btn == "4") {
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
setprop("MCDU[" ~ i ~ "]/page", "STATUS");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L4",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("L4",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
@ -176,6 +204,8 @@ var lskbutton = func(btn, i) {
} else if (btn == "5") {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("L5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("L5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
@ -200,6 +230,8 @@ var lskbutton = func(btn, i) {
} else if (btn == "6") {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("L6",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L6",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
perfCLBInput("L6",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
@ -278,7 +310,9 @@ var rskbutton = func(btn, i) {
notAllowed(i);
}
} else if (btn == "5") {
if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("R5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
perfTOInput("R5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
perfGAInput("R5",i);
@ -340,8 +374,10 @@ var arrowbutton = func(btn, i) {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
setprop("MCDU[" ~ i ~ "]/page", "INITB");
} else {
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
}
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
setprop("MCDU[" ~ i ~ "]/page", "INITA");
}
if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
@ -358,8 +394,10 @@ var arrowbutton = func(btn, i) {
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
setprop("MCDU[" ~ i ~ "]/page", "INITB");
} else {
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
}
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
setprop("MCDU[" ~ i ~ "]/page", "INITA");
}
if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {