refs #398, asserts for frequency

the line
if (frequencyKHz < 100000) { frequencyKHz += 100000; }
might be removed after the fix
This commit is contained in:
Klaus Basan
2015-03-28 00:45:20 +01:00
parent 8163ad2762
commit f95504a2c8
2 changed files with 5 additions and 1 deletions

View File

@@ -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()));
}