Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+58
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Patric Karwat, SLSE, 2016-10-05
|
||||
#
|
||||
|
||||
SET(esc_effect_show_gui_SRCS
|
||||
esc_effect_show_gui_plugin.cpp
|
||||
esc_effect_show_gui_plugin.h
|
||||
esc_operating_condition.cpp
|
||||
esc_operating_condition.h
|
||||
esc_firing_explosion.cpp
|
||||
esc_firing_explosion.h
|
||||
esc_firing_smoke.cpp
|
||||
esc_firing_smoke.h
|
||||
esc_order_model.cpp
|
||||
esc_order_model.h
|
||||
esc_order_list.cpp
|
||||
esc_order_list.h
|
||||
esc_order_edit.cpp
|
||||
esc_order_edit.h
|
||||
esc_smoke_state.cpp
|
||||
esc_smoke_state.h
|
||||
esc_safety_confirmation_widget.h
|
||||
esc_safety_confirmation_widget.cpp
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(esc_effect_show_gui_SRCS
|
||||
esc_operating_condition.ui
|
||||
esc_firing_explosion.ui
|
||||
esc_firing_smoke.ui
|
||||
esc_order_list.ui
|
||||
esc_order_edit.ui
|
||||
esc_smoke_state.ui
|
||||
esc_safety_confirmation_widget.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS EscEffectShowGuiPlugin MODULE ${esc_effect_show_gui_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(EscEffectShowGuiPlugin
|
||||
NGLLogger
|
||||
ngltools
|
||||
LtsPrinting
|
||||
LtsSession
|
||||
EscGuiPluginInterface
|
||||
EscDataPluginInterface
|
||||
SituationMapGuiPluginInterface
|
||||
TabocDataPluginInterface
|
||||
Qt5::Widgets
|
||||
LtsWidgets
|
||||
LtsDataView
|
||||
LtsNotification
|
||||
LtsUtilsGuiDds
|
||||
LtsCoordTrans
|
||||
ltsCoordWidget
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(EscEffectShowGuiPlugin)
|
||||
@@ -0,0 +1,382 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for EffectShowClient
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10-05
|
||||
*/
|
||||
|
||||
|
||||
#include "esc_effect_show_gui_plugin.h"
|
||||
#include "esc_order_list.h"
|
||||
#include "esc_operating_condition.h"
|
||||
#include "esc_firing_explosion.h"
|
||||
#include "esc_firing_smoke.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsWidgets/lts_base_layout_widget.h>
|
||||
#include <LtsNotification/lts_notification.h>
|
||||
#include <LtsWidgets/lts_events.h>
|
||||
|
||||
#include <Services/EffectShowClient/esc_operator_rights.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QUrlQuery>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
||||
{
|
||||
return std::make_shared<InterfaceImpl>(session);
|
||||
}
|
||||
|
||||
const QString InterfaceImpl::s_dmfOrderList = QStringLiteral("escOrderList");
|
||||
|
||||
|
||||
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
||||
: GuiPluginBase::Interface(session, getLogger("Plugins.Gui.Esc.EffectShow"))
|
||||
, m_operationalStatusTimer(new QTimer)
|
||||
{
|
||||
qApp->installEventFilter(this);
|
||||
connect(m_operationalStatusTimer, &QTimer::timeout,
|
||||
this, &InterfaceImpl::onOperationalStatusTimeout);
|
||||
}
|
||||
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getDtc<EffectShowClient::DataInterface>(m_dtc))
|
||||
return false;
|
||||
if (!m_session->getFtc<EffectShowClient::DataInterface>(m_ftc))
|
||||
return false;
|
||||
if (!m_session->getDtc<TrainingAreaBaseOC::DataInterface>(m_dtcTabOC))
|
||||
WARNING_LOG(m_logger) << "Got no TabOc Dtc. No Distance Measurement";
|
||||
|
||||
m_dtc->enableAll();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
m_dtc = nullptr;
|
||||
m_ftc = nullptr;
|
||||
m_dtcTabOC = nullptr;
|
||||
}
|
||||
|
||||
|
||||
QString InterfaceImpl::menuGroup() const
|
||||
{
|
||||
return tr("Effect Representation");
|
||||
}
|
||||
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> ret;
|
||||
|
||||
LtsWidgets::PluginData plData;
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Order List");
|
||||
plData.identifier = QLatin1String("escOrderList");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:effect_order_vehicle.svg"));
|
||||
//plData.operatorRight = OperatorRights::EffectShowEdit;
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::eExecution;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowOrderList(parent);
|
||||
};
|
||||
m_effecShowAction = plData;
|
||||
|
||||
|
||||
|
||||
plData.menuText = tr("Relocation List");
|
||||
plData.identifier = QLatin1String("escRelocationList");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:reloc_vehicle.svg"));
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowRelocationList(parent);
|
||||
};
|
||||
ret.append(plData);
|
||||
|
||||
|
||||
plData.menuText = tr("Operating Condition");
|
||||
plData.identifier = QLatin1String("escOperatingCondition");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:status_vehicle.svg"));
|
||||
//plData.operatorRight = OperatorRights::RelocationsEdit;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowOperatingCondition(parent);
|
||||
};
|
||||
ret.append(plData);
|
||||
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Firing Explosive");
|
||||
plData.identifier = QLatin1String("escFiringExplosion");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:fire_vehicle.svg"));
|
||||
//plData.operatorRight = OperatorRights::ActorEdit;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowFiringExplosion(parent);
|
||||
};
|
||||
m_fireAction = plData;
|
||||
|
||||
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Firing Smoke");
|
||||
plData.identifier = QLatin1String("escFiringSmoke");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:smoke_vehicle.svg"));
|
||||
//plData.operatorRight = OperatorRights::VehicleStatusShow;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowFiringSmoke(parent);
|
||||
};
|
||||
m_smokeAction = plData;
|
||||
|
||||
|
||||
// Noti:
|
||||
|
||||
plData.createInstant = LtsWidgets::CreateInstantType::CreateInstantAndDiscardAction;
|
||||
plData.identifier = QStringLiteral("DMFIcon");
|
||||
plData.menuText = QStringLiteral("DMFIcon");
|
||||
plData.createWidgetFunc = nullptr;
|
||||
plData.directFunc = [this](const LtsWidgets::PluginData &)
|
||||
{
|
||||
m_notiDmf = m_session->createNotification(QStringLiteral("DMF"));
|
||||
m_notiDmf->setIcon(QIcon(QStringLiteral("icon:status_dmf_red.svg")));
|
||||
m_notiDmf->setToolTip(tr("No DMF"));
|
||||
m_notiDmf->setAction([this]()
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), m_notiDmf->tooltip());
|
||||
});
|
||||
};
|
||||
ret.append(plData);
|
||||
m_timer = new QTimer(this);
|
||||
connect(m_timer, &QTimer::timeout, this, &InterfaceImpl::checkLastState);
|
||||
m_timer->start(3000);
|
||||
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::operatingConditionEntityChanged,
|
||||
this, &InterfaceImpl::onOperatingConditionEntityChanged);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void InterfaceImpl::onOperatingConditionEntityChanged(const OperatingConditionEntity &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
|
||||
//change icons and actions depending of vehicle type
|
||||
if (data.vehicleFeature() != m_vehicleType)
|
||||
{
|
||||
|
||||
//Change state
|
||||
m_vehicleType = data.vehicleFeature();
|
||||
// Readd action EffectShowOrderList
|
||||
m_session->baseLayout()->addMenuAction(m_effecShowAction);
|
||||
|
||||
if (m_vehicleType == EffectShowManagement::Feature_e::NotSpecified)
|
||||
{
|
||||
m_session->baseLayout()->removeMenuAction(m_fireAction);
|
||||
m_session->baseLayout()->removeMenuAction(m_smokeAction);
|
||||
m_session->baseLayout()->removeMenuAction(m_effecShowAction);
|
||||
m_notiDmf->setIcon(QIcon(QStringLiteral("icon:status_dmf_red.svg")));
|
||||
m_notiDmf->setToolTip(tr("No Effect Show Connected"));
|
||||
// close dialogs
|
||||
if(m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringExplosion")))
|
||||
m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringExplosion"))->closeRequest();
|
||||
if(m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringSmoke")))
|
||||
m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringSmoke"))->closeRequest();
|
||||
if(m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escOrderList")))
|
||||
m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escOrderList"))->closeRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
QString feature = tr("Effect Show Connected: ");
|
||||
|
||||
if (m_vehicleType == EffectShowManagement::Feature_e::Smoke)
|
||||
{
|
||||
//Feature Smoke
|
||||
m_session->baseLayout()->removeMenuAction(m_fireAction);
|
||||
m_session->baseLayout()->addMenuAction(m_smokeAction);
|
||||
feature += tr("Smoke");
|
||||
if(m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringExplosion")))
|
||||
m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringExplosion"))->closeRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_vehicleType == EffectShowManagement::Feature_e::Explosion24)
|
||||
feature += tr("Explosion (24)");
|
||||
else
|
||||
feature += tr("Explosion (48)");
|
||||
|
||||
//Feature Explosion
|
||||
m_session->baseLayout()->removeMenuAction(m_smokeAction);
|
||||
m_session->baseLayout()->addMenuAction(m_fireAction);
|
||||
if(m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringSmoke")))
|
||||
m_session->baseLayout()->getWidget(menuGroup(), QStringLiteral("escFiringSmoke"))->closeRequest();
|
||||
}
|
||||
m_notiDmf->setIcon(QIcon(QStringLiteral("icon:status_dmf_green.svg")));
|
||||
m_notiDmf->setToolTip(feature);
|
||||
}
|
||||
}
|
||||
|
||||
int currentSmokeLoad = 0;
|
||||
|
||||
// now we send our ammuniton to excon if changed
|
||||
if (m_vehicleType == EffectShowManagement::Feature_e::Smoke)
|
||||
{
|
||||
//send current smoke load to excon
|
||||
if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
|
||||
if (currentSmokeLoad != m_oldSmokeCount)
|
||||
{
|
||||
m_oldSmokeCount = currentSmokeLoad;
|
||||
onSendAmmunition(currentSmokeLoad);
|
||||
}
|
||||
}
|
||||
else if (m_vehicleType != EffectShowManagement::Feature_e::NotSpecified)
|
||||
{
|
||||
// send current magazin load to excon
|
||||
if (m_oldCondition.ammunitionMagazine() != data.ammunitionMagazine())
|
||||
onSendAmmunition();
|
||||
}
|
||||
|
||||
m_lastStatesTime = m_session->partitionTime();
|
||||
|
||||
if (data.readiness() && !m_oldCondition.readiness() && !m_operationalStatusTimer->isActive())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operating condition: operational. Starting timer.";
|
||||
m_operationalStatusTimer->start(10 * 60 * 1000);
|
||||
} // if
|
||||
|
||||
m_oldCondition = data;
|
||||
m_oldSmokeCount = currentSmokeLoad;
|
||||
}
|
||||
|
||||
void InterfaceImpl::onSendAmmunition(int currentSmokeCount)
|
||||
{
|
||||
const OperatingConditionEntity &condition = m_dtc->operatingConditionEntity();
|
||||
SendAmmunitionRequest req;
|
||||
if (currentSmokeCount >= 0)
|
||||
req.ammunitionMagazine(currentSmokeCount);
|
||||
else
|
||||
req.ammunitionMagazine(condition.ammunitionMagazine());
|
||||
req.ammunitionAvailable(condition.ammunitionAvailable());
|
||||
m_ftc->sendAmmunitionRequest(req, this);
|
||||
}
|
||||
|
||||
void InterfaceImpl::checkLastState()
|
||||
{
|
||||
if ((m_session->partitionTime() - 10 * 1000) > m_lastStatesTime)
|
||||
{
|
||||
m_notiDmf->setIcon(QIcon(QStringLiteral("icon:status_dmf_red.svg")));
|
||||
m_notiDmf->setToolTip(tr("No Effect Show Connected"));
|
||||
m_vehicleType = EffectShowManagement::Feature_e::NotSpecified;
|
||||
}
|
||||
}
|
||||
|
||||
void InterfaceImpl::onOperationalStatusTimeout()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Sending operational status: " << (m_oldCondition.readiness() ? "operational." : "not operational.");
|
||||
SendReadinessRequest req;
|
||||
req.readiness(m_oldCondition.readiness());
|
||||
m_ftc->sendReadinessRequest(req, this);
|
||||
if (!m_oldCondition.readiness())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operating condition: not operational. Stopping timer.";
|
||||
m_operationalStatusTimer->stop();
|
||||
} // if
|
||||
}
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowRelocationList(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new OrderList(menuGroup(), m_session, parent),
|
||||
false, m_dtc, m_ftc, m_dtcTabOC);
|
||||
}
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowOrderList(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new OrderList(menuGroup(), m_session, parent),
|
||||
true, m_dtc, m_ftc, m_dtcTabOC);
|
||||
}
|
||||
|
||||
void InterfaceImpl::onShowOrderList(bool isEffectShow)
|
||||
{
|
||||
OrderList *dialog = new OrderList(menuGroup(), m_session);
|
||||
if (!dialog->init(isEffectShow, m_dtc, m_ftc, m_dtcTabOC))
|
||||
{
|
||||
delete dialog;
|
||||
return;
|
||||
}
|
||||
m_session->addWidget(dialog, menuGroup(), s_dmfOrderList, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowOperatingCondition(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new OperatingCondition(parent),
|
||||
m_dtc, m_ftc);
|
||||
}
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowFiringExplosion(QWidget *parent)
|
||||
{
|
||||
//m_dtc->firingSmokeEntity()
|
||||
return LtsWidgets::initDialog(new FiringExplosion(parent),
|
||||
m_dtc, m_ftc, m_session, true);
|
||||
}
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowFiringSmoke(QWidget *parent)
|
||||
{
|
||||
FiringSmoke *dialog = new FiringSmoke(parent);
|
||||
dialog->init(m_dtc, m_ftc, m_session, true);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
|
||||
if (obj == qApp &&
|
||||
!event->isAccepted() &&
|
||||
event->type() == LtsWidgets::LtsLinkEvent::eventTypeId())
|
||||
{
|
||||
auto ev = static_cast<LtsWidgets::LtsLinkEvent*>(event);
|
||||
|
||||
const auto isChildOfSession = [this](QWidget *w)
|
||||
{
|
||||
if (!w)
|
||||
return true;
|
||||
const auto baseLayout = m_session->baseLayout();
|
||||
return baseLayout->isAncestorOf(w);
|
||||
};
|
||||
|
||||
bool isEffectShow = true;
|
||||
if (isChildOfSession(ev->sourceBaseLayoutWidget()) && ev->url().host() == s_dmfOrderList.toLower())
|
||||
{
|
||||
const QStringList params = ev->url().path().split(QStringLiteral("/"));
|
||||
DEBUG_LOG(m_logger) << "eventFilter onShowOrderList"
|
||||
<< ", path=" << ev->url().path()
|
||||
<< ", params.size=" << params.size();
|
||||
if (params.size() > 1)
|
||||
{
|
||||
isEffectShow = params.at(1).toInt();
|
||||
DEBUG_LOG(m_logger) << "isEffectShow=" << isEffectShow
|
||||
<< ", params.at(0)=" << params.at(0)
|
||||
<< ", params.at(1)=" << params.at(1);
|
||||
}
|
||||
onShowOrderList(isEffectShow);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
} // namespace EffectShowClient
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for EffectShowClient
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10-05
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <EffectShowClient/esc_data_plugin_interface.h>
|
||||
#include <EffectShowClient/esc_gui_plugin_interface.h>
|
||||
#include <EffectShowClient/esc_ftc.h>
|
||||
#include <TrainingAreaBaseOC/taboc_data_plugin_interface.h>
|
||||
#include <EffectShowManagement/esm_data_plugin_interface.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace LtsNotification
|
||||
{
|
||||
class LtsNotification;
|
||||
}
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:esc")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QLatin1String("EffectShowClientGuiPlugin"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return partition == IDL::PartitionType::Exercise;
|
||||
}
|
||||
};
|
||||
|
||||
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface,
|
||||
protected EffectShowClient::Interface::Ftc::SendAmmunitionReplyHandler, protected EffectShowClient::Interface::Ftc::SendReadinessReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
static const QString s_dmfOrderList;
|
||||
|
||||
bool fetchInterfaces() override;
|
||||
void clearInterfaces() override;
|
||||
QString menuGroup() const override;
|
||||
QVector<LtsWidgets::PluginData> getActions() override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Exercise || partition == IDL::PartitionType::Global; }
|
||||
|
||||
public slots:
|
||||
void onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data, DataModification modType);
|
||||
void checkLastState();
|
||||
void onOperationalStatusTimeout();
|
||||
|
||||
private:
|
||||
void onSendAmmunitionReply(const Core::FunctionReplyObject &replyObject) override { Q_UNUSED(replyObject) }
|
||||
void onSendReadinessReply(const Core::FunctionReplyObject &replyObject) override { Q_UNUSED(replyObject); }
|
||||
void onSendAmmunition(int currentSmokeCount = -1);
|
||||
|
||||
private:
|
||||
LtsWidgets::LtsDialog *onShowRelocationList(QWidget *parent);
|
||||
LtsWidgets::LtsDialog *onShowOrderList(QWidget *parent);
|
||||
void onShowOrderList(bool isEffectShow);
|
||||
LtsWidgets::LtsDialog *onShowOperatingCondition(QWidget *parent);
|
||||
LtsWidgets::LtsDialog *onShowFiringExplosion(QWidget *parent);
|
||||
LtsWidgets::LtsDialog *onShowFiringSmoke(QWidget *parent);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private:
|
||||
QTimer *m_timer = nullptr;
|
||||
LtsNotification::LtsNotification *m_notiDmf{nullptr};
|
||||
int m_oldSmokeCount = -1;
|
||||
qint64 m_lastStatesTime = 0;
|
||||
EffectShowManagement::Feature_e m_vehicleType = EffectShowManagement::Feature_e::NotSpecified;
|
||||
LtsWidgets::PluginData m_smokeAction;
|
||||
LtsWidgets::PluginData m_fireAction;
|
||||
LtsWidgets::PluginData m_effecShowAction;
|
||||
OperatingConditionEntity m_oldCondition;
|
||||
|
||||
QTimer *m_operationalStatusTimer{nullptr};
|
||||
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> m_dtcTabOC;
|
||||
};
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+350
@@ -0,0 +1,350 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#include "esc_firing_explosion.h"
|
||||
#include "ui_esc_firing_explosion.h"
|
||||
#include "esc_safety_confirmation_widget.h"
|
||||
#include "esc_order_edit.h"
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
//=============================================================================
|
||||
FiringExplosion::FiringExplosion(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_timer(new QTimer(this))
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_session(nullptr)
|
||||
, m_safetyConfirmationWidget(nullptr)
|
||||
, m_ui(new Ui::FiringExplosion)
|
||||
, m_logger(getLogger("FiringExplosion"))
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_idOrder(0)
|
||||
, m_idEffectShow(0)
|
||||
, m_shotsAvail(0)
|
||||
, m_isClearance(true)
|
||||
, m_firingClearanceCountDown(0)
|
||||
, m_endOfFiringClearanceCountDown(0)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->pbFire->setEnabled(false);
|
||||
connect(m_ui->pbApply, &QPushButton::clicked,
|
||||
this, &FiringExplosion::onApply);
|
||||
connect(m_ui->pbFire, &QPushButton::clicked,
|
||||
this, &FiringExplosion::onFire);
|
||||
connect(m_ui->pbInterrupt, &QPushButton::clicked,
|
||||
this, &FiringExplosion::onInterrupt);
|
||||
connect(m_timer, &QTimer::timeout, this, &FiringExplosion::onFiringClearanceCountDown);
|
||||
|
||||
// Set a consistent font size for the buttons
|
||||
QFont pbFont = m_ui->pbApply->font();
|
||||
#ifdef TABLET_MODE
|
||||
pbFont.setPointSizeF(pbFont.pointSizeF()*1.5);
|
||||
#endif
|
||||
m_ui->pbApply->setFont(pbFont);
|
||||
m_ui->pbFire->setFont(pbFont);
|
||||
m_ui->pbInterrupt->setFont(pbFont);
|
||||
|
||||
setOnlineHelpFilename(QLatin1String("OC-Firing_Explosive"));
|
||||
|
||||
}
|
||||
//=============================================================================
|
||||
FiringExplosion::~FiringExplosion()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
//=============================================================================
|
||||
bool FiringExplosion::init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
LtsSession::LtsSession *session, bool freeForm)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "FiringExplosion::init()";
|
||||
|
||||
if (!dtc || !ftc)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "FiringExplosion::init() Invalid shared_ptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_dtc = dtc;
|
||||
m_ftc = ftc;
|
||||
m_session = session;
|
||||
|
||||
m_safetyConfirmationWidget = new SafetyConfirmationWidget(this);
|
||||
if (!m_safetyConfirmationWidget->init(m_ftc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can't create SafetiConfirmationWidget";
|
||||
return false;
|
||||
}
|
||||
m_ui->mainVertLayout->insertWidget(3, m_safetyConfirmationWidget);
|
||||
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::firingExplosionEntityChanged,
|
||||
this, &FiringExplosion::onFiringExplosionEntityChanged);
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::operatingConditionEntityChanged,
|
||||
this, &FiringExplosion::onOperatingConditionEntityChanged);
|
||||
|
||||
// display data
|
||||
if (!freeForm)
|
||||
onFiringExplosionEntityChanged(m_dtc->firingExplosionEntity(), DataModification::eAdded);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::No, this, &FiringExplosion::onAbort);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::No)->setText(tr("Abort"));
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Yes, this, &FiringExplosion::onCarriedOut);
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Yes)->setText(tr("Carried Out"));
|
||||
|
||||
m_ui->sbDuration->setMinimum(5);
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Firing Explosive")); // todo only "Firing"
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onFiringExplosionEntityChanged(const EffectShowClient::FiringExplosionEntity &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return; // freeze of indication
|
||||
|
||||
m_idOrder = data.idOrder();
|
||||
m_idEffectShow = data.idEffectShow();
|
||||
// if (m_idOrder > 0) \\keep for now
|
||||
// m_ui->pbApply->setEnabled(data.fireEnabled() && data.safetyConfirmation() == EffectShowClient::SafetyConfirmation_e::SafetyNotConfirmed);
|
||||
|
||||
m_ui->pbApply->setEnabled(!data.isActive());
|
||||
|
||||
OperatingConditionEntity opcon = m_dtc->operatingConditionEntity();
|
||||
bool fireUnitsActive = opcon.firingUnitReadyAftLh() || opcon.firingUnitReadyAftRh() || opcon.firingUnitReadyFwdLh() || opcon.firingUnitReadyFwdRh();
|
||||
bool pbActiv = (data.fireEnabled() && data.safetyConfirmation() != EffectShowClient::SafetyConfirmation_e::SafetyNotConfirmed);
|
||||
|
||||
if (!fireUnitsActive && m_safetyConfirmationWidget)
|
||||
m_safetyConfirmationWidget->setMessage(tr("Waiting for ready firing unit"));
|
||||
else
|
||||
m_safetyConfirmationWidget->setMessage(QString());
|
||||
|
||||
// enable carried out
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Yes, data.carriedOutEnabled());
|
||||
|
||||
|
||||
if (m_oldEntity.numberOfVolley() != data.numberOfVolley())
|
||||
m_ui->sbNumberOfVolley->setValue(data.numberOfVolley());
|
||||
if (m_oldEntity.numberOfShot() != data.numberOfShot())
|
||||
m_ui->sbNumberOfShot->setValue(data.numberOfShot());
|
||||
if (m_oldEntity.duration() != data.duration())
|
||||
m_ui->sbDuration->setValue(data.duration() / 1000);
|
||||
|
||||
if (m_idEffectShow > 0)
|
||||
{
|
||||
QString textStr = QString::fromStdString(m_dtc->order(m_idEffectShow).info());
|
||||
m_ui->leEffectShow->setText(textStr);
|
||||
}
|
||||
else
|
||||
m_ui->leEffectShow->setText(QString());
|
||||
|
||||
m_timer->stop();
|
||||
|
||||
m_firingClearanceCountDown = data.firingClearanceTime().is_set() ? (1000 + data.firingClearanceTime().get() - m_session->partitionTime()) : 0;
|
||||
m_endOfFiringClearanceCountDown = data.endOfFiringClearanceTime().is_set() ? (1000 + data.endOfFiringClearanceTime().get() - m_session->partitionTime()) : 0;
|
||||
|
||||
onFiringClearanceCountDown();
|
||||
if (data.idOrder() == 0 || (!data.firingClearanceTime().is_set() && data.duration() == 0))
|
||||
m_isClearance = true;
|
||||
else
|
||||
m_isClearance = (m_firingClearanceCountDown <= 0 && m_endOfFiringClearanceCountDown > 0);
|
||||
|
||||
//enable fire button if show is active, the fire untis are ready and in clearnca time
|
||||
m_ui->pbFire->setEnabled(pbActiv && fireUnitsActive && m_isClearance);
|
||||
// enale Interrupt
|
||||
bool isInterruptEnabled = !data.carriedOutEnabled() && !m_ui->pbFire->isEnabled() && data.isActive() && m_isClearance;
|
||||
m_ui->pbInterrupt->setEnabled(isInterruptEnabled);
|
||||
|
||||
m_ui->leRemainingShots->setText(data.remainingShots() > 0 ? QString::number(data.remainingShots()) : QString::number(0));
|
||||
m_ui->leRemainingTime->setText(QString::number(data.remainingTime() / 1000));
|
||||
m_ui->leRemainingVolley->setText(data.remainingVolleys() > 0 ? QString::number(data.remainingVolleys()) : QString::number(0));
|
||||
m_safetyConfirmation = data.safetyConfirmation();
|
||||
onSafetyConfirmationDisplay();
|
||||
|
||||
m_oldEntity = data;
|
||||
}
|
||||
|
||||
void FiringExplosion::onOperatingConditionEntityChanged(const OperatingConditionEntity &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
if (m_safetyConfirmationWidget)
|
||||
m_safetyConfirmationWidget->onOperatingConditionEntityChanged(data);
|
||||
m_shotsAvail = data.ammunitionMagazine();
|
||||
m_ui->lblShotsAvail->setText(QString::number(m_shotsAvail));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onApply()
|
||||
{
|
||||
if (!statusChangedForManuallyEffectShow(EffectShowStatus_e::Apply))
|
||||
ERROR_LOG(m_logger) << "Apply failed";
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onFire()
|
||||
{
|
||||
bool rc;
|
||||
if (m_idOrder > 0)
|
||||
rc = statusChangedForOrderedEffectShow(EffectShowStatus_e::Fire);
|
||||
else
|
||||
rc = statusChangedForManuallyEffectShow(EffectShowStatus_e::Fire);
|
||||
|
||||
if (!rc)
|
||||
ERROR_LOG(m_logger) << "Firing Explosion Order Execution failed";
|
||||
}
|
||||
void FiringExplosion::onInterrupt()
|
||||
{
|
||||
bool rc;
|
||||
if (m_idOrder > 0)
|
||||
rc = statusChangedForOrderedEffectShow(EffectShowStatus_e::Interrupt);
|
||||
else
|
||||
rc = statusChangedForManuallyEffectShow(EffectShowStatus_e::Interrupt);
|
||||
|
||||
if (!rc)
|
||||
ERROR_LOG(m_logger) << "Firing Explosion Order Execution failed";
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onAbort()
|
||||
{
|
||||
if (m_idOrder > 0)
|
||||
{
|
||||
OrderEdit *edit = new OrderEdit(m_dtc->order(m_idEffectShow), false, this);
|
||||
edit->init(m_ftc, EffectShowManagement::OrderConfirmation_e::Abort);
|
||||
addDialog(edit, menuGroup(), QLatin1String("escOrder"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
// rc = statusChangedForOrderedEffectShow(EffectShowStatus_e::Abort);
|
||||
return;
|
||||
}
|
||||
else
|
||||
statusChangedForManuallyEffectShow(EffectShowStatus_e::Abort);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onCarriedOut()
|
||||
{
|
||||
if (m_idOrder > 0)
|
||||
{
|
||||
OrderEdit *edit = new OrderEdit(m_dtc->order(m_idEffectShow), false, this);
|
||||
edit->init(m_ftc, EffectShowManagement::OrderConfirmation_e::OrderCarriedOut);
|
||||
addDialog(edit, menuGroup(), QLatin1String("escOrder"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
statusChangedForManuallyEffectShow(EffectShowStatus_e::CarriedOut);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onSafetyConfirmationDisplay()
|
||||
{
|
||||
if (m_safetyConfirmationWidget)
|
||||
m_safetyConfirmationWidget->setNewSafetyConfirmationDisplay(m_safetyConfirmation);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringExplosion::onFiringClearanceCountDown()
|
||||
{
|
||||
if (m_timer->isActive())
|
||||
{
|
||||
m_firingClearanceCountDown -= 1000;
|
||||
m_endOfFiringClearanceCountDown -= 1000;
|
||||
}
|
||||
|
||||
if (m_firingClearanceCountDown > 0)
|
||||
m_ui->leFiringClearanceIn->setText(OrderModel::timeOfDayString(m_firingClearanceCountDown / 1000));
|
||||
else
|
||||
m_ui->leFiringClearanceIn->setText(OrderModel::timeOfDayString(0));
|
||||
|
||||
if (m_endOfFiringClearanceCountDown > 0)
|
||||
m_ui->leEndOfFiringClearanceIn->setText(OrderModel::timeOfDayString(m_endOfFiringClearanceCountDown / 1000));
|
||||
else
|
||||
m_ui->leEndOfFiringClearanceIn->setText(OrderModel::timeOfDayString(0));
|
||||
|
||||
if ((m_firingClearanceCountDown > 0) || (m_endOfFiringClearanceCountDown > 0))
|
||||
m_timer->start(1000);
|
||||
|
||||
m_isClearance = (m_firingClearanceCountDown <= 0 && m_endOfFiringClearanceCountDown > 0);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
bool FiringExplosion::statusChangedForManuallyEffectShow(EffectShowStatus_e status)
|
||||
{
|
||||
m_uiRequirements->clear();
|
||||
if (status == EffectShowStatus_e::Apply)
|
||||
{
|
||||
m_uiRequirements->addRequirement({m_ui->lbShotsAvail, [this]() { return !(m_shotsAvail < m_ui->sbNumberOfShot->value()); }});
|
||||
m_uiRequirements->addRequirement({m_ui->lblNumberOfVolley, [this]() { return !(m_ui->sbNumberOfShot->value() < m_ui->sbNumberOfVolley->value()); }});
|
||||
m_uiRequirements->addRequirement({m_ui->lblDuration, [this]() { return !(m_ui->sbDuration->value() * 1000 < ((m_ui->sbNumberOfShot->value() * 1000) + (m_ui->sbNumberOfVolley->value() * 2000 ))); }});
|
||||
}
|
||||
|
||||
if (!m_uiRequirements->checkRequirements(this))
|
||||
return false; // not all inputs done
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, status]()
|
||||
{
|
||||
EffectShowClient::ManuallyExplosionRequest request;
|
||||
if (status == EffectShowStatus_e::Interrupt)
|
||||
{
|
||||
const EffectShowClient::FiringExplosionEntity manEx = m_dtc->firingExplosionEntity();
|
||||
|
||||
request.numberOfVolley(manEx.remainingVolleys());
|
||||
request.numberOfShot(manEx.remainingShots());
|
||||
request.duration(manEx.remainingTime());
|
||||
}
|
||||
else
|
||||
{
|
||||
request.numberOfVolley(m_ui->sbNumberOfVolley->value());
|
||||
request.numberOfShot(m_ui->sbNumberOfShot->value());
|
||||
request.duration(m_ui->sbDuration->value() * 1000);
|
||||
}
|
||||
request.pbFire(status == EffectShowStatus_e::Fire);
|
||||
request.pbAbort(status == EffectShowStatus_e::Abort);
|
||||
request.pbInterrupt(status == EffectShowStatus_e::Interrupt);
|
||||
|
||||
request.pbCarriedOut(status == EffectShowStatus_e::CarriedOut || status == EffectShowStatus_e::Abort);
|
||||
|
||||
return m_ftc->manuallyExplosionRequest(request, this);
|
||||
});
|
||||
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
bool FiringExplosion::statusChangedForOrderedEffectShow(EffectShowStatus_e status)
|
||||
{
|
||||
m_uiRequirements->clear();
|
||||
|
||||
if (!m_uiRequirements->checkRequirements(this))
|
||||
return true; // not all inputs done
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, status]()
|
||||
{
|
||||
OrderModifyRequest orderModifyRequest;
|
||||
|
||||
orderModifyRequest.id(m_idEffectShow);
|
||||
EffectShowManagement::OrderConfirmation_e oc;
|
||||
switch (status)
|
||||
{
|
||||
case EffectShowStatus_e::Fire:
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::Execution;
|
||||
break;
|
||||
case EffectShowStatus_e::CarriedOut:
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut;
|
||||
break;
|
||||
case EffectShowStatus_e::Interrupt:
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptExecution;
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "FiringExplosion::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess...";
|
||||
break;
|
||||
}
|
||||
orderModifyRequest.orderConfirmation(oc);
|
||||
orderModifyRequest.answerText(QString().toStdString());
|
||||
|
||||
return m_ftc->orderModifyRequest(orderModifyRequest, this);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "esc_order_model.h"
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Services/EffectShowClient/esc_dtc.h>
|
||||
#include <Services/EffectShowClient/esc_ftc.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class FiringExplosion;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class SafetyConfirmationWidget;
|
||||
|
||||
/**
|
||||
* @brief Input mask for operating conditions.
|
||||
*/
|
||||
class FiringExplosion : public LtsWidgets::LtsDialog
|
||||
, protected EffectShowClient::Interface::Ftc::OrderModifyReplyHandler
|
||||
, protected EffectShowClient::Interface::Ftc::ManuallyExplosionReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FiringExplosion(QWidget *parent = nullptr);
|
||||
~FiringExplosion();
|
||||
|
||||
bool init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
LtsSession::LtsSession *session,
|
||||
bool freeForm = false);
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void onOrderModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
void onManuallyExplosionReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFiringExplosionEntityChanged(const EffectShowClient::FiringExplosionEntity &data, DataModification modType);
|
||||
void onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data, DataModification modType);
|
||||
void onApply();
|
||||
void onFire();
|
||||
void onAbort();
|
||||
void onInterrupt();
|
||||
void onCarriedOut();
|
||||
void onSafetyConfirmationDisplay();
|
||||
void onFiringClearanceCountDown();
|
||||
|
||||
private:
|
||||
enum class EffectShowStatus_e : unsigned int { Apply, Fire, Abort, Interrupt, CarriedOut };
|
||||
bool statusChangedForManuallyEffectShow(EffectShowStatus_e status);
|
||||
bool statusChangedForOrderedEffectShow(EffectShowStatus_e status);
|
||||
|
||||
private:
|
||||
QTimer *m_timer;
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
LtsSession::LtsSession *m_session;
|
||||
SafetyConfirmationWidget *m_safetyConfirmationWidget;
|
||||
|
||||
Ui::FiringExplosion *m_ui;
|
||||
NGL::INGLLogger &m_logger;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
EffectShowClient::FiringExplosionEntity m_oldEntity;
|
||||
EffectShowClient::SafetyConfirmation_e m_safetyConfirmation;
|
||||
int m_idOrder;
|
||||
int m_idEffectShow;
|
||||
int m_shotsAvail;
|
||||
bool m_isClearance;
|
||||
qint64 m_firingClearanceCountDown; // [ms]
|
||||
qint64 m_endOfFiringClearanceCountDown; // [ms]
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
+421
@@ -0,0 +1,421 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FiringExplosion</class>
|
||||
<widget class="QWidget" name="FiringExplosion">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>564</width>
|
||||
<height>246</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="mainVertLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="2">
|
||||
<widget class="QSpinBox" name="sbNumberOfShot">
|
||||
<property name="toolTip">
|
||||
<string>Number of Shots</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblNumberOfShot">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Number of Shots:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="sbNumberOfVolley">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Number of Volleys</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>48</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblNumberOfVolley">
|
||||
<property name="text">
|
||||
<string>Number of Volleys:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblDuration">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Duration [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="pbApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="sbDuration">
|
||||
<property name="toolTip">
|
||||
<string>Duration [s]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>6000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbShotsAvail">
|
||||
<property name="text">
|
||||
<string>Available Shots:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="lblShotsAvail">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leFiringClearanceIn">
|
||||
<property name="toolTip">
|
||||
<string>Firing Clearance in [s]</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblEffectShowId">
|
||||
<property name="text">
|
||||
<string>Effect Show:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="leEffectShow">
|
||||
<property name="toolTip">
|
||||
<string>Effect Show Id</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblFiringClearanceIn">
|
||||
<property name="text">
|
||||
<string>Firing Clearance in [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblEndOfFiringClearanceIn">
|
||||
<property name="text">
|
||||
<string>End of Firing Clearance in [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="leEndOfFiringClearanceIn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>End of Firing Clearance in [s]</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayoutLl">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblRemainingShots">
|
||||
<property name="text">
|
||||
<string>Remaining Shots:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leRemainingTime">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Remaining Time [s]</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblRemainingTime">
|
||||
<property name="text">
|
||||
<string>Remaining Time [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="leRemainingShots">
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Remaining Shots</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Remaining Volleys:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="leRemainingVolley">
|
||||
<property name="toolTip">
|
||||
<string>Remaining Volleys</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutLl">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbFire">
|
||||
<property name="text">
|
||||
<string>Fire</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbInterrupt">
|
||||
<property name="text">
|
||||
<string>Halt</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<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>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<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>
|
||||
<tabstops>
|
||||
<tabstop>sbNumberOfVolley</tabstop>
|
||||
<tabstop>sbNumberOfShot</tabstop>
|
||||
<tabstop>sbDuration</tabstop>
|
||||
<tabstop>pbApply</tabstop>
|
||||
<tabstop>leEffectShow</tabstop>
|
||||
<tabstop>leFiringClearanceIn</tabstop>
|
||||
<tabstop>leEndOfFiringClearanceIn</tabstop>
|
||||
<tabstop>pbFire</tabstop>
|
||||
<tabstop>pbInterrupt</tabstop>
|
||||
<tabstop>leRemainingShots</tabstop>
|
||||
<tabstop>leRemainingTime</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+301
@@ -0,0 +1,301 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#include "esc_firing_smoke.h"
|
||||
#include "ui_esc_firing_smoke.h"
|
||||
#include "esc_smoke_state.h"
|
||||
#include "esc_safety_confirmation_widget.h"
|
||||
#include "esc_order_edit.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
//=============================================================================
|
||||
FiringSmoke::FiringSmoke(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_timer(new QTimer(this))
|
||||
, m_meteoTimer(new QTimer(this))
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_session(nullptr)
|
||||
, m_smokeState(nullptr)
|
||||
, m_safetyConfirmationWidget(nullptr)
|
||||
, m_ui(new Ui::FiringSmoke)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_idOrder(0)
|
||||
, m_firingClearanceCountDown(0)
|
||||
, m_endOfFiringClearanceCountDown(0)
|
||||
, m_logger(getLogger("FiringSmoke"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "FiringSmoke::FiringSmoke()";
|
||||
|
||||
m_ui->setupUi(this);
|
||||
m_smokeState = new SmokeState(this);
|
||||
m_ui->layoutSmokeState->addWidget(m_smokeState);
|
||||
|
||||
m_meteoTimer->setInterval(15 * 60 * 1000);
|
||||
connect(m_timer, &QTimer::timeout, this, &FiringSmoke::onFiringClearanceCountDown);
|
||||
connect(m_meteoTimer, &QTimer::timeout, this, &FiringSmoke::onMeteoTimerTimeout);
|
||||
|
||||
setOnlineHelpFilename(QLatin1String("OC-Smoke"));
|
||||
}
|
||||
//=============================================================================
|
||||
FiringSmoke::~FiringSmoke()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
//=============================================================================
|
||||
bool FiringSmoke::init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
LtsSession::LtsSession *session, bool freeForm)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "FiringSmoke::init()";
|
||||
|
||||
if (!dtc || !ftc)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "FiringSmoke::init() Invalid shared_ptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_dtc = dtc;
|
||||
m_ftc = ftc;
|
||||
m_session = session;
|
||||
|
||||
m_safetyConfirmationWidget = new EffectShowClient::SafetyConfirmationWidget(this);
|
||||
m_safetyConfirmationWidget->init(m_ftc);
|
||||
//m_ui->FiringSmoke insertWidget(3, m_safetyConfirmationWidget);
|
||||
m_ui->hz->insertWidget(0, m_safetyConfirmationWidget);
|
||||
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::firingSmokeEntityChanged,
|
||||
this, &FiringSmoke::onFiringSmokeEntityChanged);
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::operatingConditionEntityChanged,
|
||||
this, &FiringSmoke::onOperatingConditionEntityChanged);
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::meteoNearVehicleChanged,
|
||||
this, &FiringSmoke::onMeteoDataChanged);
|
||||
|
||||
const EffectShowClient::MeteoNearVehicle dat = m_dtc.get()->meteoNearVehicle();
|
||||
if (dat.windDirection() > 0)
|
||||
onMeteoDataChanged(dat, DataModification());
|
||||
else
|
||||
onMeteoTimerTimeout();
|
||||
|
||||
// display data
|
||||
if (!freeForm)
|
||||
onFiringSmokeEntityChanged(m_dtc->firingSmokeEntity(), DataModification::eAdded);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Yes, this, &FiringSmoke::onCarriedOut);
|
||||
m_buttonBox->setText(LtsWidgets::DialogButton::Yes, tr("Carried Out"));
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::No, this, &FiringSmoke::onAbort);
|
||||
m_buttonBox->setText(LtsWidgets::DialogButton::No, tr("Abort"));
|
||||
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Firing Smoke")); // todo only "Firing"
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onFiringSmokeEntityChanged(const EffectShowClient::FiringSmokeEntity &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return; // freeze of indication
|
||||
|
||||
m_idOrder = data.idOrder();
|
||||
|
||||
if (data.idEffectShow() > 0)
|
||||
{
|
||||
const EffectShowClient::Order &order = m_dtc->order(data.idOrder());
|
||||
m_ui->leEffectShow->setText(QString::fromStdString(order.info()));
|
||||
m_ui->lblLengthOfFogZone->setText(tr("%1m x %2m").arg(QString::number(order.areaWidth()), QString::number(order.areaDepth())));
|
||||
m_ui->lblDirectionOfFogZone->setText(QString::number(order.areaRotation()));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->leEffectShow->setText(QString());
|
||||
m_ui->lblLengthOfFogZone->setText(tr("0m x 0m"));
|
||||
m_ui->lblDirectionOfFogZone->setText(QString::number(0));
|
||||
}
|
||||
|
||||
m_firingClearanceCountDown = data.firingClearanceTime().is_set() ? (1000 + data.firingClearanceTime().get() - m_session->partitionTime()) : 0;
|
||||
m_endOfFiringClearanceCountDown = data.endOfFiringClearanceTime().is_set() ? (1000 + data.endOfFiringClearanceTime().get() - m_session->partitionTime()) : 0;
|
||||
m_timer->stop();
|
||||
onFiringClearanceCountDown();
|
||||
|
||||
m_safetyConfirmation = data.safetyConfirmation();
|
||||
onSafetyConfirmationDisplay();
|
||||
|
||||
m_oldEntity = data;
|
||||
|
||||
}
|
||||
|
||||
void FiringSmoke::onOperatingConditionEntityChanged(const OperatingConditionEntity &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
|
||||
QVector<QColor> onColor =
|
||||
{
|
||||
data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0)
|
||||
};
|
||||
QVector<bool> status =
|
||||
{
|
||||
((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
)
|
||||
};
|
||||
|
||||
m_smokeState->setSmokeState(status, onColor);
|
||||
m_safetyConfirmationWidget->onOperatingConditionEntityChanged(data);
|
||||
|
||||
}
|
||||
|
||||
void FiringSmoke::onMeteoDataChanged(const MeteoNearVehicle &data, DataModification modType)
|
||||
{
|
||||
|
||||
Q_UNUSED(modType)
|
||||
m_meteoTimer->start(),
|
||||
m_ui->lblWeather->setText(tr("Speed [m/s]: %1 | Direction [°]: %2").arg(data.windSpeed()).arg(data.windDirection()));
|
||||
|
||||
}
|
||||
|
||||
void FiringSmoke::onMeteoTimerTimeout()
|
||||
{
|
||||
m_ui->lblWeather->setText(tr("Speed [m/s]: --- | Direction [°]: ---"));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onApply()
|
||||
{
|
||||
if (!statusChangedForManuallyEffectShow(EffectShowStatus_e::Apply))
|
||||
ERROR_LOG(m_logger) << "Firing Smoke Apply failed";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onAbort()
|
||||
{
|
||||
if (m_idOrder > 0)
|
||||
{
|
||||
OrderEdit *edit = new OrderEdit(m_dtc->order(m_idOrder), false, this);
|
||||
edit->init(m_ftc, EffectShowManagement::OrderConfirmation_e::Abort);
|
||||
addDialog(edit, menuGroup(), QLatin1String("escOrder"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
return;
|
||||
}
|
||||
else
|
||||
statusChangedForManuallyEffectShow(EffectShowStatus_e::Abort);
|
||||
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onCarriedOut()
|
||||
{
|
||||
if (m_idOrder > 0)
|
||||
{
|
||||
OrderEdit *edit = new OrderEdit(m_dtc->order(m_idOrder), false, this);
|
||||
edit->init(m_ftc, EffectShowManagement::OrderConfirmation_e::OrderCarriedOut);
|
||||
addDialog(edit, menuGroup(), QLatin1String("escOrder"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
return;
|
||||
}
|
||||
else
|
||||
statusChangedForManuallyEffectShow(EffectShowStatus_e::CarriedOut);
|
||||
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onSafetyConfirmationDisplay()
|
||||
{
|
||||
if (!m_safetyConfirmationWidget)
|
||||
return;
|
||||
m_safetyConfirmationWidget->setNewSafetyConfirmationDisplay(m_safetyConfirmation.underlying());
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void FiringSmoke::onFiringClearanceCountDown()
|
||||
{
|
||||
if (m_timer->isActive())
|
||||
{
|
||||
m_firingClearanceCountDown -= 1000;
|
||||
m_endOfFiringClearanceCountDown -= 1000;
|
||||
}
|
||||
|
||||
if (m_firingClearanceCountDown > 0)
|
||||
m_ui->leFiringClearanceIn->setText(OrderModel::timeOfDayString(m_firingClearanceCountDown / 1000));
|
||||
else
|
||||
m_ui->leFiringClearanceIn->setText(OrderModel::timeOfDayString(0));
|
||||
|
||||
if (m_endOfFiringClearanceCountDown > 0)
|
||||
m_ui->leEndOfFiringClearanceIn->setText(OrderModel::timeOfDayString(m_endOfFiringClearanceCountDown / 1000));
|
||||
else
|
||||
m_ui->leEndOfFiringClearanceIn->setText(OrderModel::timeOfDayString(0));
|
||||
|
||||
if ((m_firingClearanceCountDown > 0) || (m_endOfFiringClearanceCountDown > 0))
|
||||
m_timer->start(1000);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
bool FiringSmoke::statusChangedForManuallyEffectShow(EffectShowStatus_e status)
|
||||
{
|
||||
m_uiRequirements->clear();
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, status]()
|
||||
{
|
||||
EffectShowClient::ManuallySmokeRequest request;
|
||||
request.directionOfFogZone(0);
|
||||
request.lengthOfFogZone(0);
|
||||
request.pbAbort(status == EffectShowStatus_e::Abort);
|
||||
request.pbCarriedOut(status == EffectShowStatus_e::CarriedOut);
|
||||
return m_ftc->manuallySmokeRequest(request, this);
|
||||
});
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
bool FiringSmoke::statusChangedForOrderedEffectShow(EffectShowStatus_e status)
|
||||
{
|
||||
m_uiRequirements->clear();
|
||||
|
||||
if (!m_uiRequirements->checkRequirements(this))
|
||||
return true; // not all inputs done
|
||||
|
||||
return m_requestHelper->startSingleRequest([this, status]()
|
||||
{
|
||||
OrderModifyRequest orderModifyRequest;
|
||||
|
||||
orderModifyRequest.id(m_idOrder);
|
||||
EffectShowManagement::OrderConfirmation_e oc;
|
||||
switch (status)
|
||||
{
|
||||
case EffectShowStatus_e::Abort:
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::Abort;
|
||||
break;
|
||||
case EffectShowStatus_e::CarriedOut:
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut;
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "FiringSmoke::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess...";
|
||||
break;
|
||||
}
|
||||
orderModifyRequest.orderConfirmation(oc);
|
||||
orderModifyRequest.answerText(QString().toStdString());
|
||||
|
||||
return m_ftc->orderModifyRequest(orderModifyRequest, this);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "esc_order_model.h"
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Services/EffectShowClient/esc_dtc.h>
|
||||
#include <Services/EffectShowClient/esc_ftc.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class FiringSmoke;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class SmokeState;
|
||||
class SafetyConfirmationWidget;
|
||||
|
||||
/**
|
||||
* @brief Input mask for operating conditions.
|
||||
*/
|
||||
class FiringSmoke : public LtsWidgets::LtsDialog
|
||||
, protected EffectShowClient::Interface::Ftc::OrderModifyReplyHandler
|
||||
, protected EffectShowClient::Interface::Ftc::ManuallySmokeReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FiringSmoke(QWidget *parent = nullptr);
|
||||
~FiringSmoke();
|
||||
|
||||
bool init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
LtsSession::LtsSession *session,
|
||||
bool freeForm = false);
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void onOrderModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
void onManuallySmokeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFiringSmokeEntityChanged(const EffectShowClient::FiringSmokeEntity &data, DataModification modType);
|
||||
void onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data, DataModification modType);
|
||||
void onMeteoDataChanged(const EffectShowClient::MeteoNearVehicle &data, DataModification modType);
|
||||
void onMeteoTimerTimeout();
|
||||
void onApply();
|
||||
void onAbort();
|
||||
void onCarriedOut();
|
||||
void onSafetyConfirmationDisplay();
|
||||
void onFiringClearanceCountDown();
|
||||
|
||||
private:
|
||||
enum class EffectShowStatus_e : unsigned int { Apply, Abort, CarriedOut };
|
||||
bool statusChangedForManuallyEffectShow(EffectShowStatus_e status);
|
||||
bool statusChangedForOrderedEffectShow(EffectShowStatus_e status);
|
||||
|
||||
|
||||
private:
|
||||
QTimer *m_timer;
|
||||
QTimer *m_meteoTimer;
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
LtsSession::LtsSession *m_session;
|
||||
|
||||
EffectShowClient::SmokeState *m_smokeState;
|
||||
SafetyConfirmationWidget *m_safetyConfirmationWidget;
|
||||
|
||||
Ui::FiringSmoke *m_ui;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
EffectShowClient::FiringSmokeEntity m_oldEntity;
|
||||
EffectShowClient::SafetyConfirmation_e m_safetyConfirmation;
|
||||
int m_idOrder;
|
||||
qint64 m_firingClearanceCountDown; // [ms]
|
||||
qint64 m_endOfFiringClearanceCountDown; // [ms]
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FiringSmoke</class>
|
||||
<widget class="QWidget" name="FiringSmoke">
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="mainVertLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lblLengthOfFogZone">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">0m x 0m</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="lblWeather">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbWeather">
|
||||
<property name="text">
|
||||
<string>Wind:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblDirectionOfFog">
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rotation [deg]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="lblDirectionOfFogZone">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblLengthOfFog">
|
||||
<property name="text">
|
||||
<string>Dimension:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Status Firing Unit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="layoutSmokeState"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblEffectShowId">
|
||||
<property name="text">
|
||||
<string>Effect Show:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblEndOfFiringClearanceIn">
|
||||
<property name="text">
|
||||
<string>End of Firing Clearance in [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="leEndOfFiringClearanceIn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>End of Firing Clearance in [s]</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leFiringClearanceIn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Firing Clearance in [s]</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="leEffectShow">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Effect Show Id</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblFiringClearanceIn">
|
||||
<property name="text">
|
||||
<string>Firing Clearance in [s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hz">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>leEffectShow</tabstop>
|
||||
<tabstop>leFiringClearanceIn</tabstop>
|
||||
<tabstop>leEndOfFiringClearanceIn</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,384 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#include "esc_operating_condition.h"
|
||||
#include "ui_esc_operating_condition.h"
|
||||
#include "esc_smoke_state.h"
|
||||
#include "esc_safety_confirmation_widget.h"
|
||||
#include "LtsWidgets/lts_message_dialog.h"
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
//=============================================================================
|
||||
OperatingCondition::OperatingCondition(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_lastState(EffectShowClient::OperatingConditionEntity())
|
||||
, m_meteoTimerTimeout(60 * 1000 * 15) //15min
|
||||
, m_meteoTimer(new QTimer(this))
|
||||
, m_smokeState(nullptr)
|
||||
, m_safetyConfirmationWidget(nullptr)
|
||||
, m_ui(new Ui::OperatingCondition)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(getLogger("OperatingCondition"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_smokeState = new EffectShowClient::SmokeState(this);
|
||||
m_ui->hz->insertWidget(1, m_smokeState);
|
||||
m_smokeState->setVisible(false);
|
||||
//Hide for now
|
||||
m_ui->lblStation->hide();
|
||||
m_ui->leStation->hide();
|
||||
|
||||
m_ui->leLastUpdate->clear();
|
||||
m_ui->leLastUpdate->setEnabled(false);
|
||||
|
||||
m_batteryVoltage.maximumValue = m_ui->frameGreenVoltage->width();
|
||||
|
||||
connect(m_ui->pbSendAmmunition, &QPushButton::clicked,
|
||||
this, &OperatingCondition::onSendAmmunition);
|
||||
|
||||
setOnlineHelpFilename(QLatin1String("OC-Operating_Condition"));
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
OperatingCondition::~OperatingCondition()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
bool OperatingCondition::init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "OperatingCondition::init()";
|
||||
|
||||
if (!dtc || !ftc)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "OperatingCondition::init() Invalid shared_ptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_dtc = dtc;
|
||||
m_ftc = ftc;
|
||||
|
||||
m_safetyConfirmationWidget = new EffectShowClient::SafetyConfirmationWidget(this);
|
||||
m_safetyConfirmationWidget->init(m_ftc);
|
||||
m_ui->safetyLayout->insertWidget(0, m_safetyConfirmationWidget);
|
||||
|
||||
// connects for data changes
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::operatingConditionEntityChanged,
|
||||
this, &OperatingCondition::onOperatingConditionEntityChanged);
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::meteoNearVehicleChanged,
|
||||
this, &OperatingCondition::onMeteoNearVehicleChanged);
|
||||
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::firingExplosionEntityChanged,
|
||||
this, &OperatingCondition::onFiringExplosionEntityChanged);
|
||||
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::firingSmokeEntityChanged,
|
||||
this, &OperatingCondition::onFiringSmokeEntityChanged);
|
||||
|
||||
connect(m_meteoTimer, &QTimer::timeout,
|
||||
this, &OperatingCondition::onMeteoTimeout);
|
||||
|
||||
m_meteoTimer->start(m_meteoTimerTimeout);
|
||||
//resetWeather
|
||||
onMeteoTimeout();
|
||||
|
||||
// set constraints for battery voltage
|
||||
setBatteryVoltageConstraints(21.0, 22.0, 36.0);
|
||||
|
||||
// display data
|
||||
onOperatingConditionEntityChanged(m_dtc->operatingConditionEntity(), DataModification::eAdded);
|
||||
|
||||
const EffectShowClient::MeteoNearVehicle mdmv = m_dtc->meteoNearVehicle();
|
||||
if (mdmv.temperature() > 0 && mdmv.windSpeed() > 0)
|
||||
onMeteoNearVehicleChanged(m_dtc->meteoNearVehicle(), DataModification::eAdded);
|
||||
|
||||
connect(m_ui->pbConfirmReadiness, &QPushButton::clicked, this, &OperatingCondition::onSendConfirmReadiness);
|
||||
connect(m_ui->pbRevokeReadiness, &QPushButton::clicked, this, &OperatingCondition::onSendRevokeReadiness);
|
||||
|
||||
onSafetyConfirmationDisplay();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OperatingCondition::retranslate()
|
||||
{
|
||||
translate(m_ui, tr("Operating Condition"));
|
||||
}
|
||||
|
||||
int OperatingCondition::getSmokeCount()
|
||||
{
|
||||
const OperatingConditionEntity &data = m_dtc->operatingConditionEntity();
|
||||
int currentSmokeLoad = 0;
|
||||
if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready)
|
||||
currentSmokeLoad++;
|
||||
|
||||
return currentSmokeLoad;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OperatingCondition::onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return; // freeze of indication
|
||||
|
||||
m_lastState = data;
|
||||
|
||||
if (data.vehicleFeature() == EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion24))
|
||||
{
|
||||
m_ui->ledAftLh->hide();
|
||||
m_ui->ledAftRh->hide();
|
||||
}
|
||||
else if (data.vehicleFeature() == EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion48))
|
||||
{
|
||||
m_ui->ledAftLh->show();
|
||||
m_ui->ledAftRh->show();
|
||||
}
|
||||
bool isExp = data.vehicleFeature() != EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke);
|
||||
m_ui->frame->setHidden(!isExp);
|
||||
m_ui->lblMagazine->setHidden(!isExp);
|
||||
m_ui->lblMag->setHidden(!isExp);
|
||||
m_ui->sbMagazine->setHidden(!isExp);
|
||||
m_smokeState->setHidden(isExp);
|
||||
|
||||
//m_ui->frameSmoke->setHidden(isExp);
|
||||
if (m_safetyConfirmationWidget)
|
||||
{
|
||||
bool hasNoWarnings = m_safetyConfirmationWidget->onOperatingConditionEntityChanged(data);
|
||||
m_ui->pbConfirmReadiness->setEnabled(hasNoWarnings);
|
||||
}
|
||||
|
||||
// battery voltage
|
||||
setBatteryVoltage(data.batteryVoltage());
|
||||
|
||||
if (data.vehicleFeature() != EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke))
|
||||
{
|
||||
if (data.vehicleFeature() == EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::NotSpecified))
|
||||
return;
|
||||
// status firing units
|
||||
int max = data.vehicleFeature() == EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion24) ? 24 : 48;
|
||||
m_ui->sbMagazine->setMaximum(max);
|
||||
m_ui->sbAvailable->setMaximum(255);
|
||||
|
||||
m_ui->ledFwdLh->setStatus(data.firingUnitReadyFwdLh());
|
||||
m_ui->ledAftLh->setStatus(data.firingUnitReadyAftLh());
|
||||
m_ui->ledFwdRh->setStatus(data.firingUnitReadyFwdRh());
|
||||
m_ui->ledAftRh->setStatus(data.firingUnitReadyAftRh());
|
||||
}
|
||||
else
|
||||
{
|
||||
// status smoke cartridges
|
||||
m_ui->sbMagazine->setMaximum(5);
|
||||
m_ui->sbAvailable->setMaximum(12);
|
||||
QVector<QColor> onColor =
|
||||
{
|
||||
data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0),
|
||||
data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready ? QColor(0, 255, 0) : QColor(255, 255, 0)
|
||||
};
|
||||
QVector<bool> status =
|
||||
{
|
||||
((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
),
|
||||
((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) ||
|
||||
(data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)
|
||||
)
|
||||
};
|
||||
|
||||
m_smokeState->setSmokeState(status, onColor);
|
||||
|
||||
}
|
||||
|
||||
// set ammunition
|
||||
m_ui->ltsLedWidget->setColor(data.readiness() ? QColor(0, 255, 0) : QColor(255, 0, 0));
|
||||
m_ui->ltsLedWidget->setStatus(true);
|
||||
if (m_ui->lblAva->text().toInt() != data.ammunitionAvailable())
|
||||
m_ui->sbAvailable->setValue(data.ammunitionAvailable());
|
||||
m_ui->lblAva->setText(QString::number(data.ammunitionAvailable()));
|
||||
m_ui->lblMag->setText(QString::number(data.ammunitionMagazine()));
|
||||
// if ((m_lastState.ammunitionAvailable() != data.ammunitionAvailable())
|
||||
// || (m_lastState.ammunitionMagazine() != data.ammunitionMagazine()))
|
||||
// {
|
||||
// m_ui->sbMagazine->setValue(data.ammunitionMagazine());
|
||||
// m_ui->sbAvailable->setValue(data.ammunitionAvailable());
|
||||
// }
|
||||
}
|
||||
|
||||
void OperatingCondition::onFiringExplosionEntityChanged(const FiringExplosionEntity &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
|
||||
m_safetyConfirmation = data.safetyConfirmation();
|
||||
onSafetyConfirmationDisplay();
|
||||
}
|
||||
|
||||
void OperatingCondition::onFiringSmokeEntityChanged(const FiringSmokeEntity &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
m_safetyConfirmation = data.safetyConfirmation();
|
||||
onSafetyConfirmationDisplay();
|
||||
}
|
||||
|
||||
void OperatingCondition::onSafetyConfirmationDisplay()
|
||||
{
|
||||
if (!m_safetyConfirmationWidget)
|
||||
return;
|
||||
m_safetyConfirmationWidget->setNewSafetyConfirmationDisplay(m_safetyConfirmation.underlying());
|
||||
}
|
||||
|
||||
bool OperatingCondition::onSendRevokeReadiness()
|
||||
{
|
||||
bool ret = m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
EffectShowClient::SendReadinessRequest request;
|
||||
request.readiness(false);
|
||||
return m_ftc->sendReadinessRequest(request, this);
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool OperatingCondition::onSendConfirmReadiness()
|
||||
{
|
||||
bool ret = m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
EffectShowClient::SendReadinessRequest request;
|
||||
request.readiness(true);
|
||||
return m_ftc->sendReadinessRequest(request, this);
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OperatingCondition::onMeteoNearVehicleChanged(const EffectShowClient::MeteoNearVehicle &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return; // freeze of indication
|
||||
|
||||
m_meteoTimer->start(m_meteoTimerTimeout);
|
||||
m_ui->leTemperature->setText(QString::number(data.temperature(), 'f', 2));
|
||||
m_ui->leHumidity->setText(QString::number(data.humidity(), 'f', 2));
|
||||
m_ui->lePressure->setText(QString::number(data.pressure(), 'f', 2));
|
||||
m_ui->leWindSpeed->setText(QString::number(data.windSpeed(), 'f', 2));
|
||||
m_ui->leWindDirection->setText(QString::number(data.windDirection(), 'f', 2));
|
||||
m_ui->leLastUpdate->setText(DTG::toString(QDateTime::currentDateTime()));
|
||||
}
|
||||
|
||||
void OperatingCondition::onMeteoTimeout()
|
||||
{
|
||||
const QLatin1String lit("---");
|
||||
m_ui->leTemperature->setText(lit);
|
||||
m_ui->leHumidity->setText(lit);
|
||||
m_ui->lePressure->setText(lit);
|
||||
m_ui->leWindSpeed->setText(lit);
|
||||
m_ui->leWindDirection->setText(lit);
|
||||
m_ui->leLastUpdate->clear();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool OperatingCondition::onSendAmmunition()
|
||||
{
|
||||
if (m_ui->sbMagazine->value() > m_ui->sbAvailable->value())
|
||||
{
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("The value for Magazine must not be higher than the value for Available."));
|
||||
QPalette *palette = new QPalette();
|
||||
palette->setColor(QPalette::Background, Qt::red);
|
||||
m_ui->sbMagazine->setPalette(*palette);
|
||||
return false;
|
||||
} // if
|
||||
|
||||
m_ui->sbMagazine->setPalette(QApplication::palette(m_ui->sbMagazine));
|
||||
|
||||
return m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
EffectShowClient::SendAmmunitionRequest request;
|
||||
const OperatingConditionEntity &condition = m_dtc->operatingConditionEntity();
|
||||
if (condition.vehicleFeature() == EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke))
|
||||
request.ammunitionMagazine(getSmokeCount());
|
||||
else
|
||||
request.ammunitionMagazine(m_ui->sbMagazine->value());
|
||||
|
||||
request.ammunitionAvailable(m_ui->sbAvailable->value());
|
||||
|
||||
return m_ftc->sendAmmunitionRequest(request, this);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OperatingCondition::setBatteryVoltageConstraints(double redBoundary, double yellowBoundary, double greenMaximum)
|
||||
{
|
||||
m_batteryVoltage.redBoundary = redBoundary;
|
||||
m_batteryVoltage.yellowBoundary = yellowBoundary;
|
||||
m_batteryVoltage.greenMaximum = greenMaximum;
|
||||
|
||||
QRect greenRect = m_ui->frameGreenVoltage->geometry();
|
||||
double greenWidth = (double)greenRect.width();
|
||||
QRect setVal = greenRect;
|
||||
|
||||
setVal.setWidth((int)(greenWidth * redBoundary / greenMaximum));
|
||||
m_ui->frameRedVoltage->setGeometry(setVal);
|
||||
|
||||
setVal.setWidth((int)(greenWidth * yellowBoundary / greenMaximum));
|
||||
m_ui->frameYellowVoltage->setGeometry(setVal);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OperatingCondition::setBatteryVoltage(double batteryVoltage)
|
||||
{
|
||||
// set background color decimal value indication
|
||||
if (batteryVoltage < m_batteryVoltage.redBoundary)
|
||||
m_ui->leVoltage->setStyleSheet(QLatin1String("background-color: rgb(255, 0, 0)"));
|
||||
else if (batteryVoltage < m_batteryVoltage.yellowBoundary)
|
||||
m_ui->leVoltage->setStyleSheet(QLatin1String("background-color: rgb(255, 255, 0)"));
|
||||
else
|
||||
m_ui->leVoltage->setStyleSheet(QLatin1String("background-color: rgb(0, 255, 0)"));
|
||||
|
||||
// set progress bar value
|
||||
QRect barRect = m_ui->frameBarVoltage->geometry();
|
||||
barRect.setWidth((int)(m_batteryVoltage.maximumValue * batteryVoltage / m_batteryVoltage.greenMaximum));
|
||||
m_ui->frameBarVoltage->setGeometry(barRect);
|
||||
|
||||
// set decimal value
|
||||
m_ui->leVoltage->setText(QString::number(batteryVoltage, 'f', 1));
|
||||
}
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <Services/EffectShowClient/esc_dtc.h>
|
||||
#include <Services/EffectShowClient/esc_ftc.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OperatingCondition;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class SmokeState;
|
||||
class SafetyConfirmationWidget;
|
||||
|
||||
/**
|
||||
* @brief Input mask for operating conditions.
|
||||
*/
|
||||
class OperatingCondition : public LtsWidgets::LtsDialog,
|
||||
protected EffectShowClient::Interface::Ftc::SendAmmunitionReplyHandler,
|
||||
protected EffectShowClient::Interface::Ftc::SendReadinessReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OperatingCondition(QWidget *parent = nullptr);
|
||||
~OperatingCondition();
|
||||
|
||||
bool init(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc);
|
||||
private:
|
||||
void retranslate() override;
|
||||
void onSendAmmunitionReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
void onSendReadinessReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
int getSmokeCount();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onMeteoNearVehicleChanged(const EffectShowClient::MeteoNearVehicle &data, DataModification modType);
|
||||
void onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data, DataModification modType);
|
||||
void onFiringExplosionEntityChanged(const EffectShowClient::FiringExplosionEntity &data, DataModification modType);
|
||||
void onFiringSmokeEntityChanged(const EffectShowClient::FiringSmokeEntity &data, DataModification modType);
|
||||
void onSafetyConfirmationDisplay();
|
||||
bool onSendRevokeReadiness();
|
||||
bool onSendConfirmReadiness();
|
||||
|
||||
bool onSendAmmunition();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief The BatteryVoltage_t struct
|
||||
*/
|
||||
struct BatteryVoltage_t
|
||||
{
|
||||
double redBoundary = 5;
|
||||
double yellowBoundary = 15;
|
||||
double greenMaximum = 25;
|
||||
double maximumValue = 100;
|
||||
};
|
||||
/**
|
||||
* @brief Set the boundaries for red, yellow and green indications of the battery voltage.
|
||||
* @param[in] redBoundary In the range of 0..redBoundary the value is in the red area
|
||||
* @param[in] yellowBoundary In the range of redBoundary..yellowBoundary the value is in the yellow area
|
||||
* @param[in] greenMaximum In the range of yellowBoundary..greenMax the value is in the green area
|
||||
*/
|
||||
void setBatteryVoltageConstraints(double redBoundary, double yellowBoundary, double greenMaximum);
|
||||
/**
|
||||
* @brief Sets the data for the battery voltage indication at gui.
|
||||
* @param batteryVoltage The current battery voltage value
|
||||
*/
|
||||
void setBatteryVoltage(double batteryVoltage);
|
||||
void onMeteoTimeout();
|
||||
|
||||
private:
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
|
||||
EffectShowClient::OperatingConditionEntity m_lastState;
|
||||
EffectShowClient::SafetyConfirmation_e m_safetyConfirmation;
|
||||
|
||||
int m_meteoTimerTimeout;
|
||||
QTimer *m_meteoTimer;
|
||||
|
||||
SmokeState *m_smokeState;
|
||||
SafetyConfirmationWidget *m_safetyConfirmationWidget;
|
||||
Ui::OperatingCondition *m_ui;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
BatteryVoltage_t m_batteryVoltage;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
+815
@@ -0,0 +1,815 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OperatingCondition</class>
|
||||
<widget class="QWidget" name="OperatingCondition">
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Ammunition:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblMagazine">
|
||||
<property name="text">
|
||||
<string>Magazine:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblMag">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbMagazine">
|
||||
<property name="toolTip">
|
||||
<string>Magazine</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblAvailable">
|
||||
<property name="text">
|
||||
<string>Available:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblAva">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sbAvailable">
|
||||
<property name="toolTip">
|
||||
<string>Available</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbSendAmmunition">
|
||||
<property name="text">
|
||||
<string>Send Ammunition</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../Styles/Dark/resources/rme_dark_style.qrc">
|
||||
<normaloff>:/style/avm_start.svg</normaloff>:/style/avm_start.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>102</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblStatusFiringUnits">
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Status Firing Unit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="hz">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>20</horstretch>
|
||||
<verstretch>20</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/style/icons/png/camera_arrow_up.png);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledFwdLh">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="animTime">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledAftLh">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>30</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledFwdRh">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>55</x>
|
||||
<y>0</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledAftRh">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>55</x>
|
||||
<y>30</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>182</width>
|
||||
<height>49</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblReadi">
|
||||
<property name="text">
|
||||
<string>Readiness:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ltsLedWidget">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="status">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbConfirmReadiness">
|
||||
<property name="text">
|
||||
<string>Confirm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbRevokeReadiness">
|
||||
<property name="text">
|
||||
<string>Withdraw</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>182</width>
|
||||
<height>29</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="safetyLayout" stretch="0">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>3</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<widget class="QLabel" name="lblBatteryVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>321</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Battery Voltage [V]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="leVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>30</y>
|
||||
<width>81</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>41</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 0, 0);</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frameRedVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>14</x>
|
||||
<y>30</y>
|
||||
<width>31</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">#frameRedVoltage {
|
||||
background-color: rgb(255, 0, 0);
|
||||
border-left: 1px solid red;
|
||||
border-top: 1px solid red;
|
||||
border-bottom: 1px solid red;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frameYellowVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>14</x>
|
||||
<y>30</y>
|
||||
<width>61</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frameBarVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>14</x>
|
||||
<y>40</y>
|
||||
<width>121</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(0, 255, 0);
|
||||
background-color: rgb(0, 85, 255);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frameGreenVoltage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>14</x>
|
||||
<y>30</y>
|
||||
<width>121</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(0, 255, 0);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frameBarGraph">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>14</x>
|
||||
<y>40</y>
|
||||
<width>121</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>leVoltage</zorder>
|
||||
<zorder>frameGreenVoltage</zorder>
|
||||
<zorder>frameYellowVoltage</zorder>
|
||||
<zorder>frameRedVoltage</zorder>
|
||||
<zorder>frameBarVoltage</zorder>
|
||||
<zorder>frameBarGraph</zorder>
|
||||
<zorder>lblBatteryVoltage</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayoutWeather">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblTemperature">
|
||||
<property name="text">
|
||||
<string>Temperature [°C]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="leTemperature">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Temperature [°C]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblHumidity">
|
||||
<property name="text">
|
||||
<string>Humidity [%]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leHumidity">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Humidity [%]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblPressure">
|
||||
<property name="text">
|
||||
<string>Pressure [hPa]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lePressure">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pressure [hPa]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblWindSpeed">
|
||||
<property name="text">
|
||||
<string>Wind Speed [m/s]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="leWindSpeed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Wind Speed [m/s]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblWindDirection">
|
||||
<property name="text">
|
||||
<string>Wind Direction *) [°]:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="leWindDirection">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Wind Direction [°]</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lblStation">
|
||||
<property name="text">
|
||||
<string>Station:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="leStation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="lblLastUpdate">
|
||||
<property name="text">
|
||||
<string>Last Update:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="leLastUpdate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QLabel" name="lblNote">
|
||||
<property name="text">
|
||||
<string>*) North=0°, East=90°, South=180°, West=270°</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsLedWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_led_widget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>sbMagazine</tabstop>
|
||||
<tabstop>sbAvailable</tabstop>
|
||||
<tabstop>pbSendAmmunition</tabstop>
|
||||
<tabstop>pbConfirmReadiness</tabstop>
|
||||
<tabstop>pbRevokeReadiness</tabstop>
|
||||
<tabstop>leTemperature</tabstop>
|
||||
<tabstop>leHumidity</tabstop>
|
||||
<tabstop>lePressure</tabstop>
|
||||
<tabstop>leWindSpeed</tabstop>
|
||||
<tabstop>leWindDirection</tabstop>
|
||||
<tabstop>leStation</tabstop>
|
||||
<tabstop>leLastUpdate</tabstop>
|
||||
<tabstop>leVoltage</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../Styles/Dark/resources/rme_dark_style.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#include "esc_order_edit.h"
|
||||
#include "ui_esc_order_edit.h"
|
||||
|
||||
#include <EffectShowManagement/esm_translation.h>
|
||||
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
//=============================================================================
|
||||
OrderEdit::OrderEdit(const Order &order, bool fireReadinessAvailable, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkCancel)
|
||||
, m_ftc(nullptr)
|
||||
, m_ui(new Ui::OrderEdit)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_order(order)
|
||||
, m_fireReadinessAvailable(fireReadinessAvailable)
|
||||
, m_logger(getLogger("OrderEdit"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
//=============================================================================
|
||||
OrderEdit::~OrderEdit()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
//=============================================================================
|
||||
bool OrderEdit::init(const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc, EffectShowManagement::OrderConfirmation_e order)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "OrderEdit::init()";
|
||||
|
||||
if (!ftc)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "OrderEdit::init() Invalid shared_ptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ftc = ftc;
|
||||
|
||||
// Set a consistent font size for the comboBox
|
||||
QFont cbFont = m_ui->cbOrderConfirmation->font();
|
||||
#ifdef TABLET_MODE
|
||||
m_ui->cbxAnswer->setMinimumHeight(50);
|
||||
cbFont.setPointSizeF(cbFont.pointSizeF()*1.5);
|
||||
#endif
|
||||
m_ui->cbOrderConfirmation->setFont(cbFont);
|
||||
m_ui->cbxAnswer->setFont(cbFont);
|
||||
|
||||
createOrderList();
|
||||
if (order == EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance)
|
||||
showOrder();
|
||||
else
|
||||
{
|
||||
m_ui->cbOrderConfirmation->addItem(m_orderList[order.underlying()]);
|
||||
m_ui->cbOrderConfirmation->setEnabled(false);
|
||||
slotChangesMade();
|
||||
setUnchangeable(true);
|
||||
}
|
||||
|
||||
if (m_ui->cbxAnswer->lineEdit())
|
||||
{
|
||||
m_ui->cbxAnswer->lineEdit()->setFont(cbFont);
|
||||
m_ui->cbxAnswer->lineEdit()->setMaxLength(39);
|
||||
}
|
||||
m_ui->cbxAnswer->addItem(QString());
|
||||
m_ui->cbxAnswer->addItem(tr("Remaining time not sufficient"));
|
||||
m_ui->cbxAnswer->addItem(tr("Not enough ammunition for order"));
|
||||
m_ui->cbxAnswer->addItem(tr("Presentation vehicle has got stuck"));
|
||||
m_ui->cbxAnswer->addItem(tr("Commanding a fixed restricted area"));
|
||||
m_ui->cbxAnswer->addItem(tr("Command into a variable restricted area"));
|
||||
m_ui->cbxAnswer->addItem(tr("Maximum permissible working time exceeded"));
|
||||
m_ui->cbxAnswer->addItem(tr("Order executed, no confirmation"));
|
||||
|
||||
m_uiRequirements->addRequirement({m_ui->lblOrderConfirmation, [this]() { return (m_ui->cbOrderConfirmation->currentIndex() != -1); }});
|
||||
m_uiRequirements->addRequirement({m_ui->lblAnswer, [this]() { return checkForAnswerUiRequirement(); }});
|
||||
|
||||
return true;
|
||||
}
|
||||
//=============================================================================
|
||||
bool OrderEdit::apply()
|
||||
{
|
||||
// Send modified data via FTC call
|
||||
return m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
OrderModifyRequest orderModifyRequest;
|
||||
|
||||
int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText());
|
||||
EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e::inner_enum(key);
|
||||
orderModifyRequest.orderConfirmation(oc);
|
||||
|
||||
orderModifyRequest.answerText(m_ui->cbxAnswer->currentText().toStdString());
|
||||
|
||||
orderModifyRequest.id(m_order.id());
|
||||
|
||||
return m_ftc->orderModifyRequest(orderModifyRequest, this);
|
||||
});
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderEdit::retranslate()
|
||||
{
|
||||
if (m_order.typeOfOrder() == 0)
|
||||
translate(m_ui, tr("Edit relocation order"));
|
||||
else
|
||||
translate(m_ui, tr("Edit Effectshow Order"));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
bool OrderEdit::checkForAnswerUiRequirement() const
|
||||
{
|
||||
if (m_ui->cbOrderConfirmation->currentIndex() == -1)
|
||||
return true;
|
||||
|
||||
int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText());
|
||||
return !(((key == EffectShowManagement::OrderConfirmation_e_def::Nonacceptance) ||
|
||||
(key == EffectShowManagement::OrderConfirmation_e_def::Abort)) &&
|
||||
m_ui->cbxAnswer->currentText().isEmpty());
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderEdit::showOrder()
|
||||
{
|
||||
QStringList orderList;
|
||||
|
||||
switch (m_order.orderConfirmation().underlying())
|
||||
{
|
||||
case EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached];
|
||||
|
||||
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness];
|
||||
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Nonacceptance];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached];
|
||||
|
||||
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness];
|
||||
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::DriveOff:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached];
|
||||
|
||||
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness];
|
||||
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::PositionReached:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation];
|
||||
if (m_fireReadinessAvailable)
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness];
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::FiringReadiness:
|
||||
// orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptExecution]
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::Execution:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached];
|
||||
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness];
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::InterruptExecution:
|
||||
//orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut]
|
||||
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
default:
|
||||
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort];
|
||||
break;
|
||||
}
|
||||
m_ui->cbOrderConfirmation->addItems(orderList);
|
||||
m_ui->cbOrderConfirmation->setCurrentIndex(-1);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderEdit::createOrderList()
|
||||
{
|
||||
EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::DriveOff;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::PositionReached;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::FiringReadiness;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::Execution;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptExecution;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::Abort;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::Nonacceptance;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation;
|
||||
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
|
||||
}
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MeteoDataManagement - Static Meteo Data Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-10-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "esc_order_model.h"
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <Services/EffectShowClient/esc_ftc.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OrderEdit;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
/**
|
||||
* @brief Input mask for effect show order changes.
|
||||
*/
|
||||
class OrderEdit : public LtsWidgets::LtsDialog,
|
||||
protected EffectShowClient::Interface::Ftc::OrderModifyReplyHandler
|
||||
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OrderEdit(const Order &order, bool fireReadinessAvailable, QWidget *parent = nullptr);
|
||||
~OrderEdit();
|
||||
|
||||
bool init(const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc, EffectShowManagement::OrderConfirmation_e order = EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance);
|
||||
bool apply() override;
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
bool checkForAnswerUiRequirement() const;
|
||||
void showOrder();
|
||||
void createOrderList();
|
||||
void onOrderModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private:
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
Ui::OrderEdit *m_ui;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
Order m_order;
|
||||
bool m_fireReadinessAvailable;
|
||||
EffectShowManagement::OrderConfirmation_e_def m_forcedState;
|
||||
QHash<int, QString> m_orderList;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OrderEdit</class>
|
||||
<widget class="QWidget" name="OrderEdit">
|
||||
<property name="windowTitle">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbOrderConfirmation">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblAnswer">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Answer:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblOrderConfirmation">
|
||||
<property name="text">
|
||||
<string>Order Confirmation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbxAnswer">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>LtsWidgets/lts_combo_box.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+288
@@ -0,0 +1,288 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for MeteoDataManagement - Meteo Data Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10-05
|
||||
*/
|
||||
|
||||
#include "esc_order_list.h"
|
||||
#include "ui_esc_order_list.h"
|
||||
#include "esc_order_model.h"
|
||||
#include "esc_order_edit.h"
|
||||
#include "esc_firing_explosion.h"
|
||||
#include "esc_firing_smoke.h"
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <LtsPrinting/printing.h>
|
||||
#include <QTreeView>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
//=============================================================================
|
||||
OrderList::OrderList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_model(nullptr)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_sitMapGuiIfc(nullptr)
|
||||
, m_session(session)
|
||||
, m_ui(new Ui::OrderList)
|
||||
, m_isEffectShow(false)
|
||||
, m_logger(getLogger("OrderList"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->widget->setSelectionMode(QAbstractItemView::SingleSelection); //onShowEscOrderPosition();
|
||||
|
||||
// connects fuer Widgetaenderungen
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged,
|
||||
this, &OrderList::onSelectionChanged);
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalDoubleClicked,
|
||||
this, &OrderList::onEditOrder);
|
||||
|
||||
// Edit-Button erzeugen
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &OrderList::onEditOrder);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
// Show-Button erzeugen
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Show, this, &OrderList::onShowOrder);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &OrderList::onPrint);
|
||||
|
||||
// Create / Remove Button erzeugen
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Add, this, &OrderList::onCreateShowEscOrderPosition);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, false);
|
||||
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Load, this, &OrderList::onRemoveEscOrderPosition);
|
||||
|
||||
|
||||
// Beschriftung der Button der Funktionalitaet anpassen......
|
||||
m_buttonBox->setText(LtsWidgets::DialogButton::Add, tr("Create ESC Order Pos"));
|
||||
m_buttonBox->setText(LtsWidgets::DialogButton::Load, tr("Remove ESC Order Pos"));
|
||||
|
||||
setOnlineHelpFilename(QLatin1String("OC-Order_List"));
|
||||
|
||||
} // end of ctor()
|
||||
//=============================================================================
|
||||
OrderList::~OrderList()
|
||||
{
|
||||
delete m_ui;
|
||||
} // end of dtor()
|
||||
//=============================================================================
|
||||
bool OrderList::init(bool isEffectShow,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> &dtcTabOC)
|
||||
{
|
||||
if (!dtc || !ftc)
|
||||
return false;
|
||||
|
||||
m_dtc = dtc;
|
||||
m_ftc = ftc;
|
||||
if (!m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc))
|
||||
return false;
|
||||
EffectShowManagement::Feature_e feature = m_dtc->operatingConditionEntity().vehicleFeature();
|
||||
if (isEffectShow && feature == EffectShowManagement::Feature_e::NotSpecified)
|
||||
return false;
|
||||
|
||||
m_isEffectShow = isEffectShow;
|
||||
|
||||
bool isSmoke = (feature == EffectShowManagement::Feature_e::Smoke);
|
||||
|
||||
m_model = new OrderModel(this);
|
||||
m_model->initModel(m_dtc, dtcTabOC, m_isEffectShow);
|
||||
m_proxyModel = new OrderProxyModel(this);
|
||||
m_proxyModel->setSourceModel(m_model);
|
||||
m_ui->widget->setModel(m_proxyModel);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Type);
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::orderChanged,
|
||||
this, &OrderList::onSelectionChanged);
|
||||
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
//m_ui->widget->hideColumn(EffectShowClient::OrderModel::Id);
|
||||
#endif
|
||||
|
||||
if (m_isEffectShow)
|
||||
{
|
||||
if (isSmoke)
|
||||
{
|
||||
//Smoke
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Volley);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::ShotsInTotal);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Explosions
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Area);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Rotation);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Duration);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Area);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Rotation);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::Volley);
|
||||
m_ui->widget->hideColumn(EffectShowClient::OrderModel::ShotsInTotal);
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "esc Order is visible:" << m_sitMapGuiIfc->isEscOrderPositionVisible();
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, m_sitMapGuiIfc->isEscOrderPositionVisible());
|
||||
m_buttonBox->setButtonVisible(LtsWidgets::DialogButton::Show, m_isEffectShow);
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderList::retranslate()
|
||||
{
|
||||
if (m_isEffectShow)
|
||||
translate(m_ui, tr("Order List"));
|
||||
else
|
||||
translate(m_ui, tr("Relocation List"));
|
||||
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderList::onSelectionChanged()
|
||||
{
|
||||
|
||||
if (m_ui->widget->selectionModel()->selectedRows().size() <= 0)
|
||||
{
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, false);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
|
||||
return;
|
||||
}
|
||||
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
int row = idx.row();
|
||||
const EffectShowClient::Order order = m_model->getRowData(row);
|
||||
bool isReady = order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::FiringReadiness
|
||||
|| order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::Execution;
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, isReady);
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, true);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true);
|
||||
} // end of onSelectionChanged()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderList::onEditOrder()
|
||||
{
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
|
||||
int row = idx.row();
|
||||
if (row < 0)
|
||||
return;
|
||||
|
||||
const EffectShowClient::Order order = m_model->getRowData(row);
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "--- onEditOrder() ";
|
||||
if (order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut)
|
||||
return;
|
||||
bool fireReadinessEnable = true;
|
||||
const auto orders = m_dtc->orders();
|
||||
for (const auto &ord : orders)
|
||||
{
|
||||
if (ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::FiringReadiness ||
|
||||
ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::InterruptExecution ||
|
||||
ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::Execution)
|
||||
{
|
||||
//only enable one ready order
|
||||
fireReadinessEnable = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
OrderEdit *dialog = new OrderEdit(order, fireReadinessEnable, this);
|
||||
dialog->init(m_ftc);
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("escOrder"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderList::onShowOrder()
|
||||
{
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
|
||||
int row = idx.row();
|
||||
if (row < 0)
|
||||
return;
|
||||
|
||||
EffectShowManagement::Feature_e feature = m_dtc->operatingConditionEntity().vehicleFeature();
|
||||
if (feature == EffectShowManagement::Feature_e::NotSpecified)
|
||||
return;
|
||||
|
||||
if (feature == EffectShowManagement::Feature_e::Smoke) //Smoke??
|
||||
{
|
||||
FiringSmoke *dialog = new FiringSmoke(this);
|
||||
if (!dialog->init(m_dtc, m_ftc, m_session))
|
||||
{
|
||||
delete dialog;
|
||||
return;
|
||||
}
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("escFiringSmoke"));
|
||||
}
|
||||
else if (feature == EffectShowManagement::Feature_e::Explosion24 ||
|
||||
feature == EffectShowManagement::Feature_e::Explosion48) //Explo??)
|
||||
{
|
||||
FiringExplosion *dialog = new FiringExplosion(this);
|
||||
if (!dialog->init(m_dtc, m_ftc, m_session))
|
||||
{
|
||||
delete dialog;
|
||||
return;
|
||||
}
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("escFiringExplosion"));
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void OrderList::onPrint()
|
||||
{
|
||||
LtsPrinting::printView(m_session, this, m_ui->widget->treeView());
|
||||
} // end of onPrint()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void OrderList::onCreateShowEscOrderPosition()
|
||||
{
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
|
||||
int row = idx.row();
|
||||
if (row < 0)
|
||||
return;
|
||||
|
||||
const EffectShowClient::Order order = m_model->getRowData(row);
|
||||
|
||||
bool is_smoke = m_dtc.get()->operatingConditionEntity().vehicleFeature() == EffectShowManagement::Feature_e::Smoke && m_isEffectShow;
|
||||
|
||||
const QPointF &pos = QPointF(order.position().lon(), order.position().lat());
|
||||
m_sitMapGuiIfc->escOrderPosition_create(pos, order.areaWidth(), order.areaDepth(), order.areaRotation(), is_smoke);
|
||||
m_sitMapGuiIfc->setCenterPoint(pos);
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, true);
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, false);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void OrderList::onRemoveEscOrderPosition()
|
||||
{
|
||||
m_sitMapGuiIfc->escOrderPosition_remove();
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false);
|
||||
DEBUG_LOG(m_logger) << "esc Order row selected:" << m_ui->widget->selectionModel()->selectedRows().size();
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, m_ui->widget->selectionModel()->selectedRows().size() > 0);
|
||||
|
||||
}
|
||||
|
||||
void OrderList::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->widget->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
} // namespace EffectShowManagement
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for MeteoDataManagement - Meteo Data Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10-05
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <EffectShowClient/esc_dtc.h>
|
||||
#include <EffectShowClient/esc_ftc.h>
|
||||
#include <TrainingAreaBaseOC/taboc_dtc.h>
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OrderList;
|
||||
}
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
class ForeignGuiInterface;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class OrderModel;
|
||||
class OrderProxyModel;
|
||||
|
||||
/**
|
||||
* @brief The OrderList is the view related to #OrderModel
|
||||
*/
|
||||
class OrderList : public LtsWidgets::LtsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OrderList(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~OrderList();
|
||||
bool init(bool isEffectShow,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> &dtcTabOC);
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void onSelectionChanged();
|
||||
void onEditOrder();
|
||||
void onShowOrder();
|
||||
void onPrint();
|
||||
void onCreateShowEscOrderPosition();
|
||||
void onRemoveEscOrderPosition();
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
private:
|
||||
QString m_menuGroup;
|
||||
OrderModel *m_model;
|
||||
OrderProxyModel *m_proxyModel;
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
||||
|
||||
LtsSession::LtsSession *m_session;
|
||||
Ui::OrderList *m_ui;
|
||||
|
||||
bool m_isEffectShow;
|
||||
LOGGER_T m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace EffectShowManagement
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OrderList</class>
|
||||
<widget class="QWidget" name="OrderList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>455</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Effect Show</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="LtsDataView::LtsDataView" name="widget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</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>
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for EffectShowManagement - Effect Show Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10.05
|
||||
*/
|
||||
|
||||
#include "esc_order_model.h"
|
||||
#include <EffectShowManagement/esm_translation.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <sstream>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
//---------------------------------
|
||||
// Vehicle OrderModel
|
||||
//---------------------------------
|
||||
OrderModel::OrderModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<EffectShowClient::Order>(
|
||||
{
|
||||
tr("Id"),
|
||||
tr("Type"),
|
||||
tr("Info"),
|
||||
tr("Status"),
|
||||
tr("Time"),
|
||||
tr("Duration"),
|
||||
tr("Distance [m]"),
|
||||
tr("Position"),
|
||||
tr("Area"),
|
||||
tr("Rotation"),
|
||||
tr("Volley"),
|
||||
tr("Shots In Total")
|
||||
},
|
||||
parent)
|
||||
, m_logger(getLogger("OrderModel"))
|
||||
{}
|
||||
|
||||
//=============================================================================
|
||||
bool OrderModel::initModel(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> &dtcTabOC,
|
||||
bool isEffectShow)
|
||||
{
|
||||
m_dtc = dtc;
|
||||
m_dtcTabOC = dtcTabOC;
|
||||
m_isEffectShow = isEffectShow;
|
||||
connect(m_dtc.get(), &EffectShowClient::Interface::Dtc::orderChanged,
|
||||
this, &OrderModel::onDataChanged);
|
||||
|
||||
// insert Model
|
||||
const QMap<qint32, EffectShowClient::Order> &orderMap = m_dtc->orders();
|
||||
for (const auto &order : orderMap)
|
||||
{
|
||||
if (order.typeOfOrder() == m_isEffectShow) //
|
||||
insertRow(order);
|
||||
}
|
||||
|
||||
//rename Info
|
||||
if (m_isEffectShow)
|
||||
m_vecColumns.replace(OrderModel::Info, tr("Effect Simulation"));
|
||||
|
||||
if (m_dtcTabOC)
|
||||
{
|
||||
connect(m_dtcTabOC.get(), &TrainingAreaBaseOC::Interface::Dtc::ownPositionChanged,
|
||||
this, &OrderModel::onOwnPositionChanged);
|
||||
m_ownPosition = m_dtcTabOC->ownPosition(1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
//=============================================================================
|
||||
QVariant OrderModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
bool is_smoke = m_dtc.get()->operatingConditionEntity().vehicleFeature() == EffectShowManagement::Feature_e::Smoke;
|
||||
|
||||
|
||||
const EffectShowClient::Order &order = m_vecData.at(index.row());
|
||||
switch (index.column())
|
||||
{
|
||||
case Status:
|
||||
return EffectShowManagement::toString(order.orderConfirmation());
|
||||
case Id:
|
||||
return order.idOrder();
|
||||
case StartTime:
|
||||
return order.startTime().is_set() ? DTG::toStringMSec(order.startTime().get()) : tr("---");
|
||||
case Duration:
|
||||
return LtsWidgets::readableDuration(order.duration() * 1000);
|
||||
case Distance:
|
||||
{
|
||||
if (!m_dtcTabOC)
|
||||
return QVariant();
|
||||
|
||||
int distance = qRound(LtsCoordTrans::distance(m_ownPosition.position().lon(), m_ownPosition.position().lat(),
|
||||
order.position().lon(), order.position().lat()));
|
||||
return (distance / 10) * 10;
|
||||
}
|
||||
case Position:
|
||||
{
|
||||
const Core::GeoPosition2D &pos = order.position();
|
||||
return LtsCoordTrans::mgrsFromGeographic(pos.lon(), pos.lat());
|
||||
}
|
||||
case Area:
|
||||
{
|
||||
return tr("%1m x %2m", "Ausdehung: 5m x 6m").arg(order.areaWidth()).arg(order.areaDepth());
|
||||
}
|
||||
case Type:
|
||||
{
|
||||
if (order.typeOfOrder() == 0)
|
||||
return tr("Relocation Position");
|
||||
else if (is_smoke)
|
||||
return tr("Smoke");
|
||||
else
|
||||
return tr("Explosion");
|
||||
}
|
||||
case Rotation:
|
||||
if (is_smoke)
|
||||
return order.areaRotation();
|
||||
else
|
||||
return QStringLiteral("--");
|
||||
case Volley:
|
||||
if (is_smoke)
|
||||
return QStringLiteral("--");
|
||||
else
|
||||
return order.numOfVolley();
|
||||
case Info:
|
||||
return QString::fromStdString(order.info());
|
||||
case ShotsInTotal:
|
||||
if (is_smoke)
|
||||
return QStringLiteral("--");
|
||||
else
|
||||
return order.shotsPerVolley();
|
||||
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
//=============================================================================
|
||||
QString OrderModel::timeOfDayString(int seconds)
|
||||
{
|
||||
int hour = seconds / 3600;
|
||||
int hour_s = hour * 3600;
|
||||
int min = (seconds - hour_s) / 60;
|
||||
int min_s = min * 60;
|
||||
int sec = seconds - hour_s - min_s;
|
||||
|
||||
std::stringstream sStrm;
|
||||
sStrm.fill('0');
|
||||
sStrm << std::setw(2) << hour << ':' << std::setw(2) << min << ':' << std::setw(2) << sec;
|
||||
return QString::fromStdString(sStrm.str());
|
||||
}
|
||||
|
||||
bool OrderModel::onDataChanged(const Order &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return LtsAbstractTableModel::onDataChanged(data, modType);
|
||||
else if (data.typeOfOrder() == m_isEffectShow)
|
||||
return LtsAbstractTableModel::onDataChanged(data, modType);
|
||||
return false;
|
||||
}
|
||||
|
||||
void OrderModel::onOwnPositionChanged(const TrainingAreaBaseOC::OwnPosition &data)
|
||||
{
|
||||
if (m_ownPosition == data)
|
||||
return;
|
||||
m_ownPosition = data;
|
||||
for (int r = 0; r < m_vecData.size(); ++r)
|
||||
{
|
||||
const QModelIndex idx = index(r, Distance);
|
||||
emit dataChanged(idx, idx, {Qt::DisplayRole});
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// OrderProxyModel
|
||||
//
|
||||
void OrderProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
|
||||
{
|
||||
m_sourceModel = qobject_cast<OrderModel *>(sourceModel);
|
||||
LtsWidgets::LtsColumnFilterProxyModel::setSourceModel(sourceModel);
|
||||
}
|
||||
|
||||
bool OrderProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
||||
{
|
||||
if (!m_sourceModel ||
|
||||
source_left.column() != source_right.column() ||
|
||||
!source_left.isValid() ||
|
||||
!source_right.isValid())
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||
const auto &dataLeft = m_sourceModel->m_vecData.at(source_left.row());
|
||||
const auto dataRight = m_sourceModel->m_vecData.at(source_right.row());
|
||||
switch (source_left.column())
|
||||
{
|
||||
case OrderModel::StartTime:
|
||||
if (dataLeft.startTime().is_set() && dataRight.startTime().is_set())
|
||||
return dataLeft.startTime().get() < dataRight.startTime().get();
|
||||
if (dataRight.startTime().is_set())
|
||||
return true;
|
||||
if (dataLeft.startTime().is_set())
|
||||
return false;
|
||||
return dataLeft.id() < dataRight.id();
|
||||
case OrderModel::Status:
|
||||
case OrderModel::Id:
|
||||
case OrderModel::Duration:
|
||||
case OrderModel::Distance:
|
||||
case OrderModel::Position:
|
||||
case OrderModel::Area:
|
||||
case OrderModel::Volley:
|
||||
case OrderModel::ShotsInTotal:
|
||||
break;
|
||||
}
|
||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||
}
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for MeteoDataManagement - Weather Station Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10.05
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <EffectShowClient/esc_dtc.h>
|
||||
#include <EffectShowClient/logger.h>
|
||||
#include <TrainingAreaBaseOC/taboc_dtc.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief The OrderModel provides all effect show orders related to the vehicle.
|
||||
*/
|
||||
class OrderModel final : public LtsWidgets::LtsAbstractTableModel<EffectShowClient::Order>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Type,
|
||||
Info,
|
||||
Status,
|
||||
StartTime,
|
||||
Duration,
|
||||
Distance,
|
||||
Position,
|
||||
Area,
|
||||
Rotation,
|
||||
Volley,
|
||||
ShotsInTotal
|
||||
};
|
||||
explicit OrderModel(QObject *parent = nullptr);
|
||||
|
||||
bool initModel(const std::shared_ptr<EffectShowClient::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> &dtcTabOC,
|
||||
bool isEffectShow);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
/**
|
||||
* @brief Converts seconds of the day into a string like: hh::mm:ss.
|
||||
* @param seconds Seconds of the day
|
||||
* @return A string like: hh::mm:ss
|
||||
*/
|
||||
static QString timeOfDayString(int seconds);
|
||||
private slots:
|
||||
bool onDataChanged(const EffectShowClient::Order &data, DataModification modType) override;
|
||||
void onOwnPositionChanged(const TrainingAreaBaseOC::OwnPosition &data);
|
||||
|
||||
private:
|
||||
std::shared_ptr<EffectShowClient::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> m_dtcTabOC;
|
||||
TrainingAreaBaseOC::OwnPosition m_ownPosition;
|
||||
friend class OrderProxyModel;
|
||||
bool m_isEffectShow = true;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
class OrderProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel;
|
||||
void setSourceModel(QAbstractItemModel *sourceModel) override;
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
private:
|
||||
OrderModel *m_sourceModel = nullptr;
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* EffectShowClient - Safety Confirmation Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, NLE, 2020-04-07
|
||||
*/
|
||||
|
||||
#include "esc_safety_confirmation_widget.h"
|
||||
#include "ui_esc_safety_confirmation_widget.h"
|
||||
#include "esc_smoke_state.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
SafetyConfirmationWidget::SafetyConfirmationWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
, m_currentState(SafetyConfirmation_e::SafetyNotConfirmed)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_ui(new Ui::SafetyConfirmationWidget)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setMinimumHeight(sizeHint().height());
|
||||
}
|
||||
|
||||
SafetyConfirmationWidget::~SafetyConfirmationWidget()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool SafetyConfirmationWidget::init(const std::shared_ptr<Interface::Ftc> &ftc)
|
||||
{
|
||||
if (!ftc)
|
||||
return false;
|
||||
m_ftc = ftc;
|
||||
connect(m_ui->pbRevoke, &QPushButton::clicked, this, &SafetyConfirmationWidget::onRevokeClicked);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SafetyConfirmationWidget::onOperatingConditionEntityChanged(const OperatingConditionEntity &data)
|
||||
{
|
||||
QStringList warningText;
|
||||
if (data.loadingBoardWall())
|
||||
warningText.append(tr("Loading Board Wall open"));
|
||||
if (data.temperatureWarning())
|
||||
warningText.append(tr("Temperature Warning"));
|
||||
if (data.errorEquipment())
|
||||
warningText.append(tr("Error Equipment"));
|
||||
if (data.errorFireUnit())
|
||||
warningText.append(tr("Fire Unit Error"));
|
||||
if (data.errorGeneral())
|
||||
warningText.append(tr("General Error"));
|
||||
if (data.errorPanel())
|
||||
warningText.append(tr("Panel Error"));
|
||||
if (data.errorSmoke())
|
||||
warningText.append(tr("Smoke Unit Error"));
|
||||
if (data.emergencyStop())
|
||||
warningText.append(tr("Emergency Stop!"));
|
||||
|
||||
if (warningText.size() > 0)
|
||||
{
|
||||
m_errorString = tr("Warning: %1").arg(warningText.join(QLatin1Char(',')));
|
||||
setMessageInternal();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_errorString = QString();
|
||||
setMessageInternal();
|
||||
}
|
||||
return warningText.size() == 0;
|
||||
}
|
||||
|
||||
void SafetyConfirmationWidget::setMessage(const QString &message)
|
||||
{
|
||||
m_messageString = message;
|
||||
setMessageInternal();
|
||||
}
|
||||
|
||||
void SafetyConfirmationWidget::setMessageInternal()
|
||||
{
|
||||
QString text = m_messageString;
|
||||
if (!m_errorString.isEmpty() && !m_messageString.isEmpty())
|
||||
text.append(QStringLiteral(", %1").arg(m_errorString));
|
||||
else
|
||||
text.append(m_errorString);
|
||||
m_ui->lblWarningText->setText(text);
|
||||
}
|
||||
|
||||
void SafetyConfirmationWidget::setNewSafetyConfirmationDisplay(const SafetyConfirmation_e &safetyConfirmation)
|
||||
{
|
||||
if (m_currentState == safetyConfirmation)
|
||||
return;
|
||||
m_currentState = safetyConfirmation;
|
||||
onSafetyConfirmationDisplay();
|
||||
}
|
||||
|
||||
bool SafetyConfirmationWidget::onRevokeClicked()
|
||||
{
|
||||
return m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
EffectShowClient::SendSafetyRevokeRequest request;
|
||||
|
||||
request.revoke(true);
|
||||
return m_ftc->sendSafetyRevokeRequest(request, this);
|
||||
});
|
||||
}
|
||||
|
||||
void SafetyConfirmationWidget::onSafetyConfirmationDisplay()
|
||||
{
|
||||
switch (m_currentState.underlying())
|
||||
{
|
||||
case EffectShowClient::SafetyConfirmation_e_def::SafetyConfirmed:
|
||||
m_ui->ltsLedWidget->setColor(QColor(0, 255, 0));
|
||||
m_ui->ltsLedWidget->setStatus(true);
|
||||
break;
|
||||
case EffectShowClient::SafetyConfirmation_e_def::SafetyExpiring:
|
||||
m_ui->ltsLedWidget->setColor(QColor(0, 255, 0));
|
||||
m_ui->ltsLedWidget->setStatus(!m_ui->ltsLedWidget->status());
|
||||
QTimer::singleShot(800, this, &SafetyConfirmationWidget::onSafetyConfirmationDisplay);
|
||||
break;
|
||||
case EffectShowClient::SafetyConfirmation_e_def::SafetyNotConfirmed:
|
||||
m_ui->ltsLedWidget->setColor(QColor(255, 0, 0));
|
||||
m_ui->ltsLedWidget->setStatus(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace EffectShowClient
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* EffectShowClient - Safety Confirmation Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, NLE, 2020-04-07
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
|
||||
#include <Services/EffectShowClient/esc_ftc.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace Ui {
|
||||
class SafetyConfirmationWidget;
|
||||
}
|
||||
namespace EffectShowClient
|
||||
{
|
||||
class SafetyConfirmationWidget : public QWidget,
|
||||
protected EffectShowClient::Interface::Ftc::SendSafetyRevokeReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SafetyConfirmationWidget(QWidget *parent = nullptr);
|
||||
|
||||
~SafetyConfirmationWidget();
|
||||
bool init(const std::shared_ptr<EffectShowClient::Interface::Ftc> &ftc);
|
||||
bool onOperatingConditionEntityChanged(const EffectShowClient::OperatingConditionEntity &data);
|
||||
void setMessage(const QString &message);
|
||||
|
||||
private:
|
||||
void onSendSafetyRevokeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
||||
void setMessageInternal();
|
||||
public slots:
|
||||
void setNewSafetyConfirmationDisplay(const EffectShowClient::SafetyConfirmation_e &safetyConfirmation);
|
||||
|
||||
private slots:
|
||||
bool onRevokeClicked();
|
||||
void onSafetyConfirmationDisplay();
|
||||
|
||||
private:
|
||||
std::shared_ptr<EffectShowClient::Interface::Ftc> m_ftc;
|
||||
EffectShowClient::SafetyConfirmation_e m_currentState;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
QString m_errorString;
|
||||
QString m_messageString;
|
||||
|
||||
Ui::SafetyConfirmationWidget *m_ui;
|
||||
|
||||
};
|
||||
|
||||
} //namespace EffectShowClient
|
||||
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SafetyConfirmationWidget</class>
|
||||
<widget class="QWidget" name="SafetyConfirmationWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSafetyConfirmation">
|
||||
<property name="text">
|
||||
<string>Safety Confirmation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ltsLedWidget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbRevoke">
|
||||
<property name="text">
|
||||
<string>Revoke</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblWarningText">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsLedWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_led_widget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* EffectShowClient - Smoke State Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, NLE, 2020-04-07
|
||||
*/
|
||||
|
||||
#include "esc_smoke_state.h"
|
||||
#include "ui_esc_smoke_state.h"
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
SmokeState::SmokeState(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
m_ui(new Ui::SmokeState)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
void SmokeState::setSmokeState(const QVector<bool> &colorState, const QVector<QColor> &colorVariants)
|
||||
{
|
||||
if (colorState.size() < 3 || colorVariants.size() < 3)
|
||||
return;
|
||||
|
||||
m_ui->ledSmokeCartridge1->setColor(colorVariants[0], QColor(255, 0, 0));
|
||||
m_ui->ledSmokeCartridge2->setColor(colorVariants[1], QColor(255, 0, 0));
|
||||
m_ui->ledSmokeCartridge3->setColor(colorVariants[2], QColor(255, 0, 0));
|
||||
m_ui->ledSmokeCartridge4->setColor(colorVariants[3], QColor(255, 0, 0));
|
||||
m_ui->ledSmokeCartridge5->setColor(colorVariants[4], QColor(255, 0, 0));
|
||||
|
||||
m_ui->ledSmokeCartridge1->setStatus(colorState[0]);
|
||||
m_ui->ledSmokeCartridge2->setStatus(colorState[1]);
|
||||
m_ui->ledSmokeCartridge3->setStatus(colorState[2]);
|
||||
m_ui->ledSmokeCartridge4->setStatus(colorState[3]);
|
||||
m_ui->ledSmokeCartridge5->setStatus(colorState[4]);
|
||||
}
|
||||
|
||||
SmokeState::~SmokeState()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* EffectShowClient - Smoke State Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, NLE, 2020-04-07
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class SmokeState;
|
||||
}
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
class SmokeState : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SmokeState(QWidget *parent = nullptr);
|
||||
void setSmokeState(const QVector<bool> &colorState, const QVector<QColor> &colorVariants);
|
||||
~SmokeState();
|
||||
|
||||
private:
|
||||
Ui::SmokeState *m_ui;
|
||||
};
|
||||
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SmokeState</class>
|
||||
<widget class="QWidget" name="SmokeState">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>179</width>
|
||||
<height>50</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frameSmoke">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledSmokeCartridge1" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="animTime" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledSmokeCartridge2" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>10</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledSmokeCartridge4" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>10</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledSmokeCartridge3" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>10</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="LtsWidgets::LtsLedWidget" name="ledSmokeCartridge5" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>10</y>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="oncolor" stdset="0">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="offcolor" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsLedWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_led_widget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in new issue
Block a user