Bugfixes
This commit is contained in:
parent
b1f91f1639
commit
649c29e7b8
7 changed files with 48 additions and 42 deletions
|
@ -103,8 +103,6 @@ var vor2CRS = props.globals.getNode("/instrumentation/nav[3]/radials/selected-de
|
||||||
# INT-A
|
# INT-A
|
||||||
var depArpt = props.globals.getNode("/FMGC/internal/dep-arpt", 1);
|
var depArpt = props.globals.getNode("/FMGC/internal/dep-arpt", 1);
|
||||||
var arrArpt = props.globals.getNode("/FMGC/internal/arr-arpt", 1);
|
var arrArpt = props.globals.getNode("/FMGC/internal/arr-arpt", 1);
|
||||||
var costIndex = props.globals.getNode("/FMGC/internal/cost-index", 1);
|
|
||||||
var costIndexSet = props.globals.getNode("/FMGC/internal/cost-index-set", 1);
|
|
||||||
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
|
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
|
||||||
|
|
||||||
# IRSINIT variables
|
# IRSINIT variables
|
||||||
|
@ -1086,16 +1084,16 @@ var canvas_MCDU_base = {
|
||||||
me["Simple_L3"].hide();
|
me["Simple_L3"].hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fmgc.FMGCInternal.toFromSet and costIndexSet.getValue() != 1) {
|
if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.costIndexSet) {
|
||||||
me["INITA_CostIndex"].hide();
|
me["INITA_CostIndex"].hide();
|
||||||
me["Simple_L5"].setColor(1,1,1);
|
me["Simple_L5"].setColor(1,1,1);
|
||||||
me["Simple_L5"].show();
|
me["Simple_L5"].show();
|
||||||
me["Simple_L5"].setText("---");
|
me["Simple_L5"].setText("---");
|
||||||
} else if (costIndexSet.getValue() == 1) {
|
} else if (fmgc.FMGCInternal.costIndexSet) {
|
||||||
me["INITA_CostIndex"].hide();
|
me["INITA_CostIndex"].hide();
|
||||||
me["Simple_L5"].setColor(0.0901,0.6039,0.7176);
|
me["Simple_L5"].setColor(0.0901,0.6039,0.7176);
|
||||||
me["Simple_L5"].show();
|
me["Simple_L5"].show();
|
||||||
me["Simple_L5"].setText(sprintf("%s", costIndex.getValue()));
|
me["Simple_L5"].setText(sprintf("%s", fmgc.FMGCInternal.costIndex));
|
||||||
} else {
|
} else {
|
||||||
me["INITA_CostIndex"].show();
|
me["INITA_CostIndex"].show();
|
||||||
me["Simple_L5"].hide();
|
me["Simple_L5"].hide();
|
||||||
|
@ -2519,9 +2517,9 @@ var canvas_MCDU_base = {
|
||||||
}
|
}
|
||||||
|
|
||||||
me["Simple_L2S"].setText(" CI");
|
me["Simple_L2S"].setText(" CI");
|
||||||
if (costIndexSet.getValue() == 1) {
|
if (fmgc.FMGCInternal.costIndexSet) {
|
||||||
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
||||||
me["Simple_L2"].setText(sprintf(" %s", costIndex.getValue()));
|
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L2"].setColor(1,1,1);
|
me["Simple_L2"].setColor(1,1,1);
|
||||||
me["Simple_L2"].setText(" ---");
|
me["Simple_L2"].setText(" ---");
|
||||||
|
@ -2672,9 +2670,9 @@ var canvas_MCDU_base = {
|
||||||
me.fontLeft(0, 0, 0, default, 0, 0);
|
me.fontLeft(0, 0, 0, default, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (costIndexSet.getValue() == 1) {
|
if (fmgc.FMGCInternal.costIndexSet) {
|
||||||
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
||||||
me["Simple_L2"].setText(sprintf(" %s", costIndex.getValue()));
|
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L2"].setColor(1,1,1);
|
me["Simple_L2"].setColor(1,1,1);
|
||||||
me["Simple_L2"].setText(" ---");
|
me["Simple_L2"].setText(" ---");
|
||||||
|
@ -2833,9 +2831,9 @@ var canvas_MCDU_base = {
|
||||||
me.fontLeft(0, 0, 0, default, 0, 0);
|
me.fontLeft(0, 0, 0, default, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (costIndexSet.getValue() == 1) {
|
if (fmgc.FMGCInternal.costIndexSet) {
|
||||||
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
||||||
me["Simple_L2"].setText(sprintf(" %2.0f", costIndex.getValue()));
|
me["Simple_L2"].setText(sprintf(" %2.0f", fmgc.FMGCInternal.costIndex));
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L2"].setColor(1,1,1);
|
me["Simple_L2"].setColor(1,1,1);
|
||||||
me["Simple_L2"].setText(" ---");
|
me["Simple_L2"].setText(" ---");
|
||||||
|
|
|
@ -196,7 +196,7 @@ var FCUController = {
|
||||||
},
|
},
|
||||||
SPDPush: func() {
|
SPDPush: func() {
|
||||||
if (me.FCUworking) {
|
if (me.FCUworking) {
|
||||||
if (fmgc.FMGCInternal.crzSet and getprop("FMGC/internal/cost-index-set") == 1) {
|
if (fmgc.FMGCInternal.crzSet and fmgc.FMGCInternal.costIndexSet) {
|
||||||
spdManaged.setBoolValue(1);
|
spdManaged.setBoolValue(1);
|
||||||
fmgc.ManagedSPD.start();
|
fmgc.ManagedSPD.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,20 +148,24 @@ var FMGCInternal = {
|
||||||
transAltSet: 0,
|
transAltSet: 0,
|
||||||
|
|
||||||
# INIT A
|
# INIT A
|
||||||
|
altAirport: "",
|
||||||
|
altAirportSet: 0,
|
||||||
|
altSelected: 0,
|
||||||
|
arrApt: "",
|
||||||
|
costIndex: 0,
|
||||||
|
costIndexSet: 0,
|
||||||
crzFt: 10000,
|
crzFt: 10000,
|
||||||
crzFl: 0,
|
crzFl: 0,
|
||||||
crzSet: 0,
|
crzSet: 0,
|
||||||
crzTemp: 15,
|
crzTemp: 15,
|
||||||
crzTempSet: 0,
|
crzTempSet: 0,
|
||||||
tropo: 36090,
|
|
||||||
tropoSet: 0,
|
|
||||||
flightNum: "",
|
flightNum: "",
|
||||||
flightNumSet: 0,
|
flightNumSet: 0,
|
||||||
altAirport: "",
|
gndTemp: 15,
|
||||||
altAirportSet: 0,
|
gndTempSet: 0,
|
||||||
altSelected: 0,
|
|
||||||
arrApt: "",
|
|
||||||
depApt: "",
|
depApt: "",
|
||||||
|
tropo: 36090,
|
||||||
|
tropoSet: 0,
|
||||||
toFromSet: 0,
|
toFromSet: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -173,9 +177,10 @@ var postInit = func() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var FMGCNodes = {
|
var FMGCNodes = {
|
||||||
|
costIndex: props.globals.initNode("/FMGC/internal/cost-index", 0, "DOUBLE"),
|
||||||
|
toFromSet: props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL"),
|
||||||
v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"),
|
v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"),
|
||||||
v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"),
|
v1set: props.globals.initNode("/FMGC/internal/v1-set", 0, "BOOL"),
|
||||||
toFromSet: props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL"),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
############
|
############
|
||||||
|
@ -889,7 +894,7 @@ var adf1 = func {
|
||||||
#################
|
#################
|
||||||
|
|
||||||
var ManagedSPD = maketimer(0.25, func {
|
var ManagedSPD = maketimer(0.25, func {
|
||||||
if (FMGCInternal.crzSet and getprop("/FMGC/internal/cost-index-set") == 1) {
|
if (FMGCInternal.crzSet and FMGCInternal.costIndex) {
|
||||||
if (getprop("/it-autoflight/input/spd-managed") == 1) {
|
if (getprop("/it-autoflight/input/spd-managed") == 1) {
|
||||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||||
mode = getprop("/modes/pfd/fma/pitch-mode");
|
mode = getprop("/modes/pfd/fma/pitch-mode");
|
||||||
|
@ -1109,8 +1114,8 @@ setlistener("/FMGC/internal/fuel-calculating", func() {
|
||||||
var timer30secLanding = maketimer(1, func() {
|
var timer30secLanding = maketimer(1, func() {
|
||||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
|
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
|
||||||
setprop("/FMGC/status/phase", 7);
|
setprop("/FMGC/status/phase", 7);
|
||||||
if (getprop("/FMGC/internal/cost-index-set")) {
|
if (FMGCInternal.costIndexSet) {
|
||||||
setprop("/FMGC/internal/last-cost-index", getprop("/FMGC/internal/cost-index"));
|
setprop("/FMGC/internal/last-cost-index", FMGCInternal.costIndex);
|
||||||
} else {
|
} else {
|
||||||
setprop("/FMGC/internal/last-cost-index", 0);
|
setprop("/FMGC/internal/last-cost-index", 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,10 +218,11 @@ var fuelPredInput = func(key, i) {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getprop("/FMGC/internal/cost-index-set") and fmgc.FMGCInternal.toFromSet) {
|
if (!fmgc.FMGCInternal.costIndexSet and fmgc.FMGCInternal.toFromSet) {
|
||||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
|
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
|
||||||
setprop("/FMGC/internal/cost-index-set", 1);
|
fmgc.FMGCInternal.costIndexSet = 1;
|
||||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
|
fmgc.FMGCInternal.costIndex = getprop("/FMGC/internal/last-cost-index") or 0;
|
||||||
|
fmgc.FMGCNodes.setValue(fmgc.FMGCInternal.costIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (key == "R4") {
|
} else if (key == "R4") {
|
||||||
|
|
|
@ -60,16 +60,17 @@ var initInputA = func(key, i) {
|
||||||
}
|
}
|
||||||
} else if (key == "L5") {
|
} else if (key == "L5") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
setprop("/FMGC/internal/cost-index", 0);
|
fmgc.FMGCInternal.costIndex = 0;
|
||||||
setprop("/FMGC/internal/cost-index-set", 0);
|
fmgc.FMGCInternal.costIndexSet = 0;
|
||||||
|
fmgc.FMGCNodes.costIndex.setValue(0);
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else {
|
} else {
|
||||||
var ci = int(scratchpad);
|
var ci = int(scratchpad);
|
||||||
var cis = size(scratchpad);
|
var cis = size(scratchpad);
|
||||||
if (cis >= 1 and cis <= 3) {
|
if (cis >= 1 and cis <= 3) {
|
||||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||||
setprop("/FMGC/internal/cost-index", ci);
|
fmgc.FMGCInternal.costIndex = ci;
|
||||||
setprop("/FMGC/internal/cost-index-set", 1);
|
fmgc.FMGCInternal.costIndexSet = 1;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else {
|
} else {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
|
|
|
@ -233,10 +233,11 @@ var initInputB = func(key, i) {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getprop("/FMGC/internal/cost-index-set") and fmgc.FMGCInternal.toFromSet) {
|
if (!fmgc.FMGCInternal.costIndexSet and fmgc.FMGCInternal.toFromSet) {
|
||||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
|
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
|
||||||
setprop("/FMGC/internal/cost-index-set", 1);
|
fmgc.FMGCInternal.costIndexSet = 1;
|
||||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
|
fmgc.FMGCInternal.costIndex = getprop("/FMGC/internal/last-cost-index") or 0;
|
||||||
|
fmgc.FMGCNodes.setValue(fmgc.FMGCInternal.costIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
|
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||||
|
|
|
@ -50,28 +50,28 @@ var MCDU_reset = func(i) {
|
||||||
setprop("/FMGC/internal/adf2freq-set", 0);
|
setprop("/FMGC/internal/adf2freq-set", 0);
|
||||||
|
|
||||||
# INT-A
|
# INT-A
|
||||||
fmgc.FMGCInternal.flightNum = "";
|
|
||||||
fmgc.FMGCInternal.flightNumSet = 0;
|
|
||||||
fmgc.FMGCInternal.arrApt = "";
|
|
||||||
fmgc.FMGCInternal.depApt = "";
|
|
||||||
fmgc.FMGCInternal.toFromSet = 0;
|
|
||||||
fmgc.FMGCNodes.toFromSet.setValue(0);
|
|
||||||
fmgc.FMGCInternal.altAirport = "";
|
fmgc.FMGCInternal.altAirport = "";
|
||||||
fmgc.FMGCInternal.altAirportSet = 0;
|
fmgc.FMGCInternal.altAirportSet = 0;
|
||||||
setprop("/FMGC/internal/cost-index", "0");
|
fmgc.FMGCInternal.arrApt = "";
|
||||||
setprop("/FMGC/internal/cost-index-set", 0);
|
fmgc.FMGCInternal.costIndex = 0;
|
||||||
|
fmgc.FMGCInternal.costIndexSet = 0;
|
||||||
fmgc.FMGCInternal.crzFt = 10000;
|
fmgc.FMGCInternal.crzFt = 10000;
|
||||||
fmgc.altvert();
|
fmgc.altvert();
|
||||||
fmgc.updateRouteManagerAlt();
|
fmgc.updateRouteManagerAlt();
|
||||||
fmgc.FMGCInternal.crzFl = 100;
|
fmgc.FMGCInternal.crzFl = 100;
|
||||||
fmgc.FMGCInternal.crzSet = 0;
|
fmgc.FMGCInternal.crzSet = 0;
|
||||||
updateCrzLvlCallback();
|
updateCrzLvlCallback();
|
||||||
fmgc.FMGCInternal.tropo = 36090;
|
|
||||||
fmgc.FMGCInternal.tropoSet = 0;
|
|
||||||
fmgc.FMGCInternal.crzTemp = 15;
|
fmgc.FMGCInternal.crzTemp = 15;
|
||||||
fmgc.FMGCInternal.crzTempSet = 0;
|
fmgc.FMGCInternal.crzTempSet = 0;
|
||||||
|
fmgc.FMGCInternal.depApt = "";
|
||||||
|
fmgc.FMGCInternal.flightNum = "";
|
||||||
|
fmgc.FMGCInternal.flightNumSet = 0;
|
||||||
fmgc.FMGCInternal.gndTemp = -99;
|
fmgc.FMGCInternal.gndTemp = -99;
|
||||||
fmgc.FMGCInternal.gndTempSet = 0;
|
fmgc.FMGCInternal.gndTempSet = 0;
|
||||||
|
fmgc.FMGCInternal.toFromSet = 0;
|
||||||
|
fmgc.FMGCNodes.toFromSet.setValue(0);
|
||||||
|
fmgc.FMGCInternal.tropo = 36090;
|
||||||
|
fmgc.FMGCInternal.tropoSet = 0;
|
||||||
|
|
||||||
# IRSINIT
|
# IRSINIT
|
||||||
setprop("/FMGC/internal/align-set", 0);
|
setprop("/FMGC/internal/align-set", 0);
|
||||||
|
|
Loading…
Reference in a new issue