Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+73
-73
@@ -74,25 +74,25 @@ bool ObjectMineArea::removeObjectFromDb() { return m_mainHandler->db()->removeAe
|
||||
|
||||
bool ObjectMineArea::isDusMineArea() const
|
||||
{
|
||||
return static_cast<MineClass::type>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
return static_cast<MineClass>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
== MineClass::DUS;
|
||||
}
|
||||
|
||||
bool ObjectMineArea::isConcreteMine() const
|
||||
{
|
||||
return static_cast<MineClass::type>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
return static_cast<MineClass>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
== MineClass::Concrete;
|
||||
}
|
||||
|
||||
bool ObjectMineArea::isSingleVirtual() const
|
||||
{
|
||||
return static_cast<MineClass::type>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
return static_cast<MineClass>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
== MineClass::VirtualSingle;
|
||||
}
|
||||
|
||||
bool ObjectMineArea::isVirtualMine() const
|
||||
{
|
||||
return static_cast<MineClass::type>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
return static_cast<MineClass>(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId))
|
||||
== MineClass::Virtual;
|
||||
}
|
||||
|
||||
@@ -140,11 +140,11 @@ void ObjectMineArea::clearCorridor(const AesItemView &aiv)
|
||||
return;
|
||||
|
||||
QPolygonF aivUtmPoly;
|
||||
aivUtmPoly.reserve(aiv.form().size());
|
||||
int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(aiv.form()[0].lon(), aiv.form()[0].lat()).zone;
|
||||
for (const auto &pos : aiv.form()) // Last Pos just for Length and Direction...
|
||||
aivUtmPoly.reserve(aiv.form.size());
|
||||
int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(aiv.form[0].lon, aiv.form[0].lat).zone;
|
||||
for (const auto &pos : aiv.form) // Last Pos just for Length and Direction...
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), zone);
|
||||
LtsCoordTrans::UtmCoordinate utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, zone);
|
||||
aivUtmPoly.push_back(QPointF(utmPos.x, utmPos.y));
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ Core::FunctionReplyObject ObjectMineArea::createSegments(const std::vector<Core:
|
||||
|
||||
int count = 0;
|
||||
outSegments.reserve(inSegments.size());
|
||||
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(inSegments[0].lon(), inSegments[0].lat());
|
||||
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(inSegments[0].lon, inSegments[0].lat);
|
||||
int zone = start.zone;
|
||||
totalLengthOut = 0.0;
|
||||
for (size_t i = 0; i < inSegments.size() - 1; ++i) // Last Pos just for Length and Direction...
|
||||
@@ -272,10 +272,10 @@ Core::FunctionReplyObject ObjectMineArea::createSegments(const std::vector<Core:
|
||||
newSegment.elementNumber = ++count;
|
||||
newSegment.mineAreaId = mineAreaId;
|
||||
newSegment.id = 0;
|
||||
newSegment.startPosition = QPointF(inSegments[i].lon(), inSegments[i].lat());
|
||||
newSegment.endPosition = QPointF(inSegments[i + 1].lon(), inSegments[i + 1].lat());
|
||||
newSegment.startPosition = QPointF(inSegments[i].lon, inSegments[i].lat);
|
||||
newSegment.endPosition = QPointF(inSegments[i + 1].lon, inSegments[i + 1].lat);
|
||||
// calculate length
|
||||
const LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(inSegments[i + 1].lon(), inSegments[i + 1].lat(), zone);
|
||||
const LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(inSegments[i + 1].lon, inSegments[i + 1].lat, zone);
|
||||
// QLine's y-axis is southbound!
|
||||
QLineF line(QPointF(start.x, start.y), QPointF(end.x, end.y));
|
||||
// if (line.length() * density < 0.95) // We top that up to one mine later on.
|
||||
@@ -329,8 +329,8 @@ Core::FunctionReplyObject ObjectMineArea::createSegments(
|
||||
const AreaEffectSimulation::MineSegment &segment = inSegments.at(i);
|
||||
|
||||
dbSegment.elementNumber = i;
|
||||
dbSegment.startPosition = QPointF(segment.positionStart().lon(), segment.positionStart().lat());
|
||||
dbSegment.endPosition = QPointF(segment.positionEnd().lon(), segment.positionEnd().lat());
|
||||
dbSegment.startPosition = QPointF(segment.positionStart.lon, segment.positionStart.lat);
|
||||
dbSegment.endPosition = QPointF(segment.positionEnd.lon, segment.positionEnd.lat);
|
||||
dbSegment.mineAreaId = mineAreaId;
|
||||
|
||||
outSegments.push_back(std::move(dbSegment));
|
||||
@@ -345,20 +345,20 @@ bool ObjectMineArea::publishTriggeredImpacts()
|
||||
// Build an own tes-bitfield and compare, only store and publish if changed.
|
||||
TriggeredImpacts tis(m_tis);
|
||||
|
||||
tis.impactCount(m_triggeredMines.size());
|
||||
tis.bitfield().resize((m_triggeredMines.size() + 7) / 8);
|
||||
tis.impactCount = m_triggeredMines.size();
|
||||
tis.bitfield.resize((m_triggeredMines.size() + 7) / 8);
|
||||
|
||||
int i = 0;
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
{
|
||||
// Triggered Impact == 0, if mine is disarmed/exploded
|
||||
LtsUtils::BitArray::setBit(tis.bitfield(), i++, !mine.isTriggered);
|
||||
LtsUtils::BitArray::setBit(tis.bitfield, i++, !mine.isTriggered);
|
||||
}
|
||||
|
||||
if ((m_tis != tis) || m_triggeredMinesChanged)
|
||||
{
|
||||
m_tis = tis;
|
||||
m_tis.sampleTime(partitionTimeMSec());
|
||||
m_tis.sampleTime = partitionTimeMSec();
|
||||
return m_mainHandler->dds()->dts()->publish(m_tis);
|
||||
}
|
||||
return true;
|
||||
@@ -370,19 +370,19 @@ bool ObjectMineArea::publishDusMineStatus()
|
||||
// DusMineStatus mines vector is coherent to triggered impacts bitfield
|
||||
DusMineState dms(m_dms);
|
||||
|
||||
dms.mines().resize(m_triggeredMines.size());
|
||||
dms.mines.resize(m_triggeredMines.size());
|
||||
int i = 0;
|
||||
|
||||
for (const auto &mine : qAsConst(m_triggeredMines))
|
||||
{
|
||||
const DusMine entry(mine.mineId, mine.isTriggered, mine.chargeTypeId, {mine.position.x(), mine.position.y()});
|
||||
dms.mines()[i++] = entry;
|
||||
dms.mines[i++] = entry;
|
||||
}
|
||||
|
||||
if (m_dms != dms || m_triggeredMinesChanged)
|
||||
{
|
||||
m_dms = dms;
|
||||
m_dms.sampleTime(partitionTimeMSec());
|
||||
m_dms.sampleTime = partitionTimeMSec();
|
||||
return m_mainHandler->dds()->dts()->publish(m_dms);
|
||||
}
|
||||
return true;
|
||||
@@ -449,7 +449,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
DEBUG_LOG(m_logger) << "index: " << index;
|
||||
Core::GeoPosition2D startPos = vec[index];
|
||||
|
||||
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.lon(), startPos.lat());
|
||||
LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.lon, startPos.lat);
|
||||
DEBUG_LOG(m_logger) << "startPosUtm: " << startPositionUtm.mgrs();
|
||||
double length = 0.0;
|
||||
|
||||
@@ -459,7 +459,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
while (vec.size() > 0)
|
||||
{
|
||||
Core::GeoPosition2D &pos = vec.first();
|
||||
DEBUG_LOG(m_logger) << "pos: " << pos.lon() << ", " << pos.lat();
|
||||
DEBUG_LOG(m_logger) << "pos: " << pos.lon << ", " << pos.lat;
|
||||
|
||||
if (pos == startPos)
|
||||
{
|
||||
@@ -468,7 +468,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
continue;
|
||||
}
|
||||
|
||||
length = LtsCoordTrans::squareDistance(startPositionUtm, pos.lon(), pos.lat());
|
||||
length = LtsCoordTrans::squareDistance(startPositionUtm, pos.lon, pos.lat);
|
||||
DEBUG_LOG(m_logger) << "Distance between startPos and pos: " << length;
|
||||
|
||||
Core::GeoPosition2D newPos = pos;
|
||||
@@ -477,9 +477,9 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
if (pos2 == pos || pos2 == startPos)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "pos2: " << pos2.lon() << ", " << pos2.lat();
|
||||
DEBUG_LOG(m_logger) << "pos2: " << pos2.lon << ", " << pos2.lat;
|
||||
|
||||
double length2 = LtsCoordTrans::squareDistance(startPositionUtm, pos2.lon(), pos2.lat());
|
||||
double length2 = LtsCoordTrans::squareDistance(startPositionUtm, pos2.lon, pos2.lat);
|
||||
DEBUG_LOG(m_logger) << "Distance between startPos and pos2: " << length;
|
||||
|
||||
if (length2 < length)
|
||||
@@ -492,14 +492,14 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
vecSorted.push_back(newPos);
|
||||
vec.removeOne(newPos);
|
||||
|
||||
startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(newPos.lon(), newPos.lat(), startPositionUtm.zone);
|
||||
startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(newPos.lon, newPos.lat, startPositionUtm.zone);
|
||||
DEBUG_LOG(m_logger) << "New startPosUtm: " << startPositionUtm.mgrs();
|
||||
}
|
||||
|
||||
if (vecSorted.size() == 1)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "only one segment - create 2 new with distance 10m";
|
||||
const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vecSorted[0].lon(), vecSorted[0].lat());
|
||||
const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vecSorted[0].lon, vecSorted[0].lat);
|
||||
LtsCoordTrans::UtmCoordinate point1Utm = pointUtm;
|
||||
LtsCoordTrans::UtmCoordinate point2Utm = pointUtm;
|
||||
point1Utm.y = pointUtm.y - 5.01;
|
||||
@@ -511,8 +511,8 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines)
|
||||
Core::GeoPosition2D pos(point.x(), point.y());
|
||||
vecSorted.push_back(pos);
|
||||
point = point2Utm.geographic();
|
||||
pos.lon(point.x());
|
||||
pos.lat(point.y());
|
||||
pos.lon = point.x();
|
||||
pos.lat = point.y();
|
||||
vecSorted.push_back(pos);
|
||||
}
|
||||
}
|
||||
@@ -671,12 +671,12 @@ template <typename T> Core::FunctionReplyObject ObjectMineArea::createObjectTmpl
|
||||
}
|
||||
|
||||
// Set TriggeredExplosions Base Data
|
||||
m_tis.id(1000 * m_data.id + AesType::AtMineAreaSingleMines);
|
||||
m_tis.aesItemId(m_data.id);
|
||||
m_tis.aesTypeId(AesType::AtMineAreaSingleMines);
|
||||
m_tis.id = 1000 * m_data.id + static_cast<int>(AesType::AtMineAreaSingleMines);
|
||||
m_tis.aesItemId = m_data.id;
|
||||
m_tis.aesTypeId = AesType::AtMineAreaSingleMines;
|
||||
|
||||
// Set DUS-Mine status Base Data
|
||||
m_dms.id(m_data.id);
|
||||
m_dms.id = m_data.id;
|
||||
|
||||
trans.commit();
|
||||
|
||||
@@ -883,12 +883,12 @@ Core::FunctionReplyObject ObjectMineArea::createObjectFromMineData(const Databas
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error adding triggered mines to database."));
|
||||
|
||||
// Set TriggeredExplosions Base Data
|
||||
m_tis.id(1000 * m_data.id + AesType::AtMineAreaSingleMines);
|
||||
m_tis.aesItemId(m_data.id);
|
||||
m_tis.aesTypeId(AesType::AtMineAreaSingleMines);
|
||||
m_tis.id = 1000 * m_data.id + static_cast<int>(AesType::AtMineAreaSingleMines);
|
||||
m_tis.aesItemId = m_data.id;
|
||||
m_tis.aesTypeId = AesType::AtMineAreaSingleMines;
|
||||
|
||||
// Set DUS-Mine status Base Data
|
||||
m_dms.id(m_data.id);
|
||||
m_dms.id = m_data.id;
|
||||
|
||||
trans.commit();
|
||||
|
||||
@@ -1062,7 +1062,7 @@ bool ObjectMineArea::canHandleMine(int mineId, int chargeTypeId, const QPointF &
|
||||
DEBUG_LOG(m_logger) << "Mine Area " << m_data.id << " is not a DUS mine area.";
|
||||
|
||||
// EffectState has to be Created, Prepared, Active and Paused Areas
|
||||
if (m_data.effectStateId.underlying() < AesEffectState::EsCreated)
|
||||
if (m_data.effectStateId < AesEffectState::EsCreated)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Mine Area " << m_data.id << " can not handle mine because its current AesEffectState is"
|
||||
<< AreaEffectSimulation::toString(m_data.effectStateId);
|
||||
@@ -1237,9 +1237,9 @@ bool ObjectMineArea::addMineData(const std::vector<MineData> &mineData)
|
||||
tm.mineAreaId = m_data.id;
|
||||
tm.chargeTypeId = m_data.chargeTypeId;
|
||||
tm.mineId = idx++;
|
||||
tm.appearenceTime = QDateTime::fromMSecsSinceEpoch(mine.appearenceTime());
|
||||
tm.armingTime = QDateTime::fromMSecsSinceEpoch(mine.armingTime());
|
||||
tm.position = QPointF(mine.position().lon(), mine.position().lat());
|
||||
tm.appearenceTime = QDateTime::fromMSecsSinceEpoch(mine.appearenceTime);
|
||||
tm.armingTime = QDateTime::fromMSecsSinceEpoch(mine.armingTime);
|
||||
tm.position = QPointF(mine.position.lon, mine.position.lat);
|
||||
if (!m_mainHandler->db()->insert(tm))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "--[addMineData] Couldn't insert trigger mine into db";
|
||||
@@ -1412,50 +1412,50 @@ void ObjectMineArea::publishAiv()
|
||||
// Better than aiv.id(1000 * aesItemId + AesType::AtMineArea);
|
||||
|
||||
AesItemView aiv(m_aiv);
|
||||
aiv.aesItemId(m_data.id);
|
||||
aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv.effectStart(toMSec(m_data.effectStart));
|
||||
ddsVecFromPoly(m_mineAreaPolygon, aiv.form());
|
||||
aiv.aesItemId = m_data.id;
|
||||
aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv.effectStart = toMSec(m_data.effectStart);
|
||||
ddsVecFromPoly(m_mineAreaPolygon, aiv.form);
|
||||
const auto br = boundingRect(); // m_mineAreaPolygon.boundingRect()
|
||||
aiv.boundingBoxBottomLeft(Core::GeoPosition2D(br.bottomLeft().x(), br.bottomLeft().y()));
|
||||
aiv.boundingBoxTopRight(Core::GeoPosition2D(br.topRight().x(), br.topRight().y()));
|
||||
aiv.aesTypeId(AesType::AtMineArea);
|
||||
aiv.effectStateId(effectState());
|
||||
aiv.id(1000 * m_data.id + AesType::AtMineArea);
|
||||
aiv.boundingBoxBottomLeft = Core::GeoPosition2D(br.bottomLeft().x(), br.bottomLeft().y());
|
||||
aiv.boundingBoxTopRight = Core::GeoPosition2D(br.topRight().x(), br.topRight().y());
|
||||
aiv.aesTypeId = AesType::AtMineArea;
|
||||
aiv.effectStateId = effectState();
|
||||
aiv.id = 1000 * m_data.id + static_cast<int>(AesType::AtMineArea);
|
||||
if (m_data.partyId != 0)
|
||||
aiv.partyId(m_data.partyId);
|
||||
aiv.partyId = m_data.partyId;
|
||||
|
||||
checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral);
|
||||
checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral);
|
||||
|
||||
if (aiv != m_aiv)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "aiv changed - publish";
|
||||
aiv.sampleTime(partitionTimeMSec());
|
||||
aiv.sampleTime = partitionTimeMSec();
|
||||
m_aiv = aiv;
|
||||
m_mainHandler->dds()->dts()->publish(aiv);
|
||||
emit newAiv(aiv);
|
||||
}
|
||||
|
||||
AesItemView aiv2(m_aiv2);
|
||||
aiv2.aesItemId(m_data.id);
|
||||
aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId);
|
||||
aiv2.effectStart(toMSec(m_data.effectStart));
|
||||
aiv2.form().clear();
|
||||
aiv2.form().reserve(m_triggeredMines.size());
|
||||
aiv2.aesItemId = m_data.id;
|
||||
aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId;
|
||||
aiv2.effectStart = toMSec(m_data.effectStart);
|
||||
aiv2.form.clear();
|
||||
aiv2.form.reserve(m_triggeredMines.size());
|
||||
for (const auto &tm : qAsConst(m_triggeredMines))
|
||||
aiv2.form().resize(aiv2.form().size() + 1, Core::GeoPosition(tm.position.x(), tm.position.y(), 0.0));
|
||||
aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft());
|
||||
aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight());
|
||||
aiv2.aesTypeId(AesType::inner_enum::AtMineAreaSingleMines);
|
||||
aiv2.id(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines);
|
||||
aiv2.effectStateId(m_data.effectStateId);
|
||||
aiv2.form.resize(aiv2.form.size() + 1, Core::GeoPosition(tm.position.x(), tm.position.y(), 0.0));
|
||||
aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft;
|
||||
aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight;
|
||||
aiv2.aesTypeId = AesType::AtMineAreaSingleMines;
|
||||
aiv2.id = 1000 * m_data.id + static_cast<int>(AesType::AtMineAreaSingleMines);
|
||||
aiv2.effectStateId = m_data.effectStateId;
|
||||
if (m_data.partyId != 0)
|
||||
aiv2.partyId(m_data.partyId);
|
||||
aiv2.partyId = m_data.partyId;
|
||||
|
||||
if (aiv2 != m_aiv2 || m_triggeredMinesChanged)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "aiv2 changed";
|
||||
aiv2.sampleTime(partitionTimeMSec());
|
||||
aiv2.sampleTime = partitionTimeMSec();
|
||||
m_aiv2 = aiv2;
|
||||
m_mainHandler->dds()->dts()->publish(aiv2);
|
||||
emit newAiv(aiv2);
|
||||
@@ -1468,9 +1468,9 @@ void ObjectMineArea::removeTopics()
|
||||
|
||||
auto dts = m_mainHandler->dds()->dts();
|
||||
dts->removeMineAreaByKey(m_data.id);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtMineArea);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines);
|
||||
dts->removeTriggeredImpactsByKey(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines);
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtMineArea));
|
||||
dts->removeAesItemViewByKey(1000 * m_data.id + static_cast<int>(AesType::AtMineAreaSingleMines));
|
||||
dts->removeTriggeredImpactsByKey(1000 * m_data.id + static_cast<int>(AesType::AtMineAreaSingleMines));
|
||||
removeDusMineStateTopic();
|
||||
emit removeAiv(m_data.id);
|
||||
}
|
||||
@@ -1497,14 +1497,14 @@ Core::FunctionReplyObject ObjectMineArea::createGeoSegmentsFromMineData(double &
|
||||
tempMinePos.emplace_back(Core::GeoPosition2D(t.position.x(), t.position.y()));
|
||||
|
||||
for (const auto &md : mineData)
|
||||
tempMinePos.emplace_back(md.position());
|
||||
tempMinePos.emplace_back(md.position);
|
||||
|
||||
DEBUG_LOG(m_logger) << "--[createSegmentsFromMineData]: --> tempMinePos.Size: " << tempMinePos.size() << " m_triggeredMinesSIze: " << m_triggeredMines.size()
|
||||
<< " mineDataSize " << mineData.size();
|
||||
if (tempMinePos.empty())
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Mine data couldn't be added"));
|
||||
|
||||
LtsCoordTrans::UtmCoordinate tempCoord = LtsCoordTrans::UtmCoordinate::fromGeographic(tempMinePos.front().lon(), tempMinePos.front().lat());
|
||||
LtsCoordTrans::UtmCoordinate tempCoord = LtsCoordTrans::UtmCoordinate::fromGeographic(tempMinePos.front().lon, tempMinePos.front().lat);
|
||||
|
||||
// calculate position
|
||||
double angleDeg = 0.0;
|
||||
@@ -1557,7 +1557,7 @@ void ObjectMineArea::onEffectStateChanged()
|
||||
DEBUG_LOG(m_logger) << id() << " EffectStateChanged for MineArea " << m_data.id << ". Check if mines have to be released.";
|
||||
// If is an DUS-MineArea and it's state is Expired or Removed and still has mines
|
||||
if ((isDusMineArea() || isConcreteMine())
|
||||
&& (m_data.effectStateId.underlying() == AesEffectState::EsExpired || m_data.effectStateId.underlying() == AesEffectState::EsRemoved)
|
||||
&& (m_data.effectStateId == AesEffectState::EsExpired || m_data.effectStateId == AesEffectState::EsRemoved)
|
||||
&& !m_triggeredMines.isEmpty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << id() << " Releasing all mines from " << toString(m_data.effectStateId) << " MineArea " << m_data.id;
|
||||
|
||||
Reference in new issue
Block a user