1
0
Fork 0

Gnd temp, alt

This commit is contained in:
legoboyvdlp R 2020-07-10 01:25:25 +01:00
parent a125092915
commit f9bd25884a
4 changed files with 35 additions and 37 deletions

View file

@ -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 arrArpt = props.globals.getNode("/FMGC/internal/arr-arpt", 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 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);
# IRSINIT variables
var align_set = props.globals.getNode("/FMGC/internal/align-set", 1);
# ROUTE SELECTION
var alt_selected = props.globals.getNode("/FMGC/internal/alt-selected", 1);
# INT-B
var zfwcg = props.globals.getNode("/FMGC/internal/zfwcg", 1);
@ -1131,7 +1126,7 @@ var canvas_MCDU_base = {
me["Simple_L1"].show();
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
if (altSet.getValue() == 1) {
me["Simple_L2"].setText(alt_airport.getValue());
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
} else {
me["Simple_L2"].setText("NONE");
}
@ -1164,17 +1159,17 @@ var canvas_MCDU_base = {
}
me["Simple_R6S"].setText("GND TEMP");
if (getprop("/FMGC/status/phase") == 0 and !getprop("/FMGC/internal/gndtemp-set")) {
setprop("/FMGC/internal/gndtemp", 15 - (2 * getprop("/position/gear-agl-ft") / 1000));
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
if (getprop("/FMGC/status/phase") == 0 and !fmgc.FMGCInternal.gndTempSet) {
fmgc.FMGCInternal.gndTemp = 15 - (2 * getprop("/position/gear-agl-ft") / 1000);
me["Simple_R6"].setText(sprintf("%.0fg", fmgc.FMGCInternal.gndTemp));
me["Simple_R6"].setFontSize(small);
} else {
if (getprop("/FMGC/internal/gndtemp-set")) {
if (fmgc.FMGCInternal.gndTempSet) {
me["Simple_R6"].setFontSize(normal);
} else {
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");
@ -1417,12 +1412,12 @@ var canvas_MCDU_base = {
me["Simple_L1"].setText("NONE");
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()));
} else if (toFromSet.getValue() == 0 and alt_airport.getValue() != "" and alt_selected.getValue() == 1) {
me["Simple_Title"].setText(sprintf("%s", alt_airport.getValue()));
} else if (toFromSet.getValue() == 1 and alt_airport.getValue() != "" and alt_selected.getValue() == 1) {
me["Simple_Title"].setText(sprintf("%s", arrArpt.getValue() ~ "/" ~ alt_airport.getValue()));
} else if (!toFromSet.getValue() and fmgc.FMGCInternal.altAirport != "" and fmgc.FMGCInternal.altSelected) {
me["Simple_Title"].setText(sprintf("%s", fmgc.FMGCInternal.altAirport));
} else if (toFromSet.getValue() and fmgc.FMGCInternal.altAirport != "" and fmgc.FMGCInternal.altSelected) {
me["Simple_Title"].setText(sprintf("%s", arrArpt.getValue() ~ "/" ~ fmgc.FMGCInternal.altAirport));
} else {
me["Simple_Title"].setText("ROUTE SELECTION");
}
@ -1867,10 +1862,10 @@ var canvas_MCDU_base = {
} else {
me["Simple_L1"].setText(arrArpt.getValue());
}
if (!engrdy.getBoolValue() or alt_airport.getValue() == "") {
if (!engrdy.getBoolValue() or !fmgc.FMGCInternal.altAirportSet) {
me["Simple_L2"].setText("----");
} else {
me["Simple_L2"].setText(alt_airport.getValue());
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
}
me["Simple_L1S"].setText("AT");

View file

@ -22,7 +22,6 @@ var modelat = 0;
var mode = 0;
var modeI = 0;
var gs = 0;
var alt = 0;
var aglalt = 0;
var cruiseft = 0;
var cruiseft_b = 0;
@ -158,6 +157,9 @@ var FMGCInternal = {
tropoSet: 0,
flightNum: "",
flightNumSet: 0,
altAirport: "",
altAirportSet: 0,
altSelected: 0,
};
@ -196,10 +198,9 @@ var trimReset = func {
var updateARPT = func {
dep = getprop("/FMGC/internal/dep-arpt");
arr = getprop("/FMGC/internal/arr-arpt");
alt = getprop("/FMGC/internal/alt-airport");
setprop("autopilot/route-manager/departure/airport", dep);
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) {
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
}
@ -258,9 +259,9 @@ var updateFuel = func {
}
# 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
} 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
alt_fuel = 1000 * num(getprop("/FMGC/internal/alt-fuel"));
zfw = 1000 * getprop("/FMGC/internal/zfw");

View file

@ -7,8 +7,8 @@ var initInputA = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L2") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/alt-airport", "");
setprop("/FMGC/internal/alt-set", 0);
fmgc.FMGCInternal.altAirport = "";
fmgc.FMGCInternal.altAirportSet = 0;
fmgc.windController.updatePlans();
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
@ -17,14 +17,14 @@ var initInputA = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
fmgc.updateARPT();
#} else if (scratchpad == "") {
#setprop("/FMGC/internal/alt-selected", 1);
#fmgc.FMGCInternal.altSelected = 1;
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else if (getprop("/FMGC/internal/tofrom-set") == 1) {
if (!fmgc.flightPlanController.temporaryFlag[i]) {
var tfs = size(scratchpad);
if (tfs == 4) {
setprop("/FMGC/internal/alt-airport", scratchpad);
setprop("/FMGC/internal/alt-set", 1);
fmgc.FMGCInternal.altAirport = scratchpad;
fmgc.FMGCInternal.altAirportSet = 0;
fmgc.windController.updatePlans();
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
@ -32,7 +32,7 @@ var initInputA = func(key, i) {
}
mcdu_scratchpad.scratchpads[i].empty();
fmgc.updateARPT();
#setprop("/FMGC/internal/alt-selected", 1);
#fmgc.FMGCInternal.altSelected = 1;
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
mcdu_message(i, "NOT ALLOWED");
@ -186,7 +186,7 @@ var initInputA = func(key, i) {
fmgc.windController.init();
mcdu_scratchpad.scratchpads[i].empty();
#} else if (scratchpad == "") {
#setprop("/FMGC/internal/alt-selected", 0);
#fmgc.FMGCInternal.altSelected = 0;
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
if (!fmgc.flightPlanController.temporaryFlag[i]) {
@ -203,7 +203,7 @@ var initInputA = func(key, i) {
#scratchpad
mcdu_scratchpad.scratchpads[i].empty();
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
setprop("/FMGC/internal/alt-selected", 0);
fmgc.FMGCInternal.altSelected = 0;
#ref lat
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
degrees = int(dms);
@ -261,11 +261,11 @@ var initInputA = func(key, i) {
}
} else if (key == "R6") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/gndtemp-set", 0);
fmgc.FMGCInternal.gndTempSet = 0;
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) {
setprop("/FMGC/internal/gndtemp", scratchpad);
setprop("/FMGC/internal/gndtemp-set", 1);
fmgc.FMGCInternal.gndTemp = scratchpad;
fmgc.FMGCInternal.gndTempSet = 1;
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");

View file

@ -55,8 +55,8 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/dep-arpt", "");
setprop("/FMGC/internal/arr-arpt", "");
setprop("/FMGC/internal/tofrom-set", 0);
setprop("/FMGC/internal/alt-airport", "");
setprop("/FMGC/internal/alt-set", 0);
fmgc.FMGCInternal.altAirport = "";
fmgc.FMGCInternal.altAirportSet = 0;
setprop("/FMGC/internal/cost-index", "0");
setprop("/FMGC/internal/cost-index-set", 0);
fmgc.FMGCInternal.crzFt = 10000;
@ -69,6 +69,8 @@ var MCDU_reset = func(i) {
fmgc.FMGCInternal.tropoSet = 0;
fmgc.FMGCInternal.crzTemp = 15;
fmgc.FMGCInternal.crzTempSet = 0;
fmgc.FMGCInternal.gndTemp = -99;
fmgc.FMGCInternal.gndTempSet = 0;
# IRSINIT
setprop("/FMGC/internal/align-set", 0);
@ -85,7 +87,7 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/align3-done", 0);
# ROUTE SELECTION
setprop("/FMGC/internal/alt-selected", 0);
fmgc.FMGCInternal.altSelected = 0;
# INT-B
setprop("/FMGC/internal/zfw", 0);