mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 15:15:39 +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:
@@ -611,6 +611,7 @@ namespace BlackCore
|
|||||||
void CAirspaceMonitor::ps_atcPositionUpdate(const CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency, const CCoordinateGeodetic &position, const BlackMisc::PhysicalQuantities::CLength &range)
|
void CAirspaceMonitor::ps_atcPositionUpdate(const CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency, const CCoordinateGeodetic &position, const BlackMisc::PhysicalQuantities::CLength &range)
|
||||||
{
|
{
|
||||||
Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this));
|
Q_ASSERT(BlackCore::isCurrentThreadCreatingThread(this));
|
||||||
|
Q_ASSERT(CComSystem::isValidCivilAviationFrequency(frequency));
|
||||||
if (!this->m_connected) { return; }
|
if (!this->m_connected) { return; }
|
||||||
CAtcStationList stationsWithCallsign = this->m_atcStationsOnline.findByCallsign(callsign);
|
CAtcStationList stationsWithCallsign = this->m_atcStationsOnline.findByCallsign(callsign);
|
||||||
if (stationsWithCallsign.isEmpty())
|
if (stationsWithCallsign.isEmpty())
|
||||||
|
|||||||
@@ -745,8 +745,11 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CNetworkVatlib::onAtcPositionUpdate(VatSessionID, const char *callsign, const VatAtcPosition *pos, void *cbvar)
|
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
|
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,
|
emit cbvar_cast(cbvar)->atcPositionUpdate(cbvar_cast(cbvar)->fromFSD(callsign), freq,
|
||||||
CCoordinateGeodetic(pos->latitude, pos->longitude, 0), CLength(pos->visibleRange, CLengthUnit::NM()));
|
CCoordinateGeodetic(pos->latitude, pos->longitude, 0), CLength(pos->visibleRange, CLengthUnit::NM()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user