From 015ead9fcc45e1d509eea2eab444ec0866546a02 Mon Sep 17 00:00:00 2001 From: daveluff Date: Sun, 5 Mar 2006 16:49:20 +0000 Subject: [PATCH] Add the MAXNI IAF to the C83 approach, and add a few guards against not finding the fixes in the data. I realise that tweaking a hard-coded approach seems daft when loading approach data from file is high on the TODO, but I'm using C83 as an example for a readme so it may as well match the published chart properly... --- src/Instrumentation/dclgps.cxx | 51 ++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/src/Instrumentation/dclgps.cxx b/src/Instrumentation/dclgps.cxx index 41d391b9f..eb90804c1 100644 --- a/src/Instrumentation/dclgps.cxx +++ b/src/Instrumentation/dclgps.cxx @@ -561,33 +561,50 @@ void DCLGPS::init() { iap->_MAP.clear(); // ------- wp = new GPSWaypoint; - wp->id = "PATYY"; + wp->id = "MAXNI"; // Nasty using the find any function here, but it saves converting data from FGFix etc. - fp = FindFirstById(wp->id, multi, true); - *wp = *fp; - wp->appType = GPS_IAF; - iap->_IAF.push_back(wp); + fp = FindFirstById(wp->id, multi, true); + if(fp) { + *wp = *fp; + wp->appType = GPS_IAF; + iap->_IAF.push_back(wp); + } + // ------- + wp = new GPSWaypoint; + wp->id = "PATYY"; + fp = FindFirstById(wp->id, multi, true); + if(fp) { + *wp = *fp; + wp->appType = GPS_IAF; + iap->_IAF.push_back(wp); + } // ------- wp = new GPSWaypoint; wp->id = "TRACY"; - fp = FindFirstById(wp->id, multi, true); - *wp = *fp; - wp->appType = GPS_IAF; - iap->_IAF.push_back(wp); + fp = FindFirstById(wp->id, multi, true); + if(fp) { + *wp = *fp; + wp->appType = GPS_IAF; + iap->_IAF.push_back(wp); + } // ------- wp = new GPSWaypoint; wp->id = "TRACY"; - fp = FindFirstById(wp->id, multi, true); - *wp = *fp; - wp->appType = GPS_IAP; - iap->_IAP.push_back(wp); + fp = FindFirstById(wp->id, multi, true); + if(fp) { + *wp = *fp; + wp->appType = GPS_IAP; + iap->_IAP.push_back(wp); + } // ------- wp = new GPSWaypoint; wp->id = "BABPI"; - fp = FindFirstById(wp->id, multi, true); - *wp = *fp; - wp->appType = GPS_FAF; - iap->_IAP.push_back(wp); + fp = FindFirstById(wp->id, multi, true); + if(fp) { + *wp = *fp; + wp->appType = GPS_FAF; + iap->_IAP.push_back(wp); + } // ------- wp = new GPSWaypoint; wp->id = "AMOSY"; -- 2.39.5