Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+328
-391
@@ -1,526 +1,463 @@
|
||||
|
||||
|
||||
|
||||
#include "participant_move_dialog.h"
|
||||
#include "ui_participant_move_dialog.h"
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <Common/LtsCoordTrans/lts_coord_widget.h>
|
||||
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <Plugins/CentralEffectSimulation/ces_data_plugin_interface.h>
|
||||
|
||||
#include "logger.h"
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <FileManagement/flm_translation.h>
|
||||
#include "ui_participant_move_dialog.h"
|
||||
|
||||
#include <Common/LtsCoordTrans/lts_coord_widget.h>
|
||||
#include <FileManagement/flm_translation.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <Plugins/CentralEffectSimulation/ces_data_plugin_interface.h>
|
||||
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
||||
namespace CentralEffectSimulation
|
||||
{
|
||||
static constexpr double s_msConversion = 3.6;
|
||||
static constexpr int s_timeMilliConversion = 1000;
|
||||
static constexpr double s_msConversion = 3.6;
|
||||
static constexpr int s_timeMilliConversion = 1000;
|
||||
|
||||
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())
|
||||
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_ui->setupUi(this);
|
||||
m_ui->cbJump->hide();
|
||||
m_ui->label_5->hide();
|
||||
m_ui->spSpeed->setValue(30);
|
||||
m_ui->lePrefix->setText(tr("Waypoint"));
|
||||
m_uiRequirements->addRequirement({m_ui->lblMoveStart, [this]() { return hasValidEffectStart(m_ui->dteStartTime); }, tr("Begin time is smaller than current time")});
|
||||
connect (this, &ParticipantMoveDialog::signalFocused, this, &ParticipantMoveDialog::onFocus);
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Move_Participant_0"));
|
||||
}
|
||||
|
||||
m_ui->setupUi(this);
|
||||
m_ui->cbJump->hide();
|
||||
m_ui->label_5->hide();
|
||||
m_ui->spSpeed->setValue(30);
|
||||
m_ui->lePrefix->setText(tr("Waypoint"));
|
||||
m_uiRequirements->addRequirement({m_ui->lblMoveStart, [this]() { return hasValidEffectStart(m_ui->dteStartTime); },
|
||||
tr("Begin time is smaller than current time")});
|
||||
connect(this, &ParticipantMoveDialog::signalFocused, this, &ParticipantMoveDialog::onFocus);
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Move_Participant_0"));
|
||||
}
|
||||
|
||||
ParticipantMoveDialog::~ParticipantMoveDialog()
|
||||
{
|
||||
m_sitMapGuiIfc = nullptr;
|
||||
delete m_ui;
|
||||
emit closeDialog(m_participantData.id());
|
||||
}
|
||||
|
||||
m_sitMapGuiIfc = nullptr;
|
||||
delete m_ui;
|
||||
emit closeDialog(m_participantData.id());
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::enableUiElements(bool enable)
|
||||
{
|
||||
m_ui->pbPosition->setEnabled(enable);
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
}
|
||||
m_ui->pbPosition->setEnabled(enable);
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
}
|
||||
|
||||
|
||||
bool ParticipantMoveDialog::init(LtsSession::LtsSessionDataDds *session,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
|
||||
const std::shared_ptr<CentralEffectSimulation::Interface::Dtc> &cesDtc,
|
||||
const ParticipantManagement::ParticipantData &data)
|
||||
bool ParticipantMoveDialog::init(LtsSession::LtsSessionDataDds* session,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc>& ppmDtc,
|
||||
const std::shared_ptr<CentralEffectSimulation::Interface::Dtc>& cesDtc,
|
||||
const ParticipantManagement::ParticipantData& data)
|
||||
{
|
||||
m_session = session;
|
||||
m_participantData = data;
|
||||
m_cesDtc = cesDtc;
|
||||
m_session = session;
|
||||
m_participantData = data;
|
||||
m_cesDtc = cesDtc;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (!m_session->getFtc<CentralEffectSimulation::DataInterface>(m_ftc))
|
||||
return false;
|
||||
|
||||
if (!m_session->getFtc<CentralEffectSimulation::DataInterface>(m_ftc))
|
||||
return false;
|
||||
m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc);
|
||||
|
||||
m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc);
|
||||
|
||||
if (m_sitMapGuiIfc)
|
||||
{
|
||||
connect(m_ui->pbPosition, &QPushButton::clicked, this, &ParticipantMoveDialog::onGetPolyline);
|
||||
connect(m_ui->pbClear, &QPushButton::clicked, this, &ParticipantMoveDialog::clearCoordinates);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->pbPosition->setEnabled(false);
|
||||
m_ui->pbClear->setEnabled(false);
|
||||
}
|
||||
|
||||
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->lbParty->setText(partyStr);
|
||||
QString typeStr = ParticipantManagement::trTypeName(ppmDtc->type(m_participantData.typeId()).name());
|
||||
m_ui->lbType->setText(typeStr);
|
||||
|
||||
|
||||
enableUiElements(true);
|
||||
|
||||
initTableHeader();
|
||||
|
||||
connect(cesDtc.get(), &CentralEffectSimulation::Interface::Dtc::simulatedMovementChanged,
|
||||
this, &ParticipantMoveDialog::onSimulatedMovementChanged);
|
||||
|
||||
|
||||
{
|
||||
auto sm = [this](const CentralEffectSimulation::SimulatedMovement & sme)
|
||||
if (m_sitMapGuiIfc)
|
||||
{
|
||||
onSimulatedMovementChanged(sme, DataModification::eAdded);
|
||||
};
|
||||
if (!m_cesDtc->simulatedMovements(sm))
|
||||
return false;
|
||||
}
|
||||
connect(m_ui->pbPosition, &QPushButton::clicked, this, &ParticipantMoveDialog::onGetPolyline);
|
||||
connect(m_ui->pbClear, &QPushButton::clicked, this, &ParticipantMoveDialog::clearCoordinates);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->pbPosition->setEnabled(false);
|
||||
m_ui->pbClear->setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
m_buttonBox->connectLibraryButton(this,
|
||||
&ParticipantMoveDialog::onImportButtonClicked,
|
||||
&ParticipantMoveDialog::onExportButtonClicked);
|
||||
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->lbParty->setText(partyStr);
|
||||
QString typeStr = ParticipantManagement::trTypeName(ppmDtc->type(m_participantData.typeId()).name());
|
||||
m_ui->lbType->setText(typeStr);
|
||||
|
||||
if (!m_session->getForeignGuiInterface<FileManagement::ForeignGuiInterface>(m_flmGui))
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Library, false);
|
||||
enableUiElements(true);
|
||||
|
||||
return true;
|
||||
initTableHeader();
|
||||
|
||||
}
|
||||
connect(cesDtc.get(), &CentralEffectSimulation::Interface::Dtc::simulatedMovementChanged, this,
|
||||
&ParticipantMoveDialog::onSimulatedMovementChanged);
|
||||
|
||||
void ParticipantMoveDialog::onSimulatedMovementChanged(const CentralEffectSimulation::SimulatedMovement &data, DataModification modType)
|
||||
{
|
||||
auto sm = [this](const CentralEffectSimulation::SimulatedMovement& sme) {
|
||||
onSimulatedMovementChanged(sme, DataModification::eAdded);
|
||||
};
|
||||
if (!m_cesDtc->simulatedMovements(sm))
|
||||
return false;
|
||||
}
|
||||
|
||||
m_buttonBox->connectLibraryButton(this, &ParticipantMoveDialog::onImportButtonClicked,
|
||||
&ParticipantMoveDialog::onExportButtonClicked);
|
||||
|
||||
if (!m_session->getForeignGuiInterface<FileManagement::ForeignGuiInterface>(m_flmGui))
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Library, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onSimulatedMovementChanged(const CentralEffectSimulation::SimulatedMovement& data,
|
||||
DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved || m_participantData.id() != data.participantId())
|
||||
return;
|
||||
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_polyline.clear();
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
if (this->amIFocused())
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
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_polyline.clear();
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
if (this->amIFocused())
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::showPreview(bool show)
|
||||
{
|
||||
if (m_sitMapGuiIfc)
|
||||
{
|
||||
if (show)
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
else
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
if (m_sitMapGuiIfc)
|
||||
{
|
||||
if (show)
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
else
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ParticipantMoveDialog::onSimulatedMovementRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
void ParticipantMoveDialog::onSimulatedMovementRemoveReply(const Core::FunctionReplyObject& replyObject)
|
||||
{
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
if (!replyObject.error())
|
||||
{
|
||||
m_sitMapGuiIfc->cancelActiveRubberbands();
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
if (!replyObject.error())
|
||||
{
|
||||
m_sitMapGuiIfc->cancelActiveRubberbands();
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onSimulatedMovementModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
void ParticipantMoveDialog::onSimulatedMovementModifyReply(const Core::FunctionReplyObject& replyObject)
|
||||
{
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
if (!replyObject.error())
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
if (!replyObject.error())
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, QString::fromStdString(m_participantData.tacticalIdentifier()), false, tr("Waypoints"));
|
||||
DEBUG_LOG(m_logger) << "retranslate";
|
||||
translate(m_ui, QString::fromStdString(m_participantData.tacticalIdentifier()), false, tr("Waypoints"));
|
||||
DEBUG_LOG(m_logger) << "retranslate";
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::initTableHeader()
|
||||
{
|
||||
QStringList headers;
|
||||
headers << tr("Identifier") << tr("Idle Time [s]") << tr("Speed [km/h]") << tr("Position");
|
||||
m_ui->tableWidget->setHorizontalHeaderLabels(headers);
|
||||
m_ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
QStringList headers;
|
||||
headers << tr("Identifier") << tr("Idle Time [s]") << tr("Speed [km/h]") << tr("Position");
|
||||
m_ui->tableWidget->setHorizontalHeaderLabels(headers);
|
||||
m_ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
}
|
||||
|
||||
|
||||
void ParticipantMoveDialog::insertPos(const double lon, const double lat, const QString &identifier, const int idleTime, const double speed)
|
||||
void ParticipantMoveDialog::insertPos(const double lon, const double lat, const QString& identifier, const int idleTime,
|
||||
const double speed)
|
||||
{
|
||||
QLineEdit *le = new QLineEdit;
|
||||
QSpinBox *sbDelay = new QSpinBox;
|
||||
QSpinBox *sbSpeed = new QSpinBox;
|
||||
sbDelay->setMinimum(m_ui->spIdleTime->minimum());
|
||||
sbDelay->setMaximum(m_ui->spIdleTime->maximum());
|
||||
sbSpeed->setMinimum(m_ui->spSpeed->minimum());
|
||||
sbSpeed->setMaximum(m_ui->spSpeed->maximum());
|
||||
int rowCount = m_ui->tableWidget->rowCount();
|
||||
QLineEdit* le = new QLineEdit;
|
||||
QSpinBox* sbDelay = new QSpinBox;
|
||||
QSpinBox* sbSpeed = new QSpinBox;
|
||||
sbDelay->setMinimum(m_ui->spIdleTime->minimum());
|
||||
sbDelay->setMaximum(m_ui->spIdleTime->maximum());
|
||||
sbSpeed->setMinimum(m_ui->spSpeed->minimum());
|
||||
sbSpeed->setMaximum(m_ui->spSpeed->maximum());
|
||||
int rowCount = m_ui->tableWidget->rowCount();
|
||||
|
||||
LtsCoordWidget::LtsCoordWidget *wdg = new LtsCoordWidget::LtsCoordWidget();
|
||||
|
||||
wdg->setCoordinate(lon, lat);
|
||||
wdg->setObjectName(QStringLiteral("positionEdit_") + QString::number(rowCount));
|
||||
m_ui->tableWidget->insertRow(rowCount);
|
||||
le->setText(identifier);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Name, le);
|
||||
sbDelay->setValue(idleTime / s_timeMilliConversion);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, IdleTime, sbDelay);
|
||||
sbSpeed->setValue(speed * s_msConversion);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Speed, sbSpeed);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Position, wdg);
|
||||
wdg->setDisplayType(LtsCoordWidget::LtsCoordWidget::DisplayType::MGRS);
|
||||
LtsCoordWidget::LtsCoordWidget* wdg = new LtsCoordWidget::LtsCoordWidget();
|
||||
|
||||
wdg->setCoordinate(lon, lat);
|
||||
wdg->setObjectName(QStringLiteral("positionEdit_") + QString::number(rowCount));
|
||||
m_ui->tableWidget->insertRow(rowCount);
|
||||
le->setText(identifier);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Name, le);
|
||||
sbDelay->setValue(idleTime / s_timeMilliConversion);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, IdleTime, sbDelay);
|
||||
sbSpeed->setValue(speed * s_msConversion);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Speed, sbSpeed);
|
||||
m_ui->tableWidget->setCellWidget(rowCount, Position, wdg);
|
||||
wdg->setDisplayType(LtsCoordWidget::LtsCoordWidget::DisplayType::MGRS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ParticipantMoveDialog::clearContent()
|
||||
{
|
||||
m_ui->lePrefix->clear();
|
||||
m_ui->cbRepeat->setChecked(false);
|
||||
m_ui->cbJump->setChecked(false);
|
||||
m_ui->lePrefix->clear();
|
||||
m_ui->cbRepeat->setChecked(false);
|
||||
m_ui->cbJump->setChecked(false);
|
||||
|
||||
clearCoordinates();
|
||||
clearCoordinates();
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::clearCoordinates()
|
||||
{
|
||||
if (m_ui)
|
||||
{
|
||||
m_ui->tableWidget->clearContents();
|
||||
m_ui->tableWidget->setRowCount(0);
|
||||
}
|
||||
|
||||
if ( m_sitMapGuiIfc && this->amIFocused())
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
if (m_ui)
|
||||
{
|
||||
m_ui->tableWidget->clearContents();
|
||||
m_ui->tableWidget->setRowCount(0);
|
||||
}
|
||||
|
||||
if (m_sitMapGuiIfc && this->amIFocused())
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onFocus()
|
||||
{
|
||||
showPreview(true);
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
showPreview(true);
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_polyline, false);
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onGetPolyline()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
if (!m_sitMapGuiIfc)
|
||||
return;
|
||||
if (!m_sitMapGuiIfc)
|
||||
return;
|
||||
|
||||
if (m_sitMapGuiIfc->mapMode() != SituationMap::MapMode::MapMode_2D)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Only available in 2D mode"));
|
||||
return;
|
||||
}
|
||||
if (m_sitMapGuiIfc->mapMode() != SituationMap::MapMode::MapMode_2D)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Only available in 2D mode"));
|
||||
return;
|
||||
}
|
||||
|
||||
QPolygonF coordinates;
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
LtsCoordWidget::LtsCoordWidget *w = findChild<LtsCoordWidget::LtsCoordWidget *>(QStringLiteral("positionEdit_%1").arg(i));
|
||||
if (!w)
|
||||
break;
|
||||
if (!w->coordinate().isNull())
|
||||
coordinates << w->coordinate();
|
||||
++i;
|
||||
}
|
||||
QPolygonF coordinates;
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
LtsCoordWidget::LtsCoordWidget* w =
|
||||
findChild<LtsCoordWidget::LtsCoordWidget*>(QStringLiteral("positionEdit_%1").arg(i));
|
||||
if (!w)
|
||||
break;
|
||||
if (!w->coordinate().isNull())
|
||||
coordinates << w->coordinate();
|
||||
++i;
|
||||
}
|
||||
|
||||
m_sitMapGuiIfc->getPolyline(this,
|
||||
SLOT(onPolylineData(QPolygonF)),
|
||||
nullptr,
|
||||
2,
|
||||
11,
|
||||
-1,
|
||||
-1,
|
||||
coordinates);
|
||||
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 11, -1, -1, coordinates);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ParticipantMoveDialog::onPolylineData(const QPolygonF &polyline)
|
||||
void ParticipantMoveDialog::onPolylineData(const QPolygonF& polyline)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " numberOfPoints: " << polyline.size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " numberOfPoints: " << polyline.size();
|
||||
|
||||
if (polyline.size() < 2)
|
||||
return;
|
||||
if (polyline.size() < 2)
|
||||
return;
|
||||
|
||||
m_polyline = polyline;
|
||||
m_polyline = polyline;
|
||||
|
||||
clearCoordinates();
|
||||
for (int i = 0; i < polyline.size(); i++)
|
||||
insertPos(polyline.at(i).x(), polyline.at(i).y(),
|
||||
m_ui->lePrefix->text() + QLatin1Char('_') + QString::number(i + 1),
|
||||
m_ui->spIdleTime->value() * s_timeMilliConversion,
|
||||
m_ui->spSpeed->value() / s_msConversion);
|
||||
clearCoordinates();
|
||||
for (int i = 0; i < polyline.size(); i++)
|
||||
insertPos(polyline.at(i).x(), polyline.at(i).y(),
|
||||
m_ui->lePrefix->text() + QLatin1Char('_') + QString::number(i + 1),
|
||||
m_ui->spIdleTime->value() * s_timeMilliConversion, m_ui->spSpeed->value() / s_msConversion);
|
||||
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, polyline, false);
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, polyline, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool ParticipantMoveDialog::hasValidEffectStart(LtsWidgets::LtsDateTimeEdit *dte) const
|
||||
bool ParticipantMoveDialog::hasValidEffectStart(LtsWidgets::LtsDateTimeEdit* dte) const
|
||||
{
|
||||
|
||||
const bool bEmptyAllowed = dte->isCheckable();
|
||||
const auto ms = dte->msecsSinceEpoch();
|
||||
|
||||
if (bEmptyAllowed && ms == 0)
|
||||
return true;
|
||||
return ms > m_session->partitionTime();
|
||||
|
||||
const bool bEmptyAllowed = dte->isCheckable();
|
||||
const auto ms = dte->msecsSinceEpoch();
|
||||
|
||||
if (bEmptyAllowed && ms == 0)
|
||||
return true;
|
||||
return ms > m_session->partitionTime();
|
||||
}
|
||||
|
||||
SimulatedMovement ParticipantMoveDialog::requestContent() const
|
||||
{
|
||||
std::string name = m_ui->lePrefix->text().toStdString();
|
||||
int32_t repeat = m_ui->cbRepeat->isChecked();
|
||||
|
||||
int32_t jumpToStart = true;
|
||||
rti::core::int64 startTime = m_ui->dteStartTime->msecsSinceEpoch();
|
||||
int32_t participantId = m_participantData.id();
|
||||
int32_t nextPoint = 0;
|
||||
std::string name = m_ui->lePrefix->text().toStdString();
|
||||
int32_t repeat = m_ui->cbRepeat->isChecked();
|
||||
|
||||
int cntSegments = m_ui->tableWidget->rowCount();
|
||||
std::vector<CentralEffectSimulation::SimulatedMovementSegment> segments;
|
||||
segments.resize(cntSegments);
|
||||
for (int i = 0; i < cntSegments; i++)
|
||||
{
|
||||
QWidget *widget = m_ui->tableWidget->cellWidget(i, Name);
|
||||
const QString nameSeg = static_cast<QLineEdit *>(widget)->text();
|
||||
segments[i].name(nameSeg.toStdString());
|
||||
int32_t jumpToStart = true;
|
||||
rti::core::int64 startTime = m_ui->dteStartTime->msecsSinceEpoch();
|
||||
int32_t participantId = m_participantData.id();
|
||||
int32_t nextPoint = 0;
|
||||
|
||||
widget = m_ui->tableWidget->cellWidget(i, IdleTime);
|
||||
const int idleTime = static_cast<QSpinBox *>(widget)->value() * s_timeMilliConversion;
|
||||
segments[i].delay(idleTime);
|
||||
int cntSegments = m_ui->tableWidget->rowCount();
|
||||
std::vector<CentralEffectSimulation::SimulatedMovementSegment> segments;
|
||||
segments.resize(cntSegments);
|
||||
for (int i = 0; i < cntSegments; i++)
|
||||
{
|
||||
QWidget* widget = m_ui->tableWidget->cellWidget(i, Name);
|
||||
const QString nameSeg = static_cast<QLineEdit*>(widget)->text();
|
||||
segments[i].name(nameSeg.toStdString());
|
||||
|
||||
widget = m_ui->tableWidget->cellWidget(i, Speed);
|
||||
const double speed = static_cast<QSpinBox *>(widget)->value() / s_msConversion;
|
||||
widget = m_ui->tableWidget->cellWidget(i, IdleTime);
|
||||
const int idleTime = static_cast<QSpinBox*>(widget)->value() * s_timeMilliConversion;
|
||||
segments[i].delay(idleTime);
|
||||
|
||||
segments[i].speed(speed);
|
||||
widget = m_ui->tableWidget->cellWidget(i, Speed);
|
||||
const double speed = static_cast<QSpinBox*>(widget)->value() / s_msConversion;
|
||||
|
||||
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].speed(speed);
|
||||
|
||||
return SimulatedMovement(m_id,
|
||||
name,
|
||||
startTime,
|
||||
participantId,
|
||||
segments,
|
||||
repeat,
|
||||
jumpToStart,
|
||||
nextPoint
|
||||
);
|
||||
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);
|
||||
}
|
||||
|
||||
return SimulatedMovement(m_id, name, startTime, participantId, segments, repeat, jumpToStart, nextPoint);
|
||||
}
|
||||
|
||||
bool ParticipantMoveDialog::apply()
|
||||
{
|
||||
int cntSegments = m_ui->tableWidget->rowCount();
|
||||
if (cntSegments > 0)
|
||||
{
|
||||
const SimulatedMovement req = requestContent();
|
||||
|
||||
INFO_LOG(m_logger) << "--- onApplyMessage() ";
|
||||
|
||||
m_requestHelper->addRequest([this, req]()
|
||||
int cntSegments = m_ui->tableWidget->rowCount();
|
||||
if (cntSegments > 0)
|
||||
{
|
||||
return m_ftc->simulatedMovementModifyRequest(req, this);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_id > 0)
|
||||
{
|
||||
Core::RemoveElementRequest req(m_id);
|
||||
m_id = 0;
|
||||
const SimulatedMovement req = requestContent();
|
||||
|
||||
INFO_LOG(m_logger) << "--- onApplyMessage() ";
|
||||
INFO_LOG(m_logger) << "--- onApplyMessage() ";
|
||||
|
||||
m_requestHelper->addRequest([req, this]()
|
||||
{
|
||||
return m_ftc->simulatedMovementRemoveRequest(req, this);
|
||||
});
|
||||
m_requestHelper->addRequest([this, req]() { return m_ftc->simulatedMovementModifyRequest(req, this); });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_id > 0)
|
||||
{
|
||||
Core::RemoveElementRequest req(m_id);
|
||||
m_id = 0;
|
||||
|
||||
return m_requestHelper->startRequests();
|
||||
INFO_LOG(m_logger) << "--- onApplyMessage() ";
|
||||
|
||||
m_requestHelper->addRequest([req, this]() { return m_ftc->simulatedMovementRemoveRequest(req, this); });
|
||||
}
|
||||
}
|
||||
|
||||
return m_requestHelper->startRequests();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QByteArray ParticipantMoveDialog::simulatedMovementToJson() const
|
||||
{
|
||||
const SimulatedMovement req = requestContent();
|
||||
QJsonObject obj;
|
||||
obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::CESParticipantMove);
|
||||
const SimulatedMovement req = requestContent();
|
||||
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")] = req.startTime();
|
||||
|
||||
QJsonArray arr;
|
||||
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();
|
||||
arr += inner;
|
||||
}
|
||||
obj[QStringLiteral("segments")] = arr;
|
||||
QJsonArray arr;
|
||||
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();
|
||||
arr += inner;
|
||||
}
|
||||
obj[QStringLiteral("segments")] = arr;
|
||||
|
||||
QJsonDocument doc(obj);
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
QJsonDocument doc(obj);
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
SimulatedMovement ParticipantMoveDialog::jsonToSimulatedMovement(const QByteArray &content) const
|
||||
SimulatedMovement ParticipantMoveDialog::jsonToSimulatedMovement(const QByteArray& content) const
|
||||
{
|
||||
|
||||
CentralEffectSimulation::SimulatedMovement result;
|
||||
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());
|
||||
CentralEffectSimulation::SimulatedMovement result;
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(content));
|
||||
const QJsonObject obj(doc.object());
|
||||
|
||||
const QJsonArray arr(obj.value(QStringLiteral("segments")).toArray());
|
||||
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());
|
||||
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();
|
||||
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.position().lat(objArr[QStringLiteral("lat")].toDouble());
|
||||
segment.position().lon(objArr[QStringLiteral("lon")].toDouble());
|
||||
segment.speed(objArr[QStringLiteral("speed")].toDouble());
|
||||
}
|
||||
return result;
|
||||
segment.position().lat(objArr[QStringLiteral("lat")].toDouble());
|
||||
segment.position().lon(objArr[QStringLiteral("lon")].toDouble());
|
||||
segment.speed(objArr[QStringLiteral("speed")].toDouble());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onExportButtonClicked()
|
||||
{
|
||||
QJsonObject saveObject;
|
||||
saveObject[QStringLiteral("content")] = QString();
|
||||
QJsonObject saveObject;
|
||||
saveObject[QStringLiteral("content")] = QString();
|
||||
|
||||
const QByteArray byteArray = simulatedMovementToJson();
|
||||
const QByteArray byteArray = simulatedMovementToJson();
|
||||
|
||||
int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray);
|
||||
if (fileId > 0)
|
||||
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
|
||||
else
|
||||
ERROR_LOG(m_logger) << "Could not save file in library ";
|
||||
int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray);
|
||||
if (fileId > 0)
|
||||
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
|
||||
else
|
||||
ERROR_LOG(m_logger) << "Could not save file in library ";
|
||||
}
|
||||
|
||||
void ParticipantMoveDialog::onImportButtonClicked()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " onImportButtonClicked() ";
|
||||
DEBUG_LOG(m_logger) << " onImportButtonClicked() ";
|
||||
|
||||
QByteArray content;
|
||||
int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::CESParticipantMove));
|
||||
if (fileId > 0)
|
||||
{
|
||||
if (!m_flmGui->isXmlType(content, FileManagement::toString(FileManagement::XmlType::CESParticipantMove)))
|
||||
QByteArray content;
|
||||
int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(),
|
||||
FileManagement::toString(FileManagement::XmlType::CESParticipantMove));
|
||||
if (fileId > 0)
|
||||
{
|
||||
QHash<LtsWidgets::Button, QString> texts({{LtsWidgets::Button::Yes, tr("Ok")}});
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this,
|
||||
tr("Invalid xml file content"),
|
||||
windowTitle(),
|
||||
LtsWidgets::Behaviour::Modal,
|
||||
LtsWidgets::Button::Yes,
|
||||
texts);
|
||||
}
|
||||
else
|
||||
{
|
||||
SimulatedMovement req = jsonToSimulatedMovement(content);
|
||||
if (!m_flmGui->isXmlType(content, FileManagement::toString(FileManagement::XmlType::CESParticipantMove)))
|
||||
{
|
||||
QHash<LtsWidgets::Button, QString> texts({{LtsWidgets::Button::Yes, tr("Ok")}});
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Invalid xml file content"), windowTitle(),
|
||||
LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes, texts);
|
||||
}
|
||||
else
|
||||
{
|
||||
SimulatedMovement req = jsonToSimulatedMovement(content);
|
||||
|
||||
INFO_LOG(m_logger) << "--- onImportButtonClicked() ";
|
||||
INFO_LOG(m_logger) << "--- onImportButtonClicked() ";
|
||||
|
||||
m_requestHelper->addRequest([this, req]()
|
||||
{
|
||||
return m_ftc->simulatedMovementModifyRequest(req, this);
|
||||
});
|
||||
m_requestHelper->startRequests();
|
||||
m_requestHelper->addRequest([this, req]() { return m_ftc->simulatedMovementModifyRequest(req, this); });
|
||||
m_requestHelper->startRequests();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace CentralEffectSimulation
|
||||
Executable → Regular
+618
-667
File diff suppressed because it is too large.
Load diff
Executable → Regular
+40
-45
@@ -1,73 +1,68 @@
|
||||
|
||||
|
||||
|
||||
#include "participants_move_model.h"
|
||||
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
|
||||
|
||||
namespace CentralEffectSimulation
|
||||
{
|
||||
|
||||
ParticipantMoveModel::ParticipantMoveModel(QObject *parent,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc)
|
||||
: ParticipantManagement::ParticipantEditModel(parent, ppmDtc, asbIfc)
|
||||
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_titles += tr("Simulated");
|
||||
m_titles += tr("Simulated");
|
||||
|
||||
connect(m_dtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged,
|
||||
this, &ParticipantMoveModel::onParticipantChanged);
|
||||
connect(m_dtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged, this,
|
||||
&ParticipantMoveModel::onParticipantChanged);
|
||||
|
||||
DEBUG_LOG(m_logger) << "ParticipantMoveModel::ParticipantMoveModel";
|
||||
DEBUG_LOG(m_logger) << "ParticipantMoveModel::ParticipantMoveModel";
|
||||
}
|
||||
|
||||
|
||||
QVariant ParticipantMoveModel::data(const QModelIndex &index, int role) const
|
||||
QVariant ParticipantMoveModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
|
||||
if (role == Qt::DisplayRole && index.column() == columnCount() - 1)
|
||||
{
|
||||
bool bIsSimulated = false;
|
||||
if (!isSelectableBySimulation(index, &bIsSimulated))
|
||||
return QVariant();
|
||||
return bIsSimulated ? tr("Yes") : tr("No");
|
||||
}
|
||||
|
||||
return ParticipantManagement::ParticipantEditModel::data(index, role);
|
||||
if (role == Qt::DisplayRole && index.column() == columnCount() - 1)
|
||||
{
|
||||
bool bIsSimulated = false;
|
||||
if (!isSelectableBySimulation(index, &bIsSimulated))
|
||||
return QVariant();
|
||||
return bIsSimulated ? tr("Yes") : tr("No");
|
||||
}
|
||||
|
||||
return ParticipantManagement::ParticipantEditModel::data(index, role);
|
||||
}
|
||||
|
||||
void ParticipantMoveModel::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
|
||||
void ParticipantMoveModel::onParticipantChanged(const ParticipantManagement::Participant& data,
|
||||
DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
if (data.partyId() != m_partyId)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
|
||||
onReinitModel(partyId());
|
||||
emit newData();
|
||||
Q_UNUSED(modType)
|
||||
if (data.partyId() != m_partyId)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
|
||||
onReinitModel(partyId());
|
||||
emit newData();
|
||||
}
|
||||
|
||||
bool ParticipantMoveModel::isSelectableBySimulation(const QModelIndex &index, bool *bIsSimulated) const
|
||||
bool ParticipantMoveModel::isSelectableBySimulation(const QModelIndex& index, bool* bIsSimulated) const
|
||||
{
|
||||
bool isSimulatable = true;
|
||||
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
||||
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_def::Unit)
|
||||
isSimulatable = false;
|
||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
||||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::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()
|
||||
<< " isSimulatable=" << isSimulatable;
|
||||
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();
|
||||
if (bIsSimulated)
|
||||
*bIsSimulated = data.isSimulated();
|
||||
|
||||
return isSimulatable;
|
||||
return isSimulatable;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace CentralEffectSimulation
|
||||
Executable → Regular
+17
-21
@@ -1,36 +1,32 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <nglwidgets/ngltreeitem.h>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <QStringList>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include <ParticipantManagement/Gui/Common/participant_edit_model.h>
|
||||
#include "logger.h"
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <nglwidgets/ngltreeitem.h>
|
||||
|
||||
namespace CentralEffectSimulation
|
||||
{
|
||||
class ParticipantMoveModel final : public ParticipantManagement::ParticipantEditModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ParticipantMoveModel(QObject *parent,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc);
|
||||
Q_OBJECT
|
||||
public:
|
||||
ParticipantMoveModel(QObject* parent, const std::shared_ptr<ParticipantManagement::Interface::Dtc>& ppmDtc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface>& asbIfc);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
signals:
|
||||
void newData();
|
||||
signals:
|
||||
void newData();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType);
|
||||
bool isSelectableBySimulation(const QModelIndex &index, bool *bIsSimulated = nullptr) const;
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void onParticipantChanged(const ParticipantManagement::Participant& data, DataModification modType);
|
||||
bool isSelectableBySimulation(const QModelIndex& index, bool* bIsSimulated = nullptr) const;
|
||||
};
|
||||
}
|
||||
} // namespace CentralEffectSimulation
|
||||
Executable → Regular
+203
-215
@@ -1,334 +1,322 @@
|
||||
|
||||
|
||||
|
||||
#include <CentralEffectSimulation/ces_data_plugin_interface.h>
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <CentralEffectSimulation/ces_operator_rights.h>
|
||||
|
||||
#include "mission_plan_dialog.h"
|
||||
|
||||
#include "ui_mission_plan_dialog.h"
|
||||
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <CentralEffectSimulation/ces_data_plugin_interface.h>
|
||||
#include <CentralEffectSimulation/ces_operator_rights.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
|
||||
namespace CentralEffectSimulation
|
||||
{
|
||||
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)
|
||||
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_ui->setupUi(this);
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_updateMissionTimer.setSingleShot(true);
|
||||
m_updateMissionTimer.setInterval(500);
|
||||
connect(&m_updateMissionTimer, &QTimer::timeout, this, &MissionPlanDialog::enaDisa);
|
||||
m_updateMissionTimer.setSingleShot(true);
|
||||
m_updateMissionTimer.setInterval(500);
|
||||
connect(&m_updateMissionTimer, &QTimer::timeout, this, &MissionPlanDialog::enaDisa);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-UAS-Mission"));
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-UAS-Mission"));
|
||||
}
|
||||
|
||||
MissionPlanDialog::~MissionPlanDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool MissionPlanDialog::init(LtsSession::LtsSession *session)
|
||||
bool MissionPlanDialog::init(LtsSession::LtsSession* session)
|
||||
{
|
||||
m_session = session;
|
||||
m_session = session;
|
||||
|
||||
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get ppmDtc";
|
||||
return false;
|
||||
}
|
||||
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get ppmFtc";
|
||||
return false;
|
||||
}
|
||||
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get ppmDtc";
|
||||
return false;
|
||||
}
|
||||
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get ppmFtc";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ppmDtc->enableUnitPosition();
|
||||
m_ppmDtc->waitForHistoricalDataUnitPosition(1000);
|
||||
m_ppmDtc->enableUnitPosition();
|
||||
m_ppmDtc->waitForHistoricalDataUnitPosition(1000);
|
||||
|
||||
delete m_missionPlanModel;
|
||||
m_missionPlanModel = new MissionPlanModel(this);
|
||||
m_missionPlanModel->initModel(m_ppmDtc, m_session->exerciseId());
|
||||
|
||||
delete m_missionPlanModel;
|
||||
m_missionPlanModel = new MissionPlanModel(this);
|
||||
m_missionPlanModel->initModel(m_ppmDtc, m_session->exerciseId());
|
||||
m_missionPlanProxyModel = new MissionPlanProxyModel(this);
|
||||
m_missionPlanProxyModel->setSourceModel(m_missionPlanModel);
|
||||
m_ui->participantsDataView->setModel(m_missionPlanProxyModel);
|
||||
|
||||
m_missionPlanProxyModel = new MissionPlanProxyModel(this);
|
||||
m_missionPlanProxyModel->setSourceModel(m_missionPlanModel);
|
||||
m_ui->participantsDataView->setModel(m_missionPlanProxyModel);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Load, this, &MissionPlanDialog::onLockModifications);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Load)->setText(tr("Lock"));
|
||||
m_buttonBox->setIcon(LtsWidgets::DialogButton::Load, QIcon(QStringLiteral("icon:drone_remote_connection.svg")));
|
||||
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Load)->hide();
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Save, this, &MissionPlanDialog::onUnlockModifications);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Save)->setText(tr("Unlock"));
|
||||
m_buttonBox->setIcon(LtsWidgets::DialogButton::Save, QIcon(QStringLiteral("icon:drone_remote_connection.svg")));
|
||||
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Save)->hide();
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Load, this, &MissionPlanDialog::onLockModifications);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Load)->setText(tr("Lock"));
|
||||
m_buttonBox->setIcon(LtsWidgets::DialogButton::Load, QIcon(QStringLiteral("icon:drone_remote_connection.svg")));
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &MissionPlanDialog::onAddMissionPlan);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Load)->hide();
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &MissionPlanDialog::onEditMissionPlan);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Save, this, &MissionPlanDialog::onUnlockModifications);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Save)->setText(tr("Unlock"));
|
||||
m_buttonBox->setIcon(LtsWidgets::DialogButton::Save, QIcon(QStringLiteral("icon:drone_remote_connection.svg")));
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, this, &MissionPlanDialog::onRemoveMissionPlanClicked);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Save)->hide();
|
||||
|
||||
connect(m_ui->participantsDataView, &LtsDataView::LtsDataView::signalSelectionChanged, this, &MissionPlanDialog::enaDisa);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &MissionPlanDialog::onAddMissionPlan);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
|
||||
const bool &hasOperatorRightParticipantUAS = LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::ParticipantMove);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setVisible(hasOperatorRightParticipantUAS);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Add)->setVisible(hasOperatorRightParticipantUAS);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &MissionPlanDialog::onEditMissionPlan);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::missionPlanChanged,
|
||||
this, &MissionPlanDialog::onMissionPlanChanged);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, this, &MissionPlanDialog::onRemoveMissionPlanClicked);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
|
||||
connect(m_ui->participantsDataView, &LtsDataView::LtsDataView::doubleClicked, this, &MissionPlanDialog::onEditMissionPlan);
|
||||
connect(m_ui->participantsDataView, &LtsDataView::LtsDataView::signalSelectionChanged, this,
|
||||
&MissionPlanDialog::enaDisa);
|
||||
|
||||
return true;
|
||||
const bool& hasOperatorRightParticipantUAS =
|
||||
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::ParticipantMove);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setVisible(hasOperatorRightParticipantUAS);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Add)->setVisible(hasOperatorRightParticipantUAS);
|
||||
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::missionPlanChanged, this,
|
||||
&MissionPlanDialog::onMissionPlanChanged);
|
||||
|
||||
connect(m_ui->participantsDataView, &LtsDataView::LtsDataView::doubleClicked, this,
|
||||
&MissionPlanDialog::onEditMissionPlan);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onModifyMissionPlanReply(const Core::FunctionReplyObject &replyObject)
|
||||
void MissionPlanDialog::onModifyMissionPlanReply(const Core::FunctionReplyObject& replyObject)
|
||||
{
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onRemoveMissionPlanReply(const Core::FunctionReplyObject &replyObject)
|
||||
void MissionPlanDialog::onRemoveMissionPlanReply(const Core::FunctionReplyObject& replyObject)
|
||||
{
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("UAS Mission Plans"));
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setText(tr("Edit"));
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Remove)->setText(tr("Delete"));
|
||||
translate(m_ui, tr("UAS Mission Plans"));
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setText(tr("Edit"));
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Remove)->setText(tr("Delete"));
|
||||
}
|
||||
|
||||
bool MissionPlanDialog::removeMissionPlan(int32_t missionplanId)
|
||||
{
|
||||
if (missionplanId <= 0)
|
||||
return false;
|
||||
if (missionplanId <= 0)
|
||||
return false;
|
||||
|
||||
ParticipantManagement::RemoveMissionPlanRequest req(missionplanId);
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ppmFtc->removeMissionPlanRequest(req, this);
|
||||
});
|
||||
return m_requestHelper->startRequests();
|
||||
ParticipantManagement::RemoveMissionPlanRequest req(missionplanId);
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]() { return m_ppmFtc->removeMissionPlanRequest(req, this); });
|
||||
return m_requestHelper->startRequests();
|
||||
}
|
||||
|
||||
MissionPlanDialog::WayPointsStatus MissionPlanDialog::wayPointCurrentStatus(const ParticipantManagement::MissionPlan &mp) const
|
||||
MissionPlanDialog::WayPointsStatus
|
||||
MissionPlanDialog::wayPointCurrentStatus(const ParticipantManagement::MissionPlan& mp) const
|
||||
{
|
||||
WayPointsStatus state = WayPointsStatus::Undefined;
|
||||
|
||||
if (mp.missionStart() > m_session->partitionTime())
|
||||
return WayPointsStatus::Prepared;
|
||||
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()))
|
||||
return WayPointsStatus::Expired;
|
||||
WayPointsStatus state = WayPointsStatus::Undefined;
|
||||
|
||||
|
||||
WARNING_LOG(m_logger)<<" -- Status Wegpunktkette Abgebrochen muss definiert werden";
|
||||
if (mp.missionStart() > m_session->partitionTime())
|
||||
return WayPointsStatus::Prepared;
|
||||
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()))
|
||||
return WayPointsStatus::Expired;
|
||||
|
||||
return state;
|
||||
WARNING_LOG(m_logger) << " -- Status Wegpunktkette Abgebrochen muss definiert werden";
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
bool MissionPlanDialog::canBeLocked() const
|
||||
{
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id()<= 0)
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id() <= 0)
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
|
||||
if (uas.uasState() == ProjectDataManagement::UasState_def::Manual || wpStatus == WayPointsStatus::Active)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
|
||||
if (uas.uasState() == ProjectDataManagement::UasState_def::Manual
|
||||
|| wpStatus == WayPointsStatus::Active )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MissionPlanDialog::canBeUnlocked() const
|
||||
{
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id()<= 0)
|
||||
auto missionPlan = currentMissionPlan();
|
||||
if (missionPlan.id() <= 0)
|
||||
return false;
|
||||
if (missionPlan.aborted())
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
|
||||
if (uas.uasState() == ProjectDataManagement::UasState_def::Manual || wpStatus != WayPointsStatus::Active)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
if (missionPlan.aborted())
|
||||
return false;
|
||||
|
||||
const auto wpStatus = wayPointCurrentStatus(missionPlan);
|
||||
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
|
||||
|
||||
if ( uas.uasState() == ProjectDataManagement::UasState_def::Manual
|
||||
|| wpStatus != WayPointsStatus::Active)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
MissionPlanEdit *MissionPlanDialog::currentMissionPlanEditor() const
|
||||
MissionPlanEdit* MissionPlanDialog::currentMissionPlanEditor() const
|
||||
{
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return nullptr;
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return nullptr;
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() < 0)
|
||||
return nullptr;
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
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
|
||||
{
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return {};
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return {};
|
||||
|
||||
return m_missionPlanModel->getRowData(indexList.front().row());
|
||||
return m_missionPlanModel->getRowData(indexList.front().row());
|
||||
}
|
||||
|
||||
void MissionPlanDialog::tableColumnOrganiserSetting()
|
||||
{
|
||||
|
||||
m_ui->participantsDataView->setColumnsOrganiserEnabled(identifier(), true);
|
||||
|
||||
m_ui->participantsDataView->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::enaDisa()
|
||||
{
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false);
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
bool bOk = !indexList.isEmpty();
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false);
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
bool bOk = !indexList.isEmpty();
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, bOk);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, bOk);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, bOk && canBeLocked());
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, bOk && canBeUnlocked());
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, bOk);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, bOk);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, bOk && canBeLocked());
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, bOk && canBeUnlocked());
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onUnlockModifications()
|
||||
{
|
||||
auto dialog = currentMissionPlanEditor();
|
||||
if (!dialog)
|
||||
return;
|
||||
auto dialog = currentMissionPlanEditor();
|
||||
if (!dialog)
|
||||
return;
|
||||
|
||||
if (canBeUnlocked())
|
||||
dialog->setAllUiElementsEnabled(true);
|
||||
else
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Cannot unlock selected Mission Plan:\n mission plan still activ"));
|
||||
if (canBeUnlocked())
|
||||
dialog->setAllUiElementsEnabled(true);
|
||||
else
|
||||
LtsWidgets::LtsMessageDialog::showMessage(
|
||||
this, tr("Cannot unlock selected Mission Plan:\n mission plan still activ"));
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onLockModifications()
|
||||
{
|
||||
auto dialog = currentMissionPlanEditor();
|
||||
if (!dialog)
|
||||
return;
|
||||
|
||||
if (canBeLocked())
|
||||
dialog->setAllUiElementsEnabled(false);
|
||||
else {
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Cannot Lock selected Mission Plan."));
|
||||
}
|
||||
auto dialog = currentMissionPlanEditor();
|
||||
if (!dialog)
|
||||
return;
|
||||
|
||||
if (canBeLocked())
|
||||
dialog->setAllUiElementsEnabled(false);
|
||||
else
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Cannot Lock selected Mission Plan."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MissionPlanDialog::onAddMissionPlan()
|
||||
{
|
||||
static QString newMissionPlanIdentifier(QStringLiteral("NewMissionPlan"));
|
||||
static QString newMissionPlanIdentifier(QStringLiteral("NewMissionPlan"));
|
||||
|
||||
|
||||
const QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
{
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), 0, m_session),
|
||||
m_menuGroup, newMissionPlanIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
return;
|
||||
}
|
||||
const QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
{
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), 0, m_session), m_menuGroup,
|
||||
newMissionPlanIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
return;
|
||||
}
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), mp.id(), m_session, true ),
|
||||
m_menuGroup, newMissionPlanIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
addDialog(LtsWidgets::initDialog(new MissionPlanEdit(this), mp.id(), m_session, true), m_menuGroup,
|
||||
newMissionPlanIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onRemoveMissionPlanClicked()
|
||||
{
|
||||
const QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
const bool isOne = (indexList.size() == 1);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, isOne);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
const QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
const bool isOne = (indexList.size() == 1);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, isOne);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, false);
|
||||
|
||||
if (!isOne)
|
||||
return;
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (!isOne)
|
||||
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()
|
||||
{
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return;
|
||||
QModelIndexList indexList = m_ui->participantsDataView->selectedRows();
|
||||
if (indexList.isEmpty())
|
||||
return;
|
||||
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
return;
|
||||
const ParticipantManagement::MissionPlan mp = m_missionPlanModel->getRowData(indexList.front().row());
|
||||
if (mp.id() <= 0)
|
||||
return;
|
||||
|
||||
const QString dialogIdentifier = QStringLiteral("Edit-MissionPlan_%1").arg(mp.id());
|
||||
|
||||
if (!m_participantUasEditMap.contains(mp.participantId()))
|
||||
{
|
||||
MissionPlanEdit *dialog = new MissionPlanEdit(this);
|
||||
m_participantUasEditMap.insert(mp.participantId(), dialog);
|
||||
connect(dialog, &MissionPlanEdit::editUasDialogClosed, this, &MissionPlanDialog::onEditDialogClosed);
|
||||
addDialog(LtsWidgets::initDialog(dialog, mp.id(), m_session)
|
||||
, m_menuGroup
|
||||
, dialogIdentifier
|
||||
, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
focusDialog(m_menuGroup, dialogIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
const QString dialogIdentifier = QStringLiteral("Edit-MissionPlan_%1").arg(mp.id());
|
||||
|
||||
if (!m_participantUasEditMap.contains(mp.participantId()))
|
||||
{
|
||||
MissionPlanEdit* dialog = new MissionPlanEdit(this);
|
||||
m_participantUasEditMap.insert(mp.participantId(), dialog);
|
||||
connect(dialog, &MissionPlanEdit::editUasDialogClosed, this, &MissionPlanDialog::onEditDialogClosed);
|
||||
addDialog(LtsWidgets::initDialog(dialog, mp.id(), m_session), m_menuGroup, dialogIdentifier,
|
||||
LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
focusDialog(m_menuGroup, dialogIdentifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onEditDialogClosed(const int participantId)
|
||||
{
|
||||
m_participantUasEditMap.remove(participantId);
|
||||
m_participantUasEditMap.remove(participantId);
|
||||
}
|
||||
|
||||
void MissionPlanDialog::onMissionPlanChanged(const ParticipantManagement::MissionPlan &data, const DataModification modType)
|
||||
void MissionPlanDialog::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data,
|
||||
const DataModification modType)
|
||||
{
|
||||
Q_UNUSED(data)
|
||||
Q_UNUSED(modType)
|
||||
m_updateMissionTimer.start();
|
||||
Q_UNUSED(data)
|
||||
Q_UNUSED(modType)
|
||||
m_updateMissionTimer.start();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace CentralEffectSimulation
|
||||
Executable → Regular
+555
-614
File diff suppressed because it is too large.
Load diff
Executable → Regular
+116
-157
@@ -1,205 +1,164 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
|
||||
#include "mission_plan_model.h"
|
||||
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
|
||||
namespace CentralEffectSimulation
|
||||
{
|
||||
|
||||
|
||||
MissionPlanModel::MissionPlanModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<ParticipantManagement::MissionPlan>(
|
||||
{tr("Name"),
|
||||
tr("Mission Start"),
|
||||
tr("Actions [fulfilled / Count]"),
|
||||
tr("Fulfilled"),
|
||||
tr("Participant"),
|
||||
tr("UAS State"),
|
||||
tr("Current Mission"),
|
||||
tr("Aborted")},
|
||||
parent)
|
||||
, m_ppmDtc(nullptr)
|
||||
MissionPlanModel::MissionPlanModel(QObject* parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<ParticipantManagement::MissionPlan>(
|
||||
{tr("Name"), tr("Mission Start"), tr("Actions [fulfilled / Count]"), tr("Fulfilled"), tr("Participant"),
|
||||
tr("UAS State"), tr("Current Mission"), tr("Aborted")},
|
||||
parent),
|
||||
m_ppmDtc(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
QVariant MissionPlanModel::data(const QModelIndex &index, int role) const
|
||||
QVariant MissionPlanModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const ParticipantManagement::MissionPlan &mp = m_vecData.at(index.row());
|
||||
switch (index.column())
|
||||
{
|
||||
|
||||
case Columns::Name:
|
||||
return QString::fromStdString(mp.name());
|
||||
case Columns::MissionStart:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.missionStart());
|
||||
case Columns::Fulfilled:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.fulfilled());
|
||||
case Columns::ItemsCountAndFulfilled:
|
||||
{
|
||||
int actionsFulfilled = 0;
|
||||
int actionsCount = 0;
|
||||
for (const auto &item : mp.items())
|
||||
const ParticipantManagement::MissionPlan& mp = m_vecData.at(index.row());
|
||||
switch (index.column())
|
||||
{
|
||||
actionsFulfilled += item.actionsFulfilled();
|
||||
actionsCount += item.actions().size();
|
||||
|
||||
case Columns::Name:
|
||||
return QString::fromStdString(mp.name());
|
||||
case Columns::MissionStart:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.missionStart());
|
||||
case Columns::Fulfilled:
|
||||
return QDateTime::fromMSecsSinceEpoch(mp.fulfilled());
|
||||
case Columns::ItemsCountAndFulfilled: {
|
||||
int actionsFulfilled = 0;
|
||||
int actionsCount = 0;
|
||||
for (const auto& item : mp.items())
|
||||
{
|
||||
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());
|
||||
}
|
||||
case Columns::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();
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return QStringLiteral("%1/%2").arg(actionsFulfilled).arg(actionsCount);
|
||||
}
|
||||
case Columns::Participant:
|
||||
{
|
||||
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());
|
||||
}
|
||||
case Columns::CurrentMission:
|
||||
{
|
||||
return currentJob2String(mp);
|
||||
}
|
||||
case Columns::Aborted:
|
||||
{
|
||||
return mp.aborted();
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MissionPlanModel::initModel(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc, int exerciseId)
|
||||
bool MissionPlanModel::initModel(const std::shared_ptr<ParticipantManagement::Interface::Dtc>& ppmDtc, int exerciseId)
|
||||
{
|
||||
m_ppmDtc = ppmDtc;
|
||||
m_ppmDtc->enableMissionPlan(true);
|
||||
m_ppmDtc = ppmDtc;
|
||||
m_ppmDtc->enableMissionPlan(true);
|
||||
|
||||
m_exerciseId = exerciseId;
|
||||
m_exerciseId = exerciseId;
|
||||
|
||||
if (!m_ppmDtc->isUASEnabled())
|
||||
m_ppmDtc->enableUAS();
|
||||
if (!m_ppmDtc->isUASEnabled())
|
||||
m_ppmDtc->enableUAS();
|
||||
|
||||
m_ppmDtc->waitForHistoricalDataUAS(1000);
|
||||
m_ppmDtc->waitForHistoricalDataUAS(1000);
|
||||
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::missionPlanChanged,
|
||||
this, &MissionPlanModel::onMissionPlanChanged);
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::missionPlanChanged, this,
|
||||
&MissionPlanModel::onMissionPlanChanged);
|
||||
|
||||
auto cb = [this](const ParticipantManagement::MissionPlan &msp)
|
||||
{
|
||||
onMissionPlanChanged(msp, DataModification::eAdded);
|
||||
};
|
||||
m_ppmDtc->missionPlans(cb);
|
||||
auto cb = [this](const ParticipantManagement::MissionPlan& msp) {
|
||||
onMissionPlanChanged(msp, DataModification::eAdded);
|
||||
};
|
||||
m_ppmDtc->missionPlans(cb);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString MissionPlanModel::currentJob2String(const ParticipantManagement::MissionPlan &missionPlan) const
|
||||
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())
|
||||
return tr(" Mission Complete ");
|
||||
|
||||
switch (currAction.actionType().underlying())
|
||||
{
|
||||
case ParticipantManagement::MissionActionType::MoveTo:
|
||||
{
|
||||
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());
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Attack:
|
||||
{
|
||||
return tr("WP %1: Drop Charge").arg(currAction.itemNumber()+1);
|
||||
}
|
||||
default:
|
||||
return tr("Unknown");
|
||||
}
|
||||
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())
|
||||
{
|
||||
case ParticipantManagement::MissionActionType::MoveTo: {
|
||||
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());
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Attack: {
|
||||
return tr("WP %1: Drop Charge").arg(currAction.itemNumber() + 1);
|
||||
}
|
||||
default:
|
||||
return tr("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MissionPlanModel::onMissionPlanChanged(const ParticipantManagement::MissionPlan &data, const DataModification modType)
|
||||
void MissionPlanModel::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data,
|
||||
const DataModification modType)
|
||||
{
|
||||
const int id = data.id();
|
||||
int row = findRowForId(id);
|
||||
DEBUG_LOG(m_logger)<<"MISSION PLAN CHANGED id ( "<<data.id()<<" ) "<< modType;
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eModified:
|
||||
{
|
||||
if (row < 0)
|
||||
return;
|
||||
setRowData(row, data);
|
||||
break;
|
||||
}
|
||||
case DataModification::eAdded:
|
||||
{
|
||||
if (row != -1)
|
||||
return;
|
||||
else
|
||||
insertRow(data);
|
||||
break;
|
||||
}
|
||||
case DataModification::eRemoved:
|
||||
removeRow(row);
|
||||
break;
|
||||
}
|
||||
const int id = data.id();
|
||||
int row = findRowForId(id);
|
||||
DEBUG_LOG(m_logger) << "MISSION PLAN CHANGED id ( " << data.id() << " ) " << modType;
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eModified: {
|
||||
if (row < 0)
|
||||
return;
|
||||
setRowData(row, data);
|
||||
break;
|
||||
}
|
||||
case DataModification::eAdded: {
|
||||
if (row != -1)
|
||||
return;
|
||||
else
|
||||
insertRow(data);
|
||||
break;
|
||||
}
|
||||
case DataModification::eRemoved:
|
||||
removeRow(row);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void MissionPlanProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
|
||||
void MissionPlanProxyModel::setSourceModel(QAbstractItemModel* sourceModel)
|
||||
{
|
||||
m_sourceModel = qobject_cast<MissionPlanModel*>(sourceModel);
|
||||
LtsWidgets::LtsColumnFilterProxyModel::setSourceModel(sourceModel);
|
||||
m_sourceModel = qobject_cast<MissionPlanModel*>(sourceModel);
|
||||
LtsWidgets::LtsColumnFilterProxyModel::setSourceModel(sourceModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MissionPlanProxyModel::setShowExpired(bool show)
|
||||
{
|
||||
m_showExpired = show;
|
||||
m_showExpired = show;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MissionPlanProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
bool MissionPlanProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const
|
||||
{
|
||||
Q_UNUSED(sourceParent)
|
||||
return checkFilter(sourceRow);
|
||||
Q_UNUSED(sourceParent)
|
||||
return checkFilter(sourceRow);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MissionPlanProxyModel::checkFilter(int sourceRow) const
|
||||
{
|
||||
Q_UNUSED(sourceRow)
|
||||
|
||||
return true;
|
||||
Q_UNUSED(sourceRow)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace CentralEffectSimulation
|
||||
Reference in new issue
Block a user