Make minimum dest fuel work, add MCDU warning, allow fuel pred without zfw (automatically calculated)
This commit is contained in:
parent
7c21f214e7
commit
e9109a2cfc
3 changed files with 29 additions and 1 deletions
|
@ -964,6 +964,8 @@ var timer3blockFuel = maketimer(1, func() {
|
|||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/block-fuel-time") + 3) {
|
||||
setprop("/FMGC/internal/block", sprintf("%3.1f", math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round((getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs")) / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-fuel-time", -99);
|
||||
timer3blockFuel.stop();
|
||||
|
|
|
@ -113,6 +113,30 @@ var initInputB = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) {
|
||||
setprop("/FMGC/internal/min-dest-fob", tf);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (num(getprop("/FMGC/internal/min-dest-fob")) < num(getprop("/FMGC/internal/final-fuel") + getprop("/FMGC/internal/alt-fuel"))) {
|
||||
genericMessage(i, "CHECK MIN DEST FOB", "wht");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "R1" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
|
@ -181,7 +205,7 @@ var initInputB = func(key, i) {
|
|||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "" and getprop("/FMGC/internal/zfw-set") and !getprop("/FMGC/internal/fuel-request-set")) {
|
||||
if (scratchpad == "" and !getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
} else if (getprop("/FMGC/internal/fuel-request-set") and !getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/block-calculating")) {
|
||||
|
|
|
@ -397,6 +397,8 @@ var lskbutton = func(btn, i) {
|
|||
} else if (btn == "6") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("L6",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("L6",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
|
||||
initInputIRS("L6",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ROUTESELECTION") {
|
||||
|
|
Loading…
Add table
Reference in a new issue