1
0
Fork 0

Previously if a freq search matched an ILS that had no dme, it would

proceed to search for an VOR of that same frequency.  On rare occasion
this search could return true with a far distant VOR and cause a small
amount of confusion.
This commit is contained in:
curt 2003-04-01 03:44:20 +00:00
parent fe3283eb12
commit d25fa96db3

View file

@ -151,14 +151,19 @@ DME::search (double frequency_mhz, double longitude_rad,
longitude_rad, longitude_rad,
latitude_rad, latitude_rad,
altitude_m); altitude_m);
if (ils != 0 && ils->get_has_dme()) { if (ils !=0) {
_transmitter_valid = true; if (ils->get_has_dme()) {
_transmitter = Point3D(ils->get_dme_x(), _transmitter_valid = true;
ils->get_dme_y(), _transmitter = Point3D(ils->get_dme_x(),
ils->get_dme_z()); ils->get_dme_y(),
_transmitter_elevation_ft = ils->get_gselev() * SG_METER_TO_FEET; ils->get_dme_z());
_transmitter_range_nm = 50; // arbitrary _transmitter_elevation_ft = ils->get_gselev() * SG_METER_TO_FEET;
return; _transmitter_range_nm = 50; // arbitrary
return;
} else {
_transmitter_valid = false;
return;
}
} }
// try the VORs next // try the VORs next
@ -166,14 +171,18 @@ DME::search (double frequency_mhz, double longitude_rad,
longitude_rad, longitude_rad,
latitude_rad, latitude_rad,
altitude_m); altitude_m);
if (nav != 0) if (nav != 0) {
if (nav != 0 && nav->get_has_dme()) { if (nav->get_has_dme()) {
_transmitter_valid = true; _transmitter_valid = true;
_transmitter = Point3D(nav->get_x(), _transmitter = Point3D(nav->get_x(),
nav->get_y(), nav->get_y(),
nav->get_z()); nav->get_z());
_transmitter_elevation_ft = nav->get_elev() * SG_METER_TO_FEET; _transmitter_elevation_ft = nav->get_elev() * SG_METER_TO_FEET;
_transmitter_range_nm = nav->get_range(); // fixme _transmitter_range_nm = nav->get_range(); // fixme
return;
}
} else {
_transmitter_valid = false;
return; return;
} }