Complete Qt6/rtiddsgen migration of residual Lts service sources
This commit is contained in:
86 files changed
+1235
-1128
No files matched your search
@@ -4,7 +4,8 @@
|
||||
#include "canag_handler.h"
|
||||
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtils/qbytearray_byteaccess.h>
|
||||
#include <LtsUtilsCore/qbytearray_byteaccess.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "connection_handler.h"
|
||||
#include "main_handler.h"
|
||||
@@ -222,7 +223,8 @@ void TxDdlHandler::sendAbort(quint8 error)
|
||||
}
|
||||
|
||||
RxDdlHandler::RxDdlHandler(bool isMultiplexed)
|
||||
: m_isMultiplexed(isMultiplexed)
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_isMultiplexed(isMultiplexed)
|
||||
{}
|
||||
|
||||
void RxDdlHandler::process(const QByteArray &data)
|
||||
@@ -333,7 +335,8 @@ void RxDdlHandler::sendDPConfirmation(const quint32 ccs, const quint32 toggle, c
|
||||
}
|
||||
|
||||
CanagHandler::CanagHandler(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_connectionHandler(mainHandler->connectionHandler())
|
||||
, m_rxHandler(mainHandler->rxHandler())
|
||||
, m_freeText(QByteArray())
|
||||
|
||||
@@ -91,6 +91,7 @@ signals:
|
||||
private:
|
||||
void sendDPConfirmation(const quint32 ccs, const quint32 toggle, const quint32 wirkfeldMultiplex = 0);
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool m_isMultiplexed = false;
|
||||
DdlState m_state = DdlState::NotStarted;
|
||||
|
||||
@@ -186,6 +187,7 @@ private:
|
||||
WakeUpSfm = 1773
|
||||
};
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
std::shared_ptr<ConnectionHandler> m_connectionHandler;
|
||||
std::shared_ptr<HandlerAesData> m_handlerAesData;
|
||||
|
||||
@@ -3,16 +3,20 @@
|
||||
|
||||
#include "connection_handler.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
{
|
||||
|
||||
#ifdef GUEZ_MODE
|
||||
ConnectionHandler::ConnectionHandler()
|
||||
: ConnectionHandlerSerial()
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
#else
|
||||
ConnectionHandler::ConnectionHandler()
|
||||
: ConnectionHandlerTcpTtci()
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
#endif
|
||||
|
||||
|
||||
+2
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
|
||||
+3
-1
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
@@ -28,7 +30,7 @@ bool ConnectionHandlerTcp::init()
|
||||
m_socket = new QTcpSocket();
|
||||
|
||||
connect(m_socket, &QTcpSocket::readyRead, this, &ConnectionHandlerTcp::read);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &ConnectionHandlerTcp::handleError);
|
||||
connect(m_socket, &QAbstractSocket::errorOccurred, this, &ConnectionHandlerTcp::handleError);
|
||||
connect(m_socket, &QTcpSocket::disconnected, this, &ConnectionHandlerTcp::open);
|
||||
connect(m_socket, &QTcpSocket::disconnected, this, &ConnectionHandlerTcp::disconnectedFromEq);
|
||||
open();
|
||||
|
||||
+2
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
using namespace NGL;
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
|
||||
@@ -62,7 +62,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
|
||||
} // Namespace PDM
|
||||
+162
-159
@@ -6,7 +6,9 @@
|
||||
#include <utility>
|
||||
#include <QtCore/QPointF>
|
||||
|
||||
#include <LtsUtils/qbytearray_byteaccess.h>
|
||||
#include <LtsUtilsCore/qbytearray_byteaccess.h>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "handler_aes_data.h"
|
||||
#include "settings.h"
|
||||
@@ -33,6 +35,7 @@ HandlerAesData::HandlerAesData(const std::shared_ptr<DdsHandler> &dds,
|
||||
, m_aesFtc(aesFtc)
|
||||
, m_pdmDtc(pdmDtc)
|
||||
, m_utmCoord(LtsCoordTrans::UtmCoordinate::fromMgrs(Settings::baseCoord()))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -262,28 +265,28 @@ template <typename T> static inline void getBasicData(const QByteArray &data, si
|
||||
uint64_t tmp;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.id(tmp);
|
||||
req.name(data.mid(pos, 8).toStdString());
|
||||
QString name = QString::fromStdString(req.name());
|
||||
req.id = tmp;
|
||||
req.name = data.mid(pos, 8).toStdString();
|
||||
QString name = QString::fromStdString(req.name);
|
||||
|
||||
name = name.replace(QRegularExpression(QStringLiteral("[^ -~]")), QLatin1String(""));
|
||||
name = name.trimmed();
|
||||
if (!name.isEmpty())
|
||||
req.name(name.toStdString());
|
||||
req.name = name.toStdString();
|
||||
|
||||
pos += 8;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
if (tmp != 0)
|
||||
req.partyId(dds::core::optional<int32_t>(tmp));
|
||||
req.partyId = dds::core::optional<int32_t>(tmp);
|
||||
else
|
||||
req.partyId(dds::core::optional<int32_t>());
|
||||
req.partyId = dds::core::optional<int32_t>();
|
||||
if (!withoutEffectStart)
|
||||
{
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
if (tmp != 0)
|
||||
req.effectStart(dds::core::optional<rti::core::int64>(tmp * 1000));
|
||||
req.effectStart = dds::core::optional<rti::core::int64>(tmp * 1000);
|
||||
else
|
||||
req.effectStart(dds::core::optional<rti::core::int64>());
|
||||
req.effectStart = dds::core::optional<rti::core::int64>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +313,7 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
|
||||
LtsUtils::get1Byte(data, pos, cnt);
|
||||
|
||||
AreaEffectSimulation::BCContaminationModifyRequest req;
|
||||
req.weatherSource(AreaEffectSimulation::AesWeatherSource::AwsNoUpdate);
|
||||
req.weatherSource = AreaEffectSimulation::AesWeatherSource::AwsNoUpdate;
|
||||
uint64_t tmp;
|
||||
int x = 0, y = 0;
|
||||
|
||||
@@ -318,41 +321,41 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
|
||||
{
|
||||
getBasicData(data, pos, req);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.effectDuration(tmp * 60 * 1000);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition(relativeToGeoPosition(x, y));
|
||||
req.effectDuration = tmp * 60 * 1000;
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition = relativeToGeoPosition(x, y);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.impactRadius(tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.propagationDirection(dds::core::optional<double>(compassToMathAngleForSfm(tmp)));
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.windSpeed(dds::core::optional<double>(tmp));
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
req.weatherTimestamp(dds::core::optional<rti::core::int64>(tmp * 1000));
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.weatherPosition(dds::core::optional<Core::GeoPosition2D>(relativeToGeoPosition(x, y)));
|
||||
req.impactRadius = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.propagationDirection = dds::core::optional<double>(compassToMathAngleForSfm(tmp));
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.windSpeed = dds::core::optional<double>(tmp);
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
req.weatherTimestamp = dds::core::optional<rti::core::int64>(tmp * 1000);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.weatherPosition = dds::core::optional<Core::GeoPosition2D>(relativeToGeoPosition(x, y));
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Chemical, tmp);
|
||||
if (req.chargeTypeId == 0)
|
||||
req.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Biological, tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Chemical, tmp));
|
||||
if (req.chargeTypeId() == 0)
|
||||
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Biological, tmp));
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req;
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "BC contamination: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id());
|
||||
req.id(req.id() * -1);
|
||||
aesToBeDeleted.removeAll(req.id);
|
||||
req.id = req.id * -1;
|
||||
|
||||
m_aesFtc->bCContaminationModifyRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : std::as_const(aesToBeDeleted))
|
||||
{
|
||||
if (m_aesDtc->bCContamination(id).isCentral())
|
||||
if (m_aesDtc->bCContamination(id).isCentral)
|
||||
continue;
|
||||
if (m_aesDtc->bCContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (m_aesDtc->bCContamination(id).effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing BC contamination id: " << id;
|
||||
m_aesFtc->bCContaminationRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -377,78 +380,78 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
|
||||
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.id(tmp);
|
||||
|
||||
req.name(data.mid(pos, 8).toStdString());
|
||||
QString name = QString::fromStdString(req.name());
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.id = tmp;
|
||||
|
||||
req.name = data.mid(pos, 8).toStdString();
|
||||
QString name = QString::fromStdString(req.name);
|
||||
|
||||
name = name.replace(QRegularExpression(QStringLiteral("[^ -~]")), QLatin1String(""));
|
||||
name = name.trimmed();
|
||||
if (!name.isEmpty())
|
||||
req.name(name.toStdString());
|
||||
req.name = name.toStdString();
|
||||
|
||||
pos += 8;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.partyId(tmp);
|
||||
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
req.effectStart(tmp * 1000);
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.effectDuration(tmp * 1000);
|
||||
|
||||
|
||||
AreaEffectSimulation::Area area;
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
area.cornerBottomLeft(relativeToGeoPosition(x, y));
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.width(tmp * 5);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.height(tmp * 5);
|
||||
req.partyId = tmp;
|
||||
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
req.effectStart = tmp * 1000;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
area.rotation(mathToCompassAngle(tmp + 9000));
|
||||
req.area(area);
|
||||
req.effectDuration = tmp * 1000;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.mhpRotation(mathToCompassAngle(tmp + 9000));
|
||||
AreaEffectSimulation::Area area;
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
area.cornerBottomLeft = relativeToGeoPosition(x, y);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.width = tmp * 5;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.height = tmp * 5;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
area.rotation = mathToCompassAngle(tmp + 9000);
|
||||
req.area = area;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.impactCount(tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.mhpRotation = mathToCompassAngle(tmp + 9000);
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Artillery, tmp));
|
||||
if (req.chargeStruct().chargeTypeId() == 0)
|
||||
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Mortar, tmp));
|
||||
if (req.chargeStruct().chargeTypeId() == 0)
|
||||
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::AirSupport, tmp));
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.impactCount = tmp;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.mhpCount(tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.chargeStruct.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Artillery, tmp);
|
||||
if (req.chargeStruct.chargeTypeId == 0)
|
||||
req.chargeStruct.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Mortar, tmp);
|
||||
if (req.chargeStruct.chargeTypeId == 0)
|
||||
req.chargeStruct.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_AirSupport, tmp);
|
||||
|
||||
|
||||
for (int32_t mhpCounter = 0; mhpCounter < req.mhpCount(); ++mhpCounter)
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.mhpCount = tmp;
|
||||
|
||||
|
||||
for (int32_t mhpCounter = 0; mhpCounter < req.mhpCount; ++mhpCounter)
|
||||
{
|
||||
LtsUtils::get3Byte(data, pos, tmp);
|
||||
LtsUtils::get3Byte(data, pos, tmp);
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "New ExplosionClusterOcModifyRequest: "
|
||||
<< "\nid:" << req.id() << "\nname:" << req.name() << "\neffectStart:" << req.effectStart() << "\neffectDuration:" << req.effectDuration()
|
||||
<< "\narea:" << req.area() << "\nmhpCount:" << req.mhpCount() << "\nmhpRotation:" << req.mhpRotation() << "\nimpactCount:" << req.impactCount()
|
||||
<< "\nchargeTypeId:" << req.chargeStruct().chargeTypeId() << "\npartyId:" << req.partyId();
|
||||
<< "\nid:" << req.id << "\nname:" << req.name << "\neffectStart:" << req.effectStart << "\neffectDuration:" << req.effectDuration
|
||||
<< "\narea:" << req.area << "\nmhpCount:" << req.mhpCount << "\nmhpRotation:" << req.mhpRotation << "\nimpactCount:" << req.impactCount
|
||||
<< "\nchargeTypeId:" << req.chargeStruct.chargeTypeId << "\npartyId:" << req.partyId;
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion cluster: " << req;
|
||||
aesToBeDeleted.removeOne(req.id());
|
||||
req.id(req.id() * -1);
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "explosion cluster: " << req;
|
||||
aesToBeDeleted.removeOne(req.id);
|
||||
req.id = req.id * -1;
|
||||
|
||||
m_aesFtc->explosionClusterOcModifyRequest(req, this);
|
||||
}
|
||||
@@ -457,14 +460,14 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
|
||||
{
|
||||
const AreaEffectSimulation::ExplosionCluster &exp = m_aesDtc->explosionCluster(id);
|
||||
|
||||
if (exp.isCentral())
|
||||
if (exp.isCentral)
|
||||
continue;
|
||||
|
||||
if ((exp.effectStateId().underlying() >= AreaEffectSimulation::AesEffectState::EsPrepared)
|
||||
|| ((exp.effectStateId().underlying() >= AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
&& (((exp.effectStart().is_set() && ((exp.effectStart().get() + exp.effectDuration())) < (m_dds->currentPartitionTime() - 5000)))
|
||||
||
|
||||
(exp.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsPaused))))
|
||||
if ((exp.effectStateId >= AreaEffectSimulation::AesEffectState::EsPrepared)
|
||||
|| ((exp.effectStateId >= AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
&& (((exp.effectStart.is_set() && ((exp.effectStart.get() + exp.effectDuration)) < (m_dds->currentPartitionTime() - 5000)))
|
||||
||
|
||||
(exp.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused))))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing explosion cluster with id: " << id;
|
||||
m_aesFtc->explosionClusterRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -491,31 +494,31 @@ void HandlerAesData::explosionSingles(const QByteArray &data)
|
||||
{
|
||||
getBasicData(data, pos, req);
|
||||
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition(relativeToGeoPosition(x, y));
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition = relativeToGeoPosition(x, y);
|
||||
if (m_use2BytesForSingleFireDiameter)
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
else
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Artillery, tmp));
|
||||
if (req.chargeTypeId() == 0)
|
||||
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Mortar, tmp));
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req;
|
||||
req.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Artillery, tmp);
|
||||
if (req.chargeTypeId == 0)
|
||||
req.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Mortar, tmp);
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "explosion single: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id());
|
||||
req.id(req.id() * -1);
|
||||
aesToBeDeleted.removeAll(req.id);
|
||||
req.id = req.id * -1;
|
||||
m_aesFtc->explosionSingleModifyRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : std::as_const(aesToBeDeleted))
|
||||
{
|
||||
const AreaEffectSimulation::ExplosionSingle &exp = m_aesDtc->explosionSingle(id);
|
||||
if (exp.isCentral())
|
||||
if (exp.isCentral)
|
||||
continue;
|
||||
if ((exp.effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
&& (exp.effectStart().is_set() && (exp.effectStart().get() > (m_dds->currentPartitionTime() + 5000))))
|
||||
if ((exp.effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
&& (exp.effectStart.is_set() && (exp.effectStart.get() > (m_dds->currentPartitionTime() + 5000))))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing explosion single id: " << id;
|
||||
m_aesFtc->explosionSingleRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -541,49 +544,49 @@ void HandlerAesData::functionalAreas(const QByteArray &data)
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
getBasicData(data, pos, req, true);
|
||||
if (!aesToBeDeleted.contains(req.id()))
|
||||
req.effectStart(dds::core::optional<rti::core::int64>(m_dds->currentPartitionTime() + 100));
|
||||
if (!aesToBeDeleted.contains(req.id))
|
||||
req.effectStart = dds::core::optional<rti::core::int64>(m_dds->currentPartitionTime() + 100);
|
||||
|
||||
|
||||
AreaEffectSimulation::Area area;
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
area.cornerBottomLeft(relativeToGeoPosition(x, y));
|
||||
area.cornerBottomLeft = relativeToGeoPosition(x, y);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.width(tmp * 5);
|
||||
area.width = tmp * 5;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
area.height(tmp * 5);
|
||||
area.rotation(0);
|
||||
req.area(area);
|
||||
area.height = tmp * 5;
|
||||
area.rotation = 0;
|
||||
req.area = area;
|
||||
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.deconMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
|
||||
req.deconMode = static_cast<AreaEffectSimulation::AesOperatingMode>(tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.deconTime(tmp * 10 * 60 * 1000);
|
||||
req.deconTime = tmp * 10 * 60 * 1000;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.maintMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
|
||||
req.maintMode = static_cast<AreaEffectSimulation::AesOperatingMode>(tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.maintTime(tmp * 10 * 60 * 1000);
|
||||
req.maintTime = tmp * 10 * 60 * 1000;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.medicMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
|
||||
req.medicMode = static_cast<AreaEffectSimulation::AesOperatingMode>(tmp);
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.medicTime(tmp * 10 * 60 * 1000);
|
||||
req.chargeTypeId(411);
|
||||
req.medicTime = tmp * 10 * 60 * 1000;
|
||||
req.chargeTypeId = 411;
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "functional area: " << req;
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "functional area: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id());
|
||||
req.id(req.id() * -1);
|
||||
aesToBeDeleted.removeAll(req.id);
|
||||
req.id = req.id * -1;
|
||||
|
||||
m_aesFtc->functionalAreaModifyRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : std::as_const(aesToBeDeleted))
|
||||
{
|
||||
if (m_aesDtc->functionalArea(id).isCentral())
|
||||
if (m_aesDtc->functionalArea(id).isCentral)
|
||||
continue;
|
||||
if (m_aesDtc->functionalArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (m_aesDtc->functionalArea(id).effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing functional area id: " << id;
|
||||
m_aesFtc->functionalAreaRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -611,36 +614,36 @@ void HandlerAesData::nContaminations(const QByteArray &data)
|
||||
getBasicData(data, pos, req);
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.effectDuration(tmp * 6 * 60 * 1000);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition(relativeToGeoPosition(x, y));
|
||||
req.effectDuration = tmp * 6 * 60 * 1000;
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
req.impactPosition = relativeToGeoPosition(x, y);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.impactRadius(tmp);
|
||||
req.impactRadius = tmp;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.borderLengthInner(tmp);
|
||||
req.borderLengthInner = tmp;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.borderLengthOuter(tmp);
|
||||
req.borderLengthOuter = tmp;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.spanAngle(tmp / 100.0);
|
||||
req.spanAngle = tmp / 100.0;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.rotationAngle(mathToCompassAngle(tmp));
|
||||
req.rotationAngle = mathToCompassAngle(tmp);
|
||||
|
||||
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Nuclear, 1));
|
||||
req.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_Nuclear, 1);
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req;
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "N contamination: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id());
|
||||
req.id(req.id() * -1);
|
||||
aesToBeDeleted.removeAll(req.id);
|
||||
req.id = req.id * -1;
|
||||
|
||||
m_aesFtc->nContaminationModifyRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : std::as_const(aesToBeDeleted))
|
||||
{
|
||||
if (m_aesDtc->nContamination(id).isCentral())
|
||||
if (m_aesDtc->nContamination(id).isCentral)
|
||||
continue;
|
||||
if (m_aesDtc->nContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (m_aesDtc->nContamination(id).effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing N contamination id: " << id;
|
||||
m_aesFtc->nContaminationRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -668,52 +671,52 @@ void HandlerAesData::mineAreas(const QByteArray &data)
|
||||
getBasicData(data, pos, req);
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.effectDuration(tmp * 60 * 60 * 1000);
|
||||
req.effectDuration = tmp * 60 * 60 * 1000;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.width(tmp);
|
||||
req.width = tmp;
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
req.density(tmp / 100.0);
|
||||
req.density = tmp / 100.0;
|
||||
|
||||
LtsUtils::get1Byte(data, pos, tmp);
|
||||
if (217 > tmp && 210 < tmp)
|
||||
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::MineArea, tmp));
|
||||
req.chargeStruct.chargeTypeId = chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::GearClass_MineArea, tmp);
|
||||
else
|
||||
req.chargeStruct().chargeTypeId(tmp);
|
||||
req.chargeStruct.chargeTypeId = tmp;
|
||||
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
|
||||
|
||||
int segmentCnt = 0;
|
||||
LtsUtils::get1Byte(data, pos, segmentCnt);
|
||||
req.segments().resize(segmentCnt);
|
||||
req.segments.resize(segmentCnt);
|
||||
|
||||
for (int j = 0; j < segmentCnt; ++j)
|
||||
{
|
||||
AreaEffectSimulation::MineSegment &segment = req.segments().at(j);
|
||||
AreaEffectSimulation::MineSegment &segment = req.segments.at(j);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
segment.positionStart(relativeToGeoPosition(x, y));
|
||||
segment.positionStart = relativeToGeoPosition(x, y);
|
||||
LtsUtils::get3Byte(data, pos, y);
|
||||
LtsUtils::get3Byte(data, pos, x);
|
||||
segment.positionEnd(relativeToGeoPosition(x, y));
|
||||
segment.positionEnd = relativeToGeoPosition(x, y);
|
||||
}
|
||||
|
||||
req.isCenterLine(true);
|
||||
req.isCenterLine = true;
|
||||
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "mine area: " << req;
|
||||
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id) ? "Modifying " : "Creating ") << "mine area: " << req;
|
||||
|
||||
aesToBeDeleted.removeAll(req.id());
|
||||
req.id(req.id() * -1);
|
||||
aesToBeDeleted.removeAll(req.id);
|
||||
req.id = req.id * -1;
|
||||
|
||||
req.setMineSorted(false);
|
||||
req.setMineSorted = false;
|
||||
m_aesFtc->mineAreaModifyFromCtaDataRequest(req, this);
|
||||
}
|
||||
|
||||
for (int id : std::as_const(aesToBeDeleted))
|
||||
{
|
||||
if (m_aesDtc->mineArea(id).isCentral())
|
||||
if (m_aesDtc->mineArea(id).isCentral)
|
||||
continue;
|
||||
if (m_aesDtc->mineArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (m_aesDtc->mineArea(id).effectStateId > AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removing mine area id: " << id;
|
||||
m_aesFtc->mineAreaRemoveRequest(Core::RemoveElementRequest(id), this);
|
||||
@@ -754,18 +757,18 @@ void HandlerAesData::explosionAreasResume(const QByteArray &data)
|
||||
LtsUtils::get1Byte(data, pos, cnt);
|
||||
uint64_t tmp;
|
||||
AreaEffectSimulation::ExplosionAreaPauseResumeRequest req;
|
||||
req.resumeExecution(true);
|
||||
req.resumeExecution = true;
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.id(tmp);
|
||||
req.id = tmp;
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.resumeSeed = dds::core::optional<int32_t>(tmp);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.resumeSeed(dds::core::optional<int32_t>(tmp));
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
LtsUtils::get4Byte(data, pos, tmp);
|
||||
req.timeToResume(dds::core::optional<rti::core::int64>(tmp * 1000));
|
||||
req.timeToResume = dds::core::optional<rti::core::int64>(tmp * 1000);
|
||||
LtsUtils::get2Byte(data, pos, tmp);
|
||||
req.remainingDuration(dds::core::optional<int32_t>(tmp));
|
||||
req.remainingDuration = dds::core::optional<int32_t>(tmp);
|
||||
DEBUG_LOG(m_logger) << "Resuming: " << req;
|
||||
m_aesFtc->explosionAreaPauseResumeRequest(req, this);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "dds_handler.h"
|
||||
#include "main_handler.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
{
|
||||
|
||||
@@ -17,12 +19,13 @@ RecvFromDdsFts::RecvFromDdsFts(MainHandler *mainHandler)
|
||||
, m_ftsTaboc(mainHandler->dds()->ftsTaboc())
|
||||
, m_ftsTab(mainHandler->dds()->ftsTab())
|
||||
, m_txCallback(mainHandler->txHandler())
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
void RecvFromDdsFts::onDemandCyclicPositionsRequest(const rti::core::SampleIdentity &cookie, const DemandCyclicPositionsRequest &request)
|
||||
{
|
||||
OcTelegrams::DemandCyclicPositions data;
|
||||
data.cycleTime = request.cycleTime();
|
||||
data.cycleTime = request.cycleTime;
|
||||
|
||||
m_ftsTaboc->demandCyclicPositionsReply(cookie, fillFro(m_txCallback->txData(data)));
|
||||
}
|
||||
@@ -36,7 +39,7 @@ void RecvFromDdsFts::onDemandSfmSelfTestRequest(const rti::core::SampleIdentity
|
||||
void RecvFromDdsFts::onSendTechnicalStateOcRequest(const rti::core::SampleIdentity &cookie, const SendTechnicalStateOcRequest &request)
|
||||
{
|
||||
OcTelegrams::TechnicalStateOc data;
|
||||
data.errorCode = request.errorCode();
|
||||
data.errorCode = request.errorCode;
|
||||
|
||||
m_ftsTaboc->sendTechnicalStateOcReply(cookie, fillFro(m_txCallback->txData(data)));
|
||||
}
|
||||
@@ -45,7 +48,7 @@ void RecvFromDdsFts::onSendOcDataRequest(const rti::core::SampleIdentity &cookie
|
||||
{
|
||||
TrainingAreaBase::TetraIcd::OpaquePayloadDataOut data;
|
||||
data.payloadType = TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::OC;
|
||||
data.payload = request.payload();
|
||||
data.payload = request.payload;
|
||||
|
||||
m_ftsTab->sendOcDataReply(cookie, fillFro(m_txCallback->txData(data)));
|
||||
}
|
||||
@@ -54,7 +57,7 @@ void RecvFromDdsFts::onSendFireSmokeMarkerDataRequest(const rti::core::SampleIde
|
||||
{
|
||||
TrainingAreaBase::TetraIcd::OpaquePayloadDataOut data;
|
||||
data.payloadType = TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::FireSmokeMarker;
|
||||
data.payload = request.payload();
|
||||
data.payload = request.payload;
|
||||
|
||||
m_ftsTab->sendFireSmokeMarkerDataReply(cookie, fillFro(m_txCallback->txData(data)));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <QtCore/QPointF>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "main_handler.h"
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
@@ -21,21 +23,21 @@ void SendToDds::rxData(const OcTelegrams::Display &inData)
|
||||
if (0 == inData.multiplexer)
|
||||
{
|
||||
TrainingAreaBaseOC::ShortMessage outData;
|
||||
outData.id(m_idToSend++);
|
||||
outData.id = m_idToSend++;
|
||||
|
||||
outData.textType(static_cast<long>(inData.textType));
|
||||
outData.indexVbg(inData.indexVbg);
|
||||
outData.indexVba(inData.indexVba);
|
||||
outData.timeStamp(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
|
||||
outData.textType = static_cast<long>(inData.textType);
|
||||
outData.indexVbg = inData.indexVbg;
|
||||
outData.indexVba = inData.indexVba;
|
||||
outData.timeStamp = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
else
|
||||
{
|
||||
TrainingAreaBaseOC::FreeText outData;
|
||||
outData.id(m_idToSend++);
|
||||
outData.text(inData.text.data());
|
||||
outData.timeStamp(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
|
||||
outData.id = m_idToSend++;
|
||||
outData.text = inData.text.data();
|
||||
outData.timeStamp = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -44,10 +46,10 @@ void SendToDds::rxData(const OcTelegrams::Display &inData)
|
||||
void SendToDds::rxData(const OcTelegrams::TimeSync &inData)
|
||||
{
|
||||
TrainingAreaBaseOC::TimeSync outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.gpsTime(inData.gpsTimeMsec);
|
||||
outData.timezone(inData.timezone);
|
||||
outData.gpsTime = inData.gpsTimeMsec;
|
||||
outData.timezone = inData.timezone;
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -61,14 +63,14 @@ void SendToDds::rxData(const OcTelegrams::SpecificsExercise &inData)
|
||||
QString::number(inData.easting).rightJustified(7, QLatin1Char('0')));
|
||||
|
||||
TrainingAreaBaseOC::SpecificsExercise outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.exerciseId(inData.exerciseId);
|
||||
outData.zone(inData.zone);
|
||||
outData.band(inData.band);
|
||||
outData.square(inData.square.data());
|
||||
outData.easting(inData.easting);
|
||||
outData.northing(inData.northing);
|
||||
outData.exerciseId = inData.exerciseId;
|
||||
outData.zone = inData.zone;
|
||||
outData.band = inData.band;
|
||||
outData.square = inData.square.data();
|
||||
outData.easting = inData.easting;
|
||||
outData.northing = inData.northing;
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -76,14 +78,14 @@ void SendToDds::rxData(const OcTelegrams::SpecificsExercise &inData)
|
||||
void SendToDds::rxData(const OcTelegrams::SpecificsEquipment &inData)
|
||||
{
|
||||
TrainingAreaBaseOC::SpecificsEquipment outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.equipmentNumber(inData.equipmentNumber);
|
||||
outData.playerType(inData.playerType);
|
||||
outData.language(static_cast<ProjectDataManagement::LanguageConfiguration>(inData.language));
|
||||
outData.pyrotechnics(inData.pyrotechnics);
|
||||
outData.voiceOutput(inData.voiceOutput);
|
||||
outData.exerciseBreak(inData.exerciseBreak);
|
||||
outData.equipmentNumber = inData.equipmentNumber;
|
||||
outData.playerType = inData.playerType;
|
||||
outData.language = static_cast<ProjectDataManagement::LanguageConfiguration>(inData.language);
|
||||
outData.pyrotechnics = inData.pyrotechnics;
|
||||
outData.voiceOutput = inData.voiceOutput;
|
||||
outData.exerciseBreak = inData.exerciseBreak;
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -91,16 +93,16 @@ void SendToDds::rxData(const OcTelegrams::SpecificsEquipment &inData)
|
||||
void SendToDds::rxData(const OcTelegrams::TechnicalStateSfm &inData)
|
||||
{
|
||||
TrainingAreaBaseOC::TechnicalStateSfm outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.sfmConnected(inData.sfmConnected);
|
||||
outData.radioAvailable(inData.radioAvailable);
|
||||
outData.licensed(inData.licensed);
|
||||
outData.timeStamp(inData.gpsTimeMsec);
|
||||
outData.batteryTest(inData.batteryTest);
|
||||
outData.manipulationEquipment(inData.manipulationEquipment);
|
||||
outData.manipulationSfm(inData.manipulationSfm);
|
||||
outData.errorCode(inData.errorCode);
|
||||
outData.sfmConnected = inData.sfmConnected;
|
||||
outData.radioAvailable = inData.radioAvailable;
|
||||
outData.licensed = inData.licensed;
|
||||
outData.timeStamp = inData.gpsTimeMsec;
|
||||
outData.batteryTest = inData.batteryTest;
|
||||
outData.manipulationEquipment = inData.manipulationEquipment;
|
||||
outData.manipulationSfm = inData.manipulationSfm;
|
||||
outData.errorCode = inData.errorCode;
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -108,13 +110,13 @@ void SendToDds::rxData(const OcTelegrams::TechnicalStateSfm &inData)
|
||||
void SendToDds::rxData(const OcTelegrams::EnterLeaveAes &inData)
|
||||
{
|
||||
TrainingAreaBaseOC::EnterLeaveAes outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.aesId(inData.aesId);
|
||||
outData.aesEntered(inData.aesEntered);
|
||||
outData.abcArea(inData.nbcArea);
|
||||
outData.chargeTypeId(inData.chargeTasCode);
|
||||
outData.cAreaType(inData.cAreaType);
|
||||
outData.aesId = inData.aesId;
|
||||
outData.aesEntered = inData.aesEntered;
|
||||
outData.abcArea = inData.nbcArea;
|
||||
outData.chargeTypeId = inData.chargeTasCode;
|
||||
outData.cAreaType = inData.cAreaType;
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -122,17 +124,17 @@ void SendToDds::rxData(const OcTelegrams::EnterLeaveAes &inData)
|
||||
void SendToDds::rxData(const OcTelegrams::OwnPosition &inData)
|
||||
{
|
||||
TrainingAreaBaseOC::OwnPosition outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
outData.valid(inData.valid);
|
||||
outData.timeStamp(inData.gpsTimeMsec);
|
||||
outData.valid = inData.valid;
|
||||
outData.timeStamp = inData.gpsTimeMsec;
|
||||
if (inData.valid)
|
||||
{
|
||||
const QPointF point(m_utmCoord.geographic(inData.easting, inData.northing));
|
||||
outData.position(Core::GeoPosition(point.x(), point.y(), 0));
|
||||
outData.position = Core::GeoPosition(point.x(), point.y(), 0);
|
||||
}
|
||||
else
|
||||
outData.position(Core::GeoPosition(nan(""), nan(""), 0));
|
||||
outData.position = Core::GeoPosition(nan(""), nan(""), 0);
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
}
|
||||
@@ -144,8 +146,8 @@ void SendToDds::rxData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBase &
|
||||
case TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::OC:
|
||||
{
|
||||
TrainingAreaBase::OcData outData;
|
||||
outData.equipmentNumber(1);
|
||||
outData.payload(inData.payload);
|
||||
outData.equipmentNumber = 1;
|
||||
outData.payload = inData.payload;
|
||||
|
||||
m_dtsTab->publish(outData);
|
||||
break;
|
||||
@@ -153,8 +155,8 @@ void SendToDds::rxData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBase &
|
||||
case TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::FireSmokeMarker:
|
||||
{
|
||||
TrainingAreaBase::FireSmokeMarkerData outData;
|
||||
outData.equipmentNumber(1);
|
||||
outData.payload(inData.payload);
|
||||
outData.equipmentNumber = 1;
|
||||
outData.payload = inData.payload;
|
||||
|
||||
m_dtsTab->publish(outData);
|
||||
break;
|
||||
|
||||
@@ -13,8 +13,7 @@ Channel::Channel(QChar channel, bool bIsBinary, QObject *parent) : QObject(paren
|
||||
, m_channel(channel)
|
||||
, m_bIsBinary(bIsBinary)
|
||||
, m_device(nullptr)
|
||||
.getNGLLogger("SCTT.Channel")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("SCTT.Channel")) {}
|
||||
|
||||
void Channel::setDevice(Device *dev)
|
||||
{
|
||||
|
||||
@@ -16,8 +16,7 @@ Device::Device(QObject *parent, bool tcpMode) : QObject(parent)
|
||||
, m_restartTimer(new QTimer(this))
|
||||
, m_receiveTimeoutTimer(new QTimer(this))
|
||||
, m_tcpMode(tcpMode)
|
||||
.getNGLLogger("TTCI.Device")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("TTCI.Device")) {
|
||||
connect(m_spQuerry, &LtsSerialPortQuerry::LtsSerialPortQuerry::connectionEstablished, this, &Device::open);
|
||||
m_spQuerry->restartQuerry();
|
||||
|
||||
@@ -55,7 +54,7 @@ bool Device::open()
|
||||
return false;
|
||||
}
|
||||
connect(m_socket, &QTcpSocket::readyRead, this, &Device::onDataAvailable);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &Device::handleError);
|
||||
connect(m_socket, &QAbstractSocket::errorOccurred, this, &Device::handleError);
|
||||
connect(m_socket, &QTcpSocket::disconnected, this, &Device::open);
|
||||
DEBUG_LOG(m_logger) << "(Re)openend tcp destination " << m_socket->peerName() << ":" << Settings::portTtci();
|
||||
}
|
||||
|
||||
+10
-8
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <QtCore/QPointF>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QJsonDocument>
|
||||
@@ -22,9 +24,9 @@ WebsocketHandler::WebsocketHandler(QObject *parent, int exerciseId,
|
||||
m_tryConnectionTimer->start(10 * 1000);
|
||||
connect(m_dtcTaboc.get(), &TrainingAreaBaseOC::Interface::Dtc::specificsEquipmentChanged,
|
||||
this, [this](){
|
||||
m_ownEquipmentId = m_dtcTaboc->specificsEquipment(1).equipmentNumber();
|
||||
m_ownEquipmentId = m_dtcTaboc->specificsEquipment(1).equipmentNumber;
|
||||
});
|
||||
m_ownEquipmentId = m_dtcTaboc->specificsEquipment(1).equipmentNumber();
|
||||
m_ownEquipmentId = m_dtcTaboc->specificsEquipment(1).equipmentNumber;
|
||||
|
||||
|
||||
m_fetchPositionTimer = new QTimer(this);
|
||||
@@ -142,23 +144,23 @@ void WebsocketHandler::onSendOwnPosition(const QString &message)
|
||||
const QJsonObject obj = doc.object().value(QStringLiteral("data")).toObject();
|
||||
|
||||
TrainingAreaBaseOC::OwnPosition outData;
|
||||
outData.id(1);
|
||||
outData.id = 1;
|
||||
|
||||
|
||||
|
||||
if (obj.contains(QStringLiteral("lon")) && obj.contains(QStringLiteral("lat")))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got message with position";
|
||||
outData.position(Core::GeoPosition(obj.value(QStringLiteral("lon")).toDouble(),obj.value(QStringLiteral("lat")).toDouble(),obj.value(QStringLiteral("height")).toDouble()));
|
||||
outData.timeStamp(QDateTime::currentMSecsSinceEpoch());
|
||||
outData.position = Core::GeoPosition(obj.value(QStringLiteral("lon")).toDouble(),obj.value(QStringLiteral("lat")).toDouble(),obj.value(QStringLiteral("height")).toDouble());
|
||||
outData.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
if (obj.contains(QStringLiteral("buildingId")) && obj.contains(QStringLiteral("roomId")) )
|
||||
{
|
||||
outData.moutObjectId().set(obj.value(QStringLiteral("buildingId")).toInt());
|
||||
outData.moutRoomId().set(obj.value(QStringLiteral("roomId")).toInt());
|
||||
outData.moutObjectId = obj.value(QStringLiteral("buildingId")).toInt();
|
||||
outData.moutRoomId = obj.value(QStringLiteral("roomId")).toInt();
|
||||
}
|
||||
}
|
||||
else
|
||||
outData.position(Core::GeoPosition(nan(""), nan(""),0));
|
||||
outData.position = Core::GeoPosition(nan(""), nan(""),0);
|
||||
|
||||
m_dtsTaboc->publish(outData);
|
||||
|
||||
|
||||
Reference in new issue
Block a user