1
0
Fork 0

HUD tweak - don't show cross-track error if it's (effectively) zero.

This commit is contained in:
jmt 2009-10-18 21:08:22 +00:00 committed by Tim Moore
parent 332e7fc59b
commit 71a9e3d419

View file

@ -488,10 +488,16 @@ void drawHUD(osg::State* state)
apY -= 15;
double courseError = curWp->getDoubleValue("course-error-nm");
// generate an arrow indicatinng if the pilot should turn left or right
char dir = (courseError < 0.0) ? '<' : '>';
snprintf(hud_gps_text1, 256, "GPS TRK:%03.0f XTRK:%c%4.2fnm",
gps->getDoubleValue("indicated-track-magnetic-deg"), dir, fabs(courseError));
if (fabs(courseError) >= 0.01) {
// generate an arrow indicatinng if the pilot should turn left or right
char dir = (courseError < 0.0) ? '<' : '>';
snprintf(hud_gps_text1, 256, "GPS TRK:%03.0f XTRK:%c%4.2fnm",
gps->getDoubleValue("indicated-track-magnetic-deg"), dir, fabs(courseError));
} else { // on course, don't bother showing the XTRK error
snprintf(hud_gps_text1, 256, "GPS TRK:%03.0f",
gps->getDoubleValue("indicated-track-magnetic-deg"));
}
HUD_TextList.add( fgText( 40, apY, hud_gps_text1) );
apY -= 15;
} // of valid GPS output