1
0
Fork 0

Blank alternate fuel if not set

This commit is contained in:
Matthew Maring 2020-05-05 09:31:38 -04:00
parent a7ac96b90d
commit d4dd37c8df
2 changed files with 21 additions and 14 deletions

View file

@ -1708,20 +1708,27 @@ var canvas_MCDU_base = {
me["Simple_C3"].setText(sprintf("/%.1f ", rte_percent.getValue()));
}
}
me["Simple_L4"].setText(sprintf("%.1f", alt_fuel.getValue()));
me["Simple_C4"].show();
if (alt_fuel_set.getValue() == 1) {
if (num(alt_fuel.getValue()) > 9.9) {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
if (altSet.getValue() == 1) {
me["Simple_L4"].setText(sprintf("%.1f", alt_fuel.getValue()));
me["Simple_L4"].setColor(BLUE);
me["Simple_C4"].show();
if (alt_fuel_set.getValue() == 1) {
if (num(alt_fuel.getValue()) > 9.9) {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
} else {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
}
} else {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
if (num(alt_fuel.getValue()) > 9.9) {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
} else {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
}
}
} else {
if (num(alt_fuel.getValue()) > 9.9) {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
} else {
me["Simple_C4"].setText(sprintf("/%s ", alt_time.getValue()));
}
me["Simple_L4"].setText("---.-/----");
me["Simple_L4"].setColor(WHITE);
me["Simple_C4"].hide();
}
me["Simple_L5"].setText(sprintf("%.1f", final_fuel.getValue()));
if (final_time_set.getValue() == 1 and final_fuel_set.getValue() == 1) {
@ -1759,7 +1766,7 @@ var canvas_MCDU_base = {
me["Simple_R4"].setText(sprintf("%4.1f/", tow.getValue()) ~ sprintf("%4.1f", lw.getValue()));
me["Simple_R6"].setText(sprintf("%.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
me.colorLeft("ack", "grn", "blu", "blu", "blu", "blu");
me.colorLeft("ack", "grn", "blu", "ack", "blu", "blu");
me.colorRight("ack", "blu", "ack", "grn", "ack", "grn");
}
}
@ -1805,7 +1812,7 @@ var canvas_MCDU_base = {
me["Simple_C3"].setFontSize(small);
}
if (alt_fuel_set.getValue() == 1) {
if (alt_fuel_set.getValue() == 1 and altSet.getValue() == 1) {
me["Simple_L4"].setFontSize(normal);
} else {
me["Simple_L4"].setFontSize(small);

View file

@ -70,7 +70,7 @@ var initInputB = func(key, i) {
} else {
notAllowed(i);
}
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and getprop("/FMGC/internal/alt-set")) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/alt-fuel", 0.0);
setprop("/FMGC/internal/alt-time", "0000");