1
0
Fork 0

Add debug statements, fix bounced landing breaking FMGC phases

This commit is contained in:
legoboyvdlp R 2020-04-24 16:47:13 +01:00
parent 7f90496894
commit 25132937ab
2 changed files with 6 additions and 2 deletions

View file

@ -523,7 +523,7 @@ var masterFMGC = maketimer(0.2, func {
});
var reset_FMGC = func {
setprop("FMGC/status/phase", "7");
setprop("FMGC/status/phase", "0");
fd1 = getprop("it-autoflight/input/fd1");
fd2 = getprop("it-autoflight/input/fd2");
spd = getprop("it-autoflight/input/spd-kts");
@ -811,6 +811,7 @@ var switchDatabase = func {
setlistener("gear/gear[1]/wow", func() {
if (timer30secLanding.isRunning) {
timer30secLanding.stop();
setprop("FMGC/internal/landing-time", -99);
}
if (getprop("gear/gear[1]/wow") == 1 and getprop("FMGC/internal/landing-time") == -99) {

View file

@ -510,6 +510,7 @@ var flightPlanController = {
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]) {
# 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
}
}
@ -528,7 +529,8 @@ var flightPlanController = {
wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[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]) {
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 {
@ -549,6 +551,7 @@ var flightPlanController = {
}
}
}
# print("Total: " ~ me._arrivalDist);
me.arrivalDist = me._arrivalDist;
me.updateMCDUDriver(n);
},