Filter non-ATC like OBS stations

ref T563
This commit is contained in:
Roland Rossgotterer
2019-03-13 09:12:56 +01:00
committed by Mat Sutcliffe
parent 86015859f3
commit a4dae5335d

View File

@@ -1045,9 +1045,14 @@ namespace BlackCore
freq.switchUnit(CFrequencyUnit::MHz()); // we would not need to bother, but this makes it easier to identify
CLength range(pos->visibleRange, CLengthUnit::NM());
QString cs = cbvar_cast(cbvar)->fromFSD(callsign);
// Filter non-ATC like OBS stations, like pilots logging in as shared cockpit co-pilots.
if (pos->facility == vatFacilityTypeUnknown && !cs.endsWith("_OBS")) { return; }
// ATIS often have a range of 0 nm. Correct this to a proper value.
if (cs.contains("_ATIS") && pos->visibleRange == 0) { range.setValueSameUnit(150.0); }
CCoordinateGeodetic position(pos->latitude, pos->longitude, 0);
emit cbvar_cast(cbvar)->atcPositionUpdate(CCallsign(cs, CCallsign::Atc), freq, position, range);
}