Files
qt5-legatus-legacy/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participant_move_dialog.h
T
2026-08-13 18:33:10 +02:00

116 lines
3.5 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Dialog for Simulated Movement
* $Id$
* $HeadURL$
* $Author$
* Created by Gerlinde Rudolphus, SLSE, 2018-01-02 */
#pragma once
#include <LtsWidgets/lts_dialog.h>
#include <CentralEffectSimulation/ces_ftc.h>
#include <LtsWidgets/lts_frameless_dialog.h>
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
#include <QStandardItemModel>
#include <LtsUtilsGuiDds/request_helper.h>
#include <LtsSession/lts_session.h>
//DDS
#include <ParticipantManagement/ppm_dtc.h>
#include <CentralEffectSimulation/ces_dtc.h>
#include "logger.h"
namespace Ui
{
class WaypointsEdit;
}
namespace LtsWidgets
{
class LtsDateTimeEdit;
}
namespace CentralEffectSimulation
{
class TypeModel;
class ParticipantMoveDialog: public LtsWidgets::LtsDialog
, protected CentralEffectSimulation::Interface::Ftc::SimulatedMovementRemoveReplyHandler
, protected CentralEffectSimulation::Interface::Ftc::SimulatedMovementModifyReplyHandler
{
Q_OBJECT
public:
enum SegementColumns
{
Name,
IdleTime,
Speed,
Position
};
explicit ParticipantMoveDialog(QWidget *parent = nullptr);
~ParticipantMoveDialog();
bool init(LtsSession::LtsSessionDataDds *session,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
const std::shared_ptr<CentralEffectSimulation::Interface::Dtc> &cesDtc,
const ParticipantManagement::ParticipantData &data);
void retranslate() override;
//virtual functions from CentralEffectSimulation::Interface::Ftc
void onSimulatedMovementRemoveReply(const Core::FunctionReplyObject &replyObject) override;
void onSimulatedMovementModifyReply(const Core::FunctionReplyObject &replyObject) override;
void showPreview(bool show);
signals:
void closeDialog(int32_t participantId);
private:
//std::vector<LtsCoordWidget::LtsCoordWidget *> coordWidgets() const override;
//void setData(const Borderline &borderline, bool copy);
void enableUiElements(bool enable);
void initTableHeader();
void insertPos(const double lon, const double lat, const QString &identifier, const int idleTime, const double speed);
//void onApply();
void clearCoordinates();
void clearContent();
bool hasValidEffectStart(LtsWidgets::LtsDateTimeEdit *dte) const;
bool apply() override;
SimulatedMovement requestContent() const;
QByteArray simulatedMovementToJson() const;
SimulatedMovement jsonToSimulatedMovement(const QByteArray &content) const;
private slots:
void onGetPolyline();
void onPolylineData(const QPolygonF &polyline); // callback for onGetPolyline()
void onSimulatedMovementChanged(const CentralEffectSimulation::SimulatedMovement &data, DataModification modType);
void onFocus();
void onExportButtonClicked();
void onImportButtonClicked();
private:
std::shared_ptr<CentralEffectSimulation::Interface::Dtc> m_cesDtc;
std::shared_ptr<Interface::Ftc> m_ftc;
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
std::shared_ptr<FileManagement::ForeignGuiInterface> m_flmGui;
Ui::WaypointsEdit *m_ui;
LtsSession::LtsSessionDataDds *m_session;
ParticipantManagement::ParticipantData m_participantData;
int m_id;
LtsUtils::RequestHelper *m_requestHelper;
QPolygonF m_polyline;
LOGGER_T m_logger;
};
} // namespace CentralEffectSimulation