Gnd temp, alt
This commit is contained in:
parent
a125092915
commit
f9bd25884a
4 changed files with 35 additions and 37 deletions
|
@ -104,19 +104,14 @@ var vor2CRS = props.globals.getNode("/instrumentation/nav[3]/radials/selected-de
|
||||||
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 toFromSet = props.globals.getNode("/FMGC/internal/tofrom-set", 1);
|
var toFromSet = props.globals.getNode("/FMGC/internal/tofrom-set", 1);
|
||||||
var alt_airport = props.globals.getNode("/FMGC/internal/alt-airport", 1);
|
|
||||||
var altSet = props.globals.getNode("/FMGC/internal/alt-set", 1);
|
|
||||||
var costIndex = props.globals.getNode("/FMGC/internal/cost-index", 1);
|
var costIndex = props.globals.getNode("/FMGC/internal/cost-index", 1);
|
||||||
var costIndexSet = props.globals.getNode("/FMGC/internal/cost-index-set", 1);
|
var costIndexSet = props.globals.getNode("/FMGC/internal/cost-index-set", 1);
|
||||||
var gndtemp = props.globals.getNode("/FMGC/internal/gndtemp", 1);
|
|
||||||
var gndtempSet = props.globals.getNode("/FMGC/internal/gndtemp-set", 1);
|
|
||||||
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
|
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
|
||||||
|
|
||||||
# IRSINIT variables
|
# IRSINIT variables
|
||||||
var align_set = props.globals.getNode("/FMGC/internal/align-set", 1);
|
var align_set = props.globals.getNode("/FMGC/internal/align-set", 1);
|
||||||
|
|
||||||
# ROUTE SELECTION
|
# ROUTE SELECTION
|
||||||
var alt_selected = props.globals.getNode("/FMGC/internal/alt-selected", 1);
|
|
||||||
|
|
||||||
# INT-B
|
# INT-B
|
||||||
var zfwcg = props.globals.getNode("/FMGC/internal/zfwcg", 1);
|
var zfwcg = props.globals.getNode("/FMGC/internal/zfwcg", 1);
|
||||||
|
@ -1131,7 +1126,7 @@ var canvas_MCDU_base = {
|
||||||
me["Simple_L1"].show();
|
me["Simple_L1"].show();
|
||||||
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
||||||
if (altSet.getValue() == 1) {
|
if (altSet.getValue() == 1) {
|
||||||
me["Simple_L2"].setText(alt_airport.getValue());
|
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L2"].setText("NONE");
|
me["Simple_L2"].setText("NONE");
|
||||||
}
|
}
|
||||||
|
@ -1164,17 +1159,17 @@ var canvas_MCDU_base = {
|
||||||
}
|
}
|
||||||
|
|
||||||
me["Simple_R6S"].setText("GND TEMP");
|
me["Simple_R6S"].setText("GND TEMP");
|
||||||
if (getprop("/FMGC/status/phase") == 0 and !getprop("/FMGC/internal/gndtemp-set")) {
|
if (getprop("/FMGC/status/phase") == 0 and !fmgc.FMGCInternal.gndTempSet) {
|
||||||
setprop("/FMGC/internal/gndtemp", 15 - (2 * getprop("/position/gear-agl-ft") / 1000));
|
fmgc.FMGCInternal.gndTemp = 15 - (2 * getprop("/position/gear-agl-ft") / 1000);
|
||||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
me["Simple_R6"].setText(sprintf("%.0fg", fmgc.FMGCInternal.gndTemp));
|
||||||
me["Simple_R6"].setFontSize(small);
|
me["Simple_R6"].setFontSize(small);
|
||||||
} else {
|
} else {
|
||||||
if (getprop("/FMGC/internal/gndtemp-set")) {
|
if (fmgc.FMGCInternal.gndTempSet) {
|
||||||
me["Simple_R6"].setFontSize(normal);
|
me["Simple_R6"].setFontSize(normal);
|
||||||
} else {
|
} else {
|
||||||
me["Simple_R6"].setFontSize(small);
|
me["Simple_R6"].setFontSize(small);
|
||||||
}
|
}
|
||||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
me["Simple_R6"].setText(sprintf("%.0fg", fmgc.FMGCInternal.gndTemp));
|
||||||
}
|
}
|
||||||
|
|
||||||
me["Simple_L1S"].setText(" CO RTE");
|
me["Simple_L1S"].setText(" CO RTE");
|
||||||
|
@ -1417,12 +1412,12 @@ var canvas_MCDU_base = {
|
||||||
me["Simple_L1"].setText("NONE");
|
me["Simple_L1"].setText("NONE");
|
||||||
me["Simple_L6"].setText(" RETURN");
|
me["Simple_L6"].setText(" RETURN");
|
||||||
|
|
||||||
if (toFromSet.getValue() == 1 and alt_selected.getValue() == 0) {
|
if (toFromSet.getValue() and !fmgc.FMGCInternal.altSelected) {
|
||||||
me["Simple_Title"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
me["Simple_Title"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
||||||
} else if (toFromSet.getValue() == 0 and alt_airport.getValue() != "" and alt_selected.getValue() == 1) {
|
} else if (!toFromSet.getValue() and fmgc.FMGCInternal.altAirport != "" and fmgc.FMGCInternal.altSelected) {
|
||||||
me["Simple_Title"].setText(sprintf("%s", alt_airport.getValue()));
|
me["Simple_Title"].setText(sprintf("%s", fmgc.FMGCInternal.altAirport));
|
||||||
} else if (toFromSet.getValue() == 1 and alt_airport.getValue() != "" and alt_selected.getValue() == 1) {
|
} else if (toFromSet.getValue() and fmgc.FMGCInternal.altAirport != "" and fmgc.FMGCInternal.altSelected) {
|
||||||
me["Simple_Title"].setText(sprintf("%s", arrArpt.getValue() ~ "/" ~ alt_airport.getValue()));
|
me["Simple_Title"].setText(sprintf("%s", arrArpt.getValue() ~ "/" ~ fmgc.FMGCInternal.altAirport));
|
||||||
} else {
|
} else {
|
||||||
me["Simple_Title"].setText("ROUTE SELECTION");
|
me["Simple_Title"].setText("ROUTE SELECTION");
|
||||||
}
|
}
|
||||||
|
@ -1867,10 +1862,10 @@ var canvas_MCDU_base = {
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L1"].setText(arrArpt.getValue());
|
me["Simple_L1"].setText(arrArpt.getValue());
|
||||||
}
|
}
|
||||||
if (!engrdy.getBoolValue() or alt_airport.getValue() == "") {
|
if (!engrdy.getBoolValue() or !fmgc.FMGCInternal.altAirportSet) {
|
||||||
me["Simple_L2"].setText("----");
|
me["Simple_L2"].setText("----");
|
||||||
} else {
|
} else {
|
||||||
me["Simple_L2"].setText(alt_airport.getValue());
|
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
|
||||||
}
|
}
|
||||||
|
|
||||||
me["Simple_L1S"].setText("AT");
|
me["Simple_L1S"].setText("AT");
|
||||||
|
|
|
@ -22,7 +22,6 @@ var modelat = 0;
|
||||||
var mode = 0;
|
var mode = 0;
|
||||||
var modeI = 0;
|
var modeI = 0;
|
||||||
var gs = 0;
|
var gs = 0;
|
||||||
var alt = 0;
|
|
||||||
var aglalt = 0;
|
var aglalt = 0;
|
||||||
var cruiseft = 0;
|
var cruiseft = 0;
|
||||||
var cruiseft_b = 0;
|
var cruiseft_b = 0;
|
||||||
|
@ -158,6 +157,9 @@ var FMGCInternal = {
|
||||||
tropoSet: 0,
|
tropoSet: 0,
|
||||||
flightNum: "",
|
flightNum: "",
|
||||||
flightNumSet: 0,
|
flightNumSet: 0,
|
||||||
|
altAirport: "",
|
||||||
|
altAirportSet: 0,
|
||||||
|
altSelected: 0,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -196,10 +198,9 @@ var trimReset = func {
|
||||||
var updateARPT = func {
|
var updateARPT = func {
|
||||||
dep = getprop("/FMGC/internal/dep-arpt");
|
dep = getprop("/FMGC/internal/dep-arpt");
|
||||||
arr = getprop("/FMGC/internal/arr-arpt");
|
arr = getprop("/FMGC/internal/arr-arpt");
|
||||||
alt = getprop("/FMGC/internal/alt-airport");
|
|
||||||
setprop("autopilot/route-manager/departure/airport", dep);
|
setprop("autopilot/route-manager/departure/airport", dep);
|
||||||
setprop("autopilot/route-manager/destination/airport", arr);
|
setprop("autopilot/route-manager/destination/airport", arr);
|
||||||
setprop("autopilot/route-manager/alternate/airport", alt);
|
setprop("autopilot/route-manager/alternate/airport", fmgc.FMGCInternal.altAirport);
|
||||||
if (getprop("/autopilot/route-manager/active") != 1) {
|
if (getprop("/autopilot/route-manager/active") != 1) {
|
||||||
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
|
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
|
||||||
}
|
}
|
||||||
|
@ -258,9 +259,9 @@ var updateFuel = func {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Calculate alternate fuel
|
# Calculate alternate fuel
|
||||||
if (!getprop("/FMGC/internal/alt-fuel-set") and getprop("/FMGC/internal/alt-set")) {
|
if (!getprop("/FMGC/internal/alt-fuel-set") and fmgc.FMGCInternal.altAirportSet) {
|
||||||
#calc
|
#calc
|
||||||
} else if (getprop("/FMGC/internal/alt-fuel-set") and getprop("/FMGC/internal/alt-set")) {
|
} else if (getprop("/FMGC/internal/alt-fuel-set") and fmgc.FMGCInternal.altAirportSet) {
|
||||||
#dummy calc for now
|
#dummy calc for now
|
||||||
alt_fuel = 1000 * num(getprop("/FMGC/internal/alt-fuel"));
|
alt_fuel = 1000 * num(getprop("/FMGC/internal/alt-fuel"));
|
||||||
zfw = 1000 * getprop("/FMGC/internal/zfw");
|
zfw = 1000 * getprop("/FMGC/internal/zfw");
|
||||||
|
|
|
@ -7,8 +7,8 @@ var initInputA = func(key, i) {
|
||||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||||
if (key == "L2") {
|
if (key == "L2") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
setprop("/FMGC/internal/alt-airport", "");
|
fmgc.FMGCInternal.altAirport = "";
|
||||||
setprop("/FMGC/internal/alt-set", 0);
|
fmgc.FMGCInternal.altAirportSet = 0;
|
||||||
fmgc.windController.updatePlans();
|
fmgc.windController.updatePlans();
|
||||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||||
|
@ -17,14 +17,14 @@ var initInputA = func(key, i) {
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
fmgc.updateARPT();
|
fmgc.updateARPT();
|
||||||
#} else if (scratchpad == "") {
|
#} else if (scratchpad == "") {
|
||||||
#setprop("/FMGC/internal/alt-selected", 1);
|
#fmgc.FMGCInternal.altSelected = 1;
|
||||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||||
} else if (getprop("/FMGC/internal/tofrom-set") == 1) {
|
} else if (getprop("/FMGC/internal/tofrom-set") == 1) {
|
||||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||||
var tfs = size(scratchpad);
|
var tfs = size(scratchpad);
|
||||||
if (tfs == 4) {
|
if (tfs == 4) {
|
||||||
setprop("/FMGC/internal/alt-airport", scratchpad);
|
fmgc.FMGCInternal.altAirport = scratchpad;
|
||||||
setprop("/FMGC/internal/alt-set", 1);
|
fmgc.FMGCInternal.altAirportSet = 0;
|
||||||
fmgc.windController.updatePlans();
|
fmgc.windController.updatePlans();
|
||||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||||
|
@ -32,7 +32,7 @@ var initInputA = func(key, i) {
|
||||||
}
|
}
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
fmgc.updateARPT();
|
fmgc.updateARPT();
|
||||||
#setprop("/FMGC/internal/alt-selected", 1);
|
#fmgc.FMGCInternal.altSelected = 1;
|
||||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||||
} else {
|
} else {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
|
@ -186,7 +186,7 @@ var initInputA = func(key, i) {
|
||||||
fmgc.windController.init();
|
fmgc.windController.init();
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
#} else if (scratchpad == "") {
|
#} else if (scratchpad == "") {
|
||||||
#setprop("/FMGC/internal/alt-selected", 0);
|
#fmgc.FMGCInternal.altSelected = 0;
|
||||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||||
} else {
|
} else {
|
||||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||||
|
@ -203,7 +203,7 @@ var initInputA = func(key, i) {
|
||||||
#scratchpad
|
#scratchpad
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||||
setprop("/FMGC/internal/alt-selected", 0);
|
fmgc.FMGCInternal.altSelected = 0;
|
||||||
#ref lat
|
#ref lat
|
||||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
||||||
degrees = int(dms);
|
degrees = int(dms);
|
||||||
|
@ -261,11 +261,11 @@ var initInputA = func(key, i) {
|
||||||
}
|
}
|
||||||
} else if (key == "R6") {
|
} else if (key == "R6") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
setprop("/FMGC/internal/gndtemp-set", 0);
|
fmgc.FMGCInternal.gndTempSet = 0;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else if (int(scratchpad) != nil and getprop("/FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
} else if (int(scratchpad) != nil and getprop("/FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||||
setprop("/FMGC/internal/gndtemp", scratchpad);
|
fmgc.FMGCInternal.gndTemp = scratchpad;
|
||||||
setprop("/FMGC/internal/gndtemp-set", 1);
|
fmgc.FMGCInternal.gndTempSet = 1;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else {
|
} else {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
|
|
|
@ -55,8 +55,8 @@ var MCDU_reset = func(i) {
|
||||||
setprop("/FMGC/internal/dep-arpt", "");
|
setprop("/FMGC/internal/dep-arpt", "");
|
||||||
setprop("/FMGC/internal/arr-arpt", "");
|
setprop("/FMGC/internal/arr-arpt", "");
|
||||||
setprop("/FMGC/internal/tofrom-set", 0);
|
setprop("/FMGC/internal/tofrom-set", 0);
|
||||||
setprop("/FMGC/internal/alt-airport", "");
|
fmgc.FMGCInternal.altAirport = "";
|
||||||
setprop("/FMGC/internal/alt-set", 0);
|
fmgc.FMGCInternal.altAirportSet = 0;
|
||||||
setprop("/FMGC/internal/cost-index", "0");
|
setprop("/FMGC/internal/cost-index", "0");
|
||||||
setprop("/FMGC/internal/cost-index-set", 0);
|
setprop("/FMGC/internal/cost-index-set", 0);
|
||||||
fmgc.FMGCInternal.crzFt = 10000;
|
fmgc.FMGCInternal.crzFt = 10000;
|
||||||
|
@ -69,6 +69,8 @@ var MCDU_reset = func(i) {
|
||||||
fmgc.FMGCInternal.tropoSet = 0;
|
fmgc.FMGCInternal.tropoSet = 0;
|
||||||
fmgc.FMGCInternal.crzTemp = 15;
|
fmgc.FMGCInternal.crzTemp = 15;
|
||||||
fmgc.FMGCInternal.crzTempSet = 0;
|
fmgc.FMGCInternal.crzTempSet = 0;
|
||||||
|
fmgc.FMGCInternal.gndTemp = -99;
|
||||||
|
fmgc.FMGCInternal.gndTempSet = 0;
|
||||||
|
|
||||||
# IRSINIT
|
# IRSINIT
|
||||||
setprop("/FMGC/internal/align-set", 0);
|
setprop("/FMGC/internal/align-set", 0);
|
||||||
|
@ -85,7 +87,7 @@ var MCDU_reset = func(i) {
|
||||||
setprop("/FMGC/internal/align3-done", 0);
|
setprop("/FMGC/internal/align3-done", 0);
|
||||||
|
|
||||||
# ROUTE SELECTION
|
# ROUTE SELECTION
|
||||||
setprop("/FMGC/internal/alt-selected", 0);
|
fmgc.FMGCInternal.altSelected = 0;
|
||||||
|
|
||||||
# INT-B
|
# INT-B
|
||||||
setprop("/FMGC/internal/zfw", 0);
|
setprop("/FMGC/internal/zfw", 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue