1
0
Fork 0

Default GPS handling of DISCON waypoints

When a DISCON is sequencing, revert to OSB mode at the current heading.
Also fix heading capture when reverting to OBS mode in various other
places.
This commit is contained in:
James Turner 2020-04-19 17:05:29 +01:00
parent fc50680694
commit d1998f27ff

View file

@ -159,6 +159,12 @@ var DefaultGPSDeleagte = {
}
},
_captureCurrentCourse: func
{
var crs = getprop(GPSPath ~ "/desired-course-deg");
setprop(GPSPath ~ "/selected-course-deg", crs);
},
_selectOBSMode: func
{
setprop(GPSPath ~ "/command", "obs");
@ -186,6 +192,7 @@ var DefaultGPSDeleagte = {
{
if (me._modeProp.getValue() == 'leg') {
logprint(LOG_INFO, 'flightplan deactivated, default GPS to OBS mode');
me._captureCurrentCourse();
me._selectOBSMode();
}
},
@ -194,6 +201,7 @@ var DefaultGPSDeleagte = {
{
if (me._modeProp.getValue() == 'leg') {
logprint(LOG_INFO, 'end of flight-plan, switching GPS to OBS mode');
me._captureCurrentCourse();
me._selectOBSMode();
}
},
@ -205,6 +213,7 @@ var DefaultGPSDeleagte = {
if (me._modeProp.getValue() == 'leg') {
logprint(LOG_INFO, 'flight-plan cleared, switching GPS to OBS mode');
me._captureCurrentCourse();
me._selectOBSMode();
}
},
@ -227,6 +236,7 @@ var DefaultGPSDeleagte = {
# revert to OBS mode
logprint(LOG_INFO, "default GPS reached Direct-To, resuming to OBS");
me._captureCurrentCourse();
me._selectOBSMode();
}
} else if (mode == 'leg') {
@ -235,6 +245,11 @@ var DefaultGPSDeleagte = {
if (nextIndex >= me.flightplan.numWaypoints()) {
logprint(LOG_INFO, "default GPS sequencing, finishing flightplan");
me.flightplan.finish();
} elsif (me.flightplan.nextWP().wp_type == 'discontinuity') {
logprint(LOG_INFO, "default GPS sequencing DISCONTINUITY in flightplan, switching to OBS mode");
me._captureCurrentCourse();
me._selectOBSMode();
} else {
logprint(LOG_INFO, "default GPS sequencing to next WP");
me.flightplan.current = nextIndex;