Minor fixes, style

* make sure ATC view is updated when disconnected
* prepared rounding, can be enabled at any time
This commit is contained in:
Klaus Basan
2019-12-05 01:10:11 +01:00
committed by Mat Sutcliffe
parent 1deeaf39e8
commit e1498adc8e
7 changed files with 47 additions and 44 deletions

View File

@@ -11,6 +11,7 @@
#include "blackmisc/logmessage.h"
using namespace BlackMisc;
using namespace BlackMisc::Network;
namespace BlackCore
@@ -50,7 +51,7 @@ namespace BlackCore
{
if (tokens.size() < 7)
{
BlackMisc::CLogMessage(static_cast<AtcDataUpdate *>(nullptr)).warning(u"Wrong number of arguments.");
CLogMessage(static_cast<AtcDataUpdate *>(nullptr)).warning(u"Wrong number of arguments.");
return {};
}

View File

@@ -881,8 +881,11 @@ namespace BlackCore
CFrequency freq(atcDataUpdate.m_frequencykHz, CFrequencyUnit::kHz());
freq.switchUnit(CFrequencyUnit::MHz()); // we would not need to bother, but this makes it easier to identify
const CLength networkRange(atcDataUpdate.m_visibleRange, CLengthUnit::NM());
// Here we could round to channel spacing, based on https://discordapp.com/channels/539048679160676382/539486489977946112/651514202405601291
// CComSystem::roundToChannelSpacing(freq, CComSystem::ChannelSpacing25KHz);
const CLength networkRange(atcDataUpdate.m_visibleRange, CLengthUnit::NM());
const CLength range = fixAtcRange(networkRange, cs);
const CCoordinateGeodetic position(atcDataUpdate.m_latitude, atcDataUpdate.m_longitude, 0);