1
0
Fork 0

Bugfix for save last cost index

This commit is contained in:
legoboyvdlp R 2020-06-29 22:17:19 +01:00
parent 032009a707
commit 7d5de4bad9
4 changed files with 9 additions and 9 deletions

View file

@ -497,7 +497,7 @@ var taxi_b = func {
if (pts.Instrumentation.Altimeter.std.getBoolValue()) {
libraries.toggleSTD();
}
setprop("/instrumentation/altimeter[0]/setting-inhg", getprop("/environment/pressure-sea-level-inhg"));
setprop("/instrumentation/altimeter[0]/setting-inhg", getprop("/environment/metar[0]/pressure-inhg") or 29.92);
settimer(taxi_c, 2);
}
var taxi_c = func {

View file

@ -219,9 +219,9 @@ var fuelPredInput = func(key, i) {
}
if (!getprop("/FMGC/internal/cost-index-set") and getprop("/FMGC/internal/tofrom-set")) {
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
setprop("/FMGC/internal/cost-index-set", 1);
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
}
}
} else if (key == "R4") {

View file

@ -151,11 +151,6 @@ var initInputB = func(key, i) {
if (scratchpad == "CLR") {
mcdu_message(i, "NOT ALLOWED");
} else {
if (!getprop("/FMGC/internal/cost-index-set") and getprop("/FMGC/internal/tofrom-set")) {
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
setprop("/FMGC/internal/cost-index-set", 1);
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
}
var zfw_min = 80.6; #make based on performance
var zfw_max = 134.5; #61,000 kg, make based on performance
if (size(scratchpad) == 0) {
@ -237,6 +232,12 @@ var initInputB = func(key, i) {
} else {
mcdu_message(i, "NOT ALLOWED");
}
if (!getprop("/FMGC/internal/cost-index-set") and getprop("/FMGC/internal/tofrom-set")) {
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index") or 0);
setprop("/FMGC/internal/cost-index-set", 1);
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index") or 0);
}
}
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
if (scratchpad == "CLR") {

View file

@ -59,7 +59,6 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/alt-set", 0);
setprop("/FMGC/internal/cost-index", "0");
setprop("/FMGC/internal/cost-index-set", 0);
setprop("/FMGC/internal/last-cost-index", 0);
setprop("/FMGC/internal/cruise-ft", 10000);
setprop("/FMGC/internal/cruise-fl", 100);
setprop("/FMGC/internal/cruise-lvl-set", 0);