Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+259
-275
@@ -1,347 +1,331 @@
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <ChargeEffect/aes_charge_effect_edit.h>
|
||||
#include <ChargeEffect/aes_charge_effect_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
||||
#include "aes_charge_effect_item_info.h"
|
||||
|
||||
#include "aes_translation.h"
|
||||
#include "aes_charge_effect_item_info.h"
|
||||
#include "ui_aes_charge_effect_item_info.h"
|
||||
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <ChargeEffect/aes_charge_effect_edit.h>
|
||||
#include <ChargeEffect/aes_charge_effect_gui_plugin_interface.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
AesChargeEffectItemInfo::AesChargeEffectItemInfo(int chargeEffectId, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_session(nullptr)
|
||||
, m_ChargeEffectId(chargeEffectId)
|
||||
, m_ui(new Ui::AesChargeEffectItemInfo)
|
||||
AesChargeEffectItemInfo::AesChargeEffectItemInfo(int chargeEffectId, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_session(nullptr),
|
||||
m_ChargeEffectId(chargeEffectId), m_ui(new Ui::AesChargeEffectItemInfo)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->lblChargeEffectId->setText(QString::number(m_ChargeEffectId));
|
||||
|
||||
connect(m_ui->pbFindOnMap, &QToolButton::clicked, this, &AesChargeEffectItemInfo::onFindOnMap);
|
||||
connect(m_ui->pbDetails, &QToolButton::clicked, this, &AesChargeEffectItemInfo::onShowDetails);
|
||||
m_ui->lblChargeEffectId->setText(QString::number(m_ChargeEffectId));
|
||||
|
||||
connect(m_ui->pbFindOnMap, &QToolButton::clicked, this, &AesChargeEffectItemInfo::onFindOnMap);
|
||||
connect(m_ui->pbDetails, &QToolButton::clicked, this, &AesChargeEffectItemInfo::onShowDetails);
|
||||
}
|
||||
|
||||
AesChargeEffectItemInfo::~AesChargeEffectItemInfo()
|
||||
{
|
||||
delete m_ui;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool AesChargeEffectItemInfo::init(LtsSession::LtsSession *session)
|
||||
bool AesChargeEffectItemInfo::init(LtsSession::LtsSession* session)
|
||||
{
|
||||
m_session = session;
|
||||
m_session = session;
|
||||
|
||||
if (!session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get pdmDtc";
|
||||
return false;
|
||||
}
|
||||
if (!session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get pdmDtc";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get aesDtc";
|
||||
return false;
|
||||
}
|
||||
if (!m_aesDtc->isAesItemViewEnabled())
|
||||
m_aesDtc->enableAesItemView();
|
||||
if (!session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get aesDtc";
|
||||
return false;
|
||||
}
|
||||
if (!m_aesDtc->isAesItemViewEnabled())
|
||||
m_aesDtc->enableAesItemView();
|
||||
|
||||
if (!m_pdmDtc->isChargeTypeEnabled())
|
||||
m_pdmDtc->enableChargeType();
|
||||
if (!m_pdmDtc->isChargeTypeEnabled())
|
||||
m_pdmDtc->enableChargeType();
|
||||
|
||||
const ChargeEffect data = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
|
||||
m_ui->lblPosition->hide();
|
||||
|
||||
const ChargeEffect data = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
|
||||
m_ui->lblPosition->hide();
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
m_ui->lbxChargeEffectId->hide();
|
||||
m_ui->lblChargeEffectId->hide();
|
||||
m_ui->lbxChargeTypeId->hide();
|
||||
m_ui->lblChargeTypeId->hide();
|
||||
m_ui->lbxOriginatorId->hide();
|
||||
m_ui->lblOriginatorId->hide();
|
||||
m_ui->lbxOriginatorType->hide();
|
||||
m_ui->lblOriginatorType->hide();
|
||||
m_ui->lbxChargeEffectId->hide();
|
||||
m_ui->lblChargeEffectId->hide();
|
||||
m_ui->lbxChargeTypeId->hide();
|
||||
m_ui->lblChargeTypeId->hide();
|
||||
m_ui->lbxOriginatorId->hide();
|
||||
m_ui->lblOriginatorId->hide();
|
||||
m_ui->lbxOriginatorType->hide();
|
||||
m_ui->lblOriginatorType->hide();
|
||||
#endif
|
||||
|
||||
m_ui->lblOriginatorId->setText(QString::number(data.originatorId()));
|
||||
m_ui->lblOriginatorType->setText(QString::number(data.originatorTypeId().underlying()));
|
||||
m_ui->lblOriginatorId->setText(QString::number(data.originatorId()));
|
||||
m_ui->lblOriginatorType->setText(QString::number(data.originatorTypeId().underlying()));
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Charge_Effect"));
|
||||
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Charge_Effect"));
|
||||
|
||||
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::chargeEffectChanged, this,
|
||||
&AesChargeEffectItemInfo::onChargeEffectChanged);
|
||||
|
||||
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::chargeEffectChanged,
|
||||
this, &AesChargeEffectItemInfo::onChargeEffectChanged);
|
||||
handleChargeEffect(data);
|
||||
|
||||
handleChargeEffect(data);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AesChargeEffectItemInfo::retranslate()
|
||||
{
|
||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
translate(m_ui, tr("ChargeEffect: \"%1\"").arg(QString::fromStdString(item.name()), 1, QLatin1Char('?')));
|
||||
}
|
||||
|
||||
void AesChargeEffectItemInfo::onFindOnMap() const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onFindOnMap() aesId: "<<m_ChargeEffectId;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(ifc))
|
||||
ifc->centerMapToChargeEffectObject(m_ChargeEffectId);
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface<SituationMap::ForeignGuiInterface> failed!";
|
||||
DEBUG_LOG(m_logger) << "onFindOnMap() aesId: " << m_ChargeEffectId;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(ifc))
|
||||
ifc->centerMapToChargeEffectObject(m_ChargeEffectId);
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface<SituationMap::ForeignGuiInterface> failed!";
|
||||
}
|
||||
|
||||
template <typename InterfaceType>
|
||||
bool AesChargeEffectItemInfo::tryShowStandardEditDialog(const AesItemView& aiv)
|
||||
template <typename InterfaceType> bool AesChargeEffectItemInfo::tryShowStandardEditDialog(const AesItemView& aiv)
|
||||
{
|
||||
std::shared_ptr<InterfaceType> ifc;
|
||||
if (m_session->getForeignGuiInterface<InterfaceType>(ifc))
|
||||
{
|
||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(aiv.aesItemId(), this);
|
||||
if (dialog)
|
||||
std::shared_ptr<InterfaceType> ifc;
|
||||
if (m_session->getForeignGuiInterface<InterfaceType>(ifc))
|
||||
{
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(aiv.aesItemId(), this);
|
||||
if (dialog)
|
||||
{
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed for specific AES interface!";
|
||||
return false;
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed for specific AES interface!";
|
||||
return false;
|
||||
}
|
||||
|
||||
void AesChargeEffectItemInfo::onShowDetails()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||
|
||||
if (item.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
{
|
||||
AesItemView aiv;
|
||||
m_aesDtc->aesItemViewFromEntityId(item.originatorId(), AreaEffectSimulation::AesType::AtUnknown, aiv);
|
||||
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId();
|
||||
if (item.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
{
|
||||
AesItemView aiv;
|
||||
m_aesDtc->aesItemViewFromEntityId(item.originatorId(), AreaEffectSimulation::AesType::AtUnknown, aiv);
|
||||
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId();
|
||||
|
||||
|
||||
auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) {
|
||||
if (dialog) {
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
};
|
||||
auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) {
|
||||
if (dialog)
|
||||
{
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
};
|
||||
|
||||
switch(aiv.aesTypeId().underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtNContamination:
|
||||
{
|
||||
tryShowStandardEditDialog<AesNContamination::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtMineArea:
|
||||
{
|
||||
tryShowStandardEditDialog<AesMineArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtMineCorridor:
|
||||
{
|
||||
tryShowStandardEditDialog<AesMineCorridor::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtGasPipe:
|
||||
{
|
||||
tryShowStandardEditDialog<AesGasPipe::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtDangerArea:
|
||||
{
|
||||
tryShowStandardEditDialog<AesDangerArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtBorderline:
|
||||
{
|
||||
tryShowStandardEditDialog<AesBorderline::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtFunctionalArea:
|
||||
{
|
||||
tryShowStandardEditDialog<AesFunctionalArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
{
|
||||
std::shared_ptr<AesBCContamination::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
||||
if (gearClass == ProjectDataManagement::GearClass_def::Biological)
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
|
||||
else if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface<AesBCContamination::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtBoobyTrap:
|
||||
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
|
||||
{
|
||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId(), this));
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMine:
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
|
||||
{
|
||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId(), this));
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
{
|
||||
std::shared_ptr<AesExplosion::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
const bool isExplosionSingle = (aiv.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
||||
|
||||
for (auto gc : { ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar, ProjectDataManagement::GearClass::AirSupport })
|
||||
switch (aiv.aesTypeId().underlying())
|
||||
{
|
||||
if (gc == ProjectDataManagement::GearClass::AirSupport && !isExplosionSingle) continue;
|
||||
case AreaEffectSimulation::AesType::AtNContamination: {
|
||||
tryShowStandardEditDialog<AesNContamination::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtMineArea: {
|
||||
tryShowStandardEditDialog<AesMineArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
if (gearClass == gc)
|
||||
{
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), isExplosionSingle, false, gc, this));
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtMineCorridor: {
|
||||
tryShowStandardEditDialog<AesMineCorridor::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtGasPipe: {
|
||||
tryShowStandardEditDialog<AesGasPipe::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtDangerArea: {
|
||||
tryShowStandardEditDialog<AesDangerArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtBorderline: {
|
||||
tryShowStandardEditDialog<AesBorderline::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtFunctionalArea: {
|
||||
tryShowStandardEditDialog<AesFunctionalArea::ForeignGuiInterface>(aiv);
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtBCContamination: {
|
||||
std::shared_ptr<AesBCContamination::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
||||
if (gearClass == ProjectDataManagement::GearClass_def::Biological)
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
|
||||
else if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger)
|
||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesBCContamination::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtBoobyTrap:
|
||||
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary: {
|
||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId(), this));
|
||||
else
|
||||
WARNING_LOG(m_logger)
|
||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMine:
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
|
||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId(), this));
|
||||
else
|
||||
WARNING_LOG(m_logger)
|
||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea: {
|
||||
std::shared_ptr<AesExplosion::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
const bool isExplosionSingle =
|
||||
(aiv.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
||||
|
||||
for (auto gc :
|
||||
{ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar,
|
||||
ProjectDataManagement::GearClass::AirSupport})
|
||||
{
|
||||
if (gc == ProjectDataManagement::GearClass::AirSupport && !isExplosionSingle)
|
||||
continue;
|
||||
|
||||
if (gearClass == gc)
|
||||
{
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), isExplosionSingle, false, gc, this));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger)
|
||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesExplosion::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtExplosionCluster:
|
||||
case AreaEffectSimulation::AesType::AtEffectCluster: {
|
||||
std::shared_ptr<AesExplosion::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
|
||||
AesItem ai;
|
||||
m_aesDtc->aesItemFromId(aiv.aesItemId(), ai);
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), ai.effectSourceId(), this));
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger)
|
||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesExplosion::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtAirSupportImpact:
|
||||
case AreaEffectSimulation::AesType::AtDusSingleMine:
|
||||
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
|
||||
case AreaEffectSimulation::AesType::AtReconArea:
|
||||
case AreaEffectSimulation::AesType::AtTechnicalArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterGunToTargetLine:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterSingleTrajectory:
|
||||
|
||||
m_ui->pbDetails->hide();
|
||||
break;
|
||||
case AreaEffectSimulation::AesType::AtUnknown:
|
||||
Q_ASSERT(false);
|
||||
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId();
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button";
|
||||
m_ui->pbDetails->hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface<AesExplosion::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtExplosionCluster:
|
||||
case AreaEffectSimulation::AesType::AtEffectCluster:
|
||||
{
|
||||
std::shared_ptr<AesExplosion::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
|
||||
AesItem ai;
|
||||
m_aesDtc->aesItemFromId(aiv.aesItemId(), ai);
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), ai.effectSourceId(), this));
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface<AesExplosion::ForeignGuiInterface> failed!";
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaEffectSimulation::AesType::AtAirSupportImpact:
|
||||
case AreaEffectSimulation::AesType::AtDusSingleMine:
|
||||
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
|
||||
case AreaEffectSimulation::AesType::AtReconArea:
|
||||
case AreaEffectSimulation::AesType::AtTechnicalArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
|
||||
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterGunToTargetLine:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterSingleExplosions:
|
||||
case AreaEffectSimulation::AesType::AtEffectClusterSingleTrajectory:
|
||||
|
||||
m_ui->pbDetails->hide();
|
||||
break;
|
||||
case AreaEffectSimulation::AesType::AtUnknown:
|
||||
Q_ASSERT(false);
|
||||
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId();
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button";
|
||||
m_ui->pbDetails->hide();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<AesChargeEffect::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesChargeEffect::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_ChargeEffectId, this);
|
||||
if (dialog)
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface ChargeEffect failed!";
|
||||
}
|
||||
{
|
||||
std::shared_ptr<AesChargeEffect::ForeignGuiInterface> ifc;
|
||||
if (m_session->getForeignGuiInterface<AesChargeEffect::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_ChargeEffectId, this);
|
||||
if (dialog)
|
||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface ChargeEffect failed!";
|
||||
}
|
||||
}
|
||||
|
||||
void AesChargeEffectItemInfo::onChargeEffectChanged(const ChargeEffect &data, DataModification modType)
|
||||
void AesChargeEffectItemInfo::onChargeEffectChanged(const ChargeEffect& data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id();
|
||||
if (data.id() == m_ChargeEffectId && modType != DataModification::eRemoved)
|
||||
handleChargeEffect(data);
|
||||
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id();
|
||||
if (data.id() == m_ChargeEffectId && modType != DataModification::eRemoved)
|
||||
handleChargeEffect(data);
|
||||
}
|
||||
|
||||
void AesChargeEffectItemInfo::handleChargeEffect(const ChargeEffect &data)
|
||||
void AesChargeEffectItemInfo::handleChargeEffect(const ChargeEffect& data)
|
||||
{
|
||||
|
||||
m_ui->lblChargeEffectName->setText(QString::fromStdString(data.name()));
|
||||
|
||||
|
||||
m_ui->lblEffectStart->setText(DTG::toStringMSec(data.effectStart()));
|
||||
|
||||
m_ui->lblChargeEffectName->setText(QString::fromStdString(data.name()));
|
||||
|
||||
m_ui->lblEffectDuration->setVisible(data.effectDuration() > 0);
|
||||
m_ui->lbxEffectDuration->setVisible(data.effectDuration() > 0);
|
||||
m_ui->lblEffectStart->setText(DTG::toStringMSec(data.effectStart()));
|
||||
|
||||
m_ui->lblEffectDuration->setText(LtsWidgets::readableDuration(data.effectDuration()));
|
||||
m_ui->lblEffectDuration->setVisible(data.effectDuration() > 0);
|
||||
m_ui->lbxEffectDuration->setVisible(data.effectDuration() > 0);
|
||||
|
||||
|
||||
AreaEffectSimulation::AesEffectState st = data.state();
|
||||
m_ui->lblStatus->setText(AreaEffectSimulation::toString(st));
|
||||
m_ui->lblEffectDuration->setText(LtsWidgets::readableDuration(data.effectDuration()));
|
||||
|
||||
|
||||
m_ui->lblChargeTypeId->setText(QString::number(data.chargeTypeId()));
|
||||
AreaEffectSimulation::AesEffectState st = data.state();
|
||||
m_ui->lblStatus->setText(AreaEffectSimulation::toString(st));
|
||||
|
||||
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(data.chargeTypeId()));
|
||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId()));
|
||||
m_ui->lblChargeTypeId->setText(QString::number(data.chargeTypeId()));
|
||||
|
||||
|
||||
m_ui->lblPosition->show();
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
|
||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(data.chargeTypeId()));
|
||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId()));
|
||||
|
||||
m_ui->lblPosition->show();
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
|
||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AreaEffectSimulation
|
||||
Executable → Regular
+96
-106
@@ -1,160 +1,150 @@
|
||||
|
||||
|
||||
|
||||
#include "aes_danger_area_aes_item_info.h"
|
||||
#include <utility>
|
||||
|
||||
#include "ui_aes_danger_area_aes_item_info.h"
|
||||
#include <Plugins/AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
|
||||
#include <BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
||||
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
#include <Plugins/AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
#include <QDateTime>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
|
||||
DangerAreaAesItemInfo::DangerAreaAesItemInfo(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_dtc(nullptr)
|
||||
, m_session(nullptr)
|
||||
, m_ui(new Ui::DangerAreaAesItemInfo)
|
||||
, m_aesItemId(-1)
|
||||
DangerAreaAesItemInfo::DangerAreaAesItemInfo(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_session(nullptr),
|
||||
m_ui(new Ui::DangerAreaAesItemInfo), m_aesItemId(-1)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
DangerAreaAesItemInfo::~DangerAreaAesItemInfo()
|
||||
{
|
||||
for (const auto &item : std::as_const(m_aesItems))
|
||||
delete item.item;
|
||||
delete m_ui;
|
||||
for (const auto& item : std::as_const(m_aesItems))
|
||||
delete item.item;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void DangerAreaAesItemInfo::retranslate()
|
||||
{
|
||||
|
||||
std::unique_ptr<AesItem> item(new BCContamination(m_dtc->bCContamination(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->bCContamination(m_aesItemId), tr("B/C-Contamination"));
|
||||
return;
|
||||
}
|
||||
std::unique_ptr<AesItem> item(new BCContamination(m_dtc->bCContamination(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->bCContamination(m_aesItemId), tr("B/C-Contamination"));
|
||||
return;
|
||||
}
|
||||
|
||||
item.reset(new NContamination(m_dtc->nContamination(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->nContamination(m_aesItemId), tr("N-Contamination"));
|
||||
return;
|
||||
}
|
||||
item.reset(new NContamination(m_dtc->nContamination(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->nContamination(m_aesItemId), tr("N-Contamination"));
|
||||
return;
|
||||
}
|
||||
|
||||
item.reset(new ExplosionArea(m_dtc->explosionArea(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->explosionArea(m_aesItemId), tr("Explosion Area"));
|
||||
return;
|
||||
}
|
||||
|
||||
item.reset(new ExplosionArea(m_dtc->explosionArea(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->explosionArea(m_aesItemId), tr("Explosion Area"));
|
||||
return;
|
||||
}
|
||||
item.reset(new ExplosionSingle(m_dtc->explosionSingle(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->explosionSingle(m_aesItemId), tr("Single Explosion"));
|
||||
return;
|
||||
}
|
||||
|
||||
item.reset(new MineArea(m_dtc->mineArea(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->mineArea(m_aesItemId), tr("Mine Area"));
|
||||
return;
|
||||
}
|
||||
|
||||
item.reset(new ExplosionSingle(m_dtc->explosionSingle(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->explosionSingle(m_aesItemId), tr("Single Explosion"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
item.reset(new MineArea(m_dtc->mineArea(m_aesItemId)));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
translate(m_ui, m_dtc->mineArea(m_aesItemId), tr("Mine Area"));
|
||||
return;
|
||||
}
|
||||
|
||||
translate(m_ui, tr("Unknown Aes Type"));
|
||||
translate(m_ui, tr("Unknown Aes Type"));
|
||||
}
|
||||
|
||||
bool DangerAreaAesItemInfo::init(const QSet<int> &dangerAreaIds, const QSet<int> &aesItemIds, LtsSession::LtsSession *session)
|
||||
bool DangerAreaAesItemInfo::init(const QSet<int>& dangerAreaIds, const QSet<int>& aesItemIds,
|
||||
LtsSession::LtsSession* session)
|
||||
{
|
||||
if (!init(session))
|
||||
return false;
|
||||
if (!init(session))
|
||||
return false;
|
||||
|
||||
for (int dangerAreaId : dangerAreaIds)
|
||||
m_dangerAreas.insert(dangerAreaId, m_dtc->dangerArea(dangerAreaId));
|
||||
for (int aesItemId : aesItemIds)
|
||||
insertAesItem(aesItemId);
|
||||
for (int dangerAreaId : dangerAreaIds)
|
||||
m_dangerAreas.insert(dangerAreaId, m_dtc->dangerArea(dangerAreaId));
|
||||
for (int aesItemId : aesItemIds)
|
||||
insertAesItem(aesItemId);
|
||||
|
||||
m_aesItemId = aesItemIds.empty() ? -1 : *aesItemIds.begin();
|
||||
setText();
|
||||
return true;
|
||||
m_aesItemId = aesItemIds.empty() ? -1 : *aesItemIds.begin();
|
||||
setText();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DangerAreaAesItemInfo::init(LtsSession::LtsSession *session)
|
||||
bool DangerAreaAesItemInfo::init(LtsSession::LtsSession* session)
|
||||
{
|
||||
if (m_session && session)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "double init()!";
|
||||
return false;
|
||||
}
|
||||
if (!m_session && !session)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "No Session available!";
|
||||
return false;
|
||||
}
|
||||
if (!m_session)
|
||||
m_session = session;
|
||||
if (m_session && session)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "double init()!";
|
||||
return false;
|
||||
}
|
||||
if (!m_session && !session)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "No Session available!";
|
||||
return false;
|
||||
}
|
||||
if (!m_session)
|
||||
m_session = session;
|
||||
|
||||
if(!m_dtc.get())
|
||||
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_dtc))
|
||||
return false;
|
||||
if (!m_dtc.get())
|
||||
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_dtc))
|
||||
return false;
|
||||
|
||||
setText();
|
||||
return true;
|
||||
setText();
|
||||
return true;
|
||||
}
|
||||
|
||||
void DangerAreaAesItemInfo::insertAesItem(int aesItemId)
|
||||
{
|
||||
AesItem *item;
|
||||
item = new BCContamination(m_dtc->bCContamination(aesItemId));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
m_aesItems.insert(aesItemId, AesStruct(AesType::AtBCContamination, item));
|
||||
return;
|
||||
}
|
||||
delete item;
|
||||
AesItem* item;
|
||||
item = new BCContamination(m_dtc->bCContamination(aesItemId));
|
||||
if (item->id() > 0)
|
||||
{
|
||||
m_aesItems.insert(aesItemId, AesStruct(AesType::AtBCContamination, item));
|
||||
return;
|
||||
}
|
||||
delete item;
|
||||
|
||||
WARNING_LOG(m_logger) << "AesItem with id " << aesItemId << " is not of any known type!";
|
||||
WARNING_LOG(m_logger) << "AesItem with id " << aesItemId << " is not of any known type!";
|
||||
}
|
||||
|
||||
void DangerAreaAesItemInfo::setText()
|
||||
{
|
||||
for (const DangerArea &dangerArea : std::as_const(m_dangerAreas))
|
||||
aesItemInfo(&dangerArea);
|
||||
for (const DangerArea& dangerArea : std::as_const(m_dangerAreas))
|
||||
aesItemInfo(&dangerArea);
|
||||
|
||||
|
||||
for(const AesStruct &aesStruct : std::as_const(m_aesItems))
|
||||
{
|
||||
if(aesStruct.item->effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
aesItemInfo(aesStruct.item);
|
||||
}
|
||||
for (const AesStruct& aesStruct : std::as_const(m_aesItems))
|
||||
{
|
||||
if (aesStruct.item->effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
aesItemInfo(aesStruct.item);
|
||||
}
|
||||
}
|
||||
|
||||
void DangerAreaAesItemInfo::aesItemInfo(const AesItem *item)
|
||||
void DangerAreaAesItemInfo::aesItemInfo(const AesItem* item)
|
||||
{
|
||||
|
||||
std::shared_ptr<AesBCContamination::ForeignGuiInterface> guiInterface;
|
||||
if (!m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(guiInterface) || !guiInterface)
|
||||
return;
|
||||
|
||||
LtsWidgets::LtsDialog *info = guiInterface->showInfoWindow(item);
|
||||
m_ui->mainLayout->addWidget(info);
|
||||
|
||||
std::shared_ptr<AesBCContamination::ForeignGuiInterface> guiInterface;
|
||||
if (!m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(guiInterface) || !guiInterface)
|
||||
return;
|
||||
|
||||
LtsWidgets::LtsDialog* info = guiInterface->showInfoWindow(item);
|
||||
m_ui->mainLayout->addWidget(info);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AreaEffectSimulation
|
||||
Executable → Regular
+1207
-1285
File diff suppressed because it is too large.
Load diff
Executable → Regular
+93
-102
@@ -1,131 +1,122 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <AreaEffectSimulation/logger.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
|
||||
#include <AreaEffectSimulation/logger.h>
|
||||
|
||||
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <Plugins/AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class AesInfoDialog;
|
||||
}
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
class AesInfoDialog : public LtsWidgets::LtsDialog
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineResetReplyHandler
|
||||
class AesInfoDialog : public LtsWidgets::LtsDialog,
|
||||
protected AreaEffectSimulation::Interface::Ftc::MineResetReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AesInfoDialog(int aesEntityId, AreaEffectSimulation::AesType aesType, QWidget *parent = nullptr);
|
||||
~AesInfoDialog();
|
||||
public:
|
||||
explicit AesInfoDialog(int aesEntityId, AreaEffectSimulation::AesType aesType, QWidget* parent = nullptr);
|
||||
~AesInfoDialog();
|
||||
|
||||
bool init(LtsSession::LtsSession *session,
|
||||
const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<Interface::Ftc> &ftc,
|
||||
const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &pdmDtc);
|
||||
bool init(LtsSession::LtsSession* session, const std::shared_ptr<Interface::Dtc>& dtc,
|
||||
const std::shared_ptr<Interface::Ftc>& ftc,
|
||||
const std::shared_ptr<ProjectDataManagement::Interface::Dtc>& pdmDtc);
|
||||
|
||||
void onMineResetReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
void onMineResetReply(const Core::FunctionReplyObject& replyObject) override final
|
||||
{
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void retranslate() override;
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void retranslate() override;
|
||||
|
||||
void handleNContamination(const AesItemView &aesItemView);
|
||||
void handleNContamination(const AreaEffectSimulation::NContamination &data);
|
||||
void handleBCContamination(const AesItemView &aesItemView);
|
||||
void handleBCContamination(const AreaEffectSimulation::BCContamination &data);
|
||||
void handleExplosionArea(const AesItemView &aesItemView);
|
||||
void handleExplosionArea(const AreaEffectSimulation::ExplosionArea &data);
|
||||
void handleExplosionSingle(const AesItemView &aesItemView);
|
||||
void handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle &data);
|
||||
void handleMineArea(const AesItemView &aesItemView);
|
||||
void handleMineArea(const AreaEffectSimulation::MineArea &data);
|
||||
void handleMineCorridor(const AesItemView &aesItemView);
|
||||
void handleMineCorridor(const AreaEffectSimulation::MineCorridor &data);
|
||||
void handleBoobyTrap(const AesItemView &aesItemView);
|
||||
void handleBoobyTrap(const AreaEffectSimulation::BoobyTrap &data);
|
||||
void handleOffRouteMine(const AesItemView &aesItemView);
|
||||
void handleOffRouteMine(const AreaEffectSimulation::OffRouteMine &data);
|
||||
void handleGasPipe(const AesItemView &aesItemView);
|
||||
void handleGasPipe(const AreaEffectSimulation::GasPipe &data);
|
||||
void handleDangerArea(const AesItemView &aesItemView);
|
||||
void handleDangerArea(const AreaEffectSimulation::DangerArea &data);
|
||||
void handleBorderline(const AesItemView &aesItemView);
|
||||
void handleBorderline(const AreaEffectSimulation::Borderline &data);
|
||||
void handleFunctionalArea(const AesItemView &aesItemView);
|
||||
void handleFunctionalArea(const AreaEffectSimulation::FunctionalArea &data);
|
||||
void handleAirSupportImpact(const AesItemView &aesItemView);
|
||||
void handleAirSupportImpact(const AreaEffectSimulation::AirSupportImpact &data);
|
||||
void handleMineAraeSingleMine();
|
||||
void handleMineAraeSingleMine(const Core::GeoPosition2D &position, const DusMine &mine);
|
||||
void handleSingleDusMine();
|
||||
void handleExplosionCluster(const AesItemView &aesItemView);
|
||||
void handleExplosionCluster(const AreaEffectSimulation::ExplosionCluster &data);
|
||||
void handleEffectCluster(const AesItemView &aesItemView);
|
||||
void handleEffectCluster(const AreaEffectSimulation::EffectCluster &data);
|
||||
void handleNContamination(const AesItemView& aesItemView);
|
||||
void handleNContamination(const AreaEffectSimulation::NContamination& data);
|
||||
void handleBCContamination(const AesItemView& aesItemView);
|
||||
void handleBCContamination(const AreaEffectSimulation::BCContamination& data);
|
||||
void handleExplosionArea(const AesItemView& aesItemView);
|
||||
void handleExplosionArea(const AreaEffectSimulation::ExplosionArea& data);
|
||||
void handleExplosionSingle(const AesItemView& aesItemView);
|
||||
void handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle& data);
|
||||
void handleMineArea(const AesItemView& aesItemView);
|
||||
void handleMineArea(const AreaEffectSimulation::MineArea& data);
|
||||
void handleMineCorridor(const AesItemView& aesItemView);
|
||||
void handleMineCorridor(const AreaEffectSimulation::MineCorridor& data);
|
||||
void handleBoobyTrap(const AesItemView& aesItemView);
|
||||
void handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data);
|
||||
void handleOffRouteMine(const AesItemView& aesItemView);
|
||||
void handleOffRouteMine(const AreaEffectSimulation::OffRouteMine& data);
|
||||
void handleGasPipe(const AesItemView& aesItemView);
|
||||
void handleGasPipe(const AreaEffectSimulation::GasPipe& data);
|
||||
void handleDangerArea(const AesItemView& aesItemView);
|
||||
void handleDangerArea(const AreaEffectSimulation::DangerArea& data);
|
||||
void handleBorderline(const AesItemView& aesItemView);
|
||||
void handleBorderline(const AreaEffectSimulation::Borderline& data);
|
||||
void handleFunctionalArea(const AesItemView& aesItemView);
|
||||
void handleFunctionalArea(const AreaEffectSimulation::FunctionalArea& data);
|
||||
void handleAirSupportImpact(const AesItemView& aesItemView);
|
||||
void handleAirSupportImpact(const AreaEffectSimulation::AirSupportImpact& data);
|
||||
void handleMineAraeSingleMine();
|
||||
void handleMineAraeSingleMine(const Core::GeoPosition2D& position, const DusMine& mine);
|
||||
void handleSingleDusMine();
|
||||
void handleExplosionCluster(const AesItemView& aesItemView);
|
||||
void handleExplosionCluster(const AreaEffectSimulation::ExplosionCluster& data);
|
||||
void handleEffectCluster(const AesItemView& aesItemView);
|
||||
void handleEffectCluster(const AreaEffectSimulation::EffectCluster& data);
|
||||
|
||||
bool cbFunc(const AesItemView &aesItemView);
|
||||
bool cbFunc(const AesItemView& aesItemView);
|
||||
|
||||
void handleAesItem(const AesItem &aesData, AesType aesTypeId);
|
||||
void handleAesItem(const AesItem& aesData, AesType aesTypeId);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFindOnMap();
|
||||
void onShowDetails();
|
||||
bool onResetDusMines();
|
||||
private Q_SLOTS:
|
||||
void onFindOnMap();
|
||||
void onShowDetails();
|
||||
bool onResetDusMines();
|
||||
|
||||
void onNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType);
|
||||
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType);
|
||||
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType);
|
||||
void onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine &data, DataModification modType);
|
||||
void onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType);
|
||||
void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
|
||||
void onMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType);
|
||||
void onMineCorridorChanged(const AreaEffectSimulation::MineCorridor &data, DataModification modType);
|
||||
void onGasPipeChanged(const GasPipe &data, DataModification modType);
|
||||
void onDangerAreaChanged(const AreaEffectSimulation::DangerArea &data, DataModification modType);
|
||||
void onBorderlineChanged(const AreaEffectSimulation::Borderline &data, DataModification modType);
|
||||
void onFunctionalAreaChanged(const AreaEffectSimulation::FunctionalArea &data, DataModification modType);
|
||||
void onAirSupportImpactChanged(const AirSupportImpact &data, DataModification modType);
|
||||
void onDusMineStateChanged(const DusMineState &data, DataModification modType);
|
||||
void onDusSingleMineChanged(const DusSingleMine &data, DataModification modType);
|
||||
void onExplosionClusterChanged(const ExplosionCluster &data, DataModification modType);
|
||||
void onEffectClusterChanged(const EffectCluster &data, DataModification modType);
|
||||
void onNContaminationChanged(const AreaEffectSimulation::NContamination& data, DataModification modType);
|
||||
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data, DataModification modType);
|
||||
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, DataModification modType);
|
||||
void onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine& data, DataModification modType);
|
||||
void onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea& data, DataModification modType);
|
||||
void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle& data, DataModification modType);
|
||||
void onMineAreaChanged(const AreaEffectSimulation::MineArea& data, DataModification modType);
|
||||
void onMineCorridorChanged(const AreaEffectSimulation::MineCorridor& data, DataModification modType);
|
||||
void onGasPipeChanged(const GasPipe& data, DataModification modType);
|
||||
void onDangerAreaChanged(const AreaEffectSimulation::DangerArea& data, DataModification modType);
|
||||
void onBorderlineChanged(const AreaEffectSimulation::Borderline& data, DataModification modType);
|
||||
void onFunctionalAreaChanged(const AreaEffectSimulation::FunctionalArea& data, DataModification modType);
|
||||
void onAirSupportImpactChanged(const AirSupportImpact& data, DataModification modType);
|
||||
void onDusMineStateChanged(const DusMineState& data, DataModification modType);
|
||||
void onDusSingleMineChanged(const DusSingleMine& data, DataModification modType);
|
||||
void onExplosionClusterChanged(const ExplosionCluster& data, DataModification modType);
|
||||
void onEffectClusterChanged(const EffectCluster& data, DataModification modType);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_aesEntityId;
|
||||
QString m_aesEntityName;
|
||||
AreaEffectSimulation::AesType m_aesType;
|
||||
ProjectDataManagement::EffectSource m_aesEffectSource;
|
||||
int m_bcChargeTypeId;
|
||||
int m_singleExpChargeTypeId;
|
||||
int m_areaExpChargeTypeId;
|
||||
bool m_mineIsReactivatable;
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
int m_aesEntityId;
|
||||
QString m_aesEntityName;
|
||||
AreaEffectSimulation::AesType m_aesType;
|
||||
ProjectDataManagement::EffectSource m_aesEffectSource;
|
||||
int m_bcChargeTypeId;
|
||||
int m_singleExpChargeTypeId;
|
||||
int m_areaExpChargeTypeId;
|
||||
bool m_mineIsReactivatable;
|
||||
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
|
||||
LtsSession::LtsSession* m_session;
|
||||
std::shared_ptr<Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
|
||||
|
||||
|
||||
Ui::AesInfoDialog* m_ui;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
Ui::AesInfoDialog* m_ui;
|
||||
LtsUtils::RequestHelper* m_requestHelper;
|
||||
};
|
||||
}
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user