Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+238
-235
@@ -8,6 +8,7 @@
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <AreaEffectSimulation/aes_translation.h>
|
||||
#include <ngldb/db_service_handler.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <TrainingAreaBase/tab_fts.h>
|
||||
#include <QtGui/QTransform>
|
||||
|
||||
@@ -17,9 +18,10 @@ namespace TrainingAreaBase
|
||||
|
||||
|
||||
|
||||
AesStateHandler::AesStateHandler(MainHandler *mainHandler) : m_dbInterface(mainHandler->dbHandler()->db())
|
||||
, m_exerciseId(mainHandler->exerciseId()),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
AesStateHandler::AesStateHandler(MainHandler *mainHandler)
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_dbInterface(mainHandler->dbHandler()->db())
|
||||
, m_exerciseId(mainHandler->exerciseId()) {}
|
||||
|
||||
|
||||
template<>
|
||||
@@ -112,6 +114,7 @@ RecvFromDdsAes::RecvFromDdsAes(MainHandler *mainHandler,
|
||||
const std::shared_ptr<SendToTab> &txCallback,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_ddsConnector(mainHandler->ddsHandler()->ddsConnector())
|
||||
, m_txCallback(txCallback)
|
||||
, m_aesStateHandler(new AesStateHandler(mainHandler))
|
||||
@@ -211,67 +214,67 @@ int RecvFromDdsAes::aesChargeId(int aesId) const
|
||||
{
|
||||
auto it = m_currentBCContaminations.find(aesId);
|
||||
if (it != m_currentBCContaminations.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentExplosionArea.find(aesId);
|
||||
if (it != m_currentExplosionArea.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentExplosionCluster.find(aesId);
|
||||
if (it != m_currentExplosionCluster.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentExplosionSingle.find(aesId);
|
||||
if (it != m_currentExplosionSingle.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentMineArea.find(aesId);
|
||||
if (it != m_currentMineArea.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentNContamination.find(aesId);
|
||||
if (it != m_currentNContamination.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentDusSingleMine.find(aesId);
|
||||
if (it != m_currentDusSingleMine.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentGasPipes.find(aesId);
|
||||
if (it != m_currentGasPipes.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentFunctionalArea.find(aesId);
|
||||
if (it != m_currentFunctionalArea.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentBoobyTraps.find(aesId);
|
||||
if (it != m_currentBoobyTraps.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentOffRouteMines.find(aesId);
|
||||
if (it != m_currentOffRouteMines.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentTechnicalArea.find(aesId);
|
||||
if (it != m_currentTechnicalArea.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
{
|
||||
auto it = m_currentAirSupportImpacts.find(aesId);
|
||||
if (it != m_currentAirSupportImpacts.end())
|
||||
return it->second.chargeStruct().chargeTypeId();
|
||||
return it->second.chargeStruct.chargeTypeId;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -344,18 +347,18 @@ TetraIcd::AreaEffectSimulationType RecvFromDdsAes::aesTypeFromId(int aesId) cons
|
||||
bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
|
||||
{
|
||||
AreaEffectSimulation::ExplosionSingle data;
|
||||
data.chargeStruct().chargeTypeId(request.chargeTypeId());
|
||||
data.effectDuration(1);
|
||||
data.effectStart(request.effectTime());
|
||||
data.id(request.aesId());
|
||||
data.impactPosition(request.position().position());
|
||||
data.isDeleted(false);
|
||||
data.participantId(request.participantId());
|
||||
data.partyId(request.partyId());
|
||||
data.chargeStruct.chargeTypeId = request.chargeTypeId;
|
||||
data.effectDuration = 1;
|
||||
data.effectStart = request.effectTime;
|
||||
data.id = request.aesId;
|
||||
data.impactPosition = request.position.position;
|
||||
data.isDeleted = false;
|
||||
data.participantId = request.participantId;
|
||||
data.partyId = request.partyId;
|
||||
|
||||
|
||||
bool bAlreadyExists = false;
|
||||
const int aesTetraId = m_aesStateHandler->createAesTetraId(request.aesId(), bAlreadyExists);
|
||||
const int aesTetraId = m_aesStateHandler->createAesTetraId(request.aesId, bAlreadyExists);
|
||||
|
||||
if (!bAlreadyExists)
|
||||
{
|
||||
@@ -364,8 +367,8 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
|
||||
dataChanged(data, bOnlyNameChanged);
|
||||
}
|
||||
|
||||
sendCreateEffectSimulation(data, aesTetraId, request.equipmentNumber());
|
||||
m_aesStateHandler->update(request.aesId(), aesTetraId, true);
|
||||
sendCreateEffectSimulation(data, aesTetraId, request.equipmentNumber);
|
||||
m_aesStateHandler->update(request.aesId, aesTetraId, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -375,19 +378,19 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
|
||||
template <typename T>
|
||||
void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modType, TetraIcd::AreaEffectSimulationType aesType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id()
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id
|
||||
<< ", modType: " << static_cast<int>(modType)
|
||||
<< ", type=" << static_cast<int>(aesType)
|
||||
<< ", name: " << data.name()
|
||||
<< ", state: " << data.effectStateId()
|
||||
<< ", old state: " << m_currentEffectState.value(data.id()) << ")";
|
||||
<< ", name: " << data.name
|
||||
<< ", state: " << data.effectStateId
|
||||
<< ", old state: " << m_currentEffectState.value(data.id) << ")";
|
||||
|
||||
if (std::is_same<T, AreaEffectSimulation::ExplosionSingle>::value ||
|
||||
std::is_same<T, AreaEffectSimulation::ExplosionArea>::value ||
|
||||
std::is_same<T, AreaEffectSimulation::ExplosionCluster>::value
|
||||
)
|
||||
{
|
||||
if (m_mainHandler->pdmHandler()->isSmartChargeType(data.chargeStruct()))
|
||||
if (m_mainHandler->pdmHandler()->isSmartChargeType(data.chargeStruct))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Do not send SMART Single/AreaFire to Tetra as broadcast, hits are send directly.";
|
||||
return;
|
||||
@@ -401,28 +404,28 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
|
||||
case DataModification::eRemoved:
|
||||
{
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsPaused &&
|
||||
m_currentEffectState.value(data.id()) != AreaEffectSimulation::AesEffectState::EsPaused)
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused &&
|
||||
m_currentEffectState.value(data.id) != AreaEffectSimulation::AesEffectState::EsPaused)
|
||||
{
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(data.id());
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(data.id);
|
||||
if (aesTetraId <= 0)
|
||||
{
|
||||
|
||||
handleSendToTetra(data, aesType);
|
||||
}
|
||||
|
||||
sendPauseEffectSimulation(data.id());
|
||||
sendPauseEffectSimulation(data.id);
|
||||
}
|
||||
else if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated &&
|
||||
m_currentEffectState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPaused)
|
||||
else if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated &&
|
||||
m_currentEffectState.value(data.id) == AreaEffectSimulation::AesEffectState::EsPaused)
|
||||
{
|
||||
|
||||
sendResumeEffectSimulation(data);
|
||||
}
|
||||
else if (!data.effectStart().is_set() ||
|
||||
data.effectStart().get() == 0 ||
|
||||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved ||
|
||||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
else if (!data.effectStart.is_set() ||
|
||||
data.effectStart.get() == 0 ||
|
||||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved ||
|
||||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
{
|
||||
|
||||
if (modType == DataModification::eAdded)
|
||||
@@ -434,7 +437,7 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
|
||||
|
||||
|
||||
|
||||
sendRemoveEffectSimulation(aesType, data.id());
|
||||
sendRemoveEffectSimulation(aesType, data.id);
|
||||
resetStartTime(data);
|
||||
}
|
||||
else
|
||||
@@ -442,10 +445,10 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
|
||||
|
||||
|
||||
if (!(std::is_same<T, AreaEffectSimulation::FunctionalArea>::value) ||
|
||||
(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
(data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
handleSendToTetra(data, aesType);
|
||||
}
|
||||
m_currentEffectState[data.id()] = data.effectStateId();
|
||||
m_currentEffectState[data.id] = data.effectStateId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -456,7 +459,7 @@ void RecvFromDdsAes::handleSendToTetra(const T &data, TetraIcd::AreaEffectSimul
|
||||
{
|
||||
|
||||
bool bAlreadyExists = false;
|
||||
const int aesTetraId = m_aesStateHandler->createAesTetraId(data.id(), bAlreadyExists);
|
||||
const int aesTetraId = m_aesStateHandler->createAesTetraId(data.id, bAlreadyExists);
|
||||
|
||||
bool bOnlyNameChanged = false;
|
||||
|
||||
@@ -475,15 +478,15 @@ void RecvFromDdsAes::handleSendToTetra(const T &data, TetraIcd::AreaEffectSimul
|
||||
!std::is_same<T, AreaEffectSimulation::TechnicalArea>::value)
|
||||
{
|
||||
sendModifyEffectSimulationName(aesType,
|
||||
m_aesStateHandler->getAesTetraId(data.id()),
|
||||
data.name(),
|
||||
data.id());
|
||||
m_aesStateHandler->update(data.id(), aesTetraId, true);
|
||||
m_aesStateHandler->getAesTetraId(data.id),
|
||||
data.name,
|
||||
data.id);
|
||||
m_aesStateHandler->update(data.id, aesTetraId, true);
|
||||
}
|
||||
else if (bSomethingChanged)
|
||||
{
|
||||
sendCreateEffectSimulation(data, aesTetraId);
|
||||
m_aesStateHandler->update(data.id(), aesTetraId, true);
|
||||
m_aesStateHandler->update(data.id, aesTetraId, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,11 +516,11 @@ void RecvFromDdsAes::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
|
||||
handleEffectSimulation(data, modType, TetraIcd::AreaEffectSimulationType::MineArea);
|
||||
|
||||
|
||||
auto it = m_temporarySingleMineState.find(data.id());
|
||||
auto it = m_temporarySingleMineState.find(data.id);
|
||||
if (it != m_temporarySingleMineState.end())
|
||||
{
|
||||
onTriggeredImpactsChanged(it->second, DataModification::eModified);
|
||||
m_temporarySingleMineState.erase(data.id());
|
||||
m_temporarySingleMineState.erase(data.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,29 +543,29 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtMineAreaSingleMines)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtMineAreaSingleMines)
|
||||
return;
|
||||
|
||||
|
||||
if (data.aesItemId() == 0)
|
||||
if (data.aesItemId == 0)
|
||||
return;
|
||||
|
||||
|
||||
bool completeUntriggered = true;
|
||||
for (size_t i = 0; i < data.bitfield().size() && completeUntriggered; ++i)
|
||||
for (size_t i = 0; i < data.bitfield.size() && completeUntriggered; ++i)
|
||||
{
|
||||
if ((i + 1) * 8 <= static_cast<unsigned long>(data.impactCount()))
|
||||
if ((i + 1) * 8 <= static_cast<unsigned long>(data.impactCount))
|
||||
{
|
||||
if (data.bitfield().at(i) != 0xFF)
|
||||
if (data.bitfield.at(i) != 0xFF)
|
||||
completeUntriggered = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t endMask = 0;
|
||||
for (uint32_t j = 0; j < (static_cast<unsigned long>(data.impactCount()) - i * 8); ++j)
|
||||
for (uint32_t j = 0; j < (static_cast<unsigned long>(data.impactCount) - i * 8); ++j)
|
||||
endMask |= 0x80 >> j;
|
||||
|
||||
if (data.bitfield().at(i) != endMask)
|
||||
if (data.bitfield.at(i) != endMask)
|
||||
completeUntriggered = false;
|
||||
}
|
||||
}
|
||||
@@ -570,24 +573,24 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
return;
|
||||
|
||||
|
||||
auto it = m_currentMineArea.find(data.aesItemId());
|
||||
auto it = m_currentMineArea.find(data.aesItemId);
|
||||
if (it != m_currentMineArea.end())
|
||||
{
|
||||
const auto &mineArea = it->second;
|
||||
if (mineArea.isDus() || mineArea.isConcrete())
|
||||
if (mineArea.isDus || mineArea.isConcrete)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - is a DUS mineArea";
|
||||
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId << " - is a DUS mineArea";
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mineArea.effectStateId().underlying())
|
||||
switch (mineArea.effectStateId)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsError:
|
||||
case AreaEffectSimulation::AesEffectState::EsExpired:
|
||||
case AreaEffectSimulation::AesEffectState::EsRemoved:
|
||||
case AreaEffectSimulation::AesEffectState::EsUnknown:
|
||||
{
|
||||
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId());
|
||||
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
@@ -596,18 +599,18 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId();
|
||||
m_temporarySingleMineState[data.aesItemId()] = data;
|
||||
INFO_LOG(m_logger) << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId;
|
||||
m_temporarySingleMineState[data.aesItemId] = data;
|
||||
return;
|
||||
}
|
||||
|
||||
TetraIcd::MineAreaSingleMineState out;
|
||||
|
||||
out.aesDdsId = data.aesItemId();
|
||||
out.aesDdsId = data.aesItemId;
|
||||
|
||||
out.mineCount = data.impactCount();
|
||||
out.mineState.reserve(data.bitfield().size());
|
||||
for (const auto &c : data.bitfield())
|
||||
out.mineCount = data.impactCount;
|
||||
out.mineState.reserve(data.bitfield.size());
|
||||
for (const auto &c : data.bitfield)
|
||||
out.mineState.push_back(c);
|
||||
|
||||
txData(out);
|
||||
@@ -618,7 +621,7 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
const auto &vec = data.mines();
|
||||
const auto &vec = data.mines;
|
||||
if (vec.size() == 0)
|
||||
return;
|
||||
|
||||
@@ -627,26 +630,26 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt
|
||||
{
|
||||
|
||||
|
||||
if (!m_mainHandler->pdmHandler()->isReactivatableChargeType({mine.chargeTypeId(), 0,0}))
|
||||
if (!m_mainHandler->pdmHandler()->isReactivatableChargeType({mine.chargeTypeId, 0,0}))
|
||||
continue;
|
||||
|
||||
|
||||
if (mine != m_allReactivatableDusMines.value(mine.eqId()))
|
||||
if (mine != m_allReactivatableDusMines.value(mine.eqId))
|
||||
{
|
||||
|
||||
if (!mine.triggered() &&
|
||||
m_allReactivatableDusMines.contains(mine.eqId()) && m_allReactivatableDusMines.value(mine.eqId()).triggered()
|
||||
if (!mine.triggered &&
|
||||
m_allReactivatableDusMines.contains(mine.eqId) && m_allReactivatableDusMines.value(mine.eqId).triggered
|
||||
)
|
||||
m_minesToSend << mine.eqId();
|
||||
m_minesToSend << mine.eqId;
|
||||
|
||||
m_allReactivatableDusMines.insert(mine.eqId(), mine);
|
||||
m_allReactivatableDusMines.insert(mine.eqId, mine);
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_minesToSend.isEmpty())
|
||||
m_sendDusMineReactivtionTimer->start();
|
||||
else
|
||||
INFO_LOG(m_logger) << "Nothing changed in DusMineState of MineArea: " << data.id();
|
||||
INFO_LOG(m_logger) << "Nothing changed in DusMineState of MineArea: " << data.id;
|
||||
}
|
||||
|
||||
void RecvFromDdsAes::onSendDusMineReactivationTimeout()
|
||||
@@ -655,7 +658,7 @@ void RecvFromDdsAes::onSendDusMineReactivationTimeout()
|
||||
out.dusSerialNumbers.reserve(m_minesToSend.size());
|
||||
for (const auto &mineId : std::as_const(m_minesToSend))
|
||||
{
|
||||
m_allReactivatableDusMines[mineId].triggered(false);
|
||||
m_allReactivatableDusMines[mineId].triggered = false;
|
||||
out.dusSerialNumbers.push_back(mineId);
|
||||
}
|
||||
m_minesToSend.clear();
|
||||
@@ -693,19 +696,19 @@ void RecvFromDdsAes::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
template<typename T, typename S>
|
||||
void setCommonParams(T &out, const S &in, const int aesTetraId)
|
||||
{
|
||||
out.aesDdsId = in.id();
|
||||
out.aesDdsId = in.id;
|
||||
Q_UNUSED(aesTetraId);
|
||||
|
||||
out.name = in.name();
|
||||
out.partyId = in.partyId().is_set() ? in.partyId().get() : 0;
|
||||
out.name = in.name;
|
||||
out.partyId = in.partyId.is_set() ? in.partyId.get() : 0;
|
||||
}
|
||||
|
||||
template<typename T, typename S>
|
||||
void setCommonCombatParams(T &out, const S &in, const int aesTetraId)
|
||||
{
|
||||
setCommonParams(out, in, aesTetraId);
|
||||
out.effectStart = in.effectStart().is_set() ? in.effectStart().get() : 0;
|
||||
out.effectDuration = in.effectDuration();
|
||||
out.effectStart = in.effectStart.is_set() ? in.effectStart.get() : 0;
|
||||
out.effectDuration = in.effectDuration;
|
||||
}
|
||||
|
||||
|
||||
@@ -718,27 +721,27 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
|
||||
|
||||
|
||||
|
||||
if (data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
return;
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
if (aesItemId <= 0)
|
||||
return;
|
||||
|
||||
|
||||
const AreaEffectSimulation::ExplosionCluster &aes = m_dtcAes->explosionCluster(aesItemId);
|
||||
if (aes.id() != aesItemId)
|
||||
if (aes.id != aesItemId)
|
||||
return;
|
||||
|
||||
|
||||
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct());
|
||||
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
|
||||
if (!bIsLaserGuidable)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects();
|
||||
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects;
|
||||
|
||||
if (!singleEffectsRef.empty())
|
||||
{
|
||||
@@ -762,23 +765,23 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
|
||||
|
||||
|
||||
const AreaEffectSimulation::SingleEffect &firstSingleEffect = singleEffectsRef.front();
|
||||
const Core::GeoPosition &fsePosition = firstSingleEffect.position();
|
||||
const Core::GeoPosition &fsePosition = firstSingleEffect.position;
|
||||
cAes.relCorner = m_posHandler->geographicToRelative(fsePosition);
|
||||
|
||||
cAes.width = qRound(aes.area().width());
|
||||
cAes.height = qRound(aes.area().height());
|
||||
cAes.rotationAngle = aes.area().rotation();
|
||||
cAes.mhpRotation = aes.mhpRotation();
|
||||
cAes.mhpWidth = aes.mhpWidth();
|
||||
cAes.mhpLength = aes.mhpLength();
|
||||
cAes.impactCount = aes.impactCount();
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
|
||||
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct());
|
||||
cAes.width = qRound(aes.area.width);
|
||||
cAes.height = qRound(aes.area.height);
|
||||
cAes.rotationAngle = aes.area.rotation;
|
||||
cAes.mhpRotation = aes.mhpRotation;
|
||||
cAes.mhpWidth = aes.mhpWidth;
|
||||
cAes.mhpLength = aes.mhpLength;
|
||||
cAes.impactCount = aes.impactCount;
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
|
||||
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct);
|
||||
|
||||
std::vector<TetraIcd::RelativePosition> &mhPointsRef = cAes.mhPoints;
|
||||
mhPointsRef.clear();
|
||||
mhPointsRef.reserve(aes.mhPoints().size());
|
||||
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints()))
|
||||
mhPointsRef.reserve(aes.mhPoints.size());
|
||||
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints))
|
||||
mhPointsRef.emplace_back(m_posHandler->geographicToRelative(pos, 0));
|
||||
|
||||
|
||||
@@ -795,9 +798,9 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirSupportImpact &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(AirSupportImpact, "
|
||||
@@ -807,13 +810,13 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
|
||||
cAes.header.equipmentNumber = 0;
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
|
||||
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct()));
|
||||
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct));
|
||||
|
||||
if (cAes.chargeTypeId <= 0)
|
||||
return;
|
||||
@@ -823,33 +826,33 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCContamination &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::CContamination, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::CContamination, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(BCContamination, "
|
||||
<< aesTetraId << ")";
|
||||
TetraIcd::CreateCContamination cAes;
|
||||
cAes.expansionFactor = pdm()->dtc()->expansionFactor(aes.chargeStruct().chargeTypeId(),
|
||||
aes.chargeStruct().igniterTypeId(),
|
||||
aes.chargeStruct().igniterFunctionId());
|
||||
cAes.expansionFactor = pdm()->dtc()->expansionFactor(aes.chargeStruct.chargeTypeId,
|
||||
aes.chargeStruct.igniterTypeId,
|
||||
aes.chargeStruct.igniterFunctionId);
|
||||
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
|
||||
cAes.effectRadius = qRound(aes.impactRadius());
|
||||
cAes.propagationDirection = aes.propagationDirection();
|
||||
cAes.windSpeed = qRound(aes.windSpeed());
|
||||
cAes.validityTimeWind = aes.weatherTimestamp();
|
||||
cAes.relPositionValidityTimeWind = m_posHandler->geographicToRelative(aes.weatherPosition(), 0);
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
|
||||
cAes.effectRadius = qRound(aes.impactRadius);
|
||||
cAes.propagationDirection = aes.propagationDirection;
|
||||
cAes.windSpeed = qRound(aes.windSpeed);
|
||||
cAes.validityTimeWind = aes.weatherTimestamp;
|
||||
cAes.relPositionValidityTimeWind = m_posHandler->geographicToRelative(aes.weatherPosition, 0);
|
||||
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
switch (pdm()->dtc()->volatilityTypeId(aes.chargeStruct().chargeTypeId(),
|
||||
aes.chargeStruct().igniterTypeId(),
|
||||
aes.chargeStruct().igniterFunctionId()).underlying())
|
||||
switch (pdm()->dtc()->volatilityTypeId(aes.chargeStruct.chargeTypeId,
|
||||
aes.chargeStruct.igniterTypeId,
|
||||
aes.chargeStruct.igniterFunctionId))
|
||||
{
|
||||
case ProjectDataManagement::VolatilityType::Floating:
|
||||
cAes.volatility = TetraIcd::CreateCContamination::Volatiliy::Floating;
|
||||
@@ -870,9 +873,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCCo
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionArea &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, "
|
||||
@@ -880,17 +883,17 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
TetraIcd::CreateAreaExplosion cAes;
|
||||
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
cAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
|
||||
cAes.width = qRound(aes.area().width());
|
||||
cAes.height = qRound(aes.area().height());
|
||||
cAes.rotationAngle = aes.area().rotation();
|
||||
cAes.impactCount = aes.cannonCount() * aes.cannonRounds();
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
|
||||
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct());
|
||||
cAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
|
||||
cAes.width = qRound(aes.area.width);
|
||||
cAes.height = qRound(aes.area.height);
|
||||
cAes.rotationAngle = aes.area.rotation;
|
||||
cAes.impactCount = aes.cannonCount * aes.cannonRounds;
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
|
||||
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct);
|
||||
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
if (cAes.chargeTypeId <= 0)
|
||||
return;
|
||||
@@ -901,7 +904,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes, int aesTetraId)
|
||||
{
|
||||
|
||||
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct());
|
||||
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
|
||||
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation "
|
||||
<< ", aes " << aes
|
||||
@@ -914,9 +917,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
return;
|
||||
}
|
||||
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, "
|
||||
@@ -926,25 +929,25 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
|
||||
|
||||
cAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
|
||||
cAes.width = qRound(aes.area().width());
|
||||
cAes.height = qRound(aes.area().height());
|
||||
cAes.rotationAngle = aes.area().rotation();
|
||||
cAes.mhpRotation = aes.mhpRotation();
|
||||
cAes.mhpWidth = aes.mhpWidth();
|
||||
cAes.mhpLength = aes.mhpLength();
|
||||
cAes.impactCount = aes.impactCount();
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
|
||||
cAes.impactRadius = m_mainHandler->pdmHandler()->impactRadius(aes.chargeStruct());
|
||||
cAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
|
||||
cAes.width = qRound(aes.area.width);
|
||||
cAes.height = qRound(aes.area.height);
|
||||
cAes.rotationAngle = aes.area.rotation;
|
||||
cAes.mhpRotation = aes.mhpRotation;
|
||||
cAes.mhpWidth = aes.mhpWidth;
|
||||
cAes.mhpLength = aes.mhpLength;
|
||||
cAes.impactCount = aes.impactCount;
|
||||
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
|
||||
cAes.impactRadius = m_mainHandler->pdmHandler()->impactRadius(aes.chargeStruct);
|
||||
std::vector<TetraIcd::RelativePosition> &mhPointsRef = cAes.mhPoints;
|
||||
mhPointsRef.clear();
|
||||
mhPointsRef.reserve(aes.mhPoints().size());
|
||||
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints()))
|
||||
mhPointsRef.reserve(aes.mhPoints.size());
|
||||
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints))
|
||||
mhPointsRef.emplace_back(m_posHandler->geographicToRelative(pos, 0));
|
||||
|
||||
int chargeTypeId = 0;
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
chargeTypeId = pdm()->legacyChargeTypeIgniterType(aes.chargeStruct().chargeTypeId(), aes.chargeStruct().igniterTypeId(), aes.chargeStruct().igniterFunctionId());
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
chargeTypeId = pdm()->legacyChargeTypeIgniterType(aes.chargeStruct.chargeTypeId, aes.chargeStruct.igniterTypeId, aes.chargeStruct.igniterFunctionId);
|
||||
|
||||
|
||||
|
||||
@@ -952,7 +955,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
cAes.chargeTypeId = chargeTypeId;
|
||||
else
|
||||
{
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
}
|
||||
|
||||
if (cAes.chargeTypeId <= 0)
|
||||
@@ -963,9 +966,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionSingle &aes, int aesTetraId, int equipmentNumber)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionSingle, "
|
||||
@@ -974,12 +977,12 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
cAes.header.equipmentNumber = equipmentNumber;
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
|
||||
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct()));
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
|
||||
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct));
|
||||
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
if (cAes.chargeTypeId <= 0)
|
||||
return;
|
||||
@@ -989,9 +992,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::MineArea &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::MineArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::MineArea, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(MineArea, "
|
||||
@@ -1002,33 +1005,33 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine
|
||||
|
||||
|
||||
|
||||
cAes.layingDepth = aes.width();
|
||||
cAes.layingDensity = aes.density();
|
||||
cAes.layingDepth = aes.width;
|
||||
cAes.layingDensity = aes.density;
|
||||
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
TetraIcd::MineAreaSegment segment;
|
||||
cAes.segments.reserve(aes.segments().size());
|
||||
for (size_t i = 0; i < aes.segments().size(); ++i)
|
||||
cAes.segments.reserve(aes.segments.size());
|
||||
for (size_t i = 0; i < aes.segments.size(); ++i)
|
||||
{
|
||||
const AreaEffectSimulation::MineSegment &s = aes.segments().at(i);
|
||||
if (aes.isCenterLine())
|
||||
const AreaEffectSimulation::MineSegment &s = aes.segments.at(i);
|
||||
if (aes.isCenterLine)
|
||||
{
|
||||
segment.relStart = m_posHandler->geographicToRelative(s.positionStart(), 0);
|
||||
segment.relEnd = m_posHandler->geographicToRelative(s.positionEnd(), 0);
|
||||
segment.relStart = m_posHandler->geographicToRelative(s.positionStart, 0);
|
||||
segment.relEnd = m_posHandler->geographicToRelative(s.positionEnd, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
const QPointF relStart = m_posHandler->geographicToRelativePointF(s.positionStart());
|
||||
const QPointF relEnd = m_posHandler->geographicToRelativePointF(s.positionEnd());
|
||||
const QPointF relStart = m_posHandler->geographicToRelativePointF(s.positionStart);
|
||||
const QPointF relEnd = m_posHandler->geographicToRelativePointF(s.positionEnd);
|
||||
const QLineF line({relStart.x(), relStart.y()}, {relEnd.x(), relEnd.y()});
|
||||
DEBUG_LOG(m_logger) << "relStart: x: " << relStart.x() << ", y: " << relStart.y();
|
||||
DEBUG_LOG(m_logger) << "relEnd: x: " << relEnd.x() << ", y: " << relEnd.y();
|
||||
QTransform trans;
|
||||
trans.rotate(0-line.angle());
|
||||
const QPointF ofs = trans.map(QPointF(aes.width() / 2, 0));
|
||||
const QPointF ofs = trans.map(QPointF(aes.width / 2, 0));
|
||||
DEBUG_LOG(m_logger) << "ofs: x: " << ofs.x() << ", y: " << ofs.y();
|
||||
|
||||
segment.relStart.offsetX = qRound(relStart.x() + ofs.y());
|
||||
@@ -1050,9 +1053,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NContamination &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::NContamination, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::NContamination, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(NContamination, "
|
||||
@@ -1060,23 +1063,23 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NCon
|
||||
TetraIcd::CreateNContamination cAes;
|
||||
|
||||
setCommonCombatParams(cAes, aes, aesTetraId);
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
|
||||
cAes.innerRadius = qRound(aes.impactRadius());
|
||||
cAes.borderLengthInner = qRound(aes.borderLengthInner());
|
||||
cAes.borderLengthOuter = qRound(aes.borderLengthOuter());
|
||||
cAes.spanAngle = aes.spanAngle();
|
||||
cAes.rotationAngle = aes.rotationAngle();
|
||||
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
|
||||
cAes.innerRadius = qRound(aes.impactRadius);
|
||||
cAes.borderLengthInner = qRound(aes.borderLengthInner);
|
||||
cAes.borderLengthOuter = qRound(aes.borderLengthOuter);
|
||||
cAes.spanAngle = aes.spanAngle;
|
||||
cAes.rotationAngle = aes.rotationAngle;
|
||||
|
||||
cAes.chargeTypeId = aes.chargeStruct().chargeTypeId();
|
||||
cAes.chargeTypeId = aes.chargeStruct.chargeTypeId;
|
||||
|
||||
txData(cAes);
|
||||
}
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::FunctionalArea &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::FunctionalArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::FunctionalArea, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(FunctionalArea, "
|
||||
@@ -1084,24 +1087,24 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Func
|
||||
TetraIcd::CreateFunctionalArea fAes;
|
||||
|
||||
setCommonParams(fAes, aes, aesTetraId);
|
||||
fAes.relEffectPosition = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
|
||||
fAes.width = qRound(aes.area().width());
|
||||
fAes.height = qRound(aes.area().height());
|
||||
fAes.deconMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.deconMode().underlying());
|
||||
fAes.deconTimeout = aes.deconTime();
|
||||
fAes.maintenanceMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.maintMode().underlying());
|
||||
fAes.maintenanceTimeout = aes.maintTime();
|
||||
fAes.medicalMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.medicMode().underlying());
|
||||
fAes.medicalTimeout = aes.medicTime();
|
||||
fAes.relEffectPosition = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
|
||||
fAes.width = qRound(aes.area.width);
|
||||
fAes.height = qRound(aes.area.height);
|
||||
fAes.deconMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.deconMode);
|
||||
fAes.deconTimeout = aes.deconTime;
|
||||
fAes.maintenanceMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.maintMode);
|
||||
fAes.maintenanceTimeout = aes.maintTime;
|
||||
fAes.medicalMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.medicMode);
|
||||
fAes.medicalTimeout = aes.medicTime;
|
||||
|
||||
txData(fAes);
|
||||
}
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::TechnicalArea &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::TechnicalArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::TechnicalArea, aes.id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1109,22 +1112,22 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Tech
|
||||
<< aesTetraId << ")";
|
||||
TetraIcd::TechnicalArea fAes;
|
||||
|
||||
fAes.aesDdsId = aes.id();
|
||||
fAes.aesDdsId = aes.id;
|
||||
|
||||
fAes.name = aes.name();
|
||||
fAes.taType = static_cast<TetraIcd::TechnicalArea::Type>(aes.type().underlying());
|
||||
fAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
|
||||
fAes.width = qRound(aes.area().width());
|
||||
fAes.height = qRound(aes.area().height());
|
||||
fAes.name = aes.name;
|
||||
fAes.taType = static_cast<TetraIcd::TechnicalArea::Type>(aes.type);
|
||||
fAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
|
||||
fAes.width = qRound(aes.area.width);
|
||||
fAes.height = qRound(aes.area.height);
|
||||
|
||||
txData(fAes);
|
||||
}
|
||||
|
||||
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusSingleMine &aes, int aesTetraId)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::DusSingleMineSimulator, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::DusSingleMineSimulator, aes.id);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(DusSingleMine, "
|
||||
@@ -1132,13 +1135,13 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusS
|
||||
TetraIcd::CreateDusSingleMine dAes;
|
||||
|
||||
setCommonParams(dAes, aes, aesTetraId);
|
||||
dAes.relEffectPosition = m_posHandler->geographicToRelative(aes.position(), 0);
|
||||
dAes.effectStart = aes.effectStart().get();
|
||||
dAes.effectDuration = aes.effectDuration();
|
||||
dAes.mineId = aes.mineId();
|
||||
dAes.relEffectPosition = m_posHandler->geographicToRelative(aes.position, 0);
|
||||
dAes.effectStart = aes.effectStart.get();
|
||||
dAes.effectDuration = aes.effectDuration;
|
||||
dAes.mineId = aes.mineId;
|
||||
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
|
||||
dAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
|
||||
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
|
||||
dAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
|
||||
|
||||
txData(dAes);
|
||||
}
|
||||
@@ -1242,15 +1245,15 @@ void RecvFromDdsAes::sendPauseEffectSimulation(int aesDdsId)
|
||||
template<>
|
||||
void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::ExplosionArea &aes)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
|
||||
return;
|
||||
}
|
||||
const int aesDdsId = aes.id();
|
||||
const int aesDdsId = aes.id;
|
||||
if (aesDdsId == 0)
|
||||
return;
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id());
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id);
|
||||
if (aesTetraId == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ;
|
||||
@@ -1265,15 +1268,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
|
||||
<< ", tetraId=" << aesTetraId << ")";
|
||||
|
||||
TetraIcd::ResumeEffectSimulation dAes;
|
||||
dAes.aesDdsId = aes.id();
|
||||
dAes.aesDdsId = aes.id;
|
||||
|
||||
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id(),
|
||||
aes.cannonCount() * aes.cannonRounds(),
|
||||
aes.originalEffectDuration(),
|
||||
aes.effectDuration());
|
||||
dAes.nextImpact = aes.remainExplosionNumber();
|
||||
dAes.resumeTime = aes.effectStart().is_set() ? aes.effectStart().get() : 0;
|
||||
dAes.remainDuration = aes.effectDuration();
|
||||
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id,
|
||||
aes.cannonCount * aes.cannonRounds,
|
||||
aes.originalEffectDuration,
|
||||
aes.effectDuration);
|
||||
dAes.nextImpact = aes.remainExplosionNumber;
|
||||
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
|
||||
dAes.remainDuration = aes.effectDuration;
|
||||
|
||||
txData(dAes);
|
||||
}
|
||||
@@ -1282,15 +1285,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
|
||||
template<>
|
||||
void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes)
|
||||
{
|
||||
if (aes.isCentral())
|
||||
if (aes.isCentral)
|
||||
{
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
|
||||
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
|
||||
return;
|
||||
}
|
||||
const int aesDdsId = aes.id();
|
||||
const int aesDdsId = aes.id;
|
||||
if (aesDdsId == 0)
|
||||
return;
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id());
|
||||
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id);
|
||||
if (aesTetraId == 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ;
|
||||
@@ -1305,15 +1308,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
|
||||
<< ", tetraId=" << aesTetraId << ")";
|
||||
|
||||
TetraIcd::ResumeEffectSimulation dAes;
|
||||
dAes.aesDdsId = aes.id();
|
||||
dAes.aesDdsId = aes.id;
|
||||
|
||||
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id(),
|
||||
aes.impactCount(),
|
||||
aes.originalEffectDuration(),
|
||||
aes.effectDuration());
|
||||
dAes.nextImpact = aes.remainExplosionNumber();
|
||||
dAes.resumeTime = aes.effectStart().is_set() ? aes.effectStart().get() : 0;
|
||||
dAes.remainDuration = aes.effectDuration();
|
||||
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id,
|
||||
aes.impactCount,
|
||||
aes.originalEffectDuration,
|
||||
aes.effectDuration);
|
||||
dAes.nextImpact = aes.remainExplosionNumber;
|
||||
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
|
||||
dAes.remainDuration = aes.effectDuration;
|
||||
|
||||
txData(dAes);
|
||||
}
|
||||
@@ -1355,7 +1358,7 @@ void RecvFromDdsAes::resetAllDusMines()
|
||||
QTimer::singleShot(300, this, [this]()
|
||||
{
|
||||
for (AreaEffectSimulation::DusMine &mine : m_allReactivatableDusMines)
|
||||
mine.triggered(false);
|
||||
mine.triggered = false;
|
||||
m_minesToSend.clear();
|
||||
connect(m_sendDusMineReactivtionTimer, &QTimer::timeout,
|
||||
this, &RecvFromDdsAes::onSendDusMineReactivationTimeout);
|
||||
|
||||
Reference in new issue
Block a user