1
0
Fork 0

Fix bug with cruise-->descent switching

This commit is contained in:
legoboyvdlp R 2021-08-23 18:32:32 +01:00
parent 43ee3522d8
commit cb2e0e6e96
2 changed files with 13 additions and 6 deletions

View file

@ -653,7 +653,7 @@ var masterFMGC = maketimer(0.2, func {
}
} elsif (FMGCInternal.phase == 3) {
if (FMGCInternal.crzFl >= 200) {
if ((flightPlanController.arrivalDist <= 200 or altSel < 20000)) {
if ((flightPlanController.arrivalDist <= 200 and altSel < 20000)) {
newphase = 4;
systems.PNEU.pressMode.setValue("DE");
}
@ -667,10 +667,6 @@ var masterFMGC = maketimer(0.2, func {
if (getprop("/FMGC/internal/decel")) {
newphase = 5;
}
elsif (altSel == (FMGCInternal.crzFl * 100)) { # back to CRZ state
newphase = 3;
systems.PNEU.pressMode.setValue("CR");
}
} elsif (FMGCInternal.phase == 5) {
if (state1 == "TOGA" and state2 == "TOGA") {
newphase = 6;
@ -683,7 +679,6 @@ var masterFMGC = maketimer(0.2, func {
}
}
if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and
flightPlanController.arrivalDist <= 15 and (modelat == "NAV" or modelat == "LOC" or modelat == "LOC*") and pts.Position.gearAglFt.getValue() < 9500) { #todo decel pseudo waypoint
setprop("/FMGC/internal/decel", 1);

View file

@ -48,6 +48,8 @@ var progCLBInput = func(key, i) {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
@ -60,6 +62,8 @@ var progCLBInput = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
@ -80,6 +84,8 @@ var progCRZInput = func(key, i) {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
@ -92,6 +98,8 @@ var progCRZInput = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
@ -112,6 +120,8 @@ var progDESInput = func(key, i) {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
@ -124,6 +134,8 @@ var progDESInput = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
fmgc.FMGCNodes.phase.setValue(3);
systems.PNEU.pressMode.setValue("CR");
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);