mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Filter non-ATC like OBS stations
ref T563
This commit is contained in:
committed by
Mat Sutcliffe
parent
86015859f3
commit
a4dae5335d
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user