/** *@RDE_HEADER@ * GUI Plugin for Building- Info * $Id$ * $HeadURL$ * $Author$ * Created by hjl, SLSE, 2017-04-05 */ #pragma once //Lts #include //Buildings #include "info_dialog_base.h" // DDS #include #include #include #include #include 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 m_ftc; LtsUtils::RequestHelper *m_requestHelper; std::shared_ptr m_asmDtc; QHash m_relayInfoWidgets; QVBoxLayout *m_relayLayout; int m_assetId = 0; }; } // namespace Buildings