Complete Qt6/rtiddsgen migration of residual Lts service sources
This commit is contained in:
86 files changed
+1235
-1128
No files matched your search
+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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user