+
+ // search glideslope station
+ if ((_navaid.valid()) && (_navaid->type() != FGPositioned::VOR))
+ {
+ FGNavList::TypeFilter gsFilter(FGPositioned::GS);
+ FGNavRecord* gs = FGNavList::findByFreq(freq, globals->get_aircraft_position(),
+ &gsFilter);
+ if ((!_nav_search) && (gs == _gs))
+ {
+ _nav_search = true; // search NAV on next iteration
+ return; // g/s hasn't changed, neither has nav - we're done
+ }
+ // remember new glideslope station
+ _gs = gs;
+ }
+
+ _nav_search = true; // search NAV on next iteration
+
+ // nav or gs station has changed
+ updateNav();
+}
+
+// Update current nav/adf/glideslope outputs when station has changed
+void FGNavRadio::updateNav()
+{
+ // update necessary, nav and/or gs has changed
+ FGNavRecord* nav = _navaid;