Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+8
-9
@@ -11,11 +11,10 @@ namespace TetraRadio
|
||||
{
|
||||
|
||||
ConvertFromJson::ConvertFromJson(const std::shared_ptr<TrainingAreaBase::RecvFromTab> &rxHandler,
|
||||
const char *loggerName)
|
||||
: m_rxHandler(rxHandler)
|
||||
const char *loggerName) : m_rxHandler(rxHandler)
|
||||
, m_bWarnedOnce(false)
|
||||
.getNGLLogger(loggerName))
|
||||
{}
|
||||
.getNGLLogger(loggerName)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter)
|
||||
{
|
||||
@@ -30,14 +29,14 @@ bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter)
|
||||
if (!sendCounter.isDouble())
|
||||
return false;
|
||||
recvCounter = sendCounter.toInt(-1);
|
||||
DEBUG_LOG() << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString();
|
||||
DEBUG_LOG(m_logger) << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString();
|
||||
if (recvCounter < 0)
|
||||
return false;
|
||||
}
|
||||
const QJsonValue typeId = obj.value(QStringLiteral("typeId"));
|
||||
if (!typeId.isDouble())
|
||||
{
|
||||
ERROR_LOG() << "Can not read type id: " << baJson;
|
||||
ERROR_LOG(m_logger) << "Can not read type id: " << baJson;
|
||||
return false;
|
||||
}
|
||||
const QJsonObject data = obj.value(QStringLiteral("data")).toObject();
|
||||
@@ -163,14 +162,14 @@ bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter)
|
||||
|
||||
break;
|
||||
default:
|
||||
WARNING_LOG() << "Handler for telegram Id " << typeId.toInt()
|
||||
WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt()
|
||||
<< " not yet implemented (" << baJson << ")";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")";
|
||||
WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -183,7 +182,7 @@ void ConvertFromJson::rxData(const T &data)
|
||||
{
|
||||
if (!m_bWarnedOnce)
|
||||
{
|
||||
ERROR_LOG() << "No RecvFromTab available";
|
||||
ERROR_LOG(m_logger) << "No RecvFromTab available";
|
||||
m_bWarnedOnce = true;
|
||||
}
|
||||
return;
|
||||
|
||||
+2
@@ -16,6 +16,7 @@ public:
|
||||
virtual ~ConvertFromJson() = default;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool handleTelegram(const QByteArray &baJson, int &recvCounter);
|
||||
virtual void handleAcknowledge(qint64 timeStamp, int counter) = 0;
|
||||
virtual void handleTetraConnectionChanged(bool bConnected) = 0;
|
||||
@@ -28,6 +29,7 @@ private:
|
||||
static TrainingAreaBase::TetraIcd::BiteError convertBiteError(const QJsonObject &obj);
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_rxHandler;
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool m_bWarnedOnce;
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -240,7 +240,7 @@ bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::Sanitation &data)
|
||||
|
||||
bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data)
|
||||
{
|
||||
DEBUG_LOG() << "ConvertToJson::txData SelectiveReammunition";
|
||||
DEBUG_LOG(m_logger) << "ConvertToJson::txData SelectiveReammunition";
|
||||
return sendToTx(&data);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::SetDevicePowerReque
|
||||
|
||||
bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::OcCommand &data)
|
||||
{
|
||||
DEBUG_LOG() << "ConvertToJson::txData OcCommand";
|
||||
DEBUG_LOG(m_logger) << "ConvertToJson::txData OcCommand";
|
||||
return sendToTx(&data);
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ bool ConvertToJson::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTeleg
|
||||
obj[QStringLiteral("counter")] = m_sendCounter++;
|
||||
const QByteArray ba = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
if (data->id() != TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG)
|
||||
DEBUG_LOG() << "Sending tele: " << ba;
|
||||
DEBUG_LOG(m_logger) << "Sending tele: " << ba;
|
||||
emit outgoingMessage(ba);
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
@@ -72,7 +72,9 @@ public:
|
||||
Q_SIGNALS:
|
||||
void outgoingMessage(const QByteArray &msg);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_sendCounter;
|
||||
bool m_bConnected;
|
||||
};
|
||||
|
||||
+7
-7
@@ -45,7 +45,7 @@ TetraJsonInterfaceImpl::TetraJsonInterfaceImpl(TrainingAreaBase::Plugin::DataPro
|
||||
settings->settings()->value(QLatin1String("AES/use2BytesForSingleFireDiameter"), true).toBool());
|
||||
N_CoPrtCnv::CoPrtCnvTelegramConverter::setUsePvSan(
|
||||
settings->settings()->value(QLatin1String("TrainingAreaBase/UsePvSan"), false).toBool());
|
||||
ERROR_LOG() << "hello i got this!";
|
||||
ERROR_LOG(m_logger) << "hello i got this!";
|
||||
}
|
||||
|
||||
TetraJsonInterfaceImpl::~TetraJsonInterfaceImpl()
|
||||
@@ -70,7 +70,7 @@ void TetraJsonInterfaceImpl::exerciseChanged()
|
||||
NOTICE_LOG(m_logger) << "TetraJsonInterfaceImpl::exerciseChanged";
|
||||
if (m_pdp->exerciseRadioGroup().id() != m_radioGrpId)
|
||||
if (!updatePrtCnv())
|
||||
ERROR_LOG() << "Error changing PrtCnv state from radio grp id: "
|
||||
ERROR_LOG(m_logger) << "Error changing PrtCnv state from radio grp id: "
|
||||
<< m_radioGrpId
|
||||
<< " to " << m_pdp->exerciseRadioGroup().id();
|
||||
}
|
||||
@@ -92,7 +92,7 @@ bool TetraJsonInterfaceImpl::updatePrtCnv()
|
||||
QFile::remove(iniFileOut());
|
||||
if (!QFile::copy(iniFileIn(), iniFileOut()))
|
||||
{
|
||||
ERROR_LOG() << "Error creating ini file for PrtCnv: " << iniFileOut();
|
||||
ERROR_LOG(m_logger) << "Error creating ini file for PrtCnv: " << iniFileOut();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -133,10 +133,10 @@ bool TetraJsonInterfaceImpl::checkConfigTemplates()
|
||||
{
|
||||
if (!QFile::exists(iniFileIn()))
|
||||
{
|
||||
INFO_LOG() << "Creating " << iniFileIn();
|
||||
INFO_LOG(m_logger) << "Creating " << iniFileIn();
|
||||
if (!QFile::copy(QStringLiteral(":/PrtCnv.dat"), iniFileIn()))
|
||||
{
|
||||
ERROR_LOG() << "Error creating " << iniFileIn();
|
||||
ERROR_LOG(m_logger) << "Error creating " << iniFileIn();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -145,10 +145,10 @@ bool TetraJsonInterfaceImpl::checkConfigTemplates()
|
||||
|
||||
if (!QFile::exists(playerIdsFile()))
|
||||
{
|
||||
INFO_LOG() << "Creating " << playerIdsFile();
|
||||
INFO_LOG(m_logger) << "Creating " << playerIdsFile();
|
||||
if (!QFile::copy(QStringLiteral(":/playerIds.dat"), playerIdsFile()))
|
||||
{
|
||||
ERROR_LOG() << "Error creating " << playerIdsFile();
|
||||
ERROR_LOG(m_logger) << "Error creating " << playerIdsFile();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
void onTetraConnectionChanged(bool bConnected);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void cleanupProcess();
|
||||
static QString iniFileIn();
|
||||
QString iniFileOut() const;
|
||||
|
||||
Reference in new issue
Block a user