Files
qt5-legatus-legacy/Lts/Plugins/Buildings/Gui/BuildingInfo/egcu_info_dialog.h
T
2026-08-13 18:33:10 +02:00

102 lines
3.2 KiB
C++
Executable File

/**
*@RDE_HEADER@
* GUI Plugin for Building- Info
* $Id$
* $HeadURL$
* $Author$
* Created by hjl, SLSE, 2017-04-05
*/
#pragma once
//Lts
#include <LtsUtilsGuiDds/request_helper.h>
//Buildings
#include "info_dialog_base.h"
// DDS
#include <AssetManagement/asm.hpp>
#include <InfrastructureManagement/ism.hpp>
#include <LtsUtilsCore/data_modification_enum.h>
#include <Buildings/bld_data_plugin_interface.h>
#include <Plugins/InfrastructureManagement/ism_data_plugin_interface.h>
class QUrl;
class QVBoxLayout;
namespace Ui
{
class EgcuInfoDialog;
}
namespace AssetManagement
{
namespace Interface
{
class Dtc;
}
}
namespace LtsSession
{
class LtsSession;
}
namespace Buildings
{
class RelayInfoWidget;
// --------------------------------------------------------
// BuildingInfoDialog
// --------------------------------------------------------
class EgcuInfoDialog : public InfoDialogBase
//, protected InfrastructureManagement::Interface::Ftc::StructureElementModifyReplyHandler
, protected InfrastructureManagement::Interface::Ftc::StructureElementUpdateEffectOverrideReplyHandler
{
Q_OBJECT
public:
explicit EgcuInfoDialog(int assetId, const QString &menuGroup, QWidget *parent = nullptr);
~EgcuInfoDialog();
bool init(LtsSession::LtsSession *session) override;
//void onStructureElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onStructureElementUpdateEffectOverrideReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
QString buildingDisplayName() const override;
QString egcuName() const { return QString::fromStdString(m_instrumentationAsset.name()); }
private:
void retranslate() override;
void showBuildingInfos() override;
//void startRequest(const QUrl &requestedUrl);
void showEgcuInfos(const InfrastructureManagement::StructureElement &se = {});
QString structureElementName(int seId);
static bool readAllowance(InfrastructureManagement::EffectOverride eo, const std::string &properties);
static bool readShowStatus(const std::string &properties);
private slots:
void onRelayInfoChanged(const AssetManagement::RelayInfo &data, DataModification modType);
void onRelayStateChanged(const Buildings::RelayState &data, DataModification modType);
void onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType);
void onMountPointAssetChanged(const InfrastructureManagement::MountingPointAsset &data, DataModification modType);
void onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType);
void onEffectOverrideChanged(int relayId, InfrastructureManagement::EffectOverride override);
private:
Ui::EgcuInfoDialog *m_ui = nullptr;
InfrastructureManagement::InstrumentationAsset m_instrumentationAsset;
InfrastructureManagement::StructureElement m_structureElement;
std::shared_ptr<InfrastructureManagement::Interface::Ftc> m_ftc;
LtsUtils::RequestHelper *m_requestHelper;
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
QHash <int, RelayInfoWidget *> m_relayInfoWidgets;
QVBoxLayout *m_relayLayout;
int m_assetId = 0;
};
} // namespace Buildings