117 lines
3.5 KiB
C++
Executable File
117 lines
3.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* AreaEffectSimulation - Explosion Edit Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2016-07-07
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "aes_base_exports.h"
|
|
#include <AreaEffectSimulation/logger.h>
|
|
#include <AreaEffectSimulation/aes.hpp>
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsWidgets/ui_requirement.h>
|
|
|
|
// For not having to include in every derived class, we do it here:
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
#include <LtsSession/lts_session.h>
|
|
#include <LtsUtilsCore/data_modification_enum.h>
|
|
#include <AreaEffectSimulation/aes_ftc.h>
|
|
#include <AreaEffectSimulation/aes_operator_rights.h>
|
|
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
|
|
|
class QSpinBox;
|
|
class QDoubleSpinBox;
|
|
|
|
namespace SituationMap
|
|
{
|
|
class ForeignGuiInterface;
|
|
}
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
class LtsDateTimeEdit;
|
|
}
|
|
namespace LtsCoordWidget
|
|
{
|
|
class LtsCoordWidget;
|
|
}
|
|
namespace AreaEffectSimulation
|
|
{
|
|
|
|
namespace Interface
|
|
{
|
|
class Ftc;
|
|
class Dtc;
|
|
}
|
|
|
|
class AESBASEGUI_EXPORT BaseEdit : public LtsWidgets::LtsDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BaseEdit(const QString &menuGroup,
|
|
const QString &loggerName,
|
|
QWidget *parent = nullptr,
|
|
LtsWidgets::ButtonCombination buttonCombination = LtsWidgets::ButtonCombination::OkApplyCancel);
|
|
|
|
bool init(int aesItemId, LtsSession::LtsSession *session);
|
|
|
|
QString menuGroup() const { return m_menuGroup; }
|
|
virtual QString dialogIdentifier() const = 0;
|
|
|
|
public Q_SLOTS:
|
|
void onAreaChanged(const AesItem &data, DataModification modType);
|
|
|
|
protected Q_SLOTS:
|
|
void enaDisa() {}
|
|
void correctSpinBoxValue();
|
|
void onVisibilityChanged(bool visible);
|
|
virtual void showPreviewObject() = 0;
|
|
|
|
protected:
|
|
|
|
void setCombobxToValueIfPossible(QComboBox *cbx, int val);
|
|
void onAesItemCreateReply(const Core::FunctionReplyObject &replyObject);
|
|
void onAesItemModifyReply(const Core::FunctionReplyObject &replyObject);
|
|
bool isModifiable() const;
|
|
virtual bool isOnlyNameModifiable() const;
|
|
virtual void enableUiElements(bool enable) = 0;
|
|
void correctSpinBoxValueInternal(QSpinBox *sb);
|
|
void correctSpinBoxValueInternal(QDoubleSpinBox *sb);
|
|
bool hasValidEffectStart(LtsWidgets::LtsDateTimeEdit *dte) const;
|
|
void setEffectStartEnabled(LtsWidgets::LtsDateTimeEdit *dte, bool enable = true);
|
|
|
|
virtual std::vector<LtsCoordWidget::LtsCoordWidget *> coordWidgets() const { return {}; }
|
|
void setCoordinates(const QVector<QPointF> &coords, bool reverse);
|
|
void setCoordinates(const std::vector<Core::GeoPosition2D> &coords);
|
|
std::vector<Core::GeoPosition2D> getCoordinates() const;
|
|
QVector<QPointF> getCoordinatesQPointF() const;
|
|
void clearCoordinates();
|
|
void enabledCoordinates(bool enable);
|
|
bool has2DMap(bool showMsgBoxIfNot2D = true);
|
|
|
|
static double distance(const Core::GeoPosition2D &p1, const Core::GeoPosition2D &p2);
|
|
static bool isInBounds(int value, const QPair<int, int>&minMax) { return (value >= minMax.first) && (value <= minMax.second); }
|
|
|
|
bool checkSegementLengths(QWidget *parent) const;
|
|
virtual double getMaxLength() const { return 0; }
|
|
|
|
AesItem m_aesItem;
|
|
|
|
std::shared_ptr<Interface::Dtc> m_dtc;
|
|
std::shared_ptr<Interface::Ftc> m_ftc;
|
|
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
|
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> m_ppmGuiCbxIfc;
|
|
|
|
LtsSession::LtsSession *m_session;
|
|
QString m_menuGroup;
|
|
LtsUtils::RequestHelper *m_requestHelper;
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
} //namespace AreaEffectSimulation
|