mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #398, asserts for frequency
the line
if (frequencyKHz < 100000) { frequencyKHz += 100000; }
might be removed after the fix
This commit is contained in:
@@ -745,8 +745,11 @@ namespace BlackCore
|
||||
|
||||
void CNetworkVatlib::onAtcPositionUpdate(VatSessionID, const char *callsign, const VatAtcPosition *pos, void *cbvar)
|
||||
{
|
||||
CFrequency freq(pos->frequency, CFrequencyUnit::kHz());
|
||||
int frequencyKHz = pos->frequency;
|
||||
if (frequencyKHz < 100000) { frequencyKHz += 100000; }
|
||||
CFrequency freq(frequencyKHz, CFrequencyUnit::kHz());
|
||||
freq.switchUnit(CFrequencyUnit::MHz()); // we would not need to bother, but this makes it easier to identify
|
||||
Q_ASSERT(CComSystem::isValidCivilAviationFrequency(freq));
|
||||
emit cbvar_cast(cbvar)->atcPositionUpdate(cbvar_cast(cbvar)->fromFSD(callsign), freq,
|
||||
CCoordinateGeodetic(pos->latitude, pos->longitude, 0), CLength(pos->visibleRange, CLengthUnit::NM()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user