Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Christian Ehrlicher, SLSE, 2016-03-01
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(Data)
|
||||
ADD_SUBDIRECTORY(Gui)
|
||||
|
||||
#
|
||||
# Gui Plugin Interface
|
||||
#
|
||||
ADD_INTERFACE_LIBRARY(WhmGuiPluginInterface
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/whm_gui_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
GuiPluginInterface
|
||||
)
|
||||
|
||||
#
|
||||
# Data Plugin Interface
|
||||
#
|
||||
ADD_INTERFACE_LIBRARY(WhmDataPluginInterface
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/whm_data_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
DataPluginInterface
|
||||
)
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Mike Wille, SLSE, 2016-09-06
|
||||
#
|
||||
|
||||
#
|
||||
# Data Plugin
|
||||
#
|
||||
NGL_ADD_LIBRARY(WS WhmDataPlugin MODULE whm_data_plugin.cpp whm_data_plugin.h)
|
||||
NGL_TARGET_LINK_LIBRARIES(WhmDataPlugin
|
||||
Qt5::Core
|
||||
WhmDataPluginInterface
|
||||
svcWhgClient
|
||||
NGLLogger
|
||||
LtsSessionDataDds
|
||||
LtsUtilsGuiDds # dds-vec => QByteArray
|
||||
ddsconnector
|
||||
)
|
||||
NGL_INSTALL_TARGET(WhmDataPlugin)
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Data Plugin for ExerciseManangement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "whm_data_plugin.h"
|
||||
|
||||
#include <LtsSession/lts_session_data_dds.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
std::shared_ptr<DataPluginBase::Interface> DataPlugin::createDataInterface(LtsSession::LtsSessionDataDds *session)
|
||||
{
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> dtc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> ftc;
|
||||
if (!session->createTopicClient(dtc, ftc))
|
||||
return std::shared_ptr<DataPluginBase::Interface>();
|
||||
|
||||
return std::make_shared<DataInterfaceImpl>(dtc, ftc);
|
||||
}
|
||||
|
||||
|
||||
DataInterfaceImpl::DataInterfaceImpl(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<WarehouseGuez::Interface::Ftc> &ftc)
|
||||
: DataInterface()
|
||||
, m_dtc(dtc)
|
||||
, m_ftc(ftc)
|
||||
{}
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Data Plugin for WarehouseManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <WarehouseManagement/whm_data_plugin_interface.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class DataPlugin final : public QObject, public DataPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "data:3:whm")
|
||||
Q_INTERFACES(DataPluginBase::Plugin)
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DataPlugin() = default;
|
||||
~DataPlugin() = default;
|
||||
|
||||
QString pluginName() const override { return QStringLiteral("WarehouseManagement"); }
|
||||
std::shared_ptr<DataPluginBase::Interface> createDataInterface(LtsSession::LtsSessionDataDds *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return partition == IDL::PartitionType::Global;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class DataInterfaceImpl final : public DataInterface
|
||||
{
|
||||
public:
|
||||
DataInterfaceImpl(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<WarehouseGuez::Interface::Ftc> &ftc);
|
||||
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> getDtc() override { return m_dtc; }
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> getFtc() override { return m_ftc; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
#
|
||||
|
||||
SET(whm_gui_SRCS
|
||||
whm_gui_plugin.cpp
|
||||
whm_gui_plugin.h
|
||||
|
||||
CustomViews/whm_injury_model.cpp
|
||||
CustomViews/whm_injury_model.h
|
||||
injury_model_edit_dialog.cpp
|
||||
injury_model_edit_dialog.h
|
||||
injury_model_list.cpp
|
||||
injury_model_list.h
|
||||
injury_model_model.cpp
|
||||
injury_model_model.h
|
||||
injury_model_add.cpp
|
||||
injury_model_add.h
|
||||
|
||||
CustomViews/whm_equipment_type.cpp
|
||||
CustomViews/whm_equipment_type.h
|
||||
equipment_type_edit_dialog.cpp
|
||||
equipment_type_edit_dialog.h
|
||||
equipment_type_list.cpp
|
||||
equipment_type_list.h
|
||||
equipment_type_model.cpp
|
||||
equipment_type_model.h
|
||||
equipment_type_add.cpp
|
||||
equipment_type_add.h
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(whm_gui_SRCS
|
||||
CustomViews/whm_injury_model.ui
|
||||
injury_model_edit_dialog.ui
|
||||
injury_model_list.ui
|
||||
injury_model_add.ui
|
||||
|
||||
CustomViews/whm_equipment_type.ui
|
||||
equipment_type_edit_dialog.ui
|
||||
equipment_type_list.ui
|
||||
equipment_type_add.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS WhmGuiPlugin MODULE ${whm_gui_SRCS})
|
||||
|
||||
NGL_TARGET_LINK_LIBRARIES(WhmGuiPlugin
|
||||
NGLLogger
|
||||
nglwidgets
|
||||
WhmDataPluginInterface
|
||||
WhmGuiPluginInterface
|
||||
ExmDataPluginInterface
|
||||
Qt5::Widgets
|
||||
LtsWidgets
|
||||
LtsSession
|
||||
LtsSessionData
|
||||
LtsSessionDataDds
|
||||
LtsDataView
|
||||
LtsUtilsGuiDds
|
||||
LtsPrinting
|
||||
ddsconnector
|
||||
svcWhgCommon
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(WhmGuiPlugin)
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for eqm Operator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#include "whm_equipment_type.h"
|
||||
#include "ui_whm_equipment_type.h"
|
||||
|
||||
#include "equipment_type_model.h"
|
||||
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
CustomViewEquipment::CustomViewEquipment(QWidget *parent)
|
||||
: AbstractDisplayWidget(parent)
|
||||
, m_ui(new Ui::CustomViewEquipment)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
CustomViewEquipment::~CustomViewEquipment()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool CustomViewEquipment::init(const QModelIndex &idx)
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
|
||||
m_ui->lbName->setText(rowData(idx, WarehouseManagement::EquipmentModel::Name).toString());
|
||||
m_ui->lbInfo->setText(QStringLiteral("ID: %1, Group: %2")
|
||||
.arg(rowData(idx, WarehouseManagement::EquipmentModel::ID).toString(),
|
||||
rowData(idx, WarehouseManagement::EquipmentModel::Group).toString()));
|
||||
return true;
|
||||
}
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for eqm Equipment
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Viewer/LtsDataView/abstract_display_widget.h>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class CustomViewEquipment;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class CustomViewEquipment final : public LtsDataView::AbstractDisplayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomViewEquipment(QWidget *parent = nullptr);
|
||||
~CustomViewEquipment();
|
||||
bool init(const QModelIndex &idx) override;
|
||||
|
||||
private:
|
||||
Ui::CustomViewEquipment* m_ui;
|
||||
|
||||
};
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CustomViewEquipment</class>
|
||||
<widget class="QWidget" name="CustomViewEquipment">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>74</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbInfo">
|
||||
<property name="text">
|
||||
<string notr="true">Info</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for eqm Operator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#include "whm_injury_model.h"
|
||||
#include "ui_whm_injury_model.h"
|
||||
|
||||
#include "injury_model_model.h"
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
CustomViewInjuryModel::CustomViewInjuryModel(QWidget *parent)
|
||||
: AbstractDisplayWidget(parent)
|
||||
, m_ui(new Ui::CustomViewInjuryModel)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
CustomViewInjuryModel::~CustomViewInjuryModel()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool CustomViewInjuryModel::init(const QModelIndex &idx)
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
|
||||
m_ui->lbName->setText(rowData(idx, WarehouseManagement::InjuryModelModel::Name).toString());
|
||||
m_ui->lbInfo->setText(rowData(idx, WarehouseManagement::InjuryModelModel::Description).toString());
|
||||
return true;
|
||||
}
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for eqm InjuryModel
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Viewer/LtsDataView/abstract_display_widget.h>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class CustomViewInjuryModel;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class CustomViewInjuryModel final : public LtsDataView::AbstractDisplayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomViewInjuryModel(QWidget *parent = nullptr);
|
||||
~CustomViewInjuryModel();
|
||||
bool init(const QModelIndex &idx) override;
|
||||
|
||||
private:
|
||||
Ui::CustomViewInjuryModel* m_ui;
|
||||
|
||||
};
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CustomViewInjuryModel</class>
|
||||
<widget class="QWidget" name="CustomViewInjuryModel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>74</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbInfo">
|
||||
<property name="text">
|
||||
<string notr="true">Info</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Add Equipment Type - Ask for new ID and id of template to copy from
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Malte Diers, NLE, 2020-07-20
|
||||
*/
|
||||
|
||||
#include "equipment_type_add.h"
|
||||
#include "ui_equipment_type_add.h"
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
EquipmentTypeAdd::EquipmentTypeAdd(const QMap<int, QString> &equipmentTypes, QWidget *parent)
|
||||
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_ui(new Ui::EquipmentTypeAdd)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked,
|
||||
this, &EquipmentTypeAdd::reject);
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked,
|
||||
this, &EquipmentTypeAdd::onOkay);
|
||||
|
||||
for (int val = 1; val <= 255; ++ val)
|
||||
{
|
||||
if (!equipmentTypes.contains(val))
|
||||
m_ui->cbId->addItem(QString::number(val), val);
|
||||
else
|
||||
m_ui->cbEqType->addItem(equipmentTypes.value(val), val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EquipmentTypeAdd::~EquipmentTypeAdd()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void EquipmentTypeAdd::onOkay()
|
||||
{
|
||||
emit newEquipment(m_ui->cbId->currentData().toInt(), m_ui->cbEqType->currentData().toInt());
|
||||
accept();
|
||||
}
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Add Equipment Type - Ask for new ID and id of template to copy from
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Malte Diers, NLE, 2020-07-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <LtsWidgets/lts_dialog_button_box.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class EquipmentTypeAdd;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
class EquipmentTypeAdd : public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EquipmentTypeAdd(const QMap<int, QString> &equipmentTypes, QWidget *parent = nullptr);
|
||||
~EquipmentTypeAdd();
|
||||
|
||||
private slots:
|
||||
void onOkay();
|
||||
|
||||
signals:
|
||||
void newEquipment(int id, int copyOf);
|
||||
|
||||
private:
|
||||
Ui::EquipmentTypeAdd *m_ui;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EquipmentTypeAdd</class>
|
||||
<widget class="QWidget" name="EquipmentTypeAdd">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>198</width>
|
||||
<height>134</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add Equipment Type:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Copy from:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>New Id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblCharge">
|
||||
<property name="text">
|
||||
<string>Add new Equipment Type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cbEqType"/>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="LtsWidgets::LtsDialogButtonBox" name="ltsDialogButtonBox"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="cbId"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsDialogButtonBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_dialog_button_box.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,282 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* WarehouseManagement - Operator Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "equipment_type_edit_dialog.h"
|
||||
#include "ui_equipment_type_edit_dialog.h"
|
||||
#include "injury_model_model.h"
|
||||
#include "../whm_data_plugin_interface.h"
|
||||
|
||||
#include <limits>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/whg_translation.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
EquipmentEditDialog::EquipmentEditDialog(const int equipmentId,
|
||||
LtsSession::LtsSession *session,
|
||||
QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
||||
, m_equipmentId(equipmentId)
|
||||
, m_session(session)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(WarehouseGuez::getLogger("EquipmentEditDialog"))
|
||||
, m_ui(new Ui::EquipmentEditDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
m_uiRequirements->addRequirement({m_ui->lbName, [this]()
|
||||
{
|
||||
m_ui->leName->setText(m_ui->leName->text().simplified());
|
||||
return (m_ui->leName->text().size() > 0);
|
||||
}});
|
||||
}
|
||||
|
||||
EquipmentEditDialog::~EquipmentEditDialog()
|
||||
{
|
||||
delete m_requestHelper;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool EquipmentEditDialog::init()
|
||||
{
|
||||
if (!m_session->getDtc<WarehouseManagement::DataInterface>(m_dtc) ||
|
||||
!m_dtc->enableAll() ||
|
||||
!m_session->getFtc<WarehouseManagement::DataInterface>(m_ftc) ||
|
||||
!m_ftc->enableAll())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "whm equ WarehouseManagement dtc/ftc not found!";
|
||||
return false;
|
||||
}
|
||||
|
||||
loadUiStandards();
|
||||
loadUiValues();
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Equipment_Types"));
|
||||
return true;
|
||||
}
|
||||
|
||||
void EquipmentEditDialog::loadUiStandards()
|
||||
{
|
||||
// Display Unit
|
||||
m_ui->cmbDisplayLanguage->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageGerman), WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageGerman);
|
||||
m_ui->cmbDisplayLanguage->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageEnglish), WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageEnglish);
|
||||
m_ui->cmbDisplayLanguage->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageFrench), WarehouseGuez::ConfigurationAbeLanguage_def::AbeLanguageFrench);
|
||||
|
||||
// MHGR Sensor
|
||||
m_ui->cmbMhgrOperatingMode->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnTrainingEquipment), WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnTrainingEquipment);
|
||||
m_ui->cmbMhgrOperatingMode->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnOtherVehicle), WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnOtherVehicle);
|
||||
m_ui->cmbMhgrOperatingMode->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnSrVehicle), WarehouseGuez::ConfigurationMhgrSensor_def::MhgrSensorOperatingOnSrVehicle);
|
||||
|
||||
// Configuration
|
||||
m_ui->cmbConfAgdusHv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWNoHelmetNoWest), WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWNoHelmetNoWest);
|
||||
m_ui->cmbConfAgdusHv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWWithHelmetNoVest), WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWWithHelmetNoVest);
|
||||
m_ui->cmbConfAgdusHv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWWithHelmetWithVest), WarehouseGuez::ConfigurationAgdusHV_def::AgdusHWWithHelmetWithVest);
|
||||
|
||||
m_ui->cmbConfPositionUpdate->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdateVehicle), WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdateVehicle);
|
||||
m_ui->cmbConfPositionUpdate->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdatePerson), WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdatePerson);
|
||||
m_ui->cmbConfPositionUpdate->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdateAirUnit), WarehouseGuez::ConfigurationPositionUpdate_def::PositionUpdateAirUnit);
|
||||
|
||||
m_ui->cmbConfDisplayAdag->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagNoDisplay), WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagNoDisplay);
|
||||
m_ui->cmbConfDisplayAdag->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAbe), WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAbe);
|
||||
m_ui->cmbConfDisplayAdag->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusPassiveAbe), WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusPassiveAbe);
|
||||
m_ui->cmbConfDisplayAdag->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusHW), WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusHW);
|
||||
m_ui->cmbConfDisplayAdag->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusBt46), WarehouseGuez::ConfigurationDisplayAdag_def::DisplayAdagAgdusBt46);
|
||||
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASNoDisplayAll), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASNoDisplayAll);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAbeAll), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAbeAll);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeDefault), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeDefault);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeUnarmouredWheeledVehicle), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeUnarmouredWheeledVehicle);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeCraneVehicle), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeCraneVehicle);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeExcavatorVehicle), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeExcavatorVehicle);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeNbcDetectionFuchs), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeNbcDetectionFuchs);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeArmouredWheeledVehicle), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeArmouredWheeledVehicle);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeM113BasedVehicles), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeM113BasedVehicles);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPAssiveAbeMiwSkorpion), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPAssiveAbeMiwSkorpion);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePiPzDachs), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePiPzDachs);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeMiRPzKeiler), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeMiRPzKeiler);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeBPzBueffel), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeBPzBueffel);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePrLPzBiber), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePrLPzBiber);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePZh2000), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbePZh2000);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeMinethrowerMiv), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeMinethrowerMiv);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeWieselAff), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeWieselAff);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeFlarakwatrgozelot), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusPassiveAbeFlarakwatrgozelot);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusHWAll), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusHWAll);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46Default), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46Default);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46KPzLeopard), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46KPzLeopard);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46SPzMarder), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46SPzMarder);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46LLPzWieselMk), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46LLPzWieselMk);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46LLPzWieselTow), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46LLPzWieselTow);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46SpehwgFennek), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46SpehwgFennek);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GtkBoxer), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GtkBoxer);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GefKl_1_4), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GefKl_1_4);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GTFKl_1_4), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46GTFKl_1_4);
|
||||
m_ui->cmbConfDisplayAdagSubunit->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46TPzFuchs), WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::DASAgdusBt46TPzFuchs);
|
||||
|
||||
m_ui->cmbConfEffectModelAgdus->addItem(QObject::tr("NONE"), 0);
|
||||
auto cb = [this](const WarehouseGuez::InjuryModelAgdusWh &injModel)
|
||||
{
|
||||
m_ui->cmbConfEffectModelAgdus->addItem(QString::fromStdString(injModel.name()), injModel.id());
|
||||
};
|
||||
m_dtc->injuryModelAgdusWhs(cb);
|
||||
|
||||
// Effect Simulator
|
||||
m_ui->cmbSpecialSensorFir->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirNoConfiguration), WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirNoConfiguration);
|
||||
m_ui->cmbSpecialSensorFir->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirFir), WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirFir);
|
||||
m_ui->cmbSpecialSensorFir->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirFirSpzMarder), WarehouseGuez::ConfigurationSpecialSensorFir_def::SpecialSensorFirFirSpzMarder);
|
||||
|
||||
m_ui->cmbSpecialSensorMv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineFitNoConfiguration), WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineFitNoConfiguration);
|
||||
m_ui->cmbSpecialSensorMv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineMv), WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineMv);
|
||||
m_ui->cmbSpecialSensorMv->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineWmv), WarehouseGuez::ConfigurationSpecialSensorMineFit_def::SpecialSensorMineWmv);
|
||||
|
||||
m_ui->cmbSpecialSensorStd->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdNoConfiguration), WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdNoConfiguration);
|
||||
m_ui->cmbSpecialSensorStd->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdZabc), WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdZabc);
|
||||
m_ui->cmbSpecialSensorStd->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdCsf), WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdCsf);
|
||||
m_ui->cmbSpecialSensorStd->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdPzBr), WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdPzBr);
|
||||
m_ui->cmbSpecialSensorStd->addItem(WarehouseGuez::toString(WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdMrf), WarehouseGuez::ConfigurationSpecialSensorStd_def::SpecialSensorStdMrf);
|
||||
//done
|
||||
}
|
||||
|
||||
void EquipmentEditDialog::loadUiValues()
|
||||
{
|
||||
WarehouseGuez::EquipmentTypeWh eq = m_dtc->equipmentTypeWh(m_equipmentId);
|
||||
|
||||
// Head
|
||||
m_ui->lblId->setText(QString::number(eq.id()));
|
||||
m_ui->leName->setText(QString::fromStdString(eq.name()));
|
||||
m_ui->sbGroup->setValue(eq.equipGroup());
|
||||
//m_ui->sbMinEquipNo->setMaximum(USHRT_MAX);
|
||||
//m_ui->sbMaxEquipNo->setMaximum(USHRT_MAX);
|
||||
//ULICE only decodes numbers up to 50.000 not ushort max
|
||||
m_ui->sbMinEquipNo->setMaximum(50000);
|
||||
m_ui->sbMaxEquipNo->setMaximum(50000);
|
||||
|
||||
m_ui->sbMinEquipNo->setValue(eq.minEquipNo());
|
||||
m_ui->sbMaxEquipNo->setValue(eq.maxEquipNo());
|
||||
// CAN Devices
|
||||
setCanDevicesInUi(eq.canDevices());
|
||||
m_ui->sbCanStartUpTime->setValue(eq.configurationStartupTime());
|
||||
// Display Unit
|
||||
m_ui->cmbDisplayLanguage->setCurrentText(WarehouseGuez::toString(eq.configurationAbeLanguage()));
|
||||
m_ui->chbDisplayAudioFeedback->setChecked(eq.configurationAudioResponse());
|
||||
// MHGR Sensor
|
||||
m_ui->cmbMhgrOperatingMode->setCurrentText(WarehouseGuez::toString(eq.configurationMhgrOperatingMode()));
|
||||
m_ui->chbMhgrEnergySaveMode->setChecked(eq.configurationMhgrEnergieSave());
|
||||
// Configuration
|
||||
m_ui->cmbConfAgdusHv->setCurrentText(WarehouseGuez::toString(eq.configurationAgdusHV()));
|
||||
m_ui->cmbConfPositionUpdate->setCurrentText(WarehouseGuez::toString(eq.posUpdate()));
|
||||
m_ui->cmbConfDisplayAdag->setCurrentText(WarehouseGuez::toString(eq.configurationDisplayAdag()));
|
||||
m_ui->cmbConfDisplayAdagSubunit->setCurrentText(WarehouseGuez::toString(eq.configurationDisplayAdagSubUnit()));
|
||||
m_ui->cmbConfEffectModelAgdus->setCurrentIndex(m_ui->cmbConfEffectModelAgdus->findData(eq.vbAgdusId()));
|
||||
m_ui->sbConfEffectModelMineIed->setValue(eq.vbMineIed());
|
||||
m_ui->sbConfEffectModelHighAngleFire->setValue(eq.vbFireArea());
|
||||
m_ui->sbConfEffectModelResources->setValue(eq.vbAirSupport());
|
||||
m_ui->sbConfEffectModelAcWeapon->setValue(eq.vbNc());
|
||||
// Effect Simulator
|
||||
m_ui->chbEffSimPyrotechnic->setChecked(eq.configurationCedPyrotechnic());
|
||||
// Special Sensor
|
||||
m_ui->chbSpecialSensorFirSan->setChecked(eq.configurationSsFirSan());
|
||||
m_ui->cmbSpecialSensorFir->setCurrentText(WarehouseGuez::toString(eq.configurationSsFirFunction()));
|
||||
m_ui->cmbSpecialSensorMv->setCurrentText(WarehouseGuez::toString(eq.configurationSsMineFitFunction()));
|
||||
m_ui->cmbSpecialSensorStd->setCurrentText(WarehouseGuez::toString(eq.configurationSsStandardFunction()));
|
||||
// /done
|
||||
|
||||
// FireMarker == DMF entfaellt
|
||||
m_ui->chbCanFireMarker->hide();
|
||||
}
|
||||
|
||||
void EquipmentEditDialog::onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
}
|
||||
|
||||
void EquipmentEditDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, m_equipmentId <= 0 ? tr("Add Equipment Type") : tr("Edit Equipment #%1").arg(m_equipmentId));
|
||||
}
|
||||
|
||||
bool EquipmentEditDialog::apply()
|
||||
{
|
||||
WarehouseGuez::EquipmentTypeWh equ(
|
||||
m_equipmentId,
|
||||
m_ui->leName->text().simplified().toStdString(),
|
||||
m_ui->sbGroup->value(),
|
||||
m_ui->sbMinEquipNo->value(),
|
||||
m_ui->sbMaxEquipNo->value(),
|
||||
static_cast<WarehouseGuez::ConfigurationPositionUpdate_def::type>(m_ui->cmbConfPositionUpdate->currentData().toInt()),
|
||||
static_cast<WarehouseGuez::ConfigurationDisplayAdag_def::type>(m_ui->cmbConfDisplayAdag->currentData().toInt()),
|
||||
static_cast<WarehouseGuez::ConfigurationDisplayAdagSubUnit_def::type>(m_ui->cmbConfDisplayAdagSubunit->currentData().toInt()),
|
||||
static_cast<WarehouseGuez::ConfigurationAgdusHV_def::type>(m_ui->cmbConfAgdusHv->currentData().toInt()),
|
||||
m_ui->cmbConfEffectModelAgdus->currentData().toInt(),
|
||||
m_ui->sbConfEffectModelMineIed->value(),
|
||||
m_ui->sbConfEffectModelHighAngleFire->value(),
|
||||
m_ui->sbConfEffectModelResources->value(),
|
||||
m_ui->sbConfEffectModelAcWeapon->value(),
|
||||
static_cast<WarehouseGuez::ConfigurationAbeLanguage_def::type>(m_ui->cmbDisplayLanguage->currentData().toInt()),
|
||||
m_ui->chbDisplayAudioFeedback->isChecked(),
|
||||
static_cast<WarehouseGuez::ConfigurationMhgrSensor_def::type>(m_ui->cmbMhgrOperatingMode->currentData().toInt()),
|
||||
m_ui->chbMhgrEnergySaveMode->isChecked(),
|
||||
m_ui->chbEffSimPyrotechnic->isChecked(),
|
||||
m_ui->chbSpecialSensorFirSan->isChecked(),
|
||||
static_cast<WarehouseGuez::ConfigurationSpecialSensorFir_def::type>(m_ui->cmbSpecialSensorFir->currentData().toInt()),
|
||||
static_cast<WarehouseGuez::ConfigurationSpecialSensorMineFit_def::type>(m_ui->cmbSpecialSensorMv->currentData().toInt()),
|
||||
static_cast<WarehouseGuez::ConfigurationSpecialSensorStd_def::type>(m_ui->cmbSpecialSensorStd->currentData().toInt()),
|
||||
m_ui->sbCanStartUpTime->value(),
|
||||
canDevicesFromUi());
|
||||
|
||||
return m_requestHelper->startSingleRequest([equ, this]()
|
||||
{
|
||||
return m_ftc->modifyEquipmentTypeWhRequest(equ, this);
|
||||
});
|
||||
}
|
||||
|
||||
quint32 EquipmentEditDialog::canDevicesFromUi()
|
||||
{
|
||||
quint32 ret = 0;
|
||||
|
||||
if (m_ui->chbCanAgdus->isChecked()) { ret |= WarehouseGuez::CanDevices_def::AGDUS; }
|
||||
if (m_ui->chbCanDisplayUnit->isChecked()) { ret |= WarehouseGuez::CanDevices_def::ABE; }
|
||||
if (m_ui->chbCanSpecialSensorFir->isChecked()) { ret |= WarehouseGuez::CanDevices_def::SS_FIR; }
|
||||
if (m_ui->chbCanSpecialSensorMv->isChecked()) { ret |= WarehouseGuez::CanDevices_def::SS_MV; }
|
||||
if (m_ui->chbCanSpecialSensorStd->isChecked()) { ret |= WarehouseGuez::CanDevices_def::SS_STD; }
|
||||
if (m_ui->chbCanMhgrSensor->isChecked()) { ret |= WarehouseGuez::CanDevices_def::MHGR; }
|
||||
if (m_ui->chbCanOverpressureSensor->isChecked()) { ret |= WarehouseGuez::CanDevices_def::ABC_UEBERDR; }
|
||||
if (m_ui->chbCanNbcFlowSensor->isChecked()) { ret |= WarehouseGuez::CanDevices_def::ABC_STROEM; }
|
||||
if (m_ui->chbCanEffectSimulator->isChecked()) { ret |= WarehouseGuez::CanDevices_def::WIRKDARST; }
|
||||
if (m_ui->chbCanOcLaptop->isChecked()) { ret |= WarehouseGuez::CanDevices_def::SRT; }
|
||||
if (m_ui->chbCanFireMarker->isChecked()) { ret |= WarehouseGuez::CanDevices_def::DMF; }
|
||||
if (m_ui->chbCanIedSensor->isChecked()) { ret |= WarehouseGuez::CanDevices_def::IED_SENSOR; }
|
||||
if (m_ui->chbCanIedControlUnit->isChecked()) { ret |= WarehouseGuez::CanDevices_def::IED_KONT_EINH; }
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void EquipmentEditDialog::setCanDevicesInUi(quint32 devices)
|
||||
{
|
||||
m_ui->chbCanAgdus->setChecked(devices & WarehouseGuez::CanDevices_def::AGDUS);
|
||||
m_ui->chbCanDisplayUnit->setChecked(devices & WarehouseGuez::CanDevices_def::ABE);
|
||||
m_ui->chbCanSpecialSensorFir->setChecked(devices & WarehouseGuez::CanDevices_def::SS_FIR);
|
||||
m_ui->chbCanSpecialSensorMv->setChecked(devices & WarehouseGuez::CanDevices_def::SS_MV);
|
||||
m_ui->chbCanSpecialSensorStd->setChecked(devices & WarehouseGuez::CanDevices_def::SS_STD);
|
||||
m_ui->chbCanMhgrSensor->setChecked(devices & WarehouseGuez::CanDevices_def::MHGR);
|
||||
m_ui->chbCanOverpressureSensor->setChecked(devices & WarehouseGuez::CanDevices_def::ABC_UEBERDR);
|
||||
m_ui->chbCanNbcFlowSensor->setChecked(devices & WarehouseGuez::CanDevices_def::ABC_STROEM);
|
||||
m_ui->chbCanEffectSimulator->setChecked(devices & WarehouseGuez::CanDevices_def::WIRKDARST);
|
||||
m_ui->chbCanOcLaptop->setChecked(devices & WarehouseGuez::CanDevices_def::SRT);
|
||||
m_ui->chbCanFireMarker->setChecked(devices & WarehouseGuez::CanDevices_def::DMF);
|
||||
m_ui->chbCanIedSensor->setChecked(devices & WarehouseGuez::CanDevices_def::IED_SENSOR);
|
||||
m_ui->chbCanIedControlUnit->setChecked(devices & WarehouseGuez::CanDevices_def::IED_KONT_EINH);
|
||||
}
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* OperatorManangement - Operator Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
|
||||
namespace Ui {
|
||||
class EquipmentEditDialog;
|
||||
}
|
||||
|
||||
namespace LtsSession {
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace LtsUtils {
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class EquipmentEditDialog : public LtsWidgets::LtsDialog
|
||||
, protected WarehouseGuez::Interface::Ftc::ModifyEquipmentTypeWhReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EquipmentEditDialog(const int equipmentId,
|
||||
LtsSession::LtsSession *session,
|
||||
QWidget *parent = nullptr);
|
||||
~EquipmentEditDialog();
|
||||
|
||||
bool init();
|
||||
void loadUiStandards();
|
||||
void loadUiValues();
|
||||
|
||||
signals:
|
||||
void sendData(const WarehouseGuez::EquipmentTypeWh &data);
|
||||
|
||||
protected:
|
||||
void onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
bool apply() override final;
|
||||
|
||||
quint32 canDevicesFromUi();
|
||||
void setCanDevicesInUi(quint32 devices);
|
||||
|
||||
const int m_equipmentId;
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
Ui::EquipmentEditDialog *m_ui;
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,581 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EquipmentEditDialog</class>
|
||||
<widget class="QWidget" name="EquipmentEditDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>645</width>
|
||||
<height>800</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Equipment Edit Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbConfiguration">
|
||||
<property name="title">
|
||||
<string>Configuration</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="sbConfEffectModelResources">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbConfDisplayAdagSubunit">
|
||||
<property name="text">
|
||||
<string>Display ADAG subunit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbConfPositionUpdate">
|
||||
<property name="text">
|
||||
<string>Position update:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbConfEffectModelMineIed">
|
||||
<property name="text">
|
||||
<string>Effect model Mine/IED:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbConfEffectModelAgdus">
|
||||
<property name="text">
|
||||
<string>Effect model AGDUS:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cmbConfDisplayAdagSubunit"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="lbConfEffectModelResources">
|
||||
<property name="text">
|
||||
<string>Effect model Resources:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cmbConfPositionUpdate"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbConfDisplayAdag">
|
||||
<property name="text">
|
||||
<string>Display ADAG:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="sbConfEffectModelAcWeapon">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="cmbConfDisplayAdag"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="lbConfEffectModelAcWeapon">
|
||||
<property name="text">
|
||||
<string>Effect model N/C-Weapon:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="sbConfEffectModelHighAngleFire">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbConfAgdusHv"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="cmbConfEffectModelAgdus"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="sbConfEffectModelMineIed">
|
||||
<property name="maximum">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lbConfEffectModelHighAngleFire">
|
||||
<property name="text">
|
||||
<string>Effect model Artillery:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbConfAgdusHv">
|
||||
<property name="text">
|
||||
<string>AGDUS HV:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbEffectSimulator">
|
||||
<property name="title">
|
||||
<string>Effect Simulator</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chbEffSimPyrotechnic">
|
||||
<property name="text">
|
||||
<string>Pyrotechnic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbSpecialSensor">
|
||||
<property name="title">
|
||||
<string>Special Sensor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbSpecialSensorFir">
|
||||
<property name="text">
|
||||
<string>Special sensor FIR:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="cmbSpecialSensorStd"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="cmbSpecialSensorFir"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbSpecialSensorMv">
|
||||
<property name="text">
|
||||
<string>Special sensor MV:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cmbSpecialSensorMv"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbSpecialSensorStd">
|
||||
<property name="text">
|
||||
<string>Special sensor STD:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chbSpecialSensorFirSan">
|
||||
<property name="text">
|
||||
<string>Special Sensor FIR SAN</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbCanDevices">
|
||||
<property name="title">
|
||||
<string>CAN Devices</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="chbCanNbcFlowSensor">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>NBC flow sensor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="chbCanOcLaptop">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>O/C Laptop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chbCanIedSensor">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IED sensor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="chbCanIedControlUnit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IED control unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="chbCanMhgrSensor">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MHGR sensor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="chbCanDisplayUnit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="chbCanOverpressureSensor">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Overpressure sensor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="chbCanEffectSimulator">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Effect simulator</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chbCanAgdus">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AGDUS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="chbCanSpecialSensorMv">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Special sensor MV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="chbCanFireMarker">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fire marker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="chbCanSpecialSensorFir">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Special sensor FIR</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="chbCanSpecialSensorStd">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Special sensor STD</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>CAN start up time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSpinBox" name="sbCanStartUpTime">
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbDisplayUnit">
|
||||
<property name="title">
|
||||
<string>Display Unit</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbDisplayLanguage">
|
||||
<property name="text">
|
||||
<string>Language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbDisplayLanguage"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chbDisplayAudioFeedback">
|
||||
<property name="text">
|
||||
<string>Audio feedback</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>MHGR Sensor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbMhgrOperatingMode"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chbMhgrEnergySaveMode">
|
||||
<property name="text">
|
||||
<string>Energy save mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbMhgrOperatingMode">
|
||||
<property name="text">
|
||||
<string>Operating mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="5">
|
||||
<widget class="QSpinBox" name="sbMinEquipNo">
|
||||
<property name="minimum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QSpinBox" name="sbGroup"/>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QSpinBox" name="sbMaxEquipNo">
|
||||
<property name="minimum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>50000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lbGroup">
|
||||
<property name="text">
|
||||
<string>Group:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QLabel" name="lbMinEquipNo">
|
||||
<property name="text">
|
||||
<string>Min. Equip. No.:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QLabel" name="lbMaxEquipNo">
|
||||
<property name="text">
|
||||
<string>Max. Equip. No.:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbxId">
|
||||
<property name="text">
|
||||
<string>Id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="7">
|
||||
<widget class="QLineEdit" name="leName"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="lblId">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>leName</tabstop>
|
||||
<tabstop>sbGroup</tabstop>
|
||||
<tabstop>sbMinEquipNo</tabstop>
|
||||
<tabstop>sbMaxEquipNo</tabstop>
|
||||
<tabstop>chbCanAgdus</tabstop>
|
||||
<tabstop>chbCanIedSensor</tabstop>
|
||||
<tabstop>chbCanIedControlUnit</tabstop>
|
||||
<tabstop>chbCanOcLaptop</tabstop>
|
||||
<tabstop>chbCanDisplayUnit</tabstop>
|
||||
<tabstop>chbCanMhgrSensor</tabstop>
|
||||
<tabstop>chbCanNbcFlowSensor</tabstop>
|
||||
<tabstop>chbCanOverpressureSensor</tabstop>
|
||||
<tabstop>chbCanFireMarker</tabstop>
|
||||
<tabstop>chbCanEffectSimulator</tabstop>
|
||||
<tabstop>chbCanSpecialSensorFir</tabstop>
|
||||
<tabstop>chbCanSpecialSensorMv</tabstop>
|
||||
<tabstop>chbCanSpecialSensorStd</tabstop>
|
||||
<tabstop>sbCanStartUpTime</tabstop>
|
||||
<tabstop>cmbDisplayLanguage</tabstop>
|
||||
<tabstop>chbDisplayAudioFeedback</tabstop>
|
||||
<tabstop>cmbMhgrOperatingMode</tabstop>
|
||||
<tabstop>chbMhgrEnergySaveMode</tabstop>
|
||||
<tabstop>cmbConfAgdusHv</tabstop>
|
||||
<tabstop>cmbConfPositionUpdate</tabstop>
|
||||
<tabstop>cmbConfDisplayAdag</tabstop>
|
||||
<tabstop>cmbConfDisplayAdagSubunit</tabstop>
|
||||
<tabstop>cmbConfEffectModelAgdus</tabstop>
|
||||
<tabstop>sbConfEffectModelMineIed</tabstop>
|
||||
<tabstop>sbConfEffectModelHighAngleFire</tabstop>
|
||||
<tabstop>sbConfEffectModelResources</tabstop>
|
||||
<tabstop>sbConfEffectModelAcWeapon</tabstop>
|
||||
<tabstop>chbEffSimPyrotechnic</tabstop>
|
||||
<tabstop>chbSpecialSensorFirSan</tabstop>
|
||||
<tabstop>cmbSpecialSensorFir</tabstop>
|
||||
<tabstop>cmbSpecialSensorMv</tabstop>
|
||||
<tabstop>cmbSpecialSensorStd</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for WarehouseManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "equipment_type_list.h"
|
||||
#include "ui_equipment_type_list.h"
|
||||
#include "equipment_type_edit_dialog.h"
|
||||
#include "CustomViews/whm_equipment_type.h"
|
||||
#include "../whm_data_plugin_interface.h"
|
||||
#include "equipment_type_add.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
EquipmentList::EquipmentList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_model(nullptr)
|
||||
, m_session(session)
|
||||
, m_ftc(nullptr)
|
||||
, m_dtc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(WarehouseGuez::getLogger("EquipmentList"))
|
||||
, m_ui(new Ui::EquipmentList)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &EquipmentList::onAddEquipment);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &EquipmentList::onEditEquipment);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, this, &EquipmentList::onRemoveEquipment);
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalDoubleClicked,this, &EquipmentList::onEditEquipment);
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalEnterPressed,this, &EquipmentList::onEditEquipment);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Equipment_Types"));
|
||||
}
|
||||
|
||||
EquipmentList::~EquipmentList()
|
||||
{
|
||||
delete m_model;
|
||||
delete m_requestHelper;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void EquipmentList::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Equipment Types Overview"));
|
||||
}
|
||||
|
||||
void EquipmentList::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->widget->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
bool EquipmentList::init()
|
||||
{
|
||||
if (!m_session->getFtc<WarehouseManagement::DataInterface>(m_ftc) ||
|
||||
!m_session->getDtc<WarehouseManagement::DataInterface>(m_dtc))
|
||||
return false;
|
||||
|
||||
m_model = new EquipmentModel(this);
|
||||
m_model->initModel(m_dtc);
|
||||
m_ui->widget->setModel(m_model, [this]() { return new CustomViewEquipment(this); });
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
m_ui->widget->hideColumn(EquipmentModel::Columns::ID);
|
||||
#endif
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged,
|
||||
this, &EquipmentList::enaDisa);
|
||||
|
||||
enaDisa();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void EquipmentList::onRemoveEquipmentTypeWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
}
|
||||
|
||||
void EquipmentList::editEquipment(int id)
|
||||
{
|
||||
EquipmentEditDialog *dialog = LtsWidgets::initDialog(new EquipmentEditDialog(id, m_session, this));
|
||||
const QString identifier = QLatin1String("EditEquipment") + QString::number(id);
|
||||
addDialog(dialog, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void EquipmentList::onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
if (reply.error())
|
||||
return;
|
||||
|
||||
editEquipment(reply.id());
|
||||
}
|
||||
|
||||
void EquipmentList::enaDisa()
|
||||
{
|
||||
QModelIndexList selectedRows = m_ui->widget->selectedRows();
|
||||
const int cntSelectedRows = selectedRows.size();
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, cntSelectedRows == 1 );
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, cntSelectedRows == 1 );
|
||||
}
|
||||
|
||||
void EquipmentList::onRemoveEquipment()
|
||||
{
|
||||
QModelIndex idx = m_ui->widget->currentIndex();
|
||||
Core::RemoveElementRequest req = Core::RemoveElementRequest(m_model->getRowData(idx.row()).id());
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->removeEquipmentTypeWhRequest(req, this);
|
||||
});
|
||||
}
|
||||
|
||||
void EquipmentList::onAddEquipment()
|
||||
{
|
||||
EquipmentTypeAdd *addDlg = new EquipmentTypeAdd(m_model->equipmentTypeNames(), this);
|
||||
connect(addDlg, &EquipmentTypeAdd::newEquipment, this, &EquipmentList::onNewEquipment);
|
||||
addDlg->show();
|
||||
}
|
||||
|
||||
void EquipmentList::onNewEquipment(int id, int copyOf)
|
||||
{
|
||||
WarehouseGuez::EquipmentTypeWh equ = m_dtc->equipmentTypeWh(copyOf);
|
||||
equ.id(0-id);
|
||||
m_requestHelper->startSingleRequest([equ, this]()
|
||||
{
|
||||
return m_ftc->modifyEquipmentTypeWhRequest(equ, this);
|
||||
});
|
||||
}
|
||||
|
||||
void EquipmentList::onEditEquipment()
|
||||
{
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
WarehouseGuez::EquipmentTypeWh equip = m_model->getRowData(idx.row());
|
||||
|
||||
if (equip.id() < 0)
|
||||
return;
|
||||
|
||||
editEquipment(equip.id());
|
||||
}
|
||||
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OpeartorManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "equipment_type_model.h"
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
namespace Ui {
|
||||
class EquipmentList;
|
||||
}
|
||||
|
||||
namespace LtsSession {
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace LtsUtils {
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class EquipmentList : public LtsWidgets::LtsDialog
|
||||
, protected WarehouseGuez::Interface::Ftc::RemoveEquipmentTypeWhReplyHandler
|
||||
, protected WarehouseGuez::Interface::Ftc::ModifyEquipmentTypeWhReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EquipmentList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~EquipmentList();
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
void onRemoveEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
QString m_menuGroup;
|
||||
EquipmentModel *m_model;
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
Ui::EquipmentList *m_ui;
|
||||
|
||||
void editEquipment(int id);
|
||||
|
||||
private slots:
|
||||
void enaDisa();
|
||||
void onRemoveEquipment();
|
||||
void onAddEquipment();
|
||||
void onEditEquipment();
|
||||
void onNewEquipment(int id, int copyOf);
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EquipmentList</class>
|
||||
<widget class="QWidget" name="EquipmentList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>674</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Operator Edit</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="LtsDataView::LtsDataView" name="widget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OperatorManangement - Operator Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "equipment_type_model.h"
|
||||
|
||||
#include <WarehouseGuez/whg_translation.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
EquipmentModel::EquipmentModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<WarehouseGuez::EquipmentTypeWh>({tr("Id"),
|
||||
tr("Name"),
|
||||
tr("Group"),
|
||||
tr("Group Range"),
|
||||
tr("Position Update"),
|
||||
tr("Display ADAG"),
|
||||
tr("Display ADAG Subunit"),
|
||||
tr("AGDUS HV"),
|
||||
tr("AGDUS Name"),
|
||||
tr("IED-Mine"),
|
||||
tr("Artillery"),
|
||||
tr("Resource"),
|
||||
tr("N/C-Weapon"),
|
||||
tr("Language"),
|
||||
tr("Audio Response"),
|
||||
tr("MHGR Mode"),
|
||||
tr("MHGR Energy Save"),
|
||||
tr("Pyrotechnic"),
|
||||
tr("Sensor FIR"),
|
||||
tr("Sensor MineFit"),
|
||||
tr("Sensor Standard"),
|
||||
tr("Startup Time")},
|
||||
parent)
|
||||
, m_logger(WarehouseGuez::getLogger(QStringLiteral("EquipmentModel")))
|
||||
{}
|
||||
|
||||
EquipmentModel::~EquipmentModel()
|
||||
{}
|
||||
|
||||
constexpr unsigned short getUnsignedShortValue(const int value)
|
||||
{
|
||||
//return (value < USHRT_MAX ? value : USHRT_MAX);
|
||||
return (value < 50000 ? value : 50000);
|
||||
}
|
||||
|
||||
bool EquipmentModel::initModel(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc)
|
||||
{
|
||||
m_dtc = dtc;
|
||||
|
||||
if (!m_dtc ||
|
||||
!m_dtc->enableEquipmentTypeWh() ||
|
||||
!m_dtc->enableInjuryModelAgdusWh())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "dtc not okay";
|
||||
return false;
|
||||
}
|
||||
connect(m_dtc.get(), &WarehouseGuez::Interface::Dtc::equipmentTypeWhChanged,
|
||||
this, &EquipmentModel::onDataChanged);
|
||||
connect(m_dtc.get(), &WarehouseGuez::Interface::Dtc::injuryModelAgdusWhChanged,
|
||||
this, &EquipmentModel::onInjuryModelChanged);
|
||||
|
||||
{
|
||||
auto cb = [this](const WarehouseGuez::EquipmentTypeWh &et)
|
||||
{
|
||||
onDataChanged(et, DataModification::eAdded);
|
||||
};
|
||||
m_dtc->equipmentTypeWhs(cb);
|
||||
}
|
||||
{
|
||||
auto cb = [this](const WarehouseGuez::InjuryModelAgdusWh &im)
|
||||
{
|
||||
onInjuryModelChanged(im);
|
||||
};
|
||||
m_dtc->injuryModelAgdusWhs(cb);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QVariant EquipmentModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const WarehouseGuez::EquipmentTypeWh &equip = m_vecData.at(index.row());
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case ID:
|
||||
return equip.id();
|
||||
case Name:
|
||||
return QString::fromStdString(equip.name());
|
||||
case Group:
|
||||
return equip.equipGroup();
|
||||
case GroupRange:
|
||||
return QStringLiteral("%1 - %2").arg(equip.minEquipNo()).arg(getUnsignedShortValue(equip.maxEquipNo()));
|
||||
case PositionUpdate:
|
||||
return WarehouseGuez::toString(equip.posUpdate());
|
||||
case DisplayAdag:
|
||||
return WarehouseGuez::toString(equip.configurationDisplayAdag());
|
||||
case DisplayAdagSubUnit:
|
||||
return WarehouseGuez::toString(equip.configurationDisplayAdagSubUnit());
|
||||
case AgdusHv:
|
||||
return WarehouseGuez::toString(equip.configurationAgdusHV());
|
||||
case AgdusName:
|
||||
return m_injuryModelNames.value(equip.vbAgdusId());
|
||||
case MineIed:
|
||||
return equip.vbMineIed();
|
||||
case FireArea:
|
||||
return equip.vbFireArea();
|
||||
case AirSupport:
|
||||
return equip.vbAirSupport();
|
||||
case Nc:
|
||||
return equip.vbNc();
|
||||
case Language:
|
||||
return WarehouseGuez::toString(equip.configurationAbeLanguage());
|
||||
case AudioResponse:
|
||||
return equip.configurationAudioResponse() ? tr("Yes") : tr("No");
|
||||
case MhgrMode:
|
||||
return WarehouseGuez::toString(equip.configurationMhgrOperatingMode());
|
||||
case MhgrEnergySave:
|
||||
return equip.configurationMhgrEnergieSave() ? tr("Yes") : tr("No");;
|
||||
case Pyrotechnic:
|
||||
return equip.configurationCedPyrotechnic() ? tr("Yes") : tr("No");
|
||||
case SensorFir:
|
||||
return WarehouseGuez::toString(equip.configurationSsFirFunction());
|
||||
case SensorMineFit:
|
||||
return WarehouseGuez::toString(equip.configurationSsMineFitFunction());
|
||||
case SensorStandard:
|
||||
return WarehouseGuez::toString(equip.configurationSsStandardFunction());
|
||||
case StartupTime:
|
||||
return equip.configurationStartupTime();
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QMap<int, QString> EquipmentModel::equipmentTypeNames() const
|
||||
{
|
||||
QMap<int, QString> retVal;
|
||||
for(auto val : m_vecData)
|
||||
retVal.insert(val.id(), QString::fromStdString(val.name()));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void EquipmentModel::onInjuryModelChanged(const WarehouseGuez::InjuryModelAgdusWh &im)
|
||||
{
|
||||
m_injuryModelNames[im.id()] = QString::fromStdString(im.name());
|
||||
}
|
||||
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for WarehouseManagement - Operator Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "injury_model_model.h"
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
#include <QHash>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class EquipmentModel final : public LtsWidgets::LtsAbstractTableModel<WarehouseGuez::EquipmentTypeWh>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
ID,
|
||||
Name,
|
||||
Group,
|
||||
GroupRange,
|
||||
PositionUpdate,
|
||||
DisplayAdag,
|
||||
DisplayAdagSubUnit,
|
||||
AgdusHv,
|
||||
AgdusName,
|
||||
MineIed,
|
||||
FireArea,
|
||||
AirSupport,
|
||||
Nc,
|
||||
Language,
|
||||
AudioResponse,
|
||||
MhgrMode,
|
||||
MhgrEnergySave,
|
||||
Pyrotechnic,
|
||||
SensorFir,
|
||||
SensorMineFit,
|
||||
SensorStandard,
|
||||
StartupTime
|
||||
};
|
||||
|
||||
explicit EquipmentModel(QObject *parent = nullptr);
|
||||
~EquipmentModel();
|
||||
|
||||
bool initModel(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc);
|
||||
|
||||
QVariant data(const QModelIndex &, int) const override final;
|
||||
|
||||
QMap<int, QString> equipmentTypeNames() const;
|
||||
protected:
|
||||
void onInjuryModelChanged(const WarehouseGuez::InjuryModelAgdusWh &im);
|
||||
private:
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
QHash<qint32, QString> m_injuryModelNames;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Add Equipment Type - Ask for new ID and id of template to copy from
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Malte Diers, NLE, 2020-07-20
|
||||
*/
|
||||
|
||||
#include "injury_model_add.h"
|
||||
#include "ui_injury_model_add.h"
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
InjuryModelAdd::InjuryModelAdd(const QSet<int> &availableIds, QWidget *parent)
|
||||
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_ui(new Ui::InjuryModelAdd)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked,
|
||||
this, &InjuryModelAdd::reject);
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked,
|
||||
this, &InjuryModelAdd::onOkay);
|
||||
|
||||
for (int val = 1; val <= 255; ++ val)
|
||||
{
|
||||
if (availableIds.contains(val))
|
||||
m_ui->cbId->addItem(QString::number(val), val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InjuryModelAdd::~InjuryModelAdd()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void InjuryModelAdd::onOkay()
|
||||
{
|
||||
emit newInjuryModel(m_ui->cbId->currentData().toInt());
|
||||
accept();
|
||||
}
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Add Equipment Type - Ask for new ID and id of template to copy from
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Malte Diers, NLE, 2020-07-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <LtsWidgets/lts_dialog_button_box.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class InjuryModelAdd;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
class InjuryModelAdd : public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InjuryModelAdd(const QSet<int> &availableIds, QWidget *parent = nullptr);
|
||||
~InjuryModelAdd();
|
||||
|
||||
private slots:
|
||||
void onOkay();
|
||||
|
||||
signals:
|
||||
void newInjuryModel(int id);
|
||||
|
||||
private:
|
||||
Ui::InjuryModelAdd *m_ui;
|
||||
};
|
||||
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InjuryModelAdd</class>
|
||||
<widget class="QWidget" name="InjuryModelAdd">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>181</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Add Equipment Type:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="cbId"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblCharge">
|
||||
<property name="text">
|
||||
<string notr="true">Add new Injury Model</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>New Id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="LtsWidgets::LtsDialogButtonBox" name="ltsDialogButtonBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsDialogButtonBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_dialog_button_box.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* WarehouseManagement - Operator Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "injury_model_edit_dialog.h"
|
||||
#include "ui_injury_model_edit_dialog.h"
|
||||
#include "../whm_data_plugin_interface.h"
|
||||
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
InjuryModelEditDialog::InjuryModelEditDialog(const int injuryModelId,
|
||||
LtsSession::LtsSession *session,
|
||||
QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
||||
, m_injuryModelId(injuryModelId)
|
||||
, m_session(session)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(WarehouseGuez::getLogger("InjuryModelEditDialog"))
|
||||
, m_ui(new Ui::InjuryModelEditDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
m_uiRequirements->addRequirement({m_ui->lbName, [this]()
|
||||
{
|
||||
m_ui->leName->setText(m_ui->leName->text().simplified());
|
||||
return (m_ui->leName->text().size() > 0);
|
||||
}});
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Injury_Model"));
|
||||
}
|
||||
|
||||
InjuryModelEditDialog::~InjuryModelEditDialog()
|
||||
{
|
||||
delete m_requestHelper;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool InjuryModelEditDialog::init()
|
||||
{
|
||||
if (!m_session->getDtc<WarehouseManagement::DataInterface>(m_dtc) ||
|
||||
!m_dtc->enableAll() ||
|
||||
!m_session->getFtc<WarehouseManagement::DataInterface>(m_ftc) ||
|
||||
!m_ftc->enableAll())
|
||||
return false;
|
||||
|
||||
loadUiValues();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InjuryModelEditDialog::loadUiValues()
|
||||
{
|
||||
WarehouseGuez::InjuryModelAgdusWh inj = m_dtc->injuryModelAgdusWh(m_injuryModelId);
|
||||
|
||||
m_ui->lblId->setText(QString::number(inj.id()));
|
||||
m_ui->leName->setText(QString::fromStdString(inj.name()));
|
||||
m_ui->leVersion->setText(QString::fromStdString(inj.version()));
|
||||
m_ui->pteDescription->insertPlainText(QString::fromStdString(inj.description()));
|
||||
}
|
||||
|
||||
void InjuryModelEditDialog::onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
}
|
||||
|
||||
void InjuryModelEditDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, m_injuryModelId < 1 ? tr("Add Injury Model") : tr("Edit Injury Model #%1").arg(m_injuryModelId));
|
||||
}
|
||||
|
||||
bool InjuryModelEditDialog::apply()
|
||||
{
|
||||
WarehouseGuez::InjuryModelAgdusWh req = WarehouseGuez::InjuryModelAgdusWh(
|
||||
m_ui->lblId->text().toInt(),
|
||||
m_ui->leName->text().toStdString(),
|
||||
m_ui->leVersion->text().toStdString(),
|
||||
m_ui->pteDescription->toPlainText().toStdString());
|
||||
|
||||
return m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->modifyInjuryModelAgdusWhRequest(req, this);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* OperatorManangement - Operator Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
namespace Ui {
|
||||
class InjuryModelEditDialog;
|
||||
}
|
||||
|
||||
namespace LtsSession {
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace LtsUtils {
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class InjuryModelEditDialog : public LtsWidgets::LtsDialog
|
||||
, protected WarehouseGuez::Interface::Ftc::ModifyInjuryModelAgdusWhReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InjuryModelEditDialog(const int injuryModelId,
|
||||
LtsSession::LtsSession *session,
|
||||
QWidget *parent = nullptr);
|
||||
~InjuryModelEditDialog();
|
||||
|
||||
bool init();
|
||||
void loadUiValues();
|
||||
|
||||
signals:
|
||||
void sendData(const WarehouseGuez::InjuryModelAgdusWh &data);
|
||||
|
||||
protected:
|
||||
void onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
bool apply() override final;
|
||||
|
||||
const int m_injuryModelId;
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
Ui::InjuryModelEditDialog *m_ui;
|
||||
};
|
||||
} //namespace WarehouseManagement
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InjuryModelEditDialog</class>
|
||||
<widget class="QWidget" name="InjuryModelEditDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>645</width>
|
||||
<height>291</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Operator Edit</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="leVersion"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbxId">
|
||||
<property name="text">
|
||||
<string>Id:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leName"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbVersion">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbDescription">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPlainTextEdit" name="pteDescription"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lblId">
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for WarehouseManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "injury_model_list.h"
|
||||
#include "ui_injury_model_list.h"
|
||||
#include "injury_model_model.h"
|
||||
#include "injury_model_add.h"
|
||||
#include "injury_model_edit_dialog.h"
|
||||
#include "CustomViews/whm_injury_model.h"
|
||||
#include "../whm_data_plugin_interface.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
InjuryModelList::InjuryModelList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_model(nullptr)
|
||||
, m_session(session)
|
||||
, m_ftc(nullptr)
|
||||
, m_dtc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(WarehouseGuez::getLogger("InjuryModelList"))
|
||||
, m_ui(new Ui::InjuryModelList)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &InjuryModelList::onAddInjuryModel);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &InjuryModelList::onEditInjuryModel);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, this, &InjuryModelList::onRemoveInjuryModel);
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalDoubleClicked,
|
||||
this, &InjuryModelList::onEditInjuryModel);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Injury_Model"));
|
||||
}
|
||||
|
||||
InjuryModelList::~InjuryModelList()
|
||||
{
|
||||
delete m_model;
|
||||
delete m_requestHelper;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void InjuryModelList::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Injury Models Overview"));
|
||||
}
|
||||
|
||||
void InjuryModelList::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->widget->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
bool InjuryModelList::init()
|
||||
{
|
||||
if (!m_session->getFtc<WarehouseManagement::DataInterface>(m_ftc) ||
|
||||
!m_session->getDtc<WarehouseManagement::DataInterface>(m_dtc))
|
||||
return false;
|
||||
|
||||
m_model = new InjuryModelModel(this);
|
||||
m_model->initModel(m_dtc);
|
||||
m_ui->widget->setModel(m_model, [this]() { return new CustomViewInjuryModel(this); });
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged,
|
||||
this, &InjuryModelList::enaDisa);
|
||||
|
||||
enaDisa();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InjuryModelList::onRemoveInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
}
|
||||
|
||||
void InjuryModelList::onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
m_requestHelper->requestReply(reply);
|
||||
|
||||
if (reply.error())
|
||||
return;
|
||||
|
||||
editInjuryModel(reply.id());
|
||||
}
|
||||
|
||||
void InjuryModelList::enaDisa()
|
||||
{
|
||||
QModelIndexList selectedRows = m_ui->widget->selectedRows();
|
||||
const int cntSelectedRows = selectedRows.size();
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, cntSelectedRows == 1 );
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, cntSelectedRows == 1 );
|
||||
}
|
||||
|
||||
void InjuryModelList::onRemoveInjuryModel()
|
||||
{
|
||||
QModelIndex idx = m_ui->widget->currentIndex();
|
||||
Core::RemoveElementRequest req(m_model->getRowData(idx.row()).id());
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->removeInjuryModelAgdusWhRequest(req, this);
|
||||
});
|
||||
}
|
||||
|
||||
void InjuryModelList::onAddInjuryModel()
|
||||
{
|
||||
const auto takenIds = m_model->takenIds();
|
||||
QSet<int> availableIds;
|
||||
for (int i = 1; i <= 255; ++i)
|
||||
if (!takenIds.contains(i))
|
||||
availableIds << i;
|
||||
|
||||
InjuryModelAdd *dlg = new InjuryModelAdd(availableIds, this);
|
||||
connect(dlg, &InjuryModelAdd::newInjuryModel, this, &InjuryModelList::onNewInjuryModel);
|
||||
dlg->show();
|
||||
}
|
||||
|
||||
void InjuryModelList::editInjuryModel(int id)
|
||||
{
|
||||
InjuryModelEditDialog *dialog = LtsWidgets::initDialog(new InjuryModelEditDialog(id, m_session, this));
|
||||
const QString identifier = QLatin1String("EditInjuryModel") + QString::number(id);
|
||||
addDialog(dialog, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void InjuryModelList::onEditInjuryModel()
|
||||
{
|
||||
int id = m_model->getId(m_ui->widget->currentIndex());
|
||||
|
||||
if (id <= 0)
|
||||
return;
|
||||
|
||||
editInjuryModel(id);
|
||||
}
|
||||
|
||||
void InjuryModelList::onNewInjuryModel(int id)
|
||||
{
|
||||
WarehouseGuez::InjuryModelAgdusWh im;
|
||||
im.id(0-id);
|
||||
im.name(tr("New Name").toStdString());
|
||||
im.version("-");
|
||||
m_requestHelper->startSingleRequest([im, this]()
|
||||
{
|
||||
return m_ftc->modifyInjuryModelAgdusWhRequest(im, this);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OpeartorManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
namespace Ui {
|
||||
class InjuryModelList;
|
||||
}
|
||||
|
||||
namespace LtsSession {
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace LtsUtils {
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class InjuryModelModel;
|
||||
|
||||
class InjuryModelList : public LtsWidgets::LtsDialog
|
||||
, protected WarehouseGuez::Interface::Ftc::RemoveInjuryModelAgdusWhReplyHandler
|
||||
, protected WarehouseGuez::Interface::Ftc::ModifyInjuryModelAgdusWhReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InjuryModelList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~InjuryModelList();
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
void onRemoveInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
QString m_menuGroup;
|
||||
InjuryModelModel *m_model;
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
Ui::InjuryModelList *m_ui;
|
||||
|
||||
void editInjuryModel(int id);
|
||||
|
||||
private slots:
|
||||
void enaDisa();
|
||||
void onRemoveInjuryModel();
|
||||
void onAddInjuryModel();
|
||||
void onEditInjuryModel();
|
||||
void onNewInjuryModel(int id);
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InjuryModelList</class>
|
||||
<widget class="QWidget" name="InjuryModelList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>674</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Operator Edit</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="LtsDataView::LtsDataView" name="widget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OperatorManangement - Operator Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "injury_model_model.h"
|
||||
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
#include <WarehouseGuez/whg_translation.h>
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
InjuryModelModel::InjuryModelModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<WarehouseGuez::InjuryModelAgdusWh>({tr("Id"),
|
||||
tr("Name"),
|
||||
tr("Version"),
|
||||
tr("Description")},
|
||||
parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_logger(WarehouseGuez::getLogger(QStringLiteral("InjuryModelModel")))
|
||||
{}
|
||||
|
||||
InjuryModelModel::~InjuryModelModel()
|
||||
{}
|
||||
|
||||
bool InjuryModelModel::initModel(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc)
|
||||
{
|
||||
m_dtc = dtc;
|
||||
|
||||
if (!m_dtc ||
|
||||
!m_dtc->enableInjuryModelAgdusWh())
|
||||
return false;
|
||||
|
||||
auto cb = [this](const WarehouseGuez::InjuryModelAgdusWh &im)
|
||||
{
|
||||
onDataChanged(im, DataModification::eAdded);
|
||||
};
|
||||
m_dtc->injuryModelAgdusWhs(cb);
|
||||
|
||||
connect(m_dtc.get(), &WarehouseGuez::Interface::Dtc::injuryModelAgdusWhChanged,
|
||||
this, &InjuryModelModel::onDataChanged);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QVariant InjuryModelModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const WarehouseGuez::InjuryModelAgdusWh &inj = m_vecData.at(index.row());
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case ID:
|
||||
return inj.id();
|
||||
case Name:
|
||||
return QString::fromStdString(inj.name());
|
||||
case Version:
|
||||
return QString::fromStdString(inj.version());
|
||||
case Description:
|
||||
return QString::fromStdString(inj.description());
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QSet<int> InjuryModelModel::takenIds() const
|
||||
{
|
||||
QSet<int> set;
|
||||
set.reserve(m_vecData.size());
|
||||
for(const auto &m : m_vecData)
|
||||
set << m.id();
|
||||
return set;
|
||||
}
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for WarehouseManagement - Operator Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/logger.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class InjuryModelModel final : public LtsWidgets::LtsAbstractTableModel<WarehouseGuez::InjuryModelAgdusWh>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
ID,
|
||||
Name,
|
||||
Version,
|
||||
Description
|
||||
};
|
||||
|
||||
explicit InjuryModelModel(QObject *parent = nullptr);
|
||||
~InjuryModelModel();
|
||||
|
||||
bool initModel(const std::shared_ptr<WarehouseGuez::Interface::Dtc> &dtc);
|
||||
|
||||
QVariant data(const QModelIndex &, int) const override final;
|
||||
|
||||
QSet<int> takenIds() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
WarehouseGuez::LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace WarehouseManagement
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* GUI Plugin for WarehouseManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "whm_gui_plugin.h"
|
||||
#include "injury_model_edit_dialog.h"
|
||||
#include "injury_model_list.h"
|
||||
#include "equipment_type_edit_dialog.h"
|
||||
#include "equipment_type_list.h"
|
||||
#include "../whm_data_plugin_interface.h"
|
||||
|
||||
#include <WarehouseGuez/whg_operator_rights.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
||||
{
|
||||
return std::make_shared<InterfaceImpl>(session);
|
||||
}
|
||||
|
||||
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
||||
: GuiPluginBase::Interface(session, WarehouseGuez::getLogger(QStringLiteral("Plugins.Gui.Whm")))
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
{}
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getDtc<WarehouseManagement::DataInterface>(m_dtc) ||
|
||||
!m_session->getFtc<WarehouseManagement::DataInterface>(m_ftc))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> ret;
|
||||
LtsWidgets::PluginData plData;
|
||||
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Equipment Types Overview");
|
||||
plData.identifier = QStringLiteral("whmEquipmentTypes");
|
||||
// plData.operatorRight = OperatorRights:: // todo opRights
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::eSpecial;
|
||||
plData.menuIcon = QIcon(QStringLiteral("icon:player_equipment_type.svg")); // todo icon
|
||||
plData.createWidgetFunc = [this](QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new EquipmentList(menuGroup(), m_session, parent));
|
||||
};
|
||||
ret.append(plData);
|
||||
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Injury Model Overview");
|
||||
plData.identifier = QStringLiteral("whmInjuryModelTypes");
|
||||
plData.menuIcon = QIcon(QStringLiteral("icon:vul_model.svg")); // todo icon
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::eSpecial;
|
||||
plData.createWidgetFunc = [this](QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new InjuryModelList(menuGroup(), m_session, parent));
|
||||
};
|
||||
ret.append(plData);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} //namespace WarehouseManagement
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for WarehouseManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:whm")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QStringLiteral("WarehouseManagementGuiPlugin"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return partition == IDL::PartitionType::Global;
|
||||
}
|
||||
};
|
||||
|
||||
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
bool fetchInterfaces() override;
|
||||
QString menuGroup() const override { return tr("Warehouse Management"); }
|
||||
QVector<LtsWidgets::PluginData> getActions() override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global; } // global only, not in exercise mode
|
||||
|
||||
private:
|
||||
std::shared_ptr<WarehouseGuez::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<WarehouseGuez::Interface::Ftc> m_ftc;
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Data Plugin Interface for OperatorManagement (Interface for access from other Plugins)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <WarehouseGuez/whg_dtc.h>
|
||||
#include <WarehouseGuez/whg_ftc.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
/**
|
||||
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
|
||||
*/
|
||||
class DataInterface : public DataPluginBase::Interface
|
||||
{
|
||||
public:
|
||||
using DataPluginBase::Interface::Interface;
|
||||
|
||||
virtual std::shared_ptr<WarehouseGuez::Interface::Dtc> getDtc() = 0;
|
||||
virtual std::shared_ptr<WarehouseGuez::Interface::Ftc> getFtc() = 0;
|
||||
};
|
||||
|
||||
} // namespace WarehouseManagement
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OperatorManagement (Interface for access from other Plugins)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
class ForeignGuiInterface
|
||||
{
|
||||
public:
|
||||
ForeignGuiInterface() = default;
|
||||
virtual ~ForeignGuiInterface() = default;
|
||||
};
|
||||
|
||||
} //namespace WarehouseManagement
|
||||
Reference in new issue
Block a user