Add debug statements, fix bounced landing breaking FMGC phases
This commit is contained in:
parent
7f90496894
commit
25132937ab
2 changed files with 6 additions and 2 deletions
|
@ -523,7 +523,7 @@ var masterFMGC = maketimer(0.2, func {
|
||||||
});
|
});
|
||||||
|
|
||||||
var reset_FMGC = func {
|
var reset_FMGC = func {
|
||||||
setprop("FMGC/status/phase", "7");
|
setprop("FMGC/status/phase", "0");
|
||||||
fd1 = getprop("it-autoflight/input/fd1");
|
fd1 = getprop("it-autoflight/input/fd1");
|
||||||
fd2 = getprop("it-autoflight/input/fd2");
|
fd2 = getprop("it-autoflight/input/fd2");
|
||||||
spd = getprop("it-autoflight/input/spd-kts");
|
spd = getprop("it-autoflight/input/spd-kts");
|
||||||
|
@ -811,6 +811,7 @@ var switchDatabase = func {
|
||||||
setlistener("gear/gear[1]/wow", func() {
|
setlistener("gear/gear[1]/wow", func() {
|
||||||
if (timer30secLanding.isRunning) {
|
if (timer30secLanding.isRunning) {
|
||||||
timer30secLanding.stop();
|
timer30secLanding.stop();
|
||||||
|
setprop("FMGC/internal/landing-time", -99);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getprop("gear/gear[1]/wow") == 1 and getprop("FMGC/internal/landing-time") == -99) {
|
if (getprop("gear/gear[1]/wow") == 1 and getprop("FMGC/internal/landing-time") == -99) {
|
||||||
|
|
|
@ -510,6 +510,7 @@ var flightPlanController = {
|
||||||
|
|
||||||
if (wpt == 1) {
|
if (wpt == 1) {
|
||||||
if (me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
if (me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
||||||
|
# print("Adding " ~ courseDistanceFrom[1] ~ " miles for waypoint " ~ me.flightplans[n].getWP(wpt).wp_name);
|
||||||
me._arrivalDist += courseDistanceFrom[1]; # distance to next waypoint, therafter to end of flightplan
|
me._arrivalDist += courseDistanceFrom[1]; # distance to next waypoint, therafter to end of flightplan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +529,8 @@ var flightPlanController = {
|
||||||
wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[1]);
|
wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[1]);
|
||||||
if (wpt > 1) {
|
if (wpt > 1) {
|
||||||
if (me.flightplans[n].getWP(wpt - 1).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
if (me.flightplans[n].getWP(wpt - 1).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
||||||
me._arrivalDist += courseDistanceFromPrev[1]; # todo - buggy. Neglect discontinuity
|
# print("Adding " ~ courseDistanceFromPrev[1] ~ " miles for waypoint " ~ me.flightplans[n].getWP(wpt).wp_name);
|
||||||
|
me._arrivalDist += courseDistanceFromPrev[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -549,6 +551,7 @@ var flightPlanController = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# print("Total: " ~ me._arrivalDist);
|
||||||
me.arrivalDist = me._arrivalDist;
|
me.arrivalDist = me._arrivalDist;
|
||||||
me.updateMCDUDriver(n);
|
me.updateMCDUDriver(n);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue