Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+126
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The ApproachingPointsDialog shows a list of approaching points
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#include "ism_approaching_point_list_dialog.h"
|
||||
#include "ui_ism_approaching_point_list_dialog.h"
|
||||
#include "ism_approaching_point_list_dialog_model.h"
|
||||
#include "ism_edit_approaching_point_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsPrinting/printing.h>
|
||||
#include <QTreeView>
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
ApproachingPointsDialog::ApproachingPointsDialog(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_session(session)
|
||||
, m_ui(new Ui::ApproachingPointsDialog)
|
||||
, m_model(nullptr)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_logger(getLogger("ApproachingPointsDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &ApproachingPointsDialog::onPrint);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Ressourcen-Approach_Points"));
|
||||
}
|
||||
|
||||
ApproachingPointsDialog::~ApproachingPointsDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void ApproachingPointsDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Approaching Points"));
|
||||
}
|
||||
|
||||
void ApproachingPointsDialog::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->approachingPointsView->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
bool ApproachingPointsDialog::init(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMap)
|
||||
{
|
||||
m_ftc = ftc;
|
||||
m_sitMapIfc = sitMap;
|
||||
delete m_model;
|
||||
m_model = new ApproachingPointsDialogModel(this);
|
||||
if (!m_model->initModel(dtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not init model";
|
||||
delete m_model;
|
||||
m_model = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ui->approachingPointsView->setModel(m_model);
|
||||
|
||||
connect(m_ui->approachingPointsView, &LtsDataView::LtsDataView::signalDoubleClicked,
|
||||
this, &ApproachingPointsDialog::onItemDoubleClicked);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &ApproachingPointsDialog::onItemDoubleClicked);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &ApproachingPointsDialog::onAddApproachingPoint);
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
m_ui->approachingPointsView->hideColumn(ApproachingPointsDialogModel::Columns::Id);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ApproachingPointsDialog::onItemDoubleClicked()
|
||||
{
|
||||
QModelIndex currentIndex = m_ui->approachingPointsView->currentIndex();
|
||||
|
||||
if (!currentIndex.isValid())
|
||||
return;
|
||||
|
||||
EditApproachingPointDialog *dialog = new EditApproachingPointDialog(this);
|
||||
|
||||
MainStructureElement approachingPoint = m_model->getRowData(currentIndex.row());
|
||||
if (!dialog->init(m_ftc, m_sitMapIfc, approachingPoint))
|
||||
{
|
||||
delete dialog;
|
||||
return;
|
||||
}
|
||||
|
||||
addDialog(dialog, m_menuGroup, QStringLiteral("EditApproachingPoint%1").arg(approachingPoint.id()), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void ApproachingPointsDialog::onPrint()
|
||||
{
|
||||
LtsPrinting::printView(m_session, this, m_ui->approachingPointsView->treeView() );
|
||||
}
|
||||
|
||||
void ApproachingPointsDialog::onAddApproachingPoint()
|
||||
{
|
||||
QModelIndex currentIndex = m_ui->approachingPointsView->currentIndex();
|
||||
|
||||
EditApproachingPointDialog *dialog = new EditApproachingPointDialog(this);
|
||||
|
||||
MainStructureElement approachingPoint = m_model->getRowData(currentIndex.row());
|
||||
approachingPoint.id(0);
|
||||
if (!dialog->init(m_ftc, m_sitMapIfc, approachingPoint))
|
||||
{
|
||||
delete dialog;
|
||||
return;
|
||||
}
|
||||
|
||||
addDialog(dialog, m_menuGroup, QStringLiteral("AddApproachingPoint"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The ApproachingPointsDialog shows a list of approaching points
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <InfrastructureManagement/logger.h>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class ApproachingPointsDialog;
|
||||
}
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
class Dtc;
|
||||
class Ftc;
|
||||
}
|
||||
class ApproachingPointsDialogModel;
|
||||
|
||||
class ApproachingPointsDialog
|
||||
: public LtsWidgets::LtsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ApproachingPointsDialog(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~ApproachingPointsDialog();
|
||||
|
||||
bool init(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMap);
|
||||
|
||||
|
||||
private Q_SLOTS:
|
||||
void onItemDoubleClicked();
|
||||
void onPrint();
|
||||
void onAddApproachingPoint();
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
LtsSession::LtsSession *m_session;
|
||||
Ui::ApproachingPointsDialog *m_ui;
|
||||
ApproachingPointsDialogModel *m_model;
|
||||
QString m_menuGroup;
|
||||
std::shared_ptr<Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapIfc;
|
||||
|
||||
|
||||
LOGGER_T m_logger;
|
||||
|
||||
}; // class ApproachingPointsDialogModel
|
||||
} // namespace InfrastructureManagement
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ApproachingPointsDialog</class>
|
||||
<widget class="QWidget" name="ApproachingPointsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>630</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Approaching Points</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="LtsDataView::LtsDataView" name="approachingPointsView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsDataView::LtsDataView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsDataView/lts_data_view.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The ApproachingPointsDialogModel provides data for ApproachingPointsDialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#include "ism_approaching_point_list_dialog_model.h"
|
||||
#include <InfrastructureManagement/ism_data_plugin_interface.h>
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <QDateTime>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
ApproachingPointsDialogModel::ApproachingPointsDialogModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<MainStructureElement>({tr("Id"),
|
||||
tr("Name"),
|
||||
tr("Description"),
|
||||
tr("Position"),
|
||||
tr("Departure Direction"),
|
||||
tr("Special Type"),
|
||||
tr("Properties")},
|
||||
parent)
|
||||
, m_logger(getLogger("ApproachingPointsDialogModel"))
|
||||
{
|
||||
}
|
||||
|
||||
QVariant ApproachingPointsDialogModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const MainStructureElement ¤tPoint = m_vecData.at(index.row());
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return currentPoint.id();
|
||||
case Name:
|
||||
return QString::fromStdString(currentPoint.name());
|
||||
case Description:
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(currentPoint.description()));
|
||||
const QString jsonKey = QLatin1String("description");
|
||||
if (!doc.isObject())
|
||||
return QVariant();
|
||||
return doc.object().value(jsonKey).toString();
|
||||
}
|
||||
case Position:
|
||||
return LtsCoordTrans::mgrsFromGeographic(currentPoint.geoPosition().lon(), currentPoint.geoPosition().lat());
|
||||
case Orientation:
|
||||
return calculateCardinalDirection(currentPoint.angle());
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool ApproachingPointsDialogModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc)
|
||||
{
|
||||
connect(dtc.get(), &Interface::Dtc::mainStructureElementChanged,
|
||||
this, &ApproachingPointsDialogModel::onDataChanged);
|
||||
|
||||
auto cb = [this](const InfrastructureManagement::MainStructureElement &mse)
|
||||
{
|
||||
onDataChanged(mse, DataModification::eAdded);
|
||||
};
|
||||
dtc->mainStructureElements(cb);
|
||||
|
||||
INFO_LOG(m_logger) << "initModel successful";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString ApproachingPointsDialogModel::calculateCardinalDirection(double degree, bool longVersion) const
|
||||
{
|
||||
int value = (int) ((degree / 45) + 0.5) % 8;
|
||||
|
||||
switch (value)
|
||||
{
|
||||
case 0:
|
||||
return longVersion ? tr("North") : tr("N");
|
||||
case 1:
|
||||
return longVersion ? tr("North-East") : tr("NE");
|
||||
case 2:
|
||||
return longVersion ? tr("East") : tr("E");
|
||||
case 3:
|
||||
return longVersion ? tr("South-East") : tr("SE");
|
||||
case 4:
|
||||
return longVersion ? tr("South") : tr("S");
|
||||
case 5:
|
||||
return longVersion ? tr("South-West") : tr("SW");
|
||||
case 6:
|
||||
return longVersion ? tr("West") : tr("W");
|
||||
case 7:
|
||||
return longVersion ? tr("North-West") : tr("NW");
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool ApproachingPointsDialogModel::isFiltered(const InfrastructureManagement::MainStructureElement &data, DataModification modType) const
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
return (data.structureElementTypeId() != InfrastructureManagement::StructureElementType::ApproachingPoint);
|
||||
}
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The ApproachingPointsDialogModel provides data for ApproachingPointsDialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
#include <InfrastructureManagement/logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
class ApproachingPointsDialogModel : public LtsWidgets::LtsAbstractTableModel<MainStructureElement>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ApproachingPointsDialogModel(QObject *parent = nullptr);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override final;
|
||||
|
||||
bool initModel(const std::shared_ptr<Interface::Dtc> &dtc);
|
||||
QString calculateCardinalDirection(double degree, bool longVersion = true) const;
|
||||
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Name,
|
||||
Description,
|
||||
Position,
|
||||
Orientation
|
||||
};
|
||||
|
||||
protected:
|
||||
bool isFiltered(const InfrastructureManagement::MainStructureElement &data, DataModification modType) const override;
|
||||
|
||||
private: // attributes
|
||||
|
||||
LOGGER_T m_logger;
|
||||
}; // class ApproachingPointsDialogModel
|
||||
} // namespace InfrastructureManagement
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The EditApproachingPointDialog offers an UI to edit an Approaching Point
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#include "ism_edit_approaching_point_dialog.h"
|
||||
#include "ui_ism_edit_approaching_point_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
#include <Plugins/InfrastructureManagement/ism_data_plugin_interface.h>
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
|
||||
EditApproachingPointDialog::EditApproachingPointDialog(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
||||
, m_ui(new Ui::EditApproachingPointDialog)
|
||||
, m_ftc(nullptr)
|
||||
, m_sitMapGuiIfc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(getLogger("EditApproachingPointDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
fillCbDepartureDirection();
|
||||
m_uiRequirements->addRequirement({m_ui->lblPosition, [this]() { return !m_ui->positionEdit->coordinate().isNull(); }});
|
||||
m_uiRequirements->addRequirement({m_ui->lblName, [this]() { return !m_ui->leName->text().isEmpty(); }});
|
||||
|
||||
connect(m_ui->pbClear, &QPushButton::clicked,
|
||||
m_ui->positionEdit, &LtsCoordWidget::LtsCoordWidget::clear);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Ressourcen-Approach_Points"));
|
||||
}
|
||||
|
||||
EditApproachingPointDialog::~EditApproachingPointDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void EditApproachingPointDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, m_approachingPoint, tr("Approaching Point"));
|
||||
}
|
||||
|
||||
bool EditApproachingPointDialog::init(const std::shared_ptr<Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMap,
|
||||
const MainStructureElement &approachingPoint)
|
||||
{
|
||||
m_ftc = ftc;
|
||||
m_sitMapGuiIfc = sitMap;
|
||||
if (m_sitMapGuiIfc)
|
||||
connect(m_ui->pbPosition, &QPushButton::clicked, this, &EditApproachingPointDialog::getPosition);
|
||||
else
|
||||
m_ui->pbPosition->setEnabled(false);
|
||||
|
||||
setData(approachingPoint);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditApproachingPointDialog::apply()
|
||||
{
|
||||
return m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
MainStructureElementModifyRequest request;
|
||||
|
||||
request.id(m_approachingPoint.id());
|
||||
request.name(m_ui->leName->text().toStdString());
|
||||
request.angle(m_ui->cbDepartureDirection->currentData().toDouble());
|
||||
|
||||
request.properties("{}");
|
||||
request.structureElementId(m_approachingPoint.structureElementId());
|
||||
request.structureElementTypeId(InfrastructureManagement::StructureElementType::ApproachingPoint);
|
||||
|
||||
QJsonObject objDescription;
|
||||
objDescription.insert(QLatin1String("description"), m_ui->leDescription->text());
|
||||
request.description(QJsonDocument(objDescription).toJson(QJsonDocument::Compact).toStdString());
|
||||
|
||||
const Core::GeoPosition pos(m_ui->positionEdit->coordinate().x(),m_ui->positionEdit->coordinate().y(), 0);
|
||||
request.geoPosition(pos);
|
||||
|
||||
// fill in structure element (only one, needed for mse/se relationsships)
|
||||
if (m_approachingPoint.id() == 0)
|
||||
{
|
||||
StructureElement seData;
|
||||
seData.name(request.name());
|
||||
seData.displayName(request.name());
|
||||
seData.structureElementTypeId(InfrastructureManagement::StructureElementType::ApproachingPoint);
|
||||
seData.mountingPointTypeId(InfrastructureManagement::MountingPointType::Unknown);
|
||||
seData.properties("{}");
|
||||
|
||||
request.elements().resize(1, seData);
|
||||
request.childParentRelations().resize(1, -1);
|
||||
}
|
||||
|
||||
return m_ftc->mainStructureElementModifyRequest(request, this);
|
||||
});
|
||||
}
|
||||
|
||||
void EditApproachingPointDialog::fillCbDepartureDirection()
|
||||
{
|
||||
m_ui->cbDepartureDirection->insertItem(0,tr("North"),0);
|
||||
m_ui->cbDepartureDirection->insertItem(1,tr("North-East"),45);
|
||||
m_ui->cbDepartureDirection->insertItem(2,tr("East"),90);
|
||||
m_ui->cbDepartureDirection->insertItem(3,tr("South-East"),135);
|
||||
m_ui->cbDepartureDirection->insertItem(4,tr("South"),180);
|
||||
m_ui->cbDepartureDirection->insertItem(5,tr("South-West"),225);
|
||||
m_ui->cbDepartureDirection->insertItem(6,tr("West"),270);
|
||||
m_ui->cbDepartureDirection->insertItem(7,tr("North-West"),315);
|
||||
}
|
||||
|
||||
void EditApproachingPointDialog::setData(const MainStructureElement &approachingPoint)
|
||||
{
|
||||
m_approachingPoint = approachingPoint;
|
||||
|
||||
m_ui->leName->setText(QString::fromStdString(m_approachingPoint.name()));
|
||||
QJsonObject objDescription = QJsonDocument::fromJson(QByteArray::fromStdString(m_approachingPoint.description())).object();
|
||||
QString strDescription = objDescription.value(QLatin1String("description")).toString();
|
||||
m_ui->leDescription->setText(strDescription);
|
||||
QPointF pos(m_approachingPoint.geoPosition().lon(), m_approachingPoint.geoPosition().lat());
|
||||
if (!pos.isNull())
|
||||
m_ui->positionEdit->setCoordinate(pos);
|
||||
|
||||
m_ui->cbDepartureDirection->setCurrentIndex( (int) ((approachingPoint.angle() / 45) + 0.5) % 8);
|
||||
}
|
||||
|
||||
void EditApproachingPointDialog::getPosition()
|
||||
{
|
||||
if (!m_sitMapGuiIfc) //sanity
|
||||
return;
|
||||
m_sitMapGuiIfc->getCoordinate(m_ui->positionEdit, SLOT(setCoordinate(QPointF)), nullptr);
|
||||
}
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* The EditApproachingPointDialog offers an UI to edit an Approaching Point
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2018-01-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <InfrastructureManagement/ism_ftc.h>
|
||||
#include <InfrastructureManagement/logger.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
class LtsProgressDialogHelper;
|
||||
}
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class EditApproachingPointDialog;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
|
||||
namespace InfrastructureManagement
|
||||
{
|
||||
class EditApproachingPointDialog
|
||||
: public LtsWidgets::LtsDialog
|
||||
, protected Interface::Ftc::MainStructureElementModifyReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EditApproachingPointDialog(QWidget *parent = nullptr);
|
||||
~EditApproachingPointDialog();
|
||||
|
||||
bool init(const std::shared_ptr<Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMap,
|
||||
const MainStructureElement &approachingPoint = MainStructureElement());
|
||||
void onMainStructureElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private slots:
|
||||
void getPosition();
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void fillCbDepartureDirection();
|
||||
void setData(const MainStructureElement &approachingPoint);
|
||||
bool apply() override final;
|
||||
|
||||
Ui::EditApproachingPointDialog *m_ui;
|
||||
std::shared_ptr<Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
||||
MainStructureElement m_approachingPoint;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
|
||||
}; // class EditApproachingPointDialog
|
||||
} // namespace InfrastructureManagement
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EditApproachingPointDialog</class>
|
||||
<widget class="QWidget" name="EditApproachingPointDialog">
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Edit Approaching Point</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblDescription">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="leDescription"/>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="2">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbDepartureDirection"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblPosition">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="LtsCoordWidget::LtsCoordWidget" name="positionEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbPosition">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/style/position.svg</normaloff>:/style/position.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbClear">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/style/remove.svg</normaloff>:/style/remove.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblOrientation">
|
||||
<property name="text">
|
||||
<string>Departure Direction:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="leName"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblName">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsCoordWidget::LtsCoordWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsCoordTrans/lts_coord_widget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>LtsWidgets/lts_combo_box.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>leName</tabstop>
|
||||
<tabstop>leDescription</tabstop>
|
||||
<tabstop>positionEdit</tabstop>
|
||||
<tabstop>pbPosition</tabstop>
|
||||
<tabstop>pbClear</tabstop>
|
||||
<tabstop>cbDepartureDirection</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in new issue
Block a user