Migrates EffectShow and AssetManagement to generated rtiddsgen API

Converts accessor calls to plain member access across esc and asm services.
This commit is contained in:
berrux-dev committed 2026-09-21 02:46:24 +02:00
1 parent a09979afdd
commit bdb2461737
39 files changed
+818 -818

No files matched your search

@@ -144,7 +144,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
qint64 DdsHandler::currentPartitionTime() const
{
return m_dtcCore->partitionTime().timeStamp();
return m_dtcCore->partitionTime().timeStamp;
}
} // namespace EffectShowManagement
@@ -40,7 +40,7 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
Database::EsmEffectShow esmEffectShow;
if (!m_handlerPdmData->isSmoke(m_effectCluster.chargeStruct()))
if (!m_handlerPdmData->isSmoke(m_effectCluster.chargeStruct))
{
int indX = idx % m_areasWidth.numOfAreas;
int indY = idx / m_areasWidth.numOfAreas;
@@ -67,15 +67,15 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_effectCluster.effectStart().is_set() ? m_effectCluster.effectStart().get() : 0;
esmEffectShow.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id();
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name());
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name);
esmEffectShow.numOfVolley = getNumberOfVolley();
esmEffectShow.shotsPerVolley = getShotsPerArea() / esmEffectShow.numOfVolley;
esmEffectShow.typeOfAmmunition = m_effectCluster.chargeStruct().chargeTypeId();
esmEffectShow.typeOfAmmunition = m_effectCluster.chargeStruct.chargeTypeId;
// can there be more then 48 shoots?
if (esmEffectShow.shotsPerVolley > 48)
@@ -85,12 +85,12 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
DEBUG_LOG(m_logger) << "recalc effectDuration ";
if (m_effectCluster.effectDuration() == DEFAULT_EFFECT_DURATION)
if (m_effectCluster.effectDuration == DEFAULT_EFFECT_DURATION)
{
QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(m_effectCluster.properties())).object();
QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(m_effectCluster.properties)).object();
AreaEffectSimulation::FiringType firingType = AreaEffectSimulation::FiringType::ReportReadyToFire;
if (probObject.contains(QStringLiteral("abfeuerungsArt")))
firingType = static_cast<AreaEffectSimulation::FiringType::inner_enum>(probObject[QStringLiteral("abfeuerungsArt")].toInt());
firingType = static_cast<AreaEffectSimulation::FiringType>(probObject[QStringLiteral("abfeuerungsArt")].toInt());
if (firingType == AreaEffectSimulation::FiringType::FireOnCommand)
{
//use default
@@ -100,25 +100,25 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
else
{
// use cadence
if (m_effectCluster.effectors().size()) //should always be there!
if (m_effectCluster.effectors.size()) //should always be there!
{
esmEffectShow.duration = m_effectCluster.effectors().at(0).chargeAmount() * m_handlerPdmData.get()->getCadence(m_effectCluster.effectors().at(0).chargeStruct().chargeTypeId());
DEBUG_LOG(m_logger) << " recalc effectDuration use cadence value " << esmEffectShow.duration << " effector shots: " << m_effectCluster.effectors().at(0).chargeAmount() << " cadence " << m_handlerPdmData.get()->getCadence(m_effectCluster.effectors().at(0).chargeStruct().chargeTypeId());
esmEffectShow.duration = m_effectCluster.effectors.at(0).chargeAmount * m_handlerPdmData.get()->getCadence(m_effectCluster.effectors.at(0).chargeStruct.chargeTypeId);
DEBUG_LOG(m_logger) << " recalc effectDuration use cadence value " << esmEffectShow.duration << " effector shots: " << m_effectCluster.effectors.at(0).chargeAmount << " cadence " << m_handlerPdmData.get()->getCadence(m_effectCluster.effectors.at(0).chargeStruct.chargeTypeId);
}
}
}
else
{
DEBUG_LOG(m_logger) << "Use effectDuration directly ";
esmEffectShow.duration = m_effectCluster.effectDuration();
esmEffectShow.duration = m_effectCluster.effectDuration;
}
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_areasWidth.side(indX);
esmEffectShow.areaDepth = m_areasDepth.side(indY);
esmEffectShow.areaRotation = m_effectCluster.area().rotation() + 90;
esmEffectShow.areaRotation = m_effectCluster.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_effectCluster.area().width() << " Height: " << m_effectCluster.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_effectCluster.area.width << " Height: " << m_effectCluster.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nduration: " << esmEffectShow.duration
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
@@ -136,30 +136,30 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
// calculate center position
LtsCoordTrans::UtmCoordinate centerPos = lowerLeftPosRotated;
centerPos.x = centerPos.x + m_effectCluster.area().width() / 2.;
centerPos.y = centerPos.y + m_effectCluster.area().height() / 2.;
centerPos.x = centerPos.x + m_effectCluster.area.width / 2.;
centerPos.y = centerPos.y + m_effectCluster.area.height / 2.;
LtsCoordTrans::UtmCoordinate centerPosRotated = rotate(centerPos, m_lowerLeftPos, rotationRad());
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_effectCluster.effectStart().is_set() ? m_effectCluster.effectStart().get() : 0;
esmEffectShow.duration = m_effectCluster.effectDuration();
esmEffectShow.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
esmEffectShow.duration = m_effectCluster.effectDuration;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id();
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name());
esmEffectShow.typeOfAmmunition = m_effectCluster.chargeStruct().chargeTypeId();
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name);
esmEffectShow.typeOfAmmunition = m_effectCluster.chargeStruct.chargeTypeId;
esmEffectShow.numOfVolley = 1;
esmEffectShow.shotsPerVolley = 1;
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_effectCluster.area().width();
esmEffectShow.areaDepth = m_effectCluster.area().height();
esmEffectShow.areaRotation = m_effectCluster.area().rotation() + 90;
esmEffectShow.areaWidth = m_effectCluster.area.width;
esmEffectShow.areaDepth = m_effectCluster.area.height;
esmEffectShow.areaRotation = m_effectCluster.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_effectCluster.area().width() << " Height: " << m_effectCluster.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_effectCluster.area.width << " Height: " << m_effectCluster.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
<< "\nSide x,y: " << m_effectCluster.area().width() << " , " << m_effectCluster.area().height();
<< "\nSide x,y: " << m_effectCluster.area.width << " , " << m_effectCluster.area.height;
}
return esmEffectShow;
@@ -169,18 +169,18 @@ void EffectShowEffectCluster::updateEffectShow(Database::EsmEffectShow &data)
{
DEBUG_LOG(m_logger) << "update EffectSHow for (" << data.id << ")";
data.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name());
data.startTime = m_effectCluster.effectStart().is_set() ? m_effectCluster.effectStart().get() : 0;
data.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name);
data.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
DEBUG_LOG(m_logger) << "Recalc effectDuration ";
if (m_effectCluster.effectDuration() == DEFAULT_EFFECT_DURATION)
if (m_effectCluster.effectDuration == DEFAULT_EFFECT_DURATION)
{
QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(m_effectCluster.properties())).object();
QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(m_effectCluster.properties)).object();
AreaEffectSimulation::FiringType firingType = AreaEffectSimulation::FiringType::ReportReadyToFire;
if (probObject.contains(QStringLiteral("abfeuerungsArt")))
firingType = static_cast<AreaEffectSimulation::FiringType::inner_enum>(probObject[QStringLiteral("abfeuerungsArt")].toInt());
firingType = static_cast<AreaEffectSimulation::FiringType>(probObject[QStringLiteral("abfeuerungsArt")].toInt());
if (firingType == AreaEffectSimulation::FiringType::FireOnCommand)
{
//use default
@@ -190,17 +190,17 @@ void EffectShowEffectCluster::updateEffectShow(Database::EsmEffectShow &data)
else
{
// use cadence
if (m_effectCluster.effectors().size()) //should always be there!
if (m_effectCluster.effectors.size()) //should always be there!
{
data.duration = m_effectCluster.effectors().at(0).chargeAmount() * m_handlerPdmData.get()->getCadence(m_effectCluster.effectors().at(0).chargeStruct().chargeTypeId());
DEBUG_LOG(m_logger) << " recalc effectDuration use cadence value " << data.duration << " effector shots: " << m_effectCluster.effectors().at(0).chargeAmount() << " cadence " << m_handlerPdmData.get()->getCadence(m_effectCluster.effectors().at(0).chargeStruct().chargeTypeId());
data.duration = m_effectCluster.effectors.at(0).chargeAmount * m_handlerPdmData.get()->getCadence(m_effectCluster.effectors.at(0).chargeStruct.chargeTypeId);
DEBUG_LOG(m_logger) << " recalc effectDuration use cadence value " << data.duration << " effector shots: " << m_effectCluster.effectors.at(0).chargeAmount << " cadence " << m_handlerPdmData.get()->getCadence(m_effectCluster.effectors.at(0).chargeStruct.chargeTypeId);
}
}
}
else
{
DEBUG_LOG(m_logger) << "Use effectDuration directly ";
data.duration = m_effectCluster.effectDuration();
data.duration = m_effectCluster.effectDuration;
}
if (data.shotsPerVolley > 48)
@@ -208,21 +208,21 @@ void EffectShowEffectCluster::updateEffectShow(Database::EsmEffectShow &data)
if (data.shotsPerVolley <= 0)
data.shotsPerVolley = 1;
data.typeOfAmmunition = m_effectCluster.chargeStruct().chargeTypeId();
data.esmParticipantId = (m_effectCluster.esmParticipantIds().size() > 0)
? m_effectCluster.esmParticipantIds().at(0)
data.typeOfAmmunition = m_effectCluster.chargeStruct.chargeTypeId;
data.esmParticipantId = (m_effectCluster.esmParticipantIds.size() > 0)
? m_effectCluster.esmParticipantIds.at(0)
: -1;
}
//-----------------------------------------------------------------------------
void EffectShowEffectCluster::calculateSquare()
{
Core::GeoPosition2D geoPos = m_effectCluster.area().cornerBottomLeft();
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat());
Core::GeoPosition2D geoPos = m_effectCluster.area.cornerBottomLeft;
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat);
// Calculate squares.
m_areasWidth = getAreasSideLength(m_effectCluster.area().width()); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_effectCluster.area().height()); // Squares in y-direction
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_effectCluster.chargeStruct());
m_areasWidth = getAreasSideLength(m_effectCluster.area.width); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_effectCluster.area.height); // Squares in y-direction
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_effectCluster.chargeStruct);
}
//static ----------------------------------------------------------------------
LtsCoordTrans::UtmCoordinate EffectShowEffectCluster::rotate(const LtsCoordTrans::UtmCoordinate &p, const LtsCoordTrans::UtmCoordinate &c, double angle)
@@ -268,9 +268,9 @@ int EffectShowEffectCluster::getShotsPerArea() const
if (!m_numOfEffectShows)
return 0;
int v = 0;
for (const auto &effector: m_effectCluster.effectors())
for (const auto &effector: m_effectCluster.effectors)
{
v+= effector.chargeAmount();
v+= effector.chargeAmount;
}
return v / m_numOfEffectShows; //split even across all effect shows
}
@@ -280,9 +280,9 @@ int EffectShowEffectCluster::getShotsPerArea(int areas) const
if (areas == 0)
return 0;
int v = 0;
for (const auto &effector: m_effectCluster.effectors())
for (const auto &effector: m_effectCluster.effectors)
{
v+= effector.chargeAmount();
v+= effector.chargeAmount;
}
return v / areas;
}
@@ -308,7 +308,7 @@ int EffectShowEffectCluster::getNumberOfVolley(int v)
//-----------------------------------------------------------------------------
double EffectShowEffectCluster::rotationRad() const
{
return -m_effectCluster.area().rotation() * LtsCoordTrans::deg2rad();
return -m_effectCluster.area.rotation * LtsCoordTrans::deg2rad();
}
//-----------------------------------------------------------------------------
@@ -35,7 +35,7 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
Database::EsmEffectShow esmEffectShow;
if (!m_handlerPdmData->isSmoke(m_explosionArea.chargeStruct()))
if (!m_handlerPdmData->isSmoke(m_explosionArea.chargeStruct))
{
int indX = idx % m_areasWidth.numOfAreas;
int indY = idx / m_areasWidth.numOfAreas;
@@ -62,15 +62,15 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_explosionArea.effectStart().is_set() ? m_explosionArea.effectStart().get() : 0;
esmEffectShow.duration = m_explosionArea.effectDuration();
esmEffectShow.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
esmEffectShow.duration = m_explosionArea.effectDuration;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id();
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name());
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name);
esmEffectShow.numOfVolley = getNumberOfVolley();
esmEffectShow.shotsPerVolley = getShotsPerArea() / esmEffectShow.numOfVolley;
esmEffectShow.typeOfAmmunition = m_explosionArea.chargeStruct().chargeTypeId();
esmEffectShow.typeOfAmmunition = m_explosionArea.chargeStruct.chargeTypeId;
// can there be more then 48 shoots?
if (esmEffectShow.shotsPerVolley > 48)
@@ -80,10 +80,10 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_areasWidth.side(indX);
esmEffectShow.areaDepth = m_areasDepth.side(indY);
esmEffectShow.areaRotation = m_explosionArea.area().rotation() + 90;
esmEffectShow.areaRotation = m_explosionArea.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionArea.area().width() << " Height: " << m_explosionArea.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionArea.area.width << " Height: " << m_explosionArea.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
<< "\nOffset x,y: " << x_off << " , " << y_off
@@ -100,30 +100,30 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
// calculate center position
LtsCoordTrans::UtmCoordinate centerPos = lowerLeftPosRotated;
centerPos.x = centerPos.x + m_explosionArea.area().width() / 2.;
centerPos.y = centerPos.y + m_explosionArea.area().height() / 2.;
centerPos.x = centerPos.x + m_explosionArea.area.width / 2.;
centerPos.y = centerPos.y + m_explosionArea.area.height / 2.;
LtsCoordTrans::UtmCoordinate centerPosRotated = rotate(centerPos, m_lowerLeftPos, rotationRad());
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_explosionArea.effectStart().is_set() ? m_explosionArea.effectStart().get() : 0;
esmEffectShow.duration = m_explosionArea.effectDuration();
esmEffectShow.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
esmEffectShow.duration = m_explosionArea.effectDuration;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id();
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name());
esmEffectShow.typeOfAmmunition = m_explosionArea.chargeStruct().chargeTypeId();
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name);
esmEffectShow.typeOfAmmunition = m_explosionArea.chargeStruct.chargeTypeId;
esmEffectShow.numOfVolley = 1;
esmEffectShow.shotsPerVolley = 1;
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_explosionArea.area().width();
esmEffectShow.areaDepth = m_explosionArea.area().height();
esmEffectShow.areaRotation = m_explosionArea.area().rotation() + 90;
esmEffectShow.areaWidth = m_explosionArea.area.width;
esmEffectShow.areaDepth = m_explosionArea.area.height;
esmEffectShow.areaRotation = m_explosionArea.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionArea.area().width() << " Height: " << m_explosionArea.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionArea.area.width << " Height: " << m_explosionArea.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
<< "\nSide x,y: " << m_explosionArea.area().width() << " , " << m_explosionArea.area().height();
<< "\nSide x,y: " << m_explosionArea.area.width << " , " << m_explosionArea.area.height;
}
return esmEffectShow;
@@ -131,29 +131,29 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
//=============================================================================
void EffectShowExplosionArea::updateEffectShow(Database::EsmEffectShow &data)
{
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name());
data.startTime = m_explosionArea.effectStart().is_set() ? m_explosionArea.effectStart().get() : 0;
data.duration = m_explosionArea.effectDuration();
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name);
data.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
data.duration = m_explosionArea.effectDuration;
if (data.shotsPerVolley > 48)
data.shotsPerVolley = 48;//(48 / data.numOfVolley);
if (data.shotsPerVolley <= 0)
data.shotsPerVolley = 1;
data.typeOfAmmunition = m_explosionArea.chargeStruct().chargeTypeId();
data.typeOfAmmunition = m_explosionArea.chargeStruct.chargeTypeId;
}
//-----------------------------------------------------------------------------
void EffectShowExplosionArea::calculateSquare()
{
// start position of the area
Core::GeoPosition2D geoPos = m_explosionArea.area().cornerBottomLeft();
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat());
Core::GeoPosition2D geoPos = m_explosionArea.area.cornerBottomLeft;
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat);
// Calculate squares.
m_areasWidth = getAreasSideLength(m_explosionArea.area().width()); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_explosionArea.area().height()); // Squares in y-direction
m_areasWidth = getAreasSideLength(m_explosionArea.area.width); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_explosionArea.area.height); // Squares in y-direction
// Calculate number of squares
if (m_handlerPdmData->isSmoke(m_explosionArea.chargeStruct()))
if (m_handlerPdmData->isSmoke(m_explosionArea.chargeStruct))
m_numOfEffectShows = 1;
else
m_numOfEffectShows = m_areasWidth.numOfAreas * m_areasDepth.numOfAreas;
@@ -203,7 +203,7 @@ int EffectShowExplosionArea::getShotsPerArea() const
{
if (!m_numOfEffectShows)
return 0;
int v = m_explosionArea.cannonCount() * m_explosionArea.cannonRounds();
int v = m_explosionArea.cannonCount * m_explosionArea.cannonRounds;
return v / m_numOfEffectShows; //split even across all effect shows
}
@@ -211,7 +211,7 @@ int EffectShowExplosionArea::getShotsPerArea(int areas) const
{
if (areas == 0)
return 0;
int v = m_explosionArea.cannonCount() * m_explosionArea.cannonRounds();
int v = m_explosionArea.cannonCount * m_explosionArea.cannonRounds;
return v / areas;
}
@@ -237,7 +237,7 @@ int EffectShowExplosionArea::getNumberOfVolley(int v)
//-----------------------------------------------------------------------------
double EffectShowExplosionArea::rotationRad() const
{
return -m_explosionArea.area().rotation() * LtsCoordTrans::deg2rad();
return -m_explosionArea.area.rotation * LtsCoordTrans::deg2rad();
}
//-----------------------------------------------------------------------------
@@ -35,7 +35,7 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
Database::EsmEffectShow esmEffectShow;
if (!m_handlerPdmData->isSmoke(m_explosionCluster.chargeStruct()))
if (!m_handlerPdmData->isSmoke(m_explosionCluster.chargeStruct))
{
int indX = idx % m_areasWidth.numOfAreas;
int indY = idx / m_areasWidth.numOfAreas;
@@ -62,15 +62,15 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
esmEffectShow.duration = m_explosionCluster.effectDuration();
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
esmEffectShow.duration = m_explosionCluster.effectDuration;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id();
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
esmEffectShow.numOfVolley = getNumberOfVolley();
esmEffectShow.shotsPerVolley = getShotsPerArea() / esmEffectShow.numOfVolley;
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
// can there be more then 48 shoots?
if (esmEffectShow.shotsPerVolley > 48)
@@ -80,10 +80,10 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_areasWidth.side(indX);
esmEffectShow.areaDepth = m_areasDepth.side(indY);
esmEffectShow.areaRotation = m_explosionCluster.area().rotation() + 90;
esmEffectShow.areaRotation = m_explosionCluster.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area().width() << " Height: " << m_explosionCluster.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area.width << " Height: " << m_explosionCluster.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
<< "\nOffset x,y: " << x_off << " , " << y_off
@@ -100,30 +100,30 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
// calculate center position
LtsCoordTrans::UtmCoordinate centerPos = lowerLeftPosRotated;
centerPos.x = centerPos.x + m_explosionCluster.area().width() / 2.;
centerPos.y = centerPos.y + m_explosionCluster.area().height() / 2.;
centerPos.x = centerPos.x + m_explosionCluster.area.width / 2.;
centerPos.y = centerPos.y + m_explosionCluster.area.height / 2.;
LtsCoordTrans::UtmCoordinate centerPosRotated = rotate(centerPos, m_lowerLeftPos, rotationRad());
esmEffectShow.id = 0;
esmEffectShow.name = QStringLiteral("EXP");
esmEffectShow.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
esmEffectShow.duration = m_explosionCluster.effectDuration();
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
esmEffectShow.duration = m_explosionCluster.effectDuration;
esmEffectShow.centerPosition = centerPosRotated.geographic();
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id();
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
esmEffectShow.esmParticipantId = -1;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
esmEffectShow.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
esmEffectShow.numOfVolley = 1;
esmEffectShow.shotsPerVolley = 1;
esmEffectShow.lowerLeftPosition = lowerLeftPosRotated.geographic();
esmEffectShow.areaWidth = m_explosionCluster.area().width();
esmEffectShow.areaDepth = m_explosionCluster.area().height();
esmEffectShow.areaRotation = m_explosionCluster.area().rotation() + 90;
esmEffectShow.areaWidth = m_explosionCluster.area.width;
esmEffectShow.areaDepth = m_explosionCluster.area.height;
esmEffectShow.areaRotation = m_explosionCluster.area.rotation + 90;
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area().width() << " Height: " << m_explosionCluster.area().height()
DEBUG_LOG(m_logger) << "\nWidth: " << m_explosionCluster.area.width << " Height: " << m_explosionCluster.area.height
<< "\nRotated LL Pos: " << lowerLeftPosRotated.mgrs()
<< "\nRotated Center Pos: " << centerPosRotated.mgrs()
<< "\nSide x,y: " << m_explosionCluster.area().width() << " , " << m_explosionCluster.area().height();
<< "\nSide x,y: " << m_explosionCluster.area.width << " , " << m_explosionCluster.area.height;
}
return esmEffectShow;
@@ -133,27 +133,27 @@ void EffectShowExplosionCluster::updateEffectShow(Database::EsmEffectShow &data)
{
DEBUG_LOG(m_logger) << "update EffectSHow for (" << data.id << ")";
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name());
data.startTime = m_explosionCluster.effectStart().is_set() ? m_explosionCluster.effectStart().get() : 0;
data.duration = m_explosionCluster.effectDuration();
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
data.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
data.duration = m_explosionCluster.effectDuration;
if (data.shotsPerVolley > 48)
data.shotsPerVolley = 48;//(48 / data.numOfVolley);
if (data.shotsPerVolley <= 0)
data.shotsPerVolley = 1;
data.typeOfAmmunition = m_explosionCluster.chargeStruct().chargeTypeId();
data.typeOfAmmunition = m_explosionCluster.chargeStruct.chargeTypeId;
}
//-----------------------------------------------------------------------------
void EffectShowExplosionCluster::calculateSquare()
{
Core::GeoPosition2D geoPos = m_explosionCluster.area().cornerBottomLeft();
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat());
Core::GeoPosition2D geoPos = m_explosionCluster.area.cornerBottomLeft;
m_lowerLeftPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat);
// Calculate squares.
m_areasWidth = getAreasSideLength(m_explosionCluster.area().width()); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_explosionCluster.area().height()); // Squares in y-direction
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_explosionCluster.chargeStruct());
m_areasWidth = getAreasSideLength(m_explosionCluster.area.width); // Squares in x-direction
m_areasDepth = getAreasSideLength(m_explosionCluster.area.height); // Squares in y-direction
m_numOfEffectShows = m_handlerPdmData->effectShowCount(m_explosionCluster.chargeStruct);
}
//static ----------------------------------------------------------------------
LtsCoordTrans::UtmCoordinate EffectShowExplosionCluster::rotate(const LtsCoordTrans::UtmCoordinate &p, const LtsCoordTrans::UtmCoordinate &c, double angle)
@@ -198,7 +198,7 @@ int EffectShowExplosionCluster::getShotsPerArea() const
{
if (!m_numOfEffectShows)
return 0;
int v = m_explosionCluster.impactCount(); //cannonCount() * m_explosionCluster.cannonRounds();
int v = m_explosionCluster.impactCount; //cannonCount() * m_explosionCluster.cannonRounds();
return v / m_numOfEffectShows; //split even across all effect shows
}
@@ -206,7 +206,7 @@ int EffectShowExplosionCluster::getShotsPerArea(int areas) const
{
if (areas == 0)
return 0;
int v = m_explosionCluster.impactCount();//cannonCount() * m_explosionCluster.cannonRounds();
int v = m_explosionCluster.impactCount;//cannonCount() * m_explosionCluster.cannonRounds();
return v / areas;
}
@@ -232,7 +232,7 @@ int EffectShowExplosionCluster::getNumberOfVolley(int v)
//-----------------------------------------------------------------------------
double EffectShowExplosionCluster::rotationRad() const
{
return -m_explosionCluster.area().rotation() * LtsCoordTrans::deg2rad();
return -m_explosionCluster.area.rotation * LtsCoordTrans::deg2rad();
}
//-----------------------------------------------------------------------------
@@ -28,11 +28,11 @@ Database::EsmEffectShow EffectShowMineArea::getEffectShow()
Database::EsmEffectShow esmEffectShow;
esmEffectShow.id = 0;
esmEffectShow.name = QLatin1String("MIN");
esmEffectShow.startTime = m_mineArea.effectStart().is_set() ? m_mineArea.effectStart().get() : 0;
esmEffectShow.duration = m_mineArea.effectDuration();
esmEffectShow.startTime = m_mineArea.effectStart.is_set() ? m_mineArea.effectStart.get() : 0;
esmEffectShow.duration = m_mineArea.effectDuration;
esmEffectShow.centerPosition = m_centerPos.geographic();
esmEffectShow.idAreaEffectSimulation = m_mineArea.id();
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_mineArea.name());
esmEffectShow.idAreaEffectSimulation = m_mineArea.id;
esmEffectShow.nameAreaEfffectSimulation = QString::fromStdString(m_mineArea.name);
esmEffectShow.esmParticipantId = -1;
esmEffectShow.numOfVolley = 1; //Hardcode??
esmEffectShow.shotsPerVolley = 18;
@@ -43,10 +43,10 @@ Database::EsmEffectShow EffectShowMineArea::getEffectShow()
updateEffectShow(esmEffectShow);
for (const auto &seg : m_mineArea.segments())
for (const auto &seg : m_mineArea.segments)
{
const Core::GeoPosition2D &posGeo = seg.positionStart();
LtsCoordTrans::UtmCoordinate pos = LtsCoordTrans::UtmCoordinate::fromGeographic(posGeo.lon(), posGeo.lat(), m_utmZone);
const Core::GeoPosition2D &posGeo = seg.positionStart;
LtsCoordTrans::UtmCoordinate pos = LtsCoordTrans::UtmCoordinate::fromGeographic(posGeo.lon, posGeo.lat, m_utmZone);
DEBUG_LOG(m_logger) << "Start Pos Segm.: " << pos.mgrs();
}
DEBUG_LOG(m_logger) << "Center Pos Effect Show: " << LtsCoordTrans::mgrsFromGeographic(esmEffectShow.centerPosition.x(), esmEffectShow.centerPosition.y());
@@ -55,27 +55,27 @@ Database::EsmEffectShow EffectShowMineArea::getEffectShow()
//-----------------------------------------------------------------------------
void EffectShowMineArea::updateEffectShow(Database::EsmEffectShow &data)
{
data.nameAreaEfffectSimulation = QString::fromStdString(m_mineArea.name());
data.duration = m_mineArea.effectDuration() / 10;
data.nameAreaEfffectSimulation = QString::fromStdString(m_mineArea.name);
data.duration = m_mineArea.effectDuration / 10;
if (data.duration > (3600 * 1000))
data.duration = 3600 * 1000;
if (m_mineArea.effectStart().is_set())
data.startTime = m_mineArea.effectStart().get() + m_mineArea.effectDuration() - data.duration;
if (m_mineArea.effectStart.is_set())
data.startTime = m_mineArea.effectStart.get() + m_mineArea.effectDuration - data.duration;
else
data.startTime = 0;
data.typeOfAmmunition = m_mineArea.chargeStruct().chargeTypeId();
data.typeOfAmmunition = m_mineArea.chargeStruct.chargeTypeId;
}
//-----------------------------------------------------------------------------
void EffectShowMineArea::calculatePositions()
{
// start position of the segment
Core::GeoPosition2D geoPosStart = m_segment.positionStart();
Core::GeoPosition2D geoPosEnd = m_segment.positionEnd();
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosStart.lon(), geoPosStart.lat(), m_utmZone);
Core::GeoPosition2D geoPosStart = m_segment.positionStart;
Core::GeoPosition2D geoPosEnd = m_segment.positionEnd;
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosStart.lon, geoPosStart.lat, m_utmZone);
if (m_utmZone == -1)
m_utmZone = startPositionUtm.zone;
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosEnd.lon(), geoPosEnd.lat(), m_utmZone);
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosEnd.lon, geoPosEnd.lat, m_utmZone);
const QLineF line({startPositionUtm.x, startPositionUtm.y}, {endPositionUtm.x, endPositionUtm.y});
// length/2 of the segment
@@ -99,11 +99,11 @@ void EffectShowMineArea::calculatePositions()
//-----------------------------------------------------------------------------
int EffectShowMineArea::getEffectAreaWidth() const
{
Core::GeoPosition2D geoPosStart = m_segment.positionStart();
Core::GeoPosition2D geoPosEnd = m_segment.positionEnd();
Core::GeoPosition2D geoPosStart = m_segment.positionStart;
Core::GeoPosition2D geoPosEnd = m_segment.positionEnd;
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosStart.lon(), geoPosStart.lat(), m_utmZone);
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosEnd.lon(), geoPosEnd.lat(), m_utmZone);
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosStart.lon, geoPosStart.lat, m_utmZone);
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosEnd.lon, geoPosEnd.lat, m_utmZone);
const QLineF line({startPositionUtm.x, startPositionUtm.y}, {endPositionUtm.x, endPositionUtm.y});
int segmentLength = line.length();
@@ -114,7 +114,7 @@ int EffectShowMineArea::getEffectAreaWidth() const
//-----------------------------------------------------------------------------
int EffectShowMineArea::getEffectAreaDepth() const
{
int segmentWidth = qRound(m_mineArea.width());
int segmentWidth = qRound(m_mineArea.width);
if (segmentWidth <= 50) return 50;
if (segmentWidth >= 300) return 300;
return (((segmentWidth + 25) / 50) * 50);
@@ -56,7 +56,7 @@ public:
*/
static const AreaEffectSimulation::MineSegment &getEffectShowSegment(const AreaEffectSimulation::MineArea &mineArea)
{
return mineArea.segments().at(mineArea.segments().size() / 2);
return mineArea.segments.at(mineArea.segments.size() / 2);
}
private:
@@ -18,8 +18,8 @@ namespace ConvertFromTab
//=============================================================================
RxTelegram_e isTelegram(const TrainingAreaBase::FireSmokeMarkerData &data)
{
Q_ASSERT(data.payload().size() > 0);
switch (data.payload().at(0))
Q_ASSERT(data.payload.size() > 0);
switch (data.payload.at(0))
{
case 120: return RxTelegram_e::OrderConfirmation;
case 121: return RxTelegram_e::VehicleStatus;
@@ -29,10 +29,10 @@ RxTelegram_e isTelegram(const TrainingAreaBase::FireSmokeMarkerData &data)
//=============================================================================
OrderConfirmation_t getOrderConfirmation(const TrainingAreaBase::FireSmokeMarkerData &data)
{
Q_ASSERT(data.payload().size() >= 5);
Q_ASSERT(data.payload.size() >= 5);
const QByteArray tele(QByteArray::fromRawData(
reinterpret_cast<const char *>(&data.payload().at(0)),
data.payload().size()));
reinterpret_cast<const char *>(&data.payload.at(0)),
data.payload.size()));
OrderConfirmation_t res;
size_t k = 1;
@@ -45,9 +45,9 @@ OrderConfirmation_t getOrderConfirmation(const TrainingAreaBase::FireSmokeMarker
res.confirmation = EffectShowManagement::OrderConfirmation_e::inner_enum(byte);
QByteArray qbArr;
int ie = data.payload().size() - 5;
int ie = data.payload.size() - 5;
for (int i = 0; i < ie; ++i)
qbArr.append(data.payload().at(5 + i)); // rationale (text)
qbArr.append(data.payload.at(5 + i)); // rationale (text)
res.answerText = QString::fromUtf8(qbArr);
@@ -56,14 +56,14 @@ OrderConfirmation_t getOrderConfirmation(const TrainingAreaBase::FireSmokeMarker
//=============================================================================
VehicleStatus_t getVehicleStatus(const TrainingAreaBase::FireSmokeMarkerData &data)
{
Q_ASSERT(data.payload().size() == 5);
Q_ASSERT(data.payload.size() == 5);
const QByteArray tele(QByteArray::fromRawData(
reinterpret_cast<const char *>(&data.payload().at(0)),
data.payload().size()));
reinterpret_cast<const char *>(&data.payload.at(0)),
data.payload.size()));
VehicleStatus_t res;
res.equipmentNumber = data.equipmentNumber();
res.timestamp = data.sampleTime();
res.equipmentNumber = data.equipmentNumber;
res.timestamp = data.sampleTime;
size_t k = 1;
quint8 byte;
@@ -27,8 +27,8 @@ std::vector<uint8_t> convertEffectShowOrder(const EffectShowOrder_t &effectShowO
LtsUtils::set2Byte(effectShowOrder.idEffectShow, ba);
LtsUtils::set4Byte(effectShowOrder.startTime, ba);
LtsUtils::set8Byte(effectShowOrder.centerPosition.lon(), ba);
LtsUtils::set8Byte(effectShowOrder.centerPosition.lat(), ba);
LtsUtils::set8Byte(effectShowOrder.centerPosition.lon, ba);
LtsUtils::set8Byte(effectShowOrder.centerPosition.lat, ba);
// 50m squares
LtsUtils::set1Byte(effectShowOrder.areaWidth / 50, ba);
@@ -39,8 +39,8 @@ std::vector<uint8_t> convertEffectShowOrder(const EffectShowOrder_t &effectShowO
rotation += 360.0;
LtsUtils::set2Byte(qRound(rotation * 100), ba);
LtsUtils::set8Byte(effectShowOrder.lowerLeftPosition.lon(), ba);
LtsUtils::set8Byte(effectShowOrder.lowerLeftPosition.lat(), ba);
LtsUtils::set8Byte(effectShowOrder.lowerLeftPosition.lon, ba);
LtsUtils::set8Byte(effectShowOrder.lowerLeftPosition.lat, ba);
LtsUtils::set1Byte(effectShowOrder.numOfVolley, ba);
LtsUtils::set1Byte(effectShowOrder.shotsPerVolley, ba);
@@ -65,8 +65,8 @@ std::vector<uint8_t> convertRelocationOrder(const RelocationOrder_t &relocationO
LtsUtils::set2Byte(relocationOrder.idRelocation, ba);
LtsUtils::set4Byte(relocationOrder.executionTime, ba);
LtsUtils::set8Byte(relocationOrder.centerPosition.lon(), ba);
LtsUtils::set8Byte(relocationOrder.centerPosition.lat(), ba);
LtsUtils::set8Byte(relocationOrder.centerPosition.lon, ba);
LtsUtils::set8Byte(relocationOrder.centerPosition.lat, ba);
const QByteArray text = relocationOrder.infoText.toUtf8().simplified();
for (auto c : text)
@@ -124,16 +124,16 @@ std::vector<uint8_t> convertMeteoData(const MeteoDataManagement::MeteoData &mete
ba.reserve(11);
LtsUtils::set1Byte(156, ba);
LtsUtils::set2Byte(qRound(meteoData.temperature() * 10.0), ba);
LtsUtils::set2Byte(qRound(meteoData.humidity()), ba);
LtsUtils::set2Byte(qRound(meteoData.pressure()), ba);
LtsUtils::set2Byte(qRound(meteoData.temperature * 10.0), ba);
LtsUtils::set2Byte(qRound(meteoData.humidity), ba);
LtsUtils::set2Byte(qRound(meteoData.pressure), ba);
double dir = fmod(meteoData.windDirection(), 360.0);
double dir = fmod(meteoData.windDirection, 360.0);
if (dir < 0.0)
dir += 360.0;
LtsUtils::set2Byte(qRound(dir * 100), ba);
LtsUtils::set2Byte(qRound(meteoData.windSpeed()), ba);
LtsUtils::set2Byte(qRound(meteoData.windSpeed), ba);
return LtsUtils::convert<std::vector<uint8_t>>(ba);
}
@@ -117,45 +117,45 @@ bool HandlerAesData::init()
//=============================================================================
void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType)
{
const Core::GeoPosition2D &posLl = data.impactPosition();
const Core::GeoPosition2D &posLl = data.impactPosition;
AreaEffectSimulation::ExplosionArea areaData;
areaData.altitude(data.altitude());
areaData.cannonCount(1);
areaData.cannonRounds(1);
areaData.chargeStruct().chargeTypeId(data.chargeStruct().chargeTypeId());
areaData.effectDuration(data.effectDuration());
areaData.effectMarkingInTa(data.effectMarkingInTa());
areaData.effectStart(data.effectStart());
areaData.effectStateId(data.effectStateId());
areaData.externalId(data.externalId());
areaData.fireRequestTime(data.fireRequestTime());
areaData.remainExplosionNumber(1);
areaData.id(data.id());
areaData.name(data.name());
areaData.isDeleted(data.isDeleted());
areaData.isUsed(data.isUsed());
areaData.altitude = data.altitude;
areaData.cannonCount = 1;
areaData.cannonRounds = 1;
areaData.chargeStruct.chargeTypeId = data.chargeStruct.chargeTypeId;
areaData.effectDuration = data.effectDuration;
areaData.effectMarkingInTa = data.effectMarkingInTa;
areaData.effectStart = data.effectStart;
areaData.effectStateId = data.effectStateId;
areaData.externalId = data.externalId;
areaData.fireRequestTime = data.fireRequestTime;
areaData.remainExplosionNumber = 1;
areaData.id = data.id;
areaData.name = data.name;
areaData.isDeleted = data.isDeleted;
areaData.isUsed = data.isUsed;
AreaEffectSimulation::Area area;
area.cornerBottomLeft(posLl);
area.height(50);
area.width(50);
areaData.area(area);
area.cornerBottomLeft = posLl;
area.height = 50;
area.width = 50;
areaData.area = area;
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(areaData), modType);
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n Start: " << data.effectStart()
<< "\n Duration: " << data.effectDuration()
<< "\n ID: " << data.id
<< "\n Name: " << data.name
<< "\n Effect status: " << data.effectStateId
<< "\n Effect show (y/n): " << data.effectMarkingInTa
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n Start: " << data.effectStart
<< "\n Duration: " << data.effectDuration
<< "\n Modification: " << modType
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
@@ -172,7 +172,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
}
else
{
m_AesDataObjMap.insert(data.id(), ifs);
m_AesDataObjMap.insert(data.id, ifs);
m_mainHandler->handlerEffectShow()->onExplosionAreaChanged(areaData, kindOfModification);
}
break;
@@ -191,15 +191,15 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
{
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
if (!m_AesDataObjMap.remove(data.id))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
@@ -221,25 +221,25 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType)
{
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
DEBUG_LOG(m_logger) << "Got ExplosionArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n Width: " << data.area().width()
<< "\n Height: " << data.area().height()
<< "\n Rotation: " << data.area().rotation()
<< "\n Start: " << data.effectStart()
<< "\n Duration: " << data.effectDuration()
<< "\n ID: " << data.id
<< "\n Name: " << data.name
<< "\n Effect status: " << data.effectStateId
<< "\n Effect show (y/n): " << data.effectMarkingInTa
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n Width: " << data.area.width
<< "\n Height: " << data.area.height
<< "\n Rotation: " << data.area.rotation
<< "\n Start: " << data.effectStart
<< "\n Duration: " << data.effectDuration
<< "\n Modification: " << modType
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
@@ -275,15 +275,15 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
{
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
if (!m_AesDataObjMap.remove(data.id))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
@@ -303,25 +303,25 @@ void HandlerAesData::onExplosionAreaChanged(const AreaEffectSimulation::Explosio
void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType)
{
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
DEBUG_LOG(m_logger) << ">>>> Got Cluster: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n Width: " << data.area().width()
<< "\n Height: " << data.area().height()
<< "\n Rotation: " << data.area().rotation()
<< "\n Start: " << data.effectStart()
<< "\n Duration: " << data.effectDuration()
<< "\n ID: " << data.id
<< "\n Name: " << data.name
<< "\n Effect status: " << data.effectStateId
<< "\n Effect show (y/n): " << data.effectMarkingInTa
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n Width: " << data.area.width
<< "\n Height: " << data.area.height
<< "\n Rotation: " << data.area.rotation
<< "\n Start: " << data.effectStart
<< "\n Duration: " << data.effectDuration
<< "\n Modification: " << modType
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
@@ -338,7 +338,7 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
}
else
{
m_AesDataObjMap.insert(data.id(), ifs);
m_AesDataObjMap.insert(data.id, ifs);
m_mainHandler->handlerEffectShow()->onExplosionClusterChanged(data, kindOfModification);
}
break;
@@ -357,15 +357,15 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
{
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
if (!m_AesDataObjMap.remove(data.id))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
@@ -384,25 +384,25 @@ void HandlerAesData::onExplosionClusterChanged(const AreaEffectSimulation::Explo
void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType)
{
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
const Core::GeoPosition2D &posLl = data.area().cornerBottomLeft();
const Core::GeoPosition2D &posLl = data.area.cornerBottomLeft;
DEBUG_LOG(m_logger) << ">>>> Got EffectCluster: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n Width: " << data.area().width()
<< "\n Height: " << data.area().height()
<< "\n Rotation: " << data.area().rotation()
<< "\n Start: " << data.effectStart()
<< "\n Duration: " << data.effectDuration()
<< "\n ID: " << data.id
<< "\n Name: " << data.name
<< "\n Effect status: " << data.effectStateId
<< "\n Effect show (y/n): " << data.effectMarkingInTa
<< "\n Lower left Pos: " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n Width: " << data.area.width
<< "\n Height: " << data.area.height
<< "\n Rotation: " << data.area.rotation
<< "\n Start: " << data.effectStart
<< "\n Duration: " << data.effectDuration
<< "\n Modification: " << modType
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
@@ -419,7 +419,7 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
}
else
{
m_AesDataObjMap.insert(data.id(), ifs);
m_AesDataObjMap.insert(data.id, ifs);
m_mainHandler->handlerEffectShow()->onEffectClusterChanged(data, kindOfModification);
}
break;
@@ -438,15 +438,15 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Explosion Area not available for modification: " << data.id;
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
{
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
if (!m_AesDataObjMap.remove(data.id))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
@@ -466,26 +466,26 @@ void HandlerAesData::onEffectClusterChanged(const AreaEffectSimulation::EffectCl
void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType)
{
HandlerEffectShow::KindOfModification_e kindOfModification = HandlerEffectShow::KindOfModification_e::Removed;
if (takeIntoAccountEffectShow(data.effectStateId()) && data.effectMarkingInTa())
if (takeIntoAccountEffectShow(data.effectStateId) && data.effectMarkingInTa)
kindOfModification = getKindOfModification(ObjectAesData::asEsmAesData(data), modType);
ObjectAesData *ifs = m_AesDataObjMap.value(data.id());
ObjectAesData *ifs = m_AesDataObjMap.value(data.id);
if (kindOfModification == HandlerEffectShow::KindOfModification_e::Added && ifs)
kindOfModification = HandlerEffectShow::KindOfModification_e::ModifiedData;
if (data.segments().size() == 0)
if (data.segments.size() == 0)
return;
const Core::GeoPosition2D &posLl = data.segments().at(data.segments().size() / 2).positionStart();
const Core::GeoPosition2D &posLl = data.segments.at(data.segments.size() / 2).positionStart;
DEBUG_LOG(m_logger) << "Got MineArea: "
<< "\n ID: " << data.id()
<< "\n Name: " << data.name()
<< "\n Effect status: " << data.effectStateId()
<< "\n Effect show (y/n): " << data.effectMarkingInTa()
<< "\n Start Position " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n Start: " << data.effectStart()
<< "\n Duration: " << data.effectDuration()
<< "\n Num of segments: " << data.segments().size()
<< "\n ID: " << data.id
<< "\n Name: " << data.name
<< "\n Effect status: " << data.effectStateId
<< "\n Effect show (y/n): " << data.effectMarkingInTa
<< "\n Start Position " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n Start: " << data.effectStart
<< "\n Duration: " << data.effectDuration
<< "\n Num of segments: " << data.segments.size()
<< "\n Modification: " << modType
<< "\n detected Mod: " << HandlerEffectShow::enumToString(kindOfModification);
@@ -502,7 +502,7 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
}
else
{
m_AesDataObjMap.insert(data.id(), ifs);
m_AesDataObjMap.insert(data.id, ifs);
m_mainHandler->handlerEffectShow()->onMineAreaChanged(data, kindOfModification);
}
break;
@@ -521,15 +521,15 @@ void HandlerAesData::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
ERROR_LOG(m_logger) << ret();
}
else
WARNING_LOG(m_logger) << "Mine Area not available for modification: " << data.id();
WARNING_LOG(m_logger) << "Mine Area not available for modification: " << data.id;
break;
}
case HandlerEffectShow::KindOfModification_e::Removed:
{
if (ifs != nullptr)
{
if (!m_AesDataObjMap.remove(data.id()))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id() << ") from map failed.";
if (!m_AesDataObjMap.remove(data.id))
ERROR_LOG(m_logger) << "Remove of AES data (" << data.id << ") from map failed.";
Core::FunctionReplyObject ret = ifs->removeObject();
if (ret.error())
@@ -90,20 +90,20 @@ void HandlerEffectShow::onExplosionAreaChanged(const AreaEffectSimulation::Explo
break;
case KindOfModification_e::ModifiedData:
updateEffectShowsRelatedToExplosionArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
break;
case KindOfModification_e::Removed:
if(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id());
if(data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id);
break;
case KindOfModification_e::Paused:
updateEffectShowsRelatedToExplosionArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//pauseEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::Continued:
updateEffectShowsRelatedToExplosionArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//continueEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::None:
@@ -124,20 +124,20 @@ void HandlerEffectShow::onExplosionClusterChanged(const AreaEffectSimulation::Ex
break;
case KindOfModification_e::ModifiedData:
updateEffectShowsRelatedToExplosionCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
break;
case KindOfModification_e::Removed:
if(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id());
if(data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id);
break;
case KindOfModification_e::Paused:
updateEffectShowsRelatedToExplosionCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//pauseEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::Continued:
updateEffectShowsRelatedToExplosionCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//continueEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::None:
@@ -159,20 +159,20 @@ void HandlerEffectShow::onEffectClusterChanged(const AreaEffectSimulation::Effec
break;
case KindOfModification_e::ModifiedData:
updateEffectShowsRelatedToEffectCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
break;
case KindOfModification_e::Removed:
if(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id());
if(data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id);
break;
case KindOfModification_e::Paused:
updateEffectShowsRelatedToEffectCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//pauseEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::Continued:
updateEffectShowsRelatedToEffectCluster(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//continueEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::None:
@@ -195,20 +195,20 @@ void HandlerEffectShow::onMineAreaChanged(const AreaEffectSimulation::MineArea &
break;
case KindOfModification_e::ModifiedData:
updateEffectShowsRelatedToMineArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
break;
case KindOfModification_e::Removed:
if(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id());
if(data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
removeEffectShowsRelatedToAes(data.id);
break;
case KindOfModification_e::Paused:
updateEffectShowsRelatedToMineArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
// pauseEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::Continued:
updateEffectShowsRelatedToMineArea(data);
updateEffectShowOrdersRelatedToAes(data.id());
updateEffectShowOrdersRelatedToAes(data.id);
//continueEffectShowsRelatedToAes(data.id());
break;
case KindOfModification_e::None:
@@ -231,21 +231,21 @@ void HandlerEffectShow::effectShowOrderConfirmationReceived(const ConvertFromTab
// add confirmation data
ifs->updateObject(orderConfirmation);
if (oldId != ifs->getData().orderConfirmation && ifs->getData().orderConfirmation == EffectShowManagement::OrderConfirmation_e::FiringReadiness)
if (oldId != ifs->getData().orderConfirmation && ifs->getData().orderConfirmation == static_cast<int>(EffectShowManagement::OrderConfirmation_e::FiringReadiness))
{
DEBUG_LOG(m_logger) << "effectShowOrderConfirmationReceived Got Fire Readyness, send to aes for " << ifs->getId();
AreaEffectSimulation::SetAesItemEffectorStateRequest req;
req.aesId(ifs->getIdAES());
req.newEffectorState(AreaEffectSimulation::AesEffectorState::EsReadyToFire);
req.participantId(ifs->getData().esmParticipantId);
req.aesId = ifs->getIdAES();
req.newEffectorState = AreaEffectSimulation::AesEffectorState::EsReadyToFire;
req.participantId = ifs->getData().esmParticipantId;
m_mainHandler->dds()->ftcAes()->setAesItemEffectorStateRequest(req, this);
}
switch (orderConfirmation.confirmation.underlying())
switch (orderConfirmation.confirmation)
{
case EffectShowManagement::OrderConfirmation_e_def::DriveOff:
case EffectShowManagement::OrderConfirmation_e_def::FiringReadiness:
case EffectShowManagement::OrderConfirmation_e_def::InterruptExecution:
case EffectShowManagement::OrderConfirmation_e_def::PositionReached:
case EffectShowManagement::OrderConfirmation_e::DriveOff:
case EffectShowManagement::OrderConfirmation_e::FiringReadiness:
case EffectShowManagement::OrderConfirmation_e::InterruptExecution:
case EffectShowManagement::OrderConfirmation_e::PositionReached:
{
triggerMeteoData(ifs); // send meteo data for effect show position
break;
@@ -277,10 +277,10 @@ void HandlerEffectShow::onEffectShowModifyRequest(
const rti::core::SampleIdentity &cookie,
const EffectShow &request)
{
DEBUG_LOG(m_logger) << "onEffectShowModifyRequest: " << request.id();
if (request.id() <= 0)
DEBUG_LOG(m_logger) << "onEffectShowModifyRequest: " << request.id;
if (request.id <= 0)
{
ERROR_LOG(m_logger) << "Illegal Effect Show Id: " << request.id();
ERROR_LOG(m_logger) << "Illegal Effect Show Id: " << request.id;
return;
}
@@ -297,13 +297,13 @@ void HandlerEffectShow::onEffectShowModifyRequest(
//-------------------------------------------------------------------------------
Core::FunctionReplyObject HandlerEffectShow::effectShowModifyRequest(const EffectShow &request)
{
ObjectEffectShow *ifs = m_effectShowObjMap.value(request.id());
ObjectEffectShow *ifs = m_effectShowObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "EffectShow with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "EffectShow with id %1 not found")).arg(request.id);
Core::FunctionReplyObject ret;
auto idCurrent = ifs->getData().esmParticipantId;
if ((idCurrent != -1) && (request.esmParticipantId() != idCurrent))
if ((idCurrent != -1) && (request.esmParticipantId != idCurrent))
{
triggerRetractOrder(ifs); // trigger retract order to current effect show actor, if needed
ret = ifs->updateObject(request); // update effect show
@@ -327,24 +327,24 @@ Core::FunctionReplyObject HandlerEffectShow::effectShowModifyRequest(const Effec
void HandlerEffectShow::onEffectShowRemoveRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request)
{
DEBUG_LOG(m_logger) << "onEffectShowRemoveRequest: " << request.id();
DEBUG_LOG(m_logger) << "onEffectShowRemoveRequest: " << request.id;
ObjectEffectShow *ifs = m_effectShowObjMap.value(request.id());
ObjectEffectShow *ifs = m_effectShowObjMap.value(request.id);
Core::FunctionReplyObject ret;
if (ifs == nullptr)
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "EffectShow id %1 is not valid")).arg(request.id());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "EffectShow id %1 is not valid")).arg(request.id);
m_mainHandler->dds()->fts()->effectShowRemoveReply(cookie, ret);
return;
}
EffectShowManagement::EffectShow ddsData;
ddsData.id(ifs->getId());
ddsData.id = ifs->getId();
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ddsData, m_mainHandler->exerciseId()))
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "EffectShow '%1' is used by another user!")).arg(ifs->getName());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "EffectShow '%1' is used by another user!")).arg(ifs->getName());
m_mainHandler->dds()->fts()->effectShowRemoveReply(cookie, ret);
return;
}
@@ -431,7 +431,7 @@ QVector<Database::EsmEffectShow> HandlerEffectShow::createEffectShowDbDataRelate
EffectShowExplosionArea effectShowExplosionArea(data, m_mainHandler->handlerPdmData());
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct()))
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct))
{
//create exact 1
ret.reserve(1);
@@ -479,13 +479,13 @@ QVector<Database::EsmEffectShow> HandlerEffectShow::createEffectShowDbDataRelate
EffectShowExplosionCluster effectShowExplosionCluster(data, m_mainHandler->handlerPdmData());
QVector<Database::EsmEffectShow> ret;
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct()))
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct))
{
//create exact 1
ret.reserve(1);
Database::EsmEffectShow esmEffectShow = effectShowExplosionCluster.getEffectShow(0);
if(data.esmParticipantIds().size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds().at(0); // TODO handle vector
if(data.esmParticipantIds.size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds.at(0); // TODO handle vector
DEBUG_LOG(m_logger) << toString(esmEffectShow);
ret.push_back(std::move(esmEffectShow));
}
@@ -519,8 +519,8 @@ QVector<Database::EsmEffectShow> HandlerEffectShow::createEffectShowDbDataRelate
DEBUG_LOG(m_logger) << toString(esmEffectShow);
// Evlt. nicht bei DM42 (dann ist max > 1)
if(data.esmParticipantIds().size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds().at(0); // TODO handle vector
if(data.esmParticipantIds.size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds.at(0); // TODO handle vector
ret.push_back(std::move(esmEffectShow));
}
}
@@ -532,13 +532,13 @@ QVector<Database::EsmEffectShow> HandlerEffectShow::createEffectShowDbDataRelate
EffectShowEffectCluster effectShowEffectCluster(data, m_mainHandler->handlerPdmData());
QVector<Database::EsmEffectShow> ret;
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct()))
if (m_mainHandler->handlerPdmData()->isSmoke(data.chargeStruct))
{
//create exact 1
ret.reserve(1);
Database::EsmEffectShow esmEffectShow = effectShowEffectCluster.getEffectShow(0);
if(data.esmParticipantIds().size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds().at(0); // TODO handle vector
if(data.esmParticipantIds.size() > 0)
esmEffectShow.esmParticipantId = data.esmParticipantIds.at(0); // TODO handle vector
DEBUG_LOG(m_logger) << toString(esmEffectShow);
ret.push_back(std::move(esmEffectShow));
}
@@ -572,8 +572,8 @@ QVector<Database::EsmEffectShow> HandlerEffectShow::createEffectShowDbDataRelate
//DEBUG_LOG(m_logger) << toString(esmEffectShow);
// Evlt. nicht bei DM42 (dann ist max > 1)
if(data.esmParticipantIds().size() > (size_t)i)
esmEffectShow.esmParticipantId = data.esmParticipantIds().at(i); // TODO handle vector
if(data.esmParticipantIds.size() > (size_t)i)
esmEffectShow.esmParticipantId = data.esmParticipantIds.at(i); // TODO handle vector
DEBUG_LOG(m_logger) << toString(esmEffectShow);
ret.push_back(std::move(esmEffectShow));
@@ -591,8 +591,8 @@ void HandlerEffectShow::removeEffectShowsRelatedToAes(int idAes, bool retract)
bool remove = false;
if (it.value()->getIdAES() == idAes)
{
if ((it.value()->getData().orderConfirmation != EffectShowManagement::OrderConfirmation_e_def::Execution) &&
(it.value()->getData().orderConfirmation != EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut))
if ((it.value()->getData().orderConfirmation != static_cast<int>(EffectShowManagement::OrderConfirmation_e::Execution))) &&
(it.value()->getData().orderConfirmation != static_cast<int>(EffectShowManagement::OrderConfirmation_e::OrderCarriedOut))
remove = true;
else
INFO_LOG(m_logger) << "Effect Show: " << it.value()->getId() << " not removed due to EXECUTION / ORDER CARRIED OUT";
@@ -612,7 +612,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToMineArea(const AreaEffectSimul
{
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
{
if (obj->getIdAES() == data.id())
if (obj->getIdAES() == data.id)
{
Database::EsmEffectShow esmEffectShow = obj->getData();
EffectShowMineArea effectShowMineArea(data);
@@ -626,7 +626,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToExplosionArea(const AreaEffect
{
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
{
if (obj->getIdAES() == data.id())
if (obj->getIdAES() == data.id)
{
Database::EsmEffectShow esmEffectShow = obj->getData();
EffectShowExplosionArea effectShowExplosionArea(data, m_mainHandler->handlerPdmData());
@@ -640,7 +640,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToExplosionCluster(const AreaEff
{
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
{
if (obj->getIdAES() == data.id())
if (obj->getIdAES() == data.id)
{
Database::EsmEffectShow esmEffectShow = obj->getData();
EffectShowExplosionCluster effectShowExplosionCluster(data, m_mainHandler->handlerPdmData());
@@ -654,7 +654,7 @@ void HandlerEffectShow::updateEffectShowsRelatedToEffectCluster(const AreaEffect
{
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
{
if (obj->getIdAES() == data.id())
if (obj->getIdAES() == data.id)
{
Database::EsmEffectShow esmEffectShow = obj->getData();
EffectShowEffectCluster effectShowEffectCluster(data, m_mainHandler->handlerPdmData());
@@ -677,22 +677,22 @@ void HandlerEffectShow::modifyEffectShowsRelatedToMineArea(const AreaEffectSimul
{
// even there can currently only be one object we use the same logic as for
// modifyEffectShowsRelatedToExplosionArea for convenience
modifyEffectShows(createEffectShowDbDataRelatedToMineArea(data), data.id());
modifyEffectShows(createEffectShowDbDataRelatedToMineArea(data), data.id);
}
//-------------------------------------------------------------------------------
void HandlerEffectShow::modifyEffectShowsRelatedToExplosionArea(const AreaEffectSimulation::ExplosionArea &data)
{
modifyEffectShows(createEffectShowDbDataRelatedToExplosionArea(data), data.id());
modifyEffectShows(createEffectShowDbDataRelatedToExplosionArea(data), data.id);
}
void HandlerEffectShow::modifyEffectShowsRelatedToExplosionCluster(const AreaEffectSimulation::ExplosionCluster &data)
{
modifyEffectShows(createEffectShowDbDataRelatedToExplosionCluster(data), data.id());
modifyEffectShows(createEffectShowDbDataRelatedToExplosionCluster(data), data.id);
}
void HandlerEffectShow::modifyEffectShowsRelatedToEffectCluster(const AreaEffectSimulation::EffectCluster &data)
{
modifyEffectShows(createEffectShowDbDataRelatedToEffectCluster(data), data.id());
modifyEffectShows(createEffectShowDbDataRelatedToEffectCluster(data), data.id);
}
//-------------------------------------------------------------------------------
@@ -821,7 +821,7 @@ void HandlerEffectShow::triggerRetractOrder(const ObjectEffectShow *ifs)
<< ", actor: " << effectShow.esmParticipantId;
if (effectShow.esmParticipantId == -1)
return; // up to now no actor allocated
if (effectShow.orderConfirmation >= EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut)
if (effectShow.orderConfirmation >= static_cast<int>(EffectShowManagement::OrderConfirmation_e::OrderCarriedOut))
return; // order obsolete
// trigger retract order
@@ -866,7 +866,7 @@ void HandlerEffectShow::triggerMeteoData(const ObjectEffectShow *ifs)
MeteoDataManagement::MeteoData meteoData;
if (m_mainHandler->handlerMdmData()->getNearestWeather(pos, meteoData))
{
if (!meteoData.windOk() && !meteoData.climateOk())
if (!meteoData.windOk && !meteoData.climateOk)
{
WARNING_LOG(m_logger) << "Found MeteoStation but no weather Data available, try again in 1 minute";
QTimer::singleShot(6000, this, &HandlerEffectShow::onSendMeteoData);
@@ -877,7 +877,7 @@ void HandlerEffectShow::triggerMeteoData(const ObjectEffectShow *ifs)
m_mainHandler->handlerTabData()->meteoData(equipmentNumber, effectShow.esmParticipantId, meteoData);
// meteo data available
qint64 deltaTime = m_mainHandler->dds()->currentPartitionTime() - meteoData.timeStamp();
qint64 deltaTime = m_mainHandler->dds()->currentPartitionTime() - meteoData.timeStamp;
if (deltaTime > (60 * 15 * 1000))
WARNING_LOG(m_logger) << "Age of meteo data=" << (deltaTime / 60000) << "min for vehicle: " << equipmentNumber;
}
@@ -897,8 +897,8 @@ void HandlerEffectShow::onSendMeteoData()
if (effectShow.esmParticipantId == -1)
continue; // no actor allocated
if ((effectShow.orderConfirmation < EffectShowManagement::OrderConfirmation_e_def::DriveOff) ||
(effectShow.orderConfirmation >= EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut))
if ((effectShow.orderConfirmation < static_cast<int>(EffectShowManagement::OrderConfirmation_e::DriveOff))) ||
(effectShow.orderConfirmation >= static_cast<int>(EffectShowManagement::OrderConfirmation_e::OrderCarriedOut))
continue; // effect show not processed
triggerMeteoData(obj);
@@ -912,7 +912,7 @@ void HandlerEffectShow::onCleanUp()
for (ObjectEffectShow *obj : qAsConst(m_effectShowObjMap))
{
const Database::EsmEffectShow &effectShow = obj->getData();
if (effectShow.orderConfirmation == OrderConfirmation_e::OrderCarriedOut || effectShow.startTime <= 0 || effectShow.id <= 0)
if (effectShow.orderConfirmation == static_cast<int>(OrderConfirmation_e::OrderCarriedOut) || effectShow.startTime <= 0 || effectShow.id <= 0)
continue;
DEBUG_LOG(m_logger) << "Effect show with ID " << effectShow.id << " will expire at: " << QDateTime::fromMSecsSinceEpoch(effectShow.startTime + effectShow.duration + CLEANUPTIME).toString() << " current time: " << QDateTime::fromMSecsSinceEpoch(m_mainHandler->dds()->currentPartitionTime()).toString();
@@ -75,7 +75,7 @@ void HandlerEffectShowActorRelocation::relocationOrderConfirmationReceived(const
// add confirmation data
auto data = ifs->getData();
data.orderConfirmation = orderConfirmation.confirmation.underlying();
data.orderConfirmation = orderConfirmation.confirmation;
data.answertText = orderConfirmation.answerText;
ifs->updateObject(data);
}
@@ -84,8 +84,8 @@ void HandlerEffectShowActorRelocation::onEffectShowActorRelocationModifyRequest(
const rti::core::SampleIdentity &cookie,
const EffectShowActorRelocation &request)
{
DEBUG_LOG(m_logger) << "onEffectShowActorRelocationModifyRequest: " << request.id();
auto ret = request.id() > 0 ? effectShowActorRelocationModifyRequest(request) : effectShowActorRelocationCreateRequest(request);
DEBUG_LOG(m_logger) << "onEffectShowActorRelocationModifyRequest: " << request.id;
auto ret = request.id > 0 ? effectShowActorRelocationModifyRequest(request) : effectShowActorRelocationCreateRequest(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_mainHandler->dds()->fts()->effectShowActorRelocationModifyReply(cookie, ret);
@@ -114,32 +114,32 @@ Core::FunctionReplyObject HandlerEffectShowActorRelocation::effectShowActorReloc
//-----------------------------------------------------------------------------
Core::FunctionReplyObject HandlerEffectShowActorRelocation::effectShowActorRelocationModifyRequest(const EffectShowActorRelocation &request)
{
ObjectEffectShowActorRelocation *ifs = m_effectShowActorRelocationObjMap.value(request.id());
ObjectEffectShowActorRelocation *ifs = m_effectShowActorRelocationObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "EffectShowActorRelocation with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "EffectShowActorRelocation with id %1 not found")).arg(request.id);
return ifs->updateObject(ObjectEffectShowActorRelocation::ddsToDb(request));
}
//-----------------------------------------------------------------------------
void HandlerEffectShowActorRelocation::onEffectShowActorRelocationRemoveRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request)
{
DEBUG_LOG(m_logger) << "onEffectShowActorRelocationRemoveRequest: " << request.id();
DEBUG_LOG(m_logger) << "onEffectShowActorRelocationRemoveRequest: " << request.id;
Core::FunctionReplyObject ret;
ObjectEffectShowActorRelocation *ifs = m_effectShowActorRelocationObjMap.value(request.id());
ObjectEffectShowActorRelocation *ifs = m_effectShowActorRelocationObjMap.value(request.id);
if (!ifs)
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "'%1' with id %2 not found")).arg(QStringLiteral("HandlerEffectShowActorRelocation")).arg(request.id());;
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "'%1' with id %2 not found")).arg(QStringLiteral("HandlerEffectShowActorRelocation")).arg(request.id);;
m_mainHandler->dds()->fts()->effectShowActorRelocationRemoveReply(cookie, ret);
return;
}
EffectShowActorRelocation ddsData;
ddsData.id(request.id());
ddsData.id = request.id;
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ddsData, m_mainHandler->exerciseId()))
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "EffectShowActorRelocation '%1' is used by another user!")).arg(ifs->getId());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "EffectShowActorRelocation '%1' is used by another user!")).arg(ifs->getId());
m_mainHandler->dds()->fts()->effectShowActorRelocationRemoveReply(cookie, ret);
return;
}
@@ -156,7 +156,7 @@ void HandlerEffectShowActorRelocation::onEffectShowActorRelocationRemoveRequest(
// remove from map
delete ifs;
m_effectShowActorRelocationObjMap.remove(request.id());
m_effectShowActorRelocationObjMap.remove(request.id);
}
m_mainHandler->dds()->fts()->effectShowActorRelocationRemoveReply(cookie, ret);
@@ -45,16 +45,16 @@ bool HandlerMdmData::init()
bool HandlerMdmData::getNearestWeather(const Core::GeoPosition2D &pos,
MeteoDataManagement::MeteoData &data) const
{
const LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat()));
const LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat));
double nearestDistanceSquared = std::numeric_limits<double>::max();
bool found = false;
for (const auto &md : qAsConst(m_meteoData))
{
if (md.isStaticMeteoData())
if (md.isStaticMeteoData)
continue;
const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos().lon(), md.pos().lat());
const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos.lon, md.pos.lat);
if (distanceSquared < nearestDistanceSquared)
{
@@ -71,11 +71,11 @@ void HandlerMdmData::onMeteoDataChanged(const MeteoDataManagement::MeteoData &da
switch (modType)
{
case DataModification::eRemoved:
m_meteoData.remove(data.id());
m_meteoData.remove(data.id);
break;
case DataModification::eAdded:
case DataModification::eModified:
m_meteoData[data.id()] = data;
m_meteoData[data.id] = data;
break;
}
}
@@ -26,12 +26,12 @@ HandlerPdmData::HandlerPdmData(const std::shared_ptr<DdsHandler> &ddsHandler,
bool HandlerPdmData::isSmoke(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_ddsHandler->dtcPdm()->isSmoke(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_ddsHandler->dtcPdm()->isSmoke(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
} // end of isSmoke()
int HandlerPdmData::effectShowCount(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_ddsHandler->dtcPdm()->maxEffectShows(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_ddsHandler->dtcPdm()->maxEffectShows(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int HandlerPdmData::getCadence(const int chargeId) const
@@ -78,9 +78,9 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
if (modType != DataModification::eRemoved)
{
auto m_ppmDtc = m_mainHandler->dds()->dtcPpm();
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(data.typeId()).typeClass();
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(data.typeId).typeClass;
DEBUG_LOG(m_logger) << "support entity / equipment number set " << (typeClass == ParticipantManagement::TypeClass::SupportEntity)
<< " / " << data.equipmentNumber().is_set() << ", typeId: " << data.typeId()
<< " / " << data.equipmentNumber.is_set() << ", typeId: " << data.typeId
<< ", cnt: " << m_ppmDtc->types().size();
if (typeClass != ParticipantManagement::TypeClass::SupportEntity)
@@ -91,7 +91,7 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
else
{
// does not exists or has no longer an equipment number -> remove
if (!data.equipmentNumber().is_set())
if (!data.equipmentNumber.is_set())
modType = DataModification::eRemoved;
}
@@ -102,7 +102,7 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
case DataModification::eAdded:
case DataModification::eModified:
{
auto &val = m_participant[data.id()];
auto &val = m_participant[data.id];
val = Participant_t(data);
m_mainHandler->handlerEffectShowVehicleStatus()->effectShowActorChanged(val, modType);
break;
@@ -110,17 +110,17 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
case DataModification::eRemoved:
{
// remove if participant exists
auto it = m_participant.constFind(data.id());
auto it = m_participant.constFind(data.id);
if (it != m_participant.constEnd())
{
m_mainHandler->handlerEffectShowVehicleStatus()->effectShowActorChanged(it.value(), modType);
m_participant.remove(data.id());
m_participant.remove(data.id);
}
break;
}
}
DEBUG_LOG(m_logger) << "onParticipantChanged: " << data.id() << ' ' << data.name() << ' ' << modType;
DEBUG_LOG(m_logger) << "onParticipantChanged: " << data.id << ' ' << data.name << ' ' << modType;
} // end of onParticipantChanged()
@@ -42,9 +42,9 @@ public:
{
Participant_t() = default;
explicit Participant_t(const ParticipantManagement::Participant &data)
: id(data.id())
, equipmentNumber(data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0)
, name(QString::fromStdString(data.name()))
: id(data.id)
, equipmentNumber(data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0)
, name(QString::fromStdString(data.name))
{}
int id = -1;
@@ -63,9 +63,9 @@ void HandlerTabData::effectShowVehicleStatusRequest(int equipmentNumber, int par
DEBUG_LOG(m_logger) << "Trigger Status Request " << equipmentNumber << ' ' << participantId;
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertStatusRequest());
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertStatusRequest();
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of onVehicleStatusStatusRequest()
@@ -75,9 +75,9 @@ void HandlerTabData::relocationOrder(int equipmentNumber, int participantId, con
DEBUG_LOG(m_logger) << "Trigger Relocation Order " << equipmentNumber << ' ' << participantId;
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertRelocationOrder(relocationOrder));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertRelocationOrder(relocationOrder);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of relocationOrder()
//=============================================================================
@@ -85,26 +85,26 @@ void HandlerTabData::effectShowOrder(int equipmentNumber, int participantId, con
{
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertEffectShowOrder(effectShowOrder));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertEffectShowOrder(effectShowOrder);
Core::GeoPosition2D posCenter = effectShowOrder.centerPosition;
Core::GeoPosition2D posLl = effectShowOrder.lowerLeftPosition;
DEBUG_LOG(m_logger) << "Trigger Effect Show Order " << equipmentNumber << ' ' << participantId
<< "\n idEffectShow " << effectShowOrder.idEffectShow
<< "\n startTime " << effectShowOrder.startTime
<< "\n centerPosition " << LtsCoordTrans::mgrsFromGeographic(posCenter.lon(), posCenter.lat())
<< "\n centerPosition " << LtsCoordTrans::mgrsFromGeographic(posCenter.lon, posCenter.lat)
<< "\n areaDepth " << effectShowOrder.areaDepth
<< "\n areaWidth " << effectShowOrder.areaWidth
<< "\n rotation " << effectShowOrder.rotation
<< "\n lowerLeftPosition " << LtsCoordTrans::mgrsFromGeographic(posLl.lon(), posLl.lat())
<< "\n lowerLeftPosition " << LtsCoordTrans::mgrsFromGeographic(posLl.lon, posLl.lat)
<< "\n numOfVolley " << int(effectShowOrder.numOfVolley)
<< "\n shotsPerVolley " << int(effectShowOrder.shotsPerVolley)
<< "\n typeOfAmmunition " << int(effectShowOrder.typeOfAmmunition)
<< "\n duration " << effectShowOrder.duration
<< "\n name " << effectShowOrder.name
<< "\n payload" << plText(out.payload());
<< "\n payload" << plText(out.payload);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of effetShowOrder()
@@ -114,9 +114,9 @@ void HandlerTabData::effectShowStop(int equipmentNumber, int participantId, cons
DEBUG_LOG(m_logger) << "Trigger Effect Show Stop " << equipmentNumber << ' ' << participantId;
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertEffectShowStop(idEffectShow));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertEffectShowStop(idEffectShow);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of effectShowStop()
//=============================================================================
@@ -124,14 +124,14 @@ void HandlerTabData::effectShowContinue(int equipmentNumber, int participantId,
{
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertEffectShowContinue(effectShowContinue));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertEffectShowContinue(effectShowContinue);
DEBUG_LOG(m_logger) << "Trigger Effect Show Continue " << equipmentNumber << ' ' << participantId
<< "\n idEffectShow " << effectShowContinue.idEffectShow
<< "\n executionTime " << effectShowContinue.executionTime
<< "\n payload" << plText(out.payload());
<< "\n payload" << plText(out.payload);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of effectShowContinue()
@@ -140,14 +140,14 @@ void HandlerTabData::retractOrder(int equipmentNumber, int participantId, const
{
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertOrderRetract(retractOrder));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertOrderRetract(retractOrder);
DEBUG_LOG(m_logger) << "Trigger Retract Order " << equipmentNumber << ' ' << participantId
<< "\n orderType " << retractOrder.orderType
<< "\n id " << retractOrder.id
<< "\n payload" << plText(out.payload());
<< "\n payload" << plText(out.payload);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of retractOrder()
@@ -155,16 +155,16 @@ void HandlerTabData::retractOrder(int equipmentNumber, int participantId, const
void HandlerTabData::meteoData(int equipmentNumber, int participantId, const MeteoDataManagement::MeteoData &meteoData)
{
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
out.equipmentNumber(equipmentNumber);
out.participantId(participantId);
out.payload(ConvertToTab::convertMeteoData(meteoData));
out.equipmentNumber = equipmentNumber;
out.participantId = participantId;
out.payload = ConvertToTab::convertMeteoData(meteoData);
DEBUG_LOG(m_logger) << "Trigger Meteo data " << equipmentNumber << ' ' << participantId
<< "\n temperature " << meteoData.temperature()
<< "\n humidity " << meteoData.humidity()
<< "\n pressure " << meteoData.pressure()
<< "\n windDirection " << meteoData.windDirection()
<< "\n payload" << plText(out.payload());
<< "\n temperature " << meteoData.temperature
<< "\n humidity " << meteoData.humidity
<< "\n pressure " << meteoData.pressure
<< "\n windDirection " << meteoData.windDirection
<< "\n payload" << plText(out.payload);
m_mainHandler->dds()->ftcTab()->sendFireSmokeMarkerDataRequest(out, this);
} // end of
@@ -182,7 +182,7 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Got Fire Smoke Marker " << data.sampleTime();
DEBUG_LOG(m_logger) << "Got Fire Smoke Marker " << data.sampleTime;
switch (ConvertFromTab::isTelegram(data))
{
case ConvertFromTab::RxTelegram_e::VehicleStatus:
@@ -225,7 +225,7 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
//-----------------------------------------------------------------------------
void HandlerTabData::publishVehicleStatus(const EffectShowManagement::EffectShowVehicleStatus &vehicleStatus)
{
DEBUG_LOG(m_logger) << "Vehicle Status published esmParticipantId: " << vehicleStatus.esmParticipantId() << ' ' << vehicleStatus.operational();
DEBUG_LOG(m_logger) << "Vehicle Status published esmParticipantId: " << vehicleStatus.esmParticipantId << ' ' << vehicleStatus.operational;
m_mainHandler->dds()->dts()->publish(vehicleStatus);
} // end of publishVehicleStatus()
//-----------------------------------------------------------------------------
@@ -235,7 +235,7 @@ void HandlerTabData::sendAdlerFqFb(const int aesId)
DEBUG_LOG(m_logger) << "Send Adler Feuerbereitschaft";
TrainingAreaBase::AdlerFqFbRequest out;
out.aesItemId(aesId);
out.aesItemId = aesId;
m_mainHandler->dds()->ftcTab()->adlerFqFbRequest(out, this);
}
//=============================================================================
@@ -76,77 +76,77 @@ bool ObjectAesData::dataChanged(const Database::EsmAesData &data) const
DEBUG_LOG(m_logger) << "Data Volley: " << data.volley << " old: " << m_data.volley;
return (m_data.chargeTypeId != data.chargeTypeId)
|| (m_data.effectStart != data.effectStart)
|| (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsFired)
|| (m_data.effectStateId == static_cast<int>(AreaEffectSimulation::AesEffectState::EsFired))
|| (m_data.effectDuration != data.effectDuration);
}
//=============================================================================
bool ObjectAesData::statusPaused(const Database::EsmAesData &data) const
{
return (m_data.effectStateId != AreaEffectSimulation::AesEffectState_def::EsPaused) &&
(data.effectStateId == AreaEffectSimulation::AesEffectState_def::EsPaused);
return (m_data.effectStateId != static_cast<int>(AreaEffectSimulation::AesEffectState::EsPaused)) &&
(data.effectStateId == static_cast<int>(AreaEffectSimulation::AesEffectState::EsPaused));
}
//=============================================================================
bool ObjectAesData::statusContinued(const Database::EsmAesData &data) const
{
return (data.effectStateId == AreaEffectSimulation::AesEffectState_def::EsActivated) &&
return (data.effectStateId == static_cast<int>(AreaEffectSimulation::AesEffectState::EsActivated)) &&
(m_data.effectStart != data.effectStart); // false, if the scheduled start time reached
}
bool ObjectAesData::statusExpired(const Database::EsmAesData &data) const
{
return (data.effectStateId == AreaEffectSimulation::AesEffectState_def::EsExpired);
return (data.effectStateId == static_cast<int>(AreaEffectSimulation::AesEffectState::EsExpired));
}
//=============================================================================
Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::ExplosionArea &data)
{
Database::EsmAesData res;
res.idAes = data.id();
res.nameAes = QString::fromStdString(data.name());
res.effectStateId = data.effectStateId().underlying();
res.position = QPointF(data.area().cornerBottomLeft().lon(), data.area().cornerBottomLeft().lat());
res.rotationAngle = data.area().rotation();
res.depth = data.area().height();
res.width = data.area().width();
res.effectStart = data.effectStart().is_set() ? data.effectStart().get() : 0;
res.effectDuration = data.effectDuration();
res.chargeTypeId = data.chargeStruct().chargeTypeId();
res.volley = data.cannonCount() * data.cannonRounds();
res.idAes = data.id;
res.nameAes = QString::fromStdString(data.name);
res.effectStateId = data.effectStateId;
res.position = QPointF(data.area.cornerBottomLeft.lon, data.area.cornerBottomLeft.lat);
res.rotationAngle = data.area.rotation;
res.depth = data.area.height;
res.width = data.area.width;
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
res.effectDuration = data.effectDuration;
res.chargeTypeId = data.chargeStruct.chargeTypeId;
res.volley = data.cannonCount * data.cannonRounds;
return res;
}
Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::ExplosionCluster &data)
{
Database::EsmAesData res;
res.idAes = data.id();
res.nameAes = QString::fromStdString(data.name());
res.effectStateId = data.effectStateId().underlying();
res.position = QPointF(data.area().cornerBottomLeft().lon(), data.area().cornerBottomLeft().lat());
res.rotationAngle = data.area().rotation();
res.depth = data.area().height();
res.width = data.area().width();
res.effectStart = data.effectStart().is_set() ? data.effectStart().get() : 0;
res.effectDuration = data.effectDuration();
res.chargeTypeId = data.chargeStruct().chargeTypeId();
res.volley = data.impactCount(); //cannonCount() * data.cannonRounds();
res.idAes = data.id;
res.nameAes = QString::fromStdString(data.name);
res.effectStateId = data.effectStateId;
res.position = QPointF(data.area.cornerBottomLeft.lon, data.area.cornerBottomLeft.lat);
res.rotationAngle = data.area.rotation;
res.depth = data.area.height;
res.width = data.area.width;
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
res.effectDuration = data.effectDuration;
res.chargeTypeId = data.chargeStruct.chargeTypeId;
res.volley = data.impactCount; //cannonCount() * data.cannonRounds();
return res;
}
Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::EffectCluster &data)
{
Database::EsmAesData res;
res.idAes = data.id();
res.nameAes = QString::fromStdString(data.name());
res.effectStateId = data.effectStateId().underlying();
res.position = QPointF(data.area().cornerBottomLeft().lon(), data.area().cornerBottomLeft().lat());
res.rotationAngle = data.area().rotation();
res.depth = data.area().height();
res.width = data.area().width();
res.effectStart = data.effectStart().is_set() ? data.effectStart().get() : 0;
res.effectDuration = data.effectDuration();
res.chargeTypeId = data.chargeStruct().chargeTypeId();
res.idAes = data.id;
res.nameAes = QString::fromStdString(data.name);
res.effectStateId = data.effectStateId;
res.position = QPointF(data.area.cornerBottomLeft.lon, data.area.cornerBottomLeft.lat);
res.rotationAngle = data.area.rotation;
res.depth = data.area.height;
res.width = data.area.width;
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
res.effectDuration = data.effectDuration;
res.chargeTypeId = data.chargeStruct.chargeTypeId;
res.volley = 0;
for (const auto &effector : data.effectors())
for (const auto &effector : data.effectors)
{
res.volley += effector.chargeAmount();
res.volley += effector.chargeAmount;
}
return res;
@@ -157,19 +157,19 @@ Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::Min
{
Database::EsmAesData res;
const AreaEffectSimulation::MineSegment &segment = EffectShowManagement::EffectShowMineArea::getEffectShowSegment(data);
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionStart().lon(), segment.positionStart().lat()});
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionEnd().lon(), segment.positionEnd().lat()}, startPositionUtm.zone);
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionStart.lon, segment.positionStart.lat});
LtsCoordTrans::UtmCoordinate endPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionEnd.lon, segment.positionEnd.lat}, startPositionUtm.zone);
const QLineF line({startPositionUtm.x, startPositionUtm.y}, {endPositionUtm.x, endPositionUtm.y});
res.width = line.length();
res.idAes = data.id();
res.nameAes = QString::fromStdString(data.name());
res.effectStateId = data.effectStateId().underlying();
res.position = QPointF(segment.positionStart().lon(), segment.positionStart().lat());
res.depth = data.width();
res.effectStart = data.effectStart().is_set() ? data.effectStart().get() : 0;
res.effectDuration = data.effectDuration();
res.chargeTypeId = data.chargeStruct().chargeTypeId();
res.idAes = data.id;
res.nameAes = QString::fromStdString(data.name);
res.effectStateId = data.effectStateId;
res.position = QPointF(segment.positionStart.lon, segment.positionStart.lat);
res.depth = data.width;
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
res.effectDuration = data.effectDuration;
res.chargeTypeId = data.chargeStruct.chargeTypeId;
res.volley = 18;
return res;
}
@@ -74,22 +74,22 @@ Core::FunctionReplyObject ObjectEffectShow::removeObject()
//=============================================================================
Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagement::EffectShow &data)
{
if (data.id() <= 0)
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
if (data.id <= 0)
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
if (m_data.orderConfirmation == EffectShowManagement::OrderConfirmation_e_def::Execution)
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Changes rejected due to Effect Show in execution."));
if (m_data.orderConfirmation == static_cast<int>(EffectShowManagement::OrderConfirmation_e::Execution))
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Changes rejected due to Effect Show in execution."));
DEBUG_LOG(m_logger) << "updateObject(data topic) complete ->"
<< "\n id " << m_data.id << " new: " << data.id()
<< "\n centerPosition x " << m_data.centerPosition.x() << " new: " << data.position().lon()
<< "\n centerPosition y " << m_data.centerPosition.y() << " new: " << data.position().lat()
<< "\n idAreaEffectSimulation " << m_data.idAreaEffectSimulation << " new: " << data.idAreaEffectSimulation()
<< "\n esmParticipantId " << m_data.esmParticipantId << " new: " << data.esmParticipantId()
<< "\n numOfVolley " << m_data.numOfVolley << " new: " << data.numOfVolley()
<< "\n shotsPerVolley " << m_data.shotsPerVolley << " new: " << data.shotsPerVolley()
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.orderConfirmation().underlying()
<< "\n answerText " << m_data.answerText << " new: " << QString::fromStdString((data.answerText()))
<< "\n id " << m_data.id << " new: " << data.id
<< "\n centerPosition x " << m_data.centerPosition.x() << " new: " << data.position.lon
<< "\n centerPosition y " << m_data.centerPosition.y() << " new: " << data.position.lat
<< "\n idAreaEffectSimulation " << m_data.idAreaEffectSimulation << " new: " << data.idAreaEffectSimulation
<< "\n esmParticipantId " << m_data.esmParticipantId << " new: " << data.esmParticipantId
<< "\n numOfVolley " << m_data.numOfVolley << " new: " << data.numOfVolley
<< "\n shotsPerVolley " << m_data.shotsPerVolley << " new: " << data.shotsPerVolley
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.orderConfirmation
<< "\n answerText " << m_data.answerText << " new: " << QString::fromStdString((data.answerText))
<< "\n startTime " << m_data.startTime
<< "\n duration " << m_data.duration
<< "\n lowerLeftPosition x " << m_data.lowerLeftPosition.x()
@@ -99,24 +99,24 @@ Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagem
<< "\n areaRotation " << m_data.areaRotation
<< "\n typeOfAmmunition " << m_data.typeOfAmmunition;
m_data.id = data.id();
m_data.name = QString::fromStdString(data.name());
m_data.startTime = data.startTime().is_set() ? data.startTime().get() : 0;
m_data.duration = data.duration();
m_data.idAreaEffectSimulation = data.idAreaEffectSimulation();
m_data.nameAreaEfffectSimulation = QString::fromStdString(data.nameAreaEffectSimulation());
m_data.esmParticipantId = data.esmParticipantId();
m_data.centerPosition.setX(data.position().lon());
m_data.centerPosition.setY(data.position().lat());
m_data.numOfVolley = data.numOfVolley();
m_data.shotsPerVolley = data.shotsPerVolley();
m_data.lowerLeftPosition.setX(data.lowerLeftPosition().lon());
m_data.lowerLeftPosition.setY(data.lowerLeftPosition().lat());
m_data.areaDepth = data.areaDepth();
m_data.areaWidth = data.areaWidth();
m_data.areaRotation = data.areaRotation();
m_data.orderConfirmation = data.orderConfirmation().underlying();
m_data.answerText = QString::fromStdString((data.answerText()));
m_data.id = data.id;
m_data.name = QString::fromStdString(data.name);
m_data.startTime = data.startTime.is_set() ? data.startTime.get() : 0;
m_data.duration = data.duration;
m_data.idAreaEffectSimulation = data.idAreaEffectSimulation;
m_data.nameAreaEfffectSimulation = QString::fromStdString(data.nameAreaEffectSimulation);
m_data.esmParticipantId = data.esmParticipantId;
m_data.centerPosition.setX(data.position.lon);
m_data.centerPosition.setY(data.position.lat);
m_data.numOfVolley = data.numOfVolley;
m_data.shotsPerVolley = data.shotsPerVolley;
m_data.lowerLeftPosition.setX(data.lowerLeftPosition.lon);
m_data.lowerLeftPosition.setY(data.lowerLeftPosition.lat);
m_data.areaDepth = data.areaDepth;
m_data.areaWidth = data.areaWidth;
m_data.areaRotation = data.areaRotation;
m_data.orderConfirmation = data.orderConfirmation;
m_data.answerText = QString::fromStdString((data.answerText));
if (!m_mainHandler->db()->update(m_data))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating EffectShow into database"));
@@ -132,10 +132,10 @@ Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagem
bool ObjectEffectShow::updateObject(const ConvertFromTab::OrderConfirmation_t &data)
{
DEBUG_LOG(m_logger) << "updateObject() partly ->"
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.confirmation.underlying()
<< "\n orderConfirmation " << m_data.orderConfirmation << " new: " << data.confirmation
<< "\n answerText " << m_data.answerText << " new: " << data.answerText;
m_data.orderConfirmation = data.confirmation.underlying();
m_data.orderConfirmation = data.confirmation;
m_data.answerText = data.answerText;
if (!m_mainHandler->db()->update(m_data))
@@ -190,7 +190,7 @@ bool ObjectEffectShow::updateObject(const Database::EsmEffectShow &data)
//=============================================================================
bool ObjectEffectShow::resetOrderConfirmation()
{
m_data.orderConfirmation = EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance;
m_data.orderConfirmation = EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance;
m_data.answerText.clear();
if (!m_mainHandler->db()->update(m_data))
@@ -265,27 +265,27 @@ ConvertToTab::EffectShowContinue_t ObjectEffectShow::getContinueOrder() const
void ObjectEffectShow::onPublishData()
{
EffectShowManagement::EffectShow ddsData;
ddsData.id(m_data.id);
ddsData.name(m_data.name.toStdString());
ddsData.startTime(m_data.startTime);
ddsData.duration(m_data.duration);
ddsData.idAreaEffectSimulation(m_data.idAreaEffectSimulation);
ddsData.nameAreaEffectSimulation(m_data.nameAreaEfffectSimulation.toStdString());
ddsData.esmParticipantId(m_data.esmParticipantId);
ddsData.position() = Core::GeoPosition2D(m_data.centerPosition.x(), m_data.centerPosition.y());
ddsData.numOfVolley(m_data.numOfVolley);
ddsData.shotsPerVolley(m_data.shotsPerVolley);
ddsData.id = m_data.id;
ddsData.name = m_data.name.toStdString();
ddsData.startTime = m_data.startTime;
ddsData.duration = m_data.duration;
ddsData.idAreaEffectSimulation = m_data.idAreaEffectSimulation;
ddsData.nameAreaEffectSimulation = m_data.nameAreaEfffectSimulation.toStdString();
ddsData.esmParticipantId = m_data.esmParticipantId;
ddsData.position = Core::GeoPosition2D(m_data.centerPosition.x(), m_data.centerPosition.y());
ddsData.numOfVolley = m_data.numOfVolley;
ddsData.shotsPerVolley = m_data.shotsPerVolley;
//we need this for the smoke type
ddsData.lowerLeftPosition() = Core::GeoPosition2D(m_data.lowerLeftPosition.x(), m_data.lowerLeftPosition.y());
ddsData.areaDepth(m_data.areaDepth);
ddsData.areaWidth(m_data.areaWidth);
ddsData.areaRotation(m_data.areaRotation);
ddsData.typeOfAmmunition(m_data.typeOfAmmunition);
ddsData.lowerLeftPosition = Core::GeoPosition2D(m_data.lowerLeftPosition.x(), m_data.lowerLeftPosition.y());
ddsData.areaDepth = m_data.areaDepth;
ddsData.areaWidth = m_data.areaWidth;
ddsData.areaRotation = m_data.areaRotation;
ddsData.typeOfAmmunition = m_data.typeOfAmmunition;
ddsData.orderConfirmation(EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation));
ddsData.answerText(m_data.answerText.toStdString());
ddsData.isDeleted(false);
ddsData.isUsed(false);
ddsData.orderConfirmation = EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation);
ddsData.answerText = m_data.answerText.toStdString();
ddsData.isDeleted = false;
ddsData.isUsed = false;
@@ -71,15 +71,15 @@ void ObjectEffectShowActorRelocation::onPublishData()
{
EffectShowManagement::EffectShowActorRelocation ddsData;
ddsData.id(m_data.id);
ddsData.esmParticipantId(m_data.esmParticipantId);
ddsData.arrival_time(m_data.arrivalTime);
ddsData.position(Core::GeoPosition2D(m_data.position.x(), m_data.position.y()));
ddsData.info(m_data.info.toStdString());
ddsData.orderConfirmation(EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation));
ddsData.answerText(m_data.answertText.toStdString());
ddsData.isDeleted(false);
ddsData.isUsed(false);
ddsData.id = m_data.id;
ddsData.esmParticipantId = m_data.esmParticipantId;
ddsData.arrival_time = m_data.arrivalTime;
ddsData.position = Core::GeoPosition2D(m_data.position.x(), m_data.position.y());
ddsData.info = m_data.info.toStdString();
ddsData.orderConfirmation = EffectShowManagement::OrderConfirmation_e::inner_enum(m_data.orderConfirmation);
ddsData.answerText = m_data.answertText.toStdString();
ddsData.isDeleted = false;
ddsData.isUsed = false;
INFO_LOG(m_logger) << "Publish EsmEffectShowActorRelocation-data to dds (" << m_data.id << ") ...";
@@ -109,13 +109,13 @@ Database::EsmEffectShowActorRelocation ObjectEffectShowActorRelocation::ddsToDb(
{
Database::EsmEffectShowActorRelocation dbData;
dbData.id = ddsData.id();
dbData.esmParticipantId = ddsData.esmParticipantId();
dbData.arrivalTime = ddsData.arrival_time().get();
dbData.position = QPointF(ddsData.position().lon(), ddsData.position().lat());
dbData.info = QString::fromStdString(ddsData.info());
dbData.orderConfirmation = ddsData.orderConfirmation().underlying();
dbData.answertText = QString::fromStdString(ddsData.answerText());
dbData.id = ddsData.id;
dbData.esmParticipantId = ddsData.esmParticipantId;
dbData.arrivalTime = ddsData.arrival_time.get();
dbData.position = QPointF(ddsData.position.lon, ddsData.position.lat);
dbData.info = QString::fromStdString(ddsData.info);
dbData.orderConfirmation = ddsData.orderConfirmation;
dbData.answertText = QString::fromStdString(ddsData.answerText);
return dbData;
}
//=============================================================================
@@ -100,17 +100,17 @@ void ObjectEffectShowVehicleStatus::onPublishData()
EffectShowManagement::EffectShowVehicleStatus ddsData;
//ddsData.equipmentNumber(m_data.equipmentNumber);
ddsData.airSpeedMeterFail(m_data.airSpeedMeterFail);
ddsData.ammunitionAvailable(m_data.ammunitionAvailable);
ddsData.ammunitionMagazine(m_data.ammunitionMagazine);
ddsData.controlComputerFail(m_data.controlComputerFail);
ddsData.feature(EffectShowManagement::Feature_e_def::type(m_data.feature));
ddsData.esmParticipantId(m_data.esmParticipantId);
ddsData.inclinationSensorFail(m_data.inclinationSensorFail);
ddsData.magazineFail(m_data.magazineFail);
ddsData.nameEffectShowActor(m_data.nameEffectShowActor.toStdString());
ddsData.operational(m_data.operational);
ddsData.sampleTime(m_data.timestamp);
ddsData.airSpeedMeterFail = m_data.airSpeedMeterFail;
ddsData.ammunitionAvailable = m_data.ammunitionAvailable;
ddsData.ammunitionMagazine = m_data.ammunitionMagazine;
ddsData.controlComputerFail = m_data.controlComputerFail;
ddsData.feature = EffectShowManagement::Feature_e::type(m_data.feature);
ddsData.esmParticipantId = m_data.esmParticipantId;
ddsData.inclinationSensorFail = m_data.inclinationSensorFail;
ddsData.magazineFail = m_data.magazineFail;
ddsData.nameEffectShowActor = m_data.nameEffectShowActor.toStdString();
ddsData.operational = m_data.operational;
ddsData.sampleTime = m_data.timestamp;
INFO_LOG(m_logger) << "Publish EsmEffectShowVehicleStatus-data to dds (" << m_data.esmParticipantId << ") ...";
if (!m_mainHandler->dds()->dts()->publish(ddsData))