Ref T730, namespace for BlackCore::Afv

* added namespace
* removed some *.pri files and added files to blackcore.pro
* added copyright etc.
This commit is contained in:
Klaus Basan
2019-09-19 00:56:54 +02:00
committed by Mat Sutcliffe
parent d064da13b5
commit 384aa3ce19
46 changed files with 2985 additions and 2916 deletions

View File

@@ -7,12 +7,14 @@
#include <QJsonObject>
#include <QJsonArray>
using namespace BlackCore::Afv;
AFVMapReader::AFVMapReader(QObject *parent) : QObject(parent)
{
model = new AtcStationModel(this);
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &AFVMapReader::updateFromMap);
timer->start(3000);
m_model = new CSampleAtcStationModel(this);
m_timer = new QTimer(this);
connect(m_timer, &QTimer::timeout, this, &AFVMapReader::updateFromMap);
m_timer->start(3000);
}
void AFVMapReader::updateFromMap()
@@ -32,7 +34,7 @@ void AFVMapReader::updateFromMap()
if (jsonDoc.isObject())
{
QJsonObject rootObject = jsonDoc.object();
QVector<AtcStation> transceivers;
QVector<CSampleAtcStation> transceivers;
if (rootObject.contains("controllers"))
{
@@ -79,11 +81,11 @@ void AFVMapReader::updateFromMap()
}
if (transceivers.isEmpty()) { return; }
transceivers.erase(std::remove_if(transceivers.begin(), transceivers.end(), [this](const AtcStation &s)
transceivers.erase(std::remove_if(transceivers.begin(), transceivers.end(), [this](const CSampleAtcStation &s)
{
return s.callsign() == m_callsign;
}),
transceivers.end());
model->updateAtcStations(transceivers);
m_model->updateAtcStations(transceivers);
}
}