From 18ada05d41c2874477d52601b8b38474673162e8 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 9 Mar 2011 22:04:03 +0100 Subject: [PATCH] Fix navreceiver to make DME work with ILS signals. Property "dme-in-range" should also work with ILS signals, which include a DME. The nav database (dme_list) doesn't have separate entries for "ILS-DME" (unlike for "VOR-DME"), so searching a DME by frequency didn't work for ILS. => "instrumentation/nav[*]/dme-in-range" can now be used to enable/disable cockpit DME displays. --- src/Instrumentation/navradio.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/navradio.cxx b/src/Instrumentation/navradio.cxx index 5ae4e554f..bde228991 100644 --- a/src/Instrumentation/navradio.cxx +++ b/src/Instrumentation/navradio.cxx @@ -940,7 +940,11 @@ void FGNavRadio::search() _navaid = nav; string identBuffer(4, ' '); if (nav) { - _dme = globals->get_dmelist()->findByFreq(freq, pos); + // use ILS signals as DME, otherwise search by frequency + if (nav->type()==FGPositioned::ILS) + _dme = nav; + else + _dme = globals->get_dmelist()->findByFreq(freq, pos); nav_id_node->setStringValue(nav->get_ident()); identBuffer = simgear::strutils::rpad( nav->ident(), 4, ' ' );