Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1718 files changed
+126739
-18495
No files matched your search
+1
@@ -7,6 +7,7 @@
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
|
||||
|
||||
+49
-47
@@ -10,6 +10,7 @@
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
@@ -28,6 +29,7 @@ ParticipantMoveDialog::ParticipantMoveDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_ftc(nullptr),
|
||||
m_sitMapGuiIfc(nullptr), m_ui(new Ui::WaypointsEdit), m_id(0), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||
m_polyline(QPolygonF())
|
||||
, m_logger(getLogger("ParticipantMoveDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->cbJump->hide();
|
||||
@@ -44,7 +46,7 @@ ParticipantMoveDialog::~ParticipantMoveDialog()
|
||||
{
|
||||
m_sitMapGuiIfc = nullptr;
|
||||
delete m_ui;
|
||||
emit closeDialog(m_participantData.id());
|
||||
emit closeDialog(m_participantData.id);
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::enableUiElements(bool enable)
|
||||
@@ -80,10 +82,10 @@ bool ParticipantMoveDialog::init(LtsSession::LtsSessionDataDds* session,
|
||||
|
||||
m_ui->dteStartTime->setMinimumTimeMSec(m_session->partitionTime());
|
||||
m_ui->dteStartTime->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
|
||||
m_ui->lbIdentifier->setText(QString::fromStdString(data.tacticalIdentifier()));
|
||||
QString partyStr = ParticipantManagement::trPartyName(ppmDtc->party(m_participantData.partyId()).name());
|
||||
m_ui->lbIdentifier->setText(QString::fromStdString(data.tacticalIdentifier));
|
||||
QString partyStr = ParticipantManagement::trPartyName(ppmDtc->party(m_participantData.partyId).name);
|
||||
m_ui->lbParty->setText(partyStr);
|
||||
QString typeStr = ParticipantManagement::trTypeName(ppmDtc->type(m_participantData.typeId()).name());
|
||||
QString typeStr = ParticipantManagement::trTypeName(ppmDtc->type(m_participantData.typeId).name);
|
||||
m_ui->lbType->setText(typeStr);
|
||||
|
||||
enableUiElements(true);
|
||||
@@ -113,25 +115,25 @@ bool ParticipantMoveDialog::init(LtsSession::LtsSessionDataDds* session,
|
||||
void ParticipantMoveDialog::onSimulatedMovementChanged(const CentralEffectSimulation::SimulatedMovement& data,
|
||||
DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved || m_participantData.id() != data.participantId())
|
||||
if (modType == DataModification::eRemoved || m_participantData.id != data.participantId)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "onSimulatedMovementChanged";
|
||||
|
||||
clearContent();
|
||||
|
||||
m_id = data.id();
|
||||
m_ui->lePrefix->setText(QString::fromStdString(data.name()));
|
||||
m_ui->cbRepeat->setChecked(data.repeat());
|
||||
m_ui->cbJump->setChecked(data.jumpToStart());
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(data.startTime());
|
||||
m_id = data.id;
|
||||
m_ui->lePrefix->setText(QString::fromStdString(data.name));
|
||||
m_ui->cbRepeat->setChecked(data.repeat);
|
||||
m_ui->cbJump->setChecked(data.jumpToStart);
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(data.startTime);
|
||||
m_polyline.clear();
|
||||
|
||||
for (const SimulatedMovementSegment& segment : data.segments())
|
||||
for (const SimulatedMovementSegment& segment : data.segments)
|
||||
{
|
||||
const Core::GeoPosition2D& pointDds = segment.position();
|
||||
insertPos(pointDds.lon(), pointDds.lat(), QString::fromStdString(segment.name()), segment.delay(),
|
||||
segment.speed());
|
||||
m_polyline.push_back(QPointF(pointDds.lon(), pointDds.lat()));
|
||||
const Core::GeoPosition2D& pointDds = segment.position;
|
||||
insertPos(pointDds.lon, pointDds.lat, QString::fromStdString(segment.name), segment.delay,
|
||||
segment.speed);
|
||||
m_polyline.push_back(QPointF(pointDds.lon, pointDds.lat));
|
||||
}
|
||||
|
||||
if (this->amIFocused())
|
||||
@@ -168,7 +170,7 @@ void ParticipantMoveDialog::onSimulatedMovementModifyReply(const Core::FunctionR
|
||||
|
||||
void ParticipantMoveDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, QString::fromStdString(m_participantData.tacticalIdentifier()), false, tr("Waypoints"));
|
||||
translate(m_ui, QString::fromStdString(m_participantData.tacticalIdentifier), false, tr("Waypoints"));
|
||||
DEBUG_LOG(m_logger) << "retranslate";
|
||||
}
|
||||
|
||||
@@ -299,7 +301,7 @@ SimulatedMovement ParticipantMoveDialog::requestContent() const
|
||||
|
||||
int32_t jumpToStart = true;
|
||||
rti::core::int64 startTime = m_ui->dteStartTime->msecsSinceEpoch();
|
||||
int32_t participantId = m_participantData.id();
|
||||
int32_t participantId = m_participantData.id;
|
||||
int32_t nextPoint = 0;
|
||||
|
||||
int cntSegments = m_ui->tableWidget->rowCount();
|
||||
@@ -309,21 +311,21 @@ SimulatedMovement ParticipantMoveDialog::requestContent() const
|
||||
{
|
||||
QWidget* widget = m_ui->tableWidget->cellWidget(i, Name);
|
||||
const QString nameSeg = static_cast<QLineEdit*>(widget)->text();
|
||||
segments[i].name(nameSeg.toStdString());
|
||||
segments[i].name = nameSeg.toStdString();
|
||||
|
||||
widget = m_ui->tableWidget->cellWidget(i, IdleTime);
|
||||
const int idleTime = static_cast<QSpinBox*>(widget)->value() * s_timeMilliConversion;
|
||||
segments[i].delay(idleTime);
|
||||
segments[i].delay = idleTime;
|
||||
|
||||
widget = m_ui->tableWidget->cellWidget(i, Speed);
|
||||
const double speed = static_cast<QSpinBox*>(widget)->value() / s_msConversion;
|
||||
|
||||
segments[i].speed(speed);
|
||||
segments[i].speed = speed;
|
||||
|
||||
widget = m_ui->tableWidget->cellWidget(i, Position);
|
||||
const QPointF point = static_cast<LtsCoordWidget::LtsCoordWidget*>(widget)->coordinate();
|
||||
const Core::GeoPosition2D pos(Core::GeoPosition2D(point.x(), point.y()));
|
||||
segments[i].position(pos);
|
||||
segments[i].position = pos;
|
||||
}
|
||||
|
||||
return SimulatedMovement(m_id, name, startTime, participantId, segments, repeat, jumpToStart, nextPoint);
|
||||
@@ -362,23 +364,23 @@ QByteArray ParticipantMoveDialog::simulatedMovementToJson() const
|
||||
QJsonObject obj;
|
||||
obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::CESParticipantMove);
|
||||
|
||||
obj[QStringLiteral("id")] = req.id();
|
||||
obj[QStringLiteral("jumpToStart")] = req.jumpToStart();
|
||||
obj[QStringLiteral("name")] = QString::fromStdString(req.name());
|
||||
obj[QStringLiteral("nextPoint")] = req.nextPoint();
|
||||
obj[QStringLiteral("participantId")] = req.participantId();
|
||||
obj[QStringLiteral("repeat")] = req.repeat();
|
||||
obj[QStringLiteral("startTime")] = req.startTime();
|
||||
obj[QStringLiteral("id")] = req.id;
|
||||
obj[QStringLiteral("jumpToStart")] = req.jumpToStart;
|
||||
obj[QStringLiteral("name")] = QString::fromStdString(req.name);
|
||||
obj[QStringLiteral("nextPoint")] = req.nextPoint;
|
||||
obj[QStringLiteral("participantId")] = req.participantId;
|
||||
obj[QStringLiteral("repeat")] = req.repeat;
|
||||
obj[QStringLiteral("startTime")] = static_cast<double>(req.startTime);
|
||||
|
||||
QJsonArray arr;
|
||||
for (auto it = req.segments().begin(); it != req.segments().end(); ++it)
|
||||
for (auto it = req.segments.begin(); it != req.segments.end(); ++it)
|
||||
{
|
||||
QJsonObject inner;
|
||||
inner[QStringLiteral("delay")] = it->delay();
|
||||
inner[QStringLiteral("name")] = QString::fromStdString(it->name());
|
||||
inner[QStringLiteral("speed")] = it->speed();
|
||||
inner[QStringLiteral("lat")] = it->position().lat();
|
||||
inner[QStringLiteral("lon")] = it->position().lon();
|
||||
inner[QStringLiteral("delay")] = it->delay;
|
||||
inner[QStringLiteral("name")] = QString::fromStdString(it->name);
|
||||
inner[QStringLiteral("speed")] = it->speed;
|
||||
inner[QStringLiteral("lat")] = it->position.lat;
|
||||
inner[QStringLiteral("lon")] = it->position.lon;
|
||||
arr += inner;
|
||||
}
|
||||
obj[QStringLiteral("segments")] = arr;
|
||||
@@ -394,27 +396,27 @@ SimulatedMovement ParticipantMoveDialog::jsonToSimulatedMovement(const QByteArra
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(content));
|
||||
const QJsonObject obj(doc.object());
|
||||
|
||||
result.id(obj[QStringLiteral("id")].toInt());
|
||||
result.jumpToStart(obj[QStringLiteral("jumpToStart")].toInt());
|
||||
result.name(obj[QStringLiteral("name")].toString().toStdString());
|
||||
result.nextPoint(obj[QStringLiteral("nextPoint")].toInt());
|
||||
result.participantId(m_participantData.id());
|
||||
result.repeat(obj[QStringLiteral("repeat")].toInt());
|
||||
result.startTime(obj[QStringLiteral("startTime")].toDouble());
|
||||
result.id = obj[QStringLiteral("id")].toInt();
|
||||
result.jumpToStart = obj[QStringLiteral("jumpToStart")].toInt();
|
||||
result.name = obj[QStringLiteral("name")].toString().toStdString();
|
||||
result.nextPoint = obj[QStringLiteral("nextPoint")].toInt();
|
||||
result.participantId = m_participantData.id;
|
||||
result.repeat = obj[QStringLiteral("repeat")].toInt();
|
||||
result.startTime = obj[QStringLiteral("startTime")].toDouble();
|
||||
|
||||
const QJsonArray arr(obj.value(QStringLiteral("segments")).toArray());
|
||||
auto& segments = result.segments();
|
||||
auto& segments = result.segments;
|
||||
segments.resize(arr.size());
|
||||
for (int i = 0; i < arr.size(); ++i)
|
||||
{
|
||||
CentralEffectSimulation::SimulatedMovementSegment& segment = segments[i];
|
||||
const QJsonObject objArr(arr.at(i).toObject());
|
||||
segment.delay(objArr[QStringLiteral("delay")].toDouble());
|
||||
segment.name(objArr[QStringLiteral("name")].toString().toStdString());
|
||||
segment.delay = objArr[QStringLiteral("delay")].toDouble();
|
||||
segment.name = objArr[QStringLiteral("name")].toString().toStdString();
|
||||
|
||||
segment.position().lat(objArr[QStringLiteral("lat")].toDouble());
|
||||
segment.position().lon(objArr[QStringLiteral("lon")].toDouble());
|
||||
segment.speed(objArr[QStringLiteral("speed")].toDouble());
|
||||
segment.position.lat = objArr[QStringLiteral("lat")].toDouble();
|
||||
segment.position.lon = objArr[QStringLiteral("lon")].toDouble();
|
||||
segment.speed = objArr[QStringLiteral("speed")].toDouble();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
@@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
+72
-71
@@ -32,6 +32,7 @@ ParticipantsMoveDialog::ParticipantsMoveDialog(const QString& menuGroup, QWidget
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_participantModel(nullptr),
|
||||
m_ppmDtc(nullptr), m_ppmCbxIfc(nullptr), m_ftc(nullptr), m_ui(new Ui::ParticipantMoveDialog), m_session(nullptr),
|
||||
m_menuGroup(menuGroup), m_requestHelper(new LtsUtils::RequestHelper(this)), m_sitMapGuiIfc(nullptr)
|
||||
, m_logger(getLogger("ParticipantsMoveDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setUnchangeable();
|
||||
@@ -121,10 +122,10 @@ bool ParticipantsMoveDialog::init(LtsSession::LtsSession* session,
|
||||
return false;
|
||||
|
||||
const ExerciseManagement::Exercise exc = exmDtc->exercise(m_session->exerciseId());
|
||||
AssetManagement::TrainingArea ta = asmDtc->trainingArea(exc.trainingAreaId());
|
||||
if (ta.id() != exc.trainingAreaId())
|
||||
AssetManagement::TrainingArea ta = asmDtc->trainingArea(exc.trainingAreaId);
|
||||
if (ta.id != exc.trainingAreaId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << " couldn't get Training Area with id: " << exc.trainingAreaId();
|
||||
ERROR_LOG(m_logger) << " couldn't get Training Area with id: " << exc.trainingAreaId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -135,8 +136,8 @@ bool ParticipantsMoveDialog::init(LtsSession::LtsSession* session,
|
||||
}
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate& bottomLeft =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(ta.bottomLeft().lon(), ta.bottomLeft().lat());
|
||||
m_trainingAreaRect = QRectF(bottomLeft.geographic(0, ta.height()), bottomLeft.geographic(ta.width(), 0));
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(ta.bottomLeft.lon, ta.bottomLeft.lat);
|
||||
m_trainingAreaRect = QRectF(bottomLeft.geographic(0, ta.height), bottomLeft.geographic(ta.width, 0));
|
||||
|
||||
m_ppmDtc->enableUnitPosition();
|
||||
m_ppmDtc->waitForHistoricalDataUnitPosition(1000);
|
||||
@@ -196,11 +197,11 @@ void ParticipantsMoveDialog::onSelectionChanged()
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first()));
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id();
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, data.isSimulated());
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id;
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, data.isSimulated);
|
||||
|
||||
if (data.isSimulated() && m_participantDialogMap.contains(data.id()))
|
||||
m_participantDialogMap.value(data.id())->showPreview(true);
|
||||
if (data.isSimulated && m_participantDialogMap.contains(data.id))
|
||||
m_participantDialogMap.value(data.id)->showPreview(true);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -217,19 +218,19 @@ void ParticipantsMoveDialog::onSelectionChanged()
|
||||
bool isParticipantInUseOrAdler = participantInUse4ExplosionCluster(indexList.first());
|
||||
|
||||
if (!isParticipantInUseOrAdler)
|
||||
isParticipantInUseOrAdler = (m_ppmDtc->isAdlerType(data.typeId()) && !data.name().empty());
|
||||
isParticipantInUseOrAdler = (m_ppmDtc->isAdlerType(data.typeId) && !data.name.empty());
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, isOne && !isParticipantInUseOrAdler);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, isOne && !isParticipantInUseOrAdler);
|
||||
}
|
||||
|
||||
if (m_ppmDtc->type(data.typeId()).typeClass() != ParticipantManagement::TypeClass::Unit)
|
||||
if (m_ppmDtc->type(data.typeId).typeClass != ParticipantManagement::TypeClass::Unit)
|
||||
{
|
||||
|
||||
if (!data.equipmentNumber().is_set() || data.equipmentNumber().get() <= 0)
|
||||
if (!data.equipmentNumber.has_value() || data.equipmentNumber.get() <= 0)
|
||||
{
|
||||
|
||||
isOne &= !(m_ppmDtc->isAdlerType(data.typeId()) && !data.name().empty());
|
||||
isOne &= !(m_ppmDtc->isAdlerType(data.typeId) && !data.name.empty());
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, isOne);
|
||||
}
|
||||
else
|
||||
@@ -265,19 +266,19 @@ void ParticipantsMoveDialog::onDoubleClicked()
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first()));
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id;
|
||||
|
||||
if (!m_participantDialogMap.contains(data.id()))
|
||||
if (!m_participantDialogMap.contains(data.id))
|
||||
{
|
||||
ParticipantMoveDialog* dialog = new ParticipantMoveDialog(this);
|
||||
m_participantDialogMap.insert(data.id(), dialog);
|
||||
m_participantDialogMap.insert(data.id, dialog);
|
||||
connect(dialog, &ParticipantMoveDialog::closeDialog, this, &ParticipantsMoveDialog::closeDialogReceived);
|
||||
|
||||
addDialog(LtsWidgets::initDialog(dialog, m_session, m_ppmDtc, m_cesDtc, data), m_menuGroup,
|
||||
QStringLiteral("cesNewSimulation%1").arg(data.id()), LtsWidgets::LayoutArea::eDialogTab);
|
||||
QStringLiteral("cesNewSimulation%1").arg(data.id), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
focusDialog(m_menuGroup, QStringLiteral("cesNewSimulation%1").arg(data.id()),
|
||||
focusDialog(m_menuGroup, QStringLiteral("cesNewSimulation%1").arg(data.id),
|
||||
LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
@@ -317,12 +318,12 @@ void ParticipantsMoveDialog::onRemove()
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first()));
|
||||
INFO_LOG(m_logger) << "onRemove ParticipantId: " << data.id();
|
||||
INFO_LOG(m_logger) << "onRemove ParticipantId: " << data.id;
|
||||
|
||||
delete m_participantDialogMap.value(data.id());
|
||||
m_participantDialogMap.remove(data.id());
|
||||
delete m_participantDialogMap.value(data.id);
|
||||
m_participantDialogMap.remove(data.id);
|
||||
|
||||
removeFtc(data.id());
|
||||
removeFtc(data.id);
|
||||
}
|
||||
|
||||
void ParticipantsMoveDialog::onSetSimulatedMGRSPosition()
|
||||
@@ -348,23 +349,23 @@ bool ParticipantsMoveDialog::participantInUse4ExplosionCluster(const QModelIndex
|
||||
const ParticipantManagement::ParticipantData participantData(participantFromIndex(participantIndex));
|
||||
bool bret = false;
|
||||
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId());
|
||||
bool isUnitType = (participantType.typeClass() == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId);
|
||||
bool isUnitType = (participantType.typeClass == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
|
||||
|
||||
if (!isUnitType)
|
||||
{
|
||||
const QModelIndex parentIndex = m_participantModel->indexFromParticipantId(participantData.superiorModId());
|
||||
const QModelIndex parentIndex = m_participantModel->indexFromParticipantId(participantData.superiorModId);
|
||||
const ParticipantManagement::ParticipantData parentParticipantData(participantFromIndex(parentIndex));
|
||||
|
||||
const ParticipantManagement::Type& partentParticipantType = m_ppmDtc->type(parentParticipantData.typeId());
|
||||
isUnitType = (partentParticipantType.typeClass() == ParticipantManagement::TypeClass::Unit) ||
|
||||
(partentParticipantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
|
||||
bret = isUnitType && isParticipantInUseForExplosionCluster(parentParticipantData.id());
|
||||
const ParticipantManagement::Type& partentParticipantType = m_ppmDtc->type(parentParticipantData.typeId);
|
||||
isUnitType = (partentParticipantType.typeClass == ParticipantManagement::TypeClass::Unit) ||
|
||||
(partentParticipantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
|
||||
bret = isUnitType && isParticipantInUseForExplosionCluster(parentParticipantData.id);
|
||||
;
|
||||
}
|
||||
else
|
||||
bret = isParticipantInUseForExplosionCluster(participantData.id());
|
||||
bret = isParticipantInUseForExplosionCluster(participantData.id);
|
||||
|
||||
return bret;
|
||||
}
|
||||
@@ -409,17 +410,17 @@ void ParticipantsMoveDialog::onGetCoordinate(QPointF coordinate)
|
||||
|
||||
const ParticipantManagement::ParticipantData participantData(participantFromIndex(indexList.first()));
|
||||
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << "ParticipantId=" << participantData.id()
|
||||
<< " EquipmentNr=" << participantData.equipmentNumber()
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << "ParticipantId=" << participantData.id
|
||||
<< " EquipmentNr=" << participantData.equipmentNumber
|
||||
<< " onGetCoordinate x=" << coordinate.x() << " y=" << coordinate.y();
|
||||
if (participantData.id() <= 0)
|
||||
if (participantData.id <= 0)
|
||||
return;
|
||||
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId());
|
||||
const bool& isUnitType = (participantType.typeClass() == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId);
|
||||
const bool& isUnitType = (participantType.typeClass == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
|
||||
|
||||
m_formationProps.setFormation(QString::fromStdString(participantType.properties()));
|
||||
m_formationProps.setFormation(QString::fromStdString(participantType.properties));
|
||||
const bool& withFormation = (isUnitType && m_formationProps.isArtillery);
|
||||
if (withFormation || m_mgrsPosEditCoordinateActive)
|
||||
setFormationAndPositioningUi(participantData, coordinate, withFormation);
|
||||
@@ -481,8 +482,8 @@ bool ParticipantsMoveDialog::isParticipantInUseForExplosionCluster(int id)
|
||||
const QMap<qint32, AreaEffectSimulation::ExplosionCluster>& ecMap = m_aesDtc->explosionClusters();
|
||||
for (const AreaEffectSimulation::ExplosionCluster& aes : std::as_const(ecMap))
|
||||
{
|
||||
if (aes.participantId() == id && (aes.effectStateId() == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
aes.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
if (aes.participantId == id && (aes.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
aes.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -500,11 +501,11 @@ void ParticipantsMoveDialog::setFormationAndPositioningUi(const ParticipantManag
|
||||
if (!unitWithFormation && !m_mgrsPosEditCoordinateActive)
|
||||
return;
|
||||
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId());
|
||||
const bool isUnitType = (participantType.typeClass() == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
|
||||
const ParticipantManagement::Type& participantType = m_ppmDtc->type(participantData.typeId);
|
||||
const bool isUnitType = (participantType.typeClass == ParticipantManagement::TypeClass::Unit) ||
|
||||
(participantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
|
||||
|
||||
m_formationProps.setFormation(QString::fromStdString(participantType.properties()));
|
||||
m_formationProps.setFormation(QString::fromStdString(participantType.properties));
|
||||
|
||||
if (m_formationProps.hasFormationData())
|
||||
return;
|
||||
@@ -688,7 +689,7 @@ bool ParticipantsMoveDialog::getUnitPosition(int32_t participantId, Core::GeoPos
|
||||
FilterManagement::SymbolAppearanceSettings::UnitSymbolPosition usp = settings.symbolSettings.unitSymbolPosition;
|
||||
|
||||
ParticipantManagement::UnitPosition up = m_ppmDtc->unitPosition(participantId);
|
||||
if (up.participantId() != participantId)
|
||||
if (up.participantId != participantId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << ", unitPosition failed for participantId=" << participantId;
|
||||
return false;
|
||||
@@ -697,11 +698,11 @@ bool ParticipantsMoveDialog::getUnitPosition(int32_t participantId, Core::GeoPos
|
||||
switch (usp)
|
||||
{
|
||||
case FilterManagement::SymbolAppearanceSettings::UnitSymbolPosition::Center:
|
||||
unitPositionOut = up.positionCenter();
|
||||
unitPositionOut = up.positionCenter;
|
||||
return true;
|
||||
break;
|
||||
case FilterManagement::SymbolAppearanceSettings::UnitSymbolPosition::Leader:
|
||||
unitPositionOut = up.positionLeader();
|
||||
unitPositionOut = up.positionLeader;
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
@@ -713,7 +714,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRequest(
|
||||
const ParticipantManagement::ParticipantData& participantData, const QPointF& coordinate)
|
||||
{
|
||||
|
||||
const int participantId = participantData.id();
|
||||
const int participantId = participantData.id;
|
||||
if (participantId <= 0)
|
||||
return;
|
||||
|
||||
@@ -721,20 +722,20 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRequest(
|
||||
bool bAll = m_ui->cbAll->isChecked();
|
||||
bool bAskOutdated = true;
|
||||
if (bAll)
|
||||
req.participantId(-1);
|
||||
req.participantId = -1;
|
||||
else
|
||||
{
|
||||
const ParticipantManagement::TypeClass tc = m_ppmDtc->type(participantData.typeId()).typeClass();
|
||||
const ParticipantManagement::TypeClass tc = m_ppmDtc->type(participantData.typeId).typeClass;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ParticipantId=" << participantData.id()
|
||||
<< " EquipmentNr=" << participantData.equipmentNumber()
|
||||
DEBUG_LOG(m_logger) << "ParticipantId=" << participantData.id
|
||||
<< " EquipmentNr=" << participantData.equipmentNumber
|
||||
<< " onGetCoordinate x=" << coordinate.x() << " y=" << coordinate.y() << ", tc=" << tc;
|
||||
if (participantData.id() <= 0)
|
||||
if (participantData.id <= 0)
|
||||
return;
|
||||
req.participantId(participantData.id());
|
||||
req.participantId = participantData.id;
|
||||
|
||||
bAskOutdated =
|
||||
m_ppmDtc->type(participantData.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit;
|
||||
m_ppmDtc->type(participantData.typeId).typeClass == ParticipantManagement::TypeClass::Unit;
|
||||
}
|
||||
|
||||
bool bOnlyOutdated = false;
|
||||
@@ -751,8 +752,8 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRequest(
|
||||
bOnlyOutdated = (b == LtsWidgets::Button::No);
|
||||
}
|
||||
|
||||
req.onlyOutdatedParticipants(bOnlyOutdated);
|
||||
req.position(Core::GeoPosition(coordinate.x(), coordinate.y(), 0.0));
|
||||
req.onlyOutdatedParticipants = bOnlyOutdated;
|
||||
req.position = Core::GeoPosition(coordinate.x(), coordinate.y(), 0.0);
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]() { return m_ppmFtc->setSimulatedPositionRequest(req, this); });
|
||||
}
|
||||
@@ -761,7 +762,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(
|
||||
const ParticipantManagement::ParticipantData& participantData, const QPointF& coordinate)
|
||||
{
|
||||
|
||||
const int participantId = participantData.id();
|
||||
const int participantId = participantData.id;
|
||||
if (participantId <= 0)
|
||||
return;
|
||||
|
||||
@@ -773,10 +774,10 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId
|
||||
<< ", unitPositionOut: lon=" << unitPositionOut.lon() << " - lat=" << unitPositionOut.lat();
|
||||
<< ", unitPositionOut: lon=" << unitPositionOut.lon << " - lat=" << unitPositionOut.lat;
|
||||
|
||||
LtsCoordTrans::UtmCoordinate curUnitPosUtm =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon(), unitPositionOut.lat());
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon, unitPositionOut.lat);
|
||||
LtsCoordTrans::UtmCoordinate desiredUnitPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(coordinate);
|
||||
QPointF offset = desiredUnitPosUtm.relativeTo(curUnitPosUtm);
|
||||
|
||||
@@ -787,9 +788,9 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(
|
||||
}
|
||||
|
||||
ParticipantManagement::SetSimulatedPositionRelative req;
|
||||
req.participantId(participantId);
|
||||
req.positionOffsetX(offset.x());
|
||||
req.positionOffsetY(offset.y());
|
||||
req.participantId = participantId;
|
||||
req.positionOffsetX = offset.x();
|
||||
req.positionOffsetY = offset.y();
|
||||
|
||||
DEBUG_LOG(m_logger) << "SetSimulatedPositionRelative = " << req;
|
||||
|
||||
@@ -802,7 +803,7 @@ void ParticipantsMoveDialog::doSetSimulatedParticipantFormationRequest(
|
||||
const QString& formationData)
|
||||
{
|
||||
|
||||
const int participantId = participantData.id();
|
||||
const int participantId = participantData.id;
|
||||
if (participantId <= 0)
|
||||
return;
|
||||
|
||||
@@ -814,10 +815,10 @@ void ParticipantsMoveDialog::doSetSimulatedParticipantFormationRequest(
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId
|
||||
<< ", unitPositionOut: lon=" << unitPositionOut.lon() << " - lat=" << unitPositionOut.lat();
|
||||
<< ", unitPositionOut: lon=" << unitPositionOut.lon << " - lat=" << unitPositionOut.lat;
|
||||
|
||||
LtsCoordTrans::UtmCoordinate curUnitPosUtm =
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon(), unitPositionOut.lat());
|
||||
LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon, unitPositionOut.lat);
|
||||
LtsCoordTrans::UtmCoordinate desiredUnitPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(coordinate);
|
||||
const QPointF offset = desiredUnitPosUtm.relativeTo(curUnitPosUtm);
|
||||
|
||||
@@ -828,11 +829,11 @@ void ParticipantsMoveDialog::doSetSimulatedParticipantFormationRequest(
|
||||
}
|
||||
|
||||
ParticipantManagement::SetSimulatedParticipantFormation req;
|
||||
req.participantId(participantId);
|
||||
req.position(Core::GeoPosition(coordinate.x(), coordinate.y(), 0.0));
|
||||
req.positionOffsetX(offset.x());
|
||||
req.positionOffsetY(offset.y());
|
||||
req.formation(formationData.toStdString());
|
||||
req.participantId = participantId;
|
||||
req.position = Core::GeoPosition(coordinate.x(), coordinate.y(), 0.0);
|
||||
req.positionOffsetX = offset.x();
|
||||
req.positionOffsetY = offset.y();
|
||||
req.formation = formationData.toStdString();
|
||||
|
||||
m_requestHelper->startSingleRequest(
|
||||
[req, this]() { return m_ppmFtc->setSimulatedParticipantFormationRequest(req, this); });
|
||||
|
||||
+1
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
|
||||
+9
-8
@@ -11,6 +11,7 @@ ParticipantMoveModel::ParticipantMoveModel(QObject* parent,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc>& ppmDtc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface>& asbIfc)
|
||||
: ParticipantManagement::ParticipantEditModel(parent, ppmDtc, asbIfc)
|
||||
, m_logger(getLogger("ParticipantMoveModel"))
|
||||
{
|
||||
m_titles += tr("Simulated");
|
||||
|
||||
@@ -38,9 +39,9 @@ void ParticipantMoveModel::onParticipantChanged(const ParticipantManagement::Par
|
||||
DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
if (data.partyId() != m_partyId)
|
||||
if (data.partyId != m_partyId)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated;
|
||||
onReinitModel(partyId());
|
||||
emit newData();
|
||||
}
|
||||
@@ -50,17 +51,17 @@ bool ParticipantMoveModel::isSelectableBySimulation(const QModelIndex& index, bo
|
||||
bool isSimulatable = true;
|
||||
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
||||
|
||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
||||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
|
||||
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
|
||||
m_dtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
|
||||
isSimulatable = false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
|
||||
<< " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId()
|
||||
<< " modId=" << data.modId() << " typeClass=" << m_dtc->type(data.typeId()).typeClass()
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id << " isSimulated:" << data.isSimulated
|
||||
<< " equipmentNo:" << data.equipmentNumber << " typeId=" << data.typeId
|
||||
<< " modId=" << data.modId << " typeClass=" << m_dtc->type(data.typeId).typeClass
|
||||
<< " isSimulatable=" << isSimulatable;
|
||||
|
||||
if (bIsSimulated)
|
||||
*bIsSimulated = data.isSimulated();
|
||||
*bIsSimulated = data.isSimulated;
|
||||
|
||||
return isSimulatable;
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <CentralEffectSimulation/ces_operator_rights.h>
|
||||
#include <CentralEffectSimulation/ces_data_plugin_interface.h>
|
||||
#include <CentralEffectSimulation/ParticipantUAS/mission_plan_edit.h>
|
||||
#include "mission_plan_edit.h"
|
||||
#include "mission_plan_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
|
||||
|
||||
+23
-22
@@ -16,6 +16,7 @@ MissionPlanDialog::MissionPlanDialog(const QString& menuGroup, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_ppmDtc(nullptr), m_ppmFtc(nullptr),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_session(nullptr), m_menuGroup(menuGroup),
|
||||
m_ui(new Ui::MissionPlanDialog)
|
||||
, m_logger(getLogger("MissionPlanDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -130,11 +131,11 @@ MissionPlanDialog::wayPointCurrentStatus(const ParticipantManagement::MissionPla
|
||||
{
|
||||
WayPointsStatus state = WayPointsStatus::Undefined;
|
||||
|
||||
if (mp.missionStart() > m_session->partitionTime())
|
||||
if (mp.missionStart > m_session->partitionTime())
|
||||
return WayPointsStatus::Prepared;
|
||||
else if (mp.itemsFulfilled() != static_cast<int32_t>(mp.items().size()))
|
||||
else if (mp.itemsFulfilled != static_cast<int32_t>(mp.items.size()))
|
||||
return WayPointsStatus::Active;
|
||||
else if (mp.itemsFulfilled() == static_cast<int32_t>(mp.items().size()))
|
||||
else if (mp.itemsFulfilled == static_cast<int32_t>(mp.items.size()))
|
||||
return WayPointsStatus::Expired;
|
||||
|
||||
WARNING_LOG(m_logger) << " -- Status Wegpunktkette Abgebrochen muss definiert werden";
|
||||
@@ -145,13 +146,13 @@ MissionPlanDialog::wayPointCurrentStatus(const ParticipantManagement::MissionPla
|
||||
bool MissionPlanDialog::canBeLocked() const
|
||||
{
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id() <= 0)
|
||||
if (missionPlan.id <= 0)
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId, m_session->exerciseId());
|
||||
|
||||
if (uas.uasState() == ProjectDataManagement::UasState::Manual || wpStatus == WayPointsStatus::Active)
|
||||
if (uas.uasState == ProjectDataManagement::UasState::UasState_Manual || wpStatus == WayPointsStatus::Active)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -160,15 +161,15 @@ bool MissionPlanDialog::canBeLocked() const
|
||||
bool MissionPlanDialog::canBeUnlocked() const
|
||||
{
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id() <= 0)
|
||||
if (missionPlan.id <= 0)
|
||||
return false;
|
||||
if (missionPlan.aborted())
|
||||
if (missionPlan.aborted)
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId, m_session->exerciseId());
|
||||
|
||||
if (uas.uasState() == ProjectDataManagement::UasState::Manual || wpStatus != WayPointsStatus::Active)
|
||||
if (uas.uasState == ProjectDataManagement::UasState::UasState_Manual || wpStatus != WayPointsStatus::Active)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -181,10 +182,10 @@ MissionPlanEdit* MissionPlanDialog::currentMissionPlanEditor() const
|
||||
return nullptr;
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() < 0)
|
||||
if (mp.id < 0)
|
||||
return nullptr;
|
||||
|
||||
return m_participantUasEditMap.value(mp.participantId(), nullptr);
|
||||
return m_participantUasEditMap.value(mp.participantId, nullptr);
|
||||
}
|
||||
|
||||
ParticipantManagement::MissionPlan MissionPlanDialog::currentMissionPlan() const
|
||||
@@ -257,12 +258,12 @@ void MissionPlanDialog::onAddMissionPlan()
|
||||
}
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
if (mp.id <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), mp.id(), m_session, true), m_menuGroup,
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), mp.id, m_session, true), m_menuGroup,
|
||||
newMissionPlanIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
@@ -277,9 +278,9 @@ void MissionPlanDialog::onRemoveMissionPlanClicked()
|
||||
return;
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
|
||||
delete m_participantUasEditMap.value(mp.id());
|
||||
m_participantUasEditMap.remove(mp.id());
|
||||
removeMissionPlan(mp.id());
|
||||
delete m_participantUasEditMap.value(mp.id);
|
||||
m_participantUasEditMap.remove(mp.id);
|
||||
removeMissionPlan(mp.id);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onEditMissionPlan()
|
||||
@@ -289,17 +290,17 @@ void MissionPlanDialog::onEditMissionPlan()
|
||||
return;
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
if (mp.id <= 0)
|
||||
return;
|
||||
|
||||
const QString dialogIdentifier = QStringLiteral("Edit-MissionPlan_%1").arg(mp.id());
|
||||
const QString dialogIdentifier = QStringLiteral("Edit-MissionPlan_%1").arg(mp.id);
|
||||
|
||||
if (!m_participantUasEditMap.contains(mp.participantId()))
|
||||
if (!m_participantUasEditMap.contains(mp.participantId))
|
||||
{
|
||||
MissionPlanEdit* dialog = new MissionPlanEdit(this);
|
||||
m_participantUasEditMap.insert(mp.participantId(), dialog);
|
||||
m_participantUasEditMap.insert(mp.participantId, dialog);
|
||||
connect(dialog, &MissionPlanEdit::editUasDialogClosed, this, &MissionPlanDialog::onEditDialogClosed);
|
||||
addDialog(LtsWidgets::initDialog(dialog, mp.id(), m_session), m_menuGroup, dialogIdentifier,
|
||||
addDialog(LtsWidgets::initDialog(dialog, mp.id, m_session), m_menuGroup, dialogIdentifier,
|
||||
LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
|
||||
+1
@@ -6,6 +6,7 @@
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
|
||||
+97
-95
@@ -9,6 +9,7 @@
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
@@ -29,6 +30,7 @@ MissionPlanEdit::MissionPlanEdit(QWidget* parent)
|
||||
m_uiEnabled(false), m_sitMapGuiIfc(nullptr), m_ppmCbxGui(nullptr),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_participantTimer(new QTimer(this)),
|
||||
m_ui(new Ui::MissionPlanEdit)
|
||||
, m_logger(getLogger("MissionPlanEdit"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->nameLineEdit->clear();
|
||||
@@ -58,7 +60,7 @@ MissionPlanEdit::~MissionPlanEdit()
|
||||
{
|
||||
m_sitMapGuiIfc = nullptr;
|
||||
delete m_ui;
|
||||
emit editUasDialogClosed(m_participantData.id());
|
||||
emit editUasDialogClosed(m_participantData.id);
|
||||
}
|
||||
|
||||
bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDds* session, bool asCopy)
|
||||
@@ -97,14 +99,14 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd
|
||||
|
||||
m_missionPlan = m_ppmDtc->missionPlan(m_missionPlanId);
|
||||
auto cb = [this, asCopy](const ParticipantManagement::MissionPlan& mission) {
|
||||
if ((((mission.participantId() == m_missionPlan.participantId()) && !asCopy) || mission.participantId() <= 0) &&
|
||||
mission.missionStart() <= m_missionPlan.missionStart() && !mission.aborted())
|
||||
if ((((mission.participantId == m_missionPlan.participantId) && !asCopy) || mission.participantId <= 0) &&
|
||||
mission.missionStart <= m_missionPlan.missionStart && !mission.aborted)
|
||||
return;
|
||||
|
||||
if (static_cast<int>(mission.items().size()) == mission.itemsFulfilled() || mission.aborted())
|
||||
if (static_cast<int>(mission.items.size()) == mission.itemsFulfilled || mission.aborted)
|
||||
return;
|
||||
|
||||
m_usedUasSet.insert(mission.participantId());
|
||||
m_usedUasSet.insert(mission.participantId);
|
||||
};
|
||||
m_ppmDtc->missionPlans(cb);
|
||||
|
||||
@@ -116,11 +118,11 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd
|
||||
setReady(false);
|
||||
const auto pId = m_ui->participantCBox->currentData().toInt();
|
||||
m_participant = m_ppmDtc->participant(pId);
|
||||
const auto dpd = m_ppmDtc->dynamicParticipantData(m_participant.id());
|
||||
DEBUG_LOG(m_logger) << "idx changed! pId: " << pId << ", m_participant.id(): " << m_participant.id()
|
||||
<< ", dpd.participantId(): " << dpd.participantId();
|
||||
const auto dpd = m_ppmDtc->dynamicParticipantData(m_participant.id);
|
||||
DEBUG_LOG(m_logger) << "idx changed! pId: " << pId << ", m_participant.id(): " << m_participant.id
|
||||
<< ", dpd.participantId(): " << dpd.participantId;
|
||||
|
||||
if (dpd.participantId() < 1)
|
||||
if (dpd.participantId < 1)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "no dynamic pdata yet for pId " << pId;
|
||||
setReady(false);
|
||||
@@ -159,10 +161,10 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd
|
||||
|
||||
enaDisa();
|
||||
|
||||
if (m_participant.id() <= 0)
|
||||
if (m_participant.id <= 0)
|
||||
setReady(false);
|
||||
|
||||
if (m_missionPlanId > 0 && m_session->partitionTime() > m_missionPlan.missionStart() && !asCopy)
|
||||
if (m_missionPlanId > 0 && m_session->partitionTime() > m_missionPlan.missionStart && !asCopy)
|
||||
{
|
||||
enableUiElements(false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setEnabled(false);
|
||||
@@ -183,7 +185,7 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd
|
||||
|
||||
void MissionPlanEdit::retranslate()
|
||||
{
|
||||
translate(m_ui, ((m_missionPlanId <= 0) ? QString() : QString::fromStdString(m_missionPlan.name())),
|
||||
translate(m_ui, ((m_missionPlanId <= 0) ? QString() : QString::fromStdString(m_missionPlan.name)),
|
||||
m_missionPlanId <= 0, tr("UAS-Waypoints"));
|
||||
}
|
||||
|
||||
@@ -198,14 +200,14 @@ void MissionPlanEdit::setReady(bool isReady)
|
||||
void MissionPlanEdit::onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData& data,
|
||||
DataModification modType)
|
||||
{
|
||||
if (data.participantId() != m_participant.id() && data.participantId() != 0)
|
||||
if (data.participantId != m_participant.id && data.participantId != 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "### " << data.participantId() << " != " << m_participant.id() << " (" << (int)modType
|
||||
ERROR_LOG(m_logger) << "### " << data.participantId << " != " << m_participant.id << " (" << (int)modType
|
||||
<< ")";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "### " << data.participantId() << " == " << m_participant.id() << " (" << (int)modType
|
||||
DEBUG_LOG(m_logger) << "### " << data.participantId << " == " << m_participant.id << " (" << (int)modType
|
||||
<< ") !!!";
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
@@ -213,48 +215,48 @@ void MissionPlanEdit::onDynamicParticipantDataChanged(const ParticipantManagemen
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.stateHistory().empty())
|
||||
if (data.stateHistory.empty())
|
||||
{
|
||||
setReady(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& history = data.stateHistory();
|
||||
const auto& history = data.stateHistory;
|
||||
|
||||
auto lastState = m_ppmDtc->youngestStateInformation(history);
|
||||
decltype(lastState) youngestState;
|
||||
youngestState.stateTime(0);
|
||||
youngestState.stateTime = 0;
|
||||
for (const auto& si : history)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "StateInformation "
|
||||
<< " time=" << si.stateTime() << " vulnerabilityBits=" << si.vulnerabilityBits()
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId();
|
||||
if (youngestState.stateTime() < si.stateTime())
|
||||
<< " time=" << si.stateTime << " vulnerabilityBits=" << si.vulnerabilityBits
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId;
|
||||
if (youngestState.stateTime < si.stateTime)
|
||||
youngestState = si;
|
||||
}
|
||||
|
||||
setReady(youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
setReady(youngestState.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
}
|
||||
|
||||
void MissionPlanEdit::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data,
|
||||
const DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
if (data.id() != m_missionPlanId)
|
||||
if (data.id != m_missionPlanId)
|
||||
{
|
||||
|
||||
if (static_cast<int>(data.items().size()) != data.itemsFulfilled())
|
||||
if (static_cast<int>(data.items.size()) != data.itemsFulfilled)
|
||||
return;
|
||||
if (m_usedUasSet.contains(data.participantId()))
|
||||
if (m_usedUasSet.contains(data.participantId))
|
||||
{
|
||||
m_usedUasSet.remove(data.participantId());
|
||||
m_usedUasSet.remove(data.participantId);
|
||||
fillParticipants();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
if (m_session->partitionTime() > m_missionPlan.missionStart() && !m_missionPlan.aborted())
|
||||
if (m_session->partitionTime() > m_missionPlan.missionStart && !m_missionPlan.aborted)
|
||||
enabled = false;
|
||||
else
|
||||
enabled = true;
|
||||
@@ -264,7 +266,7 @@ void MissionPlanEdit::onMissionPlanChanged(const ParticipantManagement::MissionP
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setEnabled(enabled);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Apply)->setEnabled(enabled);
|
||||
|
||||
if (static_cast<int>(data.items().size()) == data.itemsFulfilled() && m_usedUasSet.remove(data.participantId()))
|
||||
if (static_cast<int>(data.items.size()) == data.itemsFulfilled && m_usedUasSet.remove(data.participantId))
|
||||
fillParticipants();
|
||||
}
|
||||
|
||||
@@ -314,21 +316,21 @@ bool MissionPlanEdit::apply()
|
||||
ParticipantManagement::UAS uasP =
|
||||
m_ppmDtc->getUasByParticipantId(m_ui->participantCBox->currentData().toInt(), m_session->exerciseId());
|
||||
|
||||
if (uasP.uasState() == ProjectDataManagement::UasState::Manual &&
|
||||
uasP.participantId() != m_missionPlan.participantId())
|
||||
if (uasP.uasState == ProjectDataManagement::UasState::UasState_Manual &&
|
||||
uasP.participantId != m_missionPlan.participantId)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Waypoints can't be saved!: Uas switched to %1-Mode")
|
||||
.arg(ProjectDataManagement::toString(uasP.uasState())));
|
||||
.arg(ProjectDataManagement::toString(uasP.uasState)));
|
||||
return false;
|
||||
}
|
||||
ParticipantManagement::ModifyMissionPlanRequest req;
|
||||
req.id(m_missionPlanId);
|
||||
req.missionStart(m_ui->dteStartTime->msecsSinceEpoch());
|
||||
req.participantId(m_ui->participantCBox->currentData().toInt());
|
||||
req.jumpToStart(false);
|
||||
req.repeat(false);
|
||||
req.name(m_ui->nameLineEdit->text().toStdString());
|
||||
req.items(itemsRequestContent());
|
||||
req.id = m_missionPlanId;
|
||||
req.missionStart = m_ui->dteStartTime->msecsSinceEpoch();
|
||||
req.participantId = m_ui->participantCBox->currentData().toInt();
|
||||
req.jumpToStart = false;
|
||||
req.repeat = false;
|
||||
req.name = m_ui->nameLineEdit->text().toStdString();
|
||||
req.items = itemsRequestContent();
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, req]() { return m_ppmFtc->modifyMissionPlanRequest(req, this); });
|
||||
}
|
||||
@@ -476,43 +478,43 @@ const std::vector<ParticipantManagement::MissionItem> MissionPlanEdit::itemsRequ
|
||||
|
||||
{
|
||||
ParticipantManagement::MissionAction actionMoveTo;
|
||||
actionMoveTo.actionType(ParticipantManagement::MissionActionType::MoveTo);
|
||||
actionMoveTo.duration(0);
|
||||
actionMoveTo.actionNumber(actionNumber++);
|
||||
actionMoveTo.name(msaName.toStdString());
|
||||
actionMoveTo.itemNumber(itemNumber);
|
||||
actionMoveTo.planId(m_missionPlan.id());
|
||||
actionMoveTo.actionType = ParticipantManagement::MissionActionType::MoveTo;
|
||||
actionMoveTo.duration = 0;
|
||||
actionMoveTo.actionNumber = actionNumber++;
|
||||
actionMoveTo.name = msaName.toStdString();
|
||||
actionMoveTo.itemNumber = itemNumber;
|
||||
actionMoveTo.planId = m_missionPlan.id;
|
||||
|
||||
QJsonObject jsoMoveTo;
|
||||
jsoMoveTo.insert(QStringLiteral("location_x"), point.x());
|
||||
jsoMoveTo.insert(QStringLiteral("location_y"), point.y());
|
||||
jsoMoveTo.insert(QStringLiteral("location_z"), altitude);
|
||||
const QString props = QString::fromUtf8(QJsonDocument(jsoMoveTo).toJson(QJsonDocument::Compact));
|
||||
actionMoveTo.properties(props.toStdString());
|
||||
msi.actions().push_back(actionMoveTo);
|
||||
actionMoveTo.properties = props.toStdString();
|
||||
msi.actions.push_back(actionMoveTo);
|
||||
}
|
||||
|
||||
if (idleTime > 0)
|
||||
{
|
||||
ParticipantManagement::MissionAction actionLoiter;
|
||||
actionLoiter.actionType(ParticipantManagement::MissionActionType::Loiter);
|
||||
actionLoiter.duration(idleTime);
|
||||
actionLoiter.actionNumber(actionNumber++);
|
||||
actionLoiter.itemNumber(itemNumber);
|
||||
actionLoiter.name(msaName.toStdString());
|
||||
actionLoiter.planId(m_missionPlan.id());
|
||||
msi.actions().push_back(actionLoiter);
|
||||
actionLoiter.actionType = ParticipantManagement::MissionActionType::Loiter;
|
||||
actionLoiter.duration = idleTime;
|
||||
actionLoiter.actionNumber = actionNumber++;
|
||||
actionLoiter.itemNumber = itemNumber;
|
||||
actionLoiter.name = msaName.toStdString();
|
||||
actionLoiter.planId = m_missionPlan.id;
|
||||
msi.actions.push_back(actionLoiter);
|
||||
}
|
||||
|
||||
if (chargeTypeId > 0)
|
||||
{
|
||||
ParticipantManagement::MissionAction actionAttack;
|
||||
actionAttack.actionType(ParticipantManagement::MissionActionType::Attack);
|
||||
actionAttack.duration(idleTime);
|
||||
actionAttack.actionNumber(actionNumber++);
|
||||
actionAttack.itemNumber(itemNumber);
|
||||
actionAttack.name(msaName.toStdString());
|
||||
actionAttack.planId(m_missionPlan.id());
|
||||
actionAttack.actionType = ParticipantManagement::MissionActionType::Attack;
|
||||
actionAttack.duration = idleTime;
|
||||
actionAttack.actionNumber = actionNumber++;
|
||||
actionAttack.itemNumber = itemNumber;
|
||||
actionAttack.name = msaName.toStdString();
|
||||
actionAttack.planId = m_missionPlan.id;
|
||||
|
||||
QJsonObject jsoAttack;
|
||||
jsoAttack.insert(QStringLiteral("location_x"), point.x());
|
||||
@@ -520,14 +522,14 @@ const std::vector<ParticipantManagement::MissionItem> MissionPlanEdit::itemsRequ
|
||||
jsoAttack.insert(QStringLiteral("location_z"), 0);
|
||||
jsoAttack.insert(QStringLiteral("chargeTypeId"), chargeTypeId);
|
||||
const QString props = QString::fromUtf8(QJsonDocument(jsoAttack).toJson(QJsonDocument::Compact));
|
||||
actionAttack.properties(props.toStdString());
|
||||
actionAttack.properties = props.toStdString();
|
||||
|
||||
msi.actions().push_back(actionAttack);
|
||||
msi.actions.push_back(actionAttack);
|
||||
}
|
||||
|
||||
msi.itemNumber(itemNumber++);
|
||||
msi.location(geoPos);
|
||||
msi.name(msiName.toStdString());
|
||||
msi.itemNumber = itemNumber++;
|
||||
msi.location = geoPos;
|
||||
msi.name = msiName.toStdString();
|
||||
missionItems.push_back(msi);
|
||||
}
|
||||
|
||||
@@ -542,13 +544,13 @@ void MissionPlanEdit::setUASCharges()
|
||||
for (const ProjectDataManagement::ChargeType& chargeType : std::as_const(chargesForGearClass))
|
||||
{
|
||||
|
||||
if (!m_pdmDtc->isUasDroppable(chargeType.id(), 0, 0))
|
||||
if (!m_pdmDtc->isUasDroppable(chargeType.id, 0, 0))
|
||||
continue;
|
||||
DEBUG_LOG(m_logger) << " fillCharges"
|
||||
<< ", id=" << chargeType.id() << ", name= " << chargeType.name();
|
||||
<< ", id=" << chargeType.id << ", name= " << chargeType.name;
|
||||
|
||||
m_ui->chargesCBox->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
|
||||
m_uasCharges.insert(chargeType.id(), QString::fromStdString(chargeType.name()));
|
||||
m_ui->chargesCBox->addItem(QString::fromStdString(chargeType.name), chargeType.id);
|
||||
m_uasCharges.insert(chargeType.id, QString::fromStdString(chargeType.name));
|
||||
}
|
||||
m_ui->chargesCBox->setCurrentIndex(0);
|
||||
}
|
||||
@@ -561,37 +563,37 @@ void MissionPlanEdit::setData(int mpId)
|
||||
return;
|
||||
|
||||
m_missionPlan = m_ppmDtc->missionPlan(mpId);
|
||||
m_participantData = m_ppmDtc->participant(m_missionPlan.participantId());
|
||||
m_participantData = m_ppmDtc->participant(m_missionPlan.participantId);
|
||||
m_ui->dteStartTime->setMinimumTimeMSec(m_session->partitionTime());
|
||||
m_ui->dteStartTime->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); });
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(m_missionPlan.missionStart());
|
||||
m_ui->nameLineEdit->setText(QString::fromStdString(m_missionPlan.name()));
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(m_missionPlan.missionStart);
|
||||
m_ui->nameLineEdit->setText(QString::fromStdString(m_missionPlan.name));
|
||||
|
||||
if (m_participantData.partyId() > 0)
|
||||
if (m_participantData.partyId > 0)
|
||||
{
|
||||
const int partyIdx = m_ui->cbParty->findData(QVariant::fromValue(m_participantData.partyId()));
|
||||
const int partyIdx = m_ui->cbParty->findData(QVariant::fromValue(m_participantData.partyId));
|
||||
m_ui->cbParty->setCurrentIndex(partyIdx);
|
||||
|
||||
const int ppIdx = m_ui->participantCBox->findData(QVariant::fromValue(m_missionPlan.participantId()));
|
||||
const int ppIdx = m_ui->participantCBox->findData(QVariant::fromValue(m_missionPlan.participantId));
|
||||
m_ui->participantCBox->setCurrentIndex(ppIdx);
|
||||
}
|
||||
|
||||
for (const auto& item : std::as_const(m_missionPlan.items()))
|
||||
for (const auto& item : std::as_const(m_missionPlan.items))
|
||||
{
|
||||
const std::vector<ParticipantManagement::MissionAction>& msaVec = item.actions();
|
||||
const std::vector<ParticipantManagement::MissionAction>& msaVec = item.actions;
|
||||
WayPointParam wpp;
|
||||
wpp.identifier = QString::fromStdString(item.name());
|
||||
wpp.lat = item.location().lat();
|
||||
wpp.lon = item.location().lon();
|
||||
wpp.z = item.location().z();
|
||||
wpp.identifier = QString::fromStdString(item.name);
|
||||
wpp.lat = item.location.lat;
|
||||
wpp.lon = item.location.lon;
|
||||
wpp.z = item.location.z;
|
||||
for (auto const& msa : msaVec)
|
||||
{
|
||||
if (msa.actionType() == ParticipantManagement::MissionActionType::Loiter)
|
||||
wpp.idleTime = msa.duration();
|
||||
if (msa.actionType == ParticipantManagement::MissionActionType::Loiter)
|
||||
wpp.idleTime = msa.duration;
|
||||
|
||||
if (msa.actionType() == ParticipantManagement::MissionActionType::Attack)
|
||||
if (msa.actionType == ParticipantManagement::MissionActionType::Attack)
|
||||
{
|
||||
const QJsonObject& obj = QJsonDocument::fromJson(QByteArray::fromStdString(msa.properties())).object();
|
||||
const QJsonObject& obj = QJsonDocument::fromJson(QByteArray::fromStdString(msa.properties)).object();
|
||||
wpp.chargeTypeId = obj.value(QLatin1String("chargeTypeId")).toInt();
|
||||
}
|
||||
}
|
||||
@@ -618,17 +620,17 @@ void MissionPlanEdit::fillParticipants()
|
||||
m_ui->participantCBox->clear();
|
||||
for (const auto& participant : participants)
|
||||
{
|
||||
QString uasString = QStringLiteral("%1 (%2)").arg(m_ppmDtc->hierarchyFromParticipant(participant.id()));
|
||||
if (uasString.isEmpty() || m_usedUasSet.contains(participant.id()))
|
||||
QString uasString = QStringLiteral("%1 (%2)").arg(m_ppmDtc->hierarchyFromParticipant(participant.id));
|
||||
if (uasString.isEmpty() || m_usedUasSet.contains(participant.id))
|
||||
continue;
|
||||
const ParticipantManagement::UAS& uasP =
|
||||
m_ppmDtc->getUasByParticipantId(participant.id(), m_session->exerciseId());
|
||||
uasString = uasString.arg(ProjectDataManagement::toString(uasP.uasState()));
|
||||
m_ui->participantCBox->addItem(uasString, participant.id());
|
||||
m_ppmDtc->getUasByParticipantId(participant.id, m_session->exerciseId());
|
||||
uasString = uasString.arg(ProjectDataManagement::toString(uasP.uasState));
|
||||
m_ui->participantCBox->addItem(uasString, participant.id);
|
||||
}
|
||||
if (m_missionPlan.id() > 0)
|
||||
if (m_missionPlan.id > 0)
|
||||
m_ui->participantCBox->setCurrentIndex(
|
||||
m_ui->participantCBox->findData(QVariant::fromValue(m_missionPlan.participantId())));
|
||||
m_ui->participantCBox->findData(QVariant::fromValue(m_missionPlan.participantId)));
|
||||
|
||||
if (m_ui->participantCBox->currentIndex() < 0)
|
||||
m_ui->participantCBox->setCurrentIndex(0);
|
||||
@@ -637,13 +639,13 @@ void MissionPlanEdit::fillParticipants()
|
||||
void MissionPlanEdit::gatherUASParticipants(int partyId, QVector<ParticipantManagement::Participant>& participant)
|
||||
{
|
||||
auto cb = [this, &partyId, &participant](const ParticipantManagement::Participant& p) {
|
||||
if (p.isDeleted() || p.partyId() != partyId)
|
||||
if (p.isDeleted || p.partyId != partyId)
|
||||
return;
|
||||
const ParticipantManagement::ParticipantData& ppData = m_ppmDtc->convertParticipantToParticipantData(p);
|
||||
const ParticipantManagement::Type&& ppType = m_ppmDtc->type(ppData.typeId());
|
||||
const ParticipantManagement::Type&& ppType = m_ppmDtc->type(ppData.typeId);
|
||||
const QJsonObject typeProperties(
|
||||
QJsonDocument::fromJson(QByteArray::fromStdString(ppType.properties())).object());
|
||||
if (typeProperties.isEmpty() || ppType.typeClass() != ParticipantManagement::TypeClass::Aircraft ||
|
||||
QJsonDocument::fromJson(QByteArray::fromStdString(ppType.properties)).object());
|
||||
if (typeProperties.isEmpty() || ppType.typeClass != ParticipantManagement::TypeClass::Aircraft ||
|
||||
!typeProperties[QStringLiteral("isUAS")].toBool(false))
|
||||
return;
|
||||
|
||||
|
||||
+1
@@ -15,6 +15,7 @@
|
||||
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <CentralEffectSimulation/ces_dtc.h>
|
||||
#include <LtsWidgets/lts_date_time_edit.h>
|
||||
|
||||
+20
-19
@@ -15,6 +15,7 @@ MissionPlanModel::MissionPlanModel(QObject* parent)
|
||||
tr("UAS State"), tr("Current Mission"), tr("Aborted")},
|
||||
parent),
|
||||
m_ppmDtc(nullptr)
|
||||
, m_logger(getLogger("MissionPlanModel"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -28,34 +29,34 @@ QVariant MissionPlanModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
|
||||
case Columns::Name:
|
||||
return QString::fromStdString(mp.name());
|
||||
return QString::fromStdString(mp.name);
|
||||
case Columns::MissionStart:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.missionStart());
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.missionStart);
|
||||
case Columns::Fulfilled:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.fulfilled());
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.fulfilled);
|
||||
case Columns::ItemsCountAndFulfilled: {
|
||||
int actionsFulfilled = 0;
|
||||
int actionsCount = 0;
|
||||
for (const auto& item : mp.items())
|
||||
for (const auto& item : mp.items)
|
||||
{
|
||||
actionsFulfilled += item.actionsFulfilled();
|
||||
actionsCount += item.actions().size();
|
||||
actionsFulfilled += item.actionsFulfilled;
|
||||
actionsCount += item.actions.size();
|
||||
}
|
||||
return QStringLiteral("%1/%2").arg(actionsFulfilled).arg(actionsCount);
|
||||
}
|
||||
case Columns::Participant: {
|
||||
const auto& participant = m_ppmDtc->participant(mp.participantId());
|
||||
return QString::number(mp.participantId());
|
||||
const auto& participant = m_ppmDtc->participant(mp.participantId);
|
||||
return QString::number(mp.participantId);
|
||||
}
|
||||
case Columns::UasState: {
|
||||
const auto& uas = m_ppmDtc->getUasByParticipantId(mp.participantId(), m_exerciseId);
|
||||
return ProjectDataManagement::toString(uas.uasState());
|
||||
const auto& uas = m_ppmDtc->getUasByParticipantId(mp.participantId, m_exerciseId);
|
||||
return ProjectDataManagement::toString(uas.uasState);
|
||||
}
|
||||
case Columns::CurrentMission: {
|
||||
return currentJob2String(mp);
|
||||
}
|
||||
case Columns::Aborted: {
|
||||
return mp.aborted();
|
||||
return mp.aborted;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
@@ -90,20 +91,20 @@ bool MissionPlanModel::initModel(const std::shared_ptr<ParticipantManagement::In
|
||||
QString MissionPlanModel::currentJob2String(const ParticipantManagement::MissionPlan& missionPlan) const
|
||||
{
|
||||
|
||||
ParticipantManagement::MissionAction currAction = m_ppmDtc->currentMissionAction(missionPlan.id());
|
||||
if (currAction.planId() == 0 || static_cast<int>(missionPlan.items().size()) == missionPlan.itemsFulfilled())
|
||||
ParticipantManagement::MissionAction currAction = m_ppmDtc->currentMissionAction(missionPlan.id);
|
||||
if (currAction.planId == 0 || static_cast<int>(missionPlan.items.size()) == missionPlan.itemsFulfilled)
|
||||
return tr(" Mission Complete ");
|
||||
|
||||
switch (currAction.actionType().underlying())
|
||||
switch (currAction.actionType)
|
||||
{
|
||||
case ParticipantManagement::MissionActionType::MoveTo: {
|
||||
return tr("Move to WP %1").arg(currAction.itemNumber() + 1);
|
||||
return tr("Move to WP %1").arg(currAction.itemNumber + 1);
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Loiter: {
|
||||
return tr("WP %1: Loiter %2 sec.").arg(currAction.itemNumber() + 1).arg(currAction.duration());
|
||||
return tr("WP %1: Loiter %2 sec.").arg(currAction.itemNumber + 1).arg(currAction.duration);
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Attack: {
|
||||
return tr("WP %1: Drop Charge").arg(currAction.itemNumber() + 1);
|
||||
return tr("WP %1: Drop Charge").arg(currAction.itemNumber + 1);
|
||||
}
|
||||
default:
|
||||
return tr("Unknown");
|
||||
@@ -113,9 +114,9 @@ QString MissionPlanModel::currentJob2String(const ParticipantManagement::Mission
|
||||
void MissionPlanModel::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data,
|
||||
const DataModification modType)
|
||||
{
|
||||
const int id = data.id();
|
||||
const int id = data.id;
|
||||
int row = findRowForId(id);
|
||||
DEBUG_LOG(m_logger) << "MISSION PLAN CHANGED id ( " << data.id() << " ) " << modType;
|
||||
DEBUG_LOG(m_logger) << "MISSION PLAN CHANGED id ( " << data.id << " ) " << modType;
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eModified: {
|
||||
|
||||
+1
@@ -11,6 +11,7 @@
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include "logger.h"
|
||||
|
||||
Reference in new issue
Block a user