Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
DamperAutomated.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_MODEL_ELEMENTSAUTOMATED_DAMPERAUTOMATED_HPP_
2#define IV_SRC_MIMICS_MODEL_ELEMENTSAUTOMATED_DAMPERAUTOMATED_HPP_
3
15
17{
18
25{
26public:
28 ~DamperAutomated() override = default;
29
30 bool load(const iv::file::xml::node &nodeControlMimic) override;
31 bool save(iv::file::xml::node &nodeControlMimic) const override;
32
33 // Controller
34 void getChannels(const std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>>
35 &channelsInControl) const override;
36 void mapChannels(const std::function<void(std::weak_ptr<iv::channels::AbstractChannel> &)> &mapFunction) override;
37 [[nodiscard]] std::shared_ptr<iv::mimics::AbstractMimicElement> clone() const override;
38
39 [[nodiscard]] std::optional<iv::types::color> getColorWorkingState() const override;
40 [[nodiscard]] std::optional<std::string> getStringWorkingState() const override;
41 [[nodiscard]] std::optional<iv::mimics::eAlarmState> getAlarmState() const override;
42
43 void executeCommand(const std::string &strAction) const override;
44
45 // Draw
46 void drawSpecific(IGraphics *graphics, std::optional<iv::types::color> colorWorkingState,
47 std::optional<iv::types::color> colorControlState, iv::eLanguage drawingLanguage) override;
48
49 // UI
51 void addOptionsMenu(const std::shared_ptr<iv::mimics::MimicControlMenu> &menu) override;
52
53 bool canShowCircularMenu() const override;
54 bool hasAlternativeAction() const override;
55 void runAlternativeAction(CDialog *dlgFatherRef) override;
56
57protected:
58 DamperAutomated(const DamperAutomated &other);
59
60 bool checkIntegrity() const override;
61 bool hasRepeatedChannels(const std::unordered_set<iv::types::channelId> &channelsRepeatedOpt) const override;
62 bool
63 isRepeatedMimicElement(const std::set<std::shared_ptr<AbstractMimicElement>> &otherMimicsElements) const override;
64
65 bool removePreviousOnlineVariables(const std::optional<iv::types::control::damper::damperId> &previousDamperId) const;
66 bool addOnlineVariables(const std::optional<iv::types::control::damper::damperId> &newDamperId) const;
67
68 // View
69 std::unique_ptr<iv::shapes::DamperSymbol> m_damperSymbol {nullptr};
70
72 std::weak_ptr<iv::model::control::Damper> m_damper;
73
74private:
79 void updateDamperTraits();
80
81 struct Keys
82 {
83 static constexpr std::string_view damper {"Damper"};
84 };
85 struct Sections
86 {
87 static constexpr std::string_view damper {"Damper"};
88 static constexpr std::string_view maintenance {"Maintenance"};
89 static constexpr std::string_view feedbackOpCl {"FeedbackOpCl"};
90 static constexpr std::string_view feedbackAutoSemiAuto {"FeedbackAutoSemiAuto"};
91 static constexpr std::string_view commandsOpCl {"CommandsOpCl"};
92 static constexpr std::string_view orderOpCl {"OrderOpCl"};
93 static constexpr std::string_view remoteLocal {"RemoteLocal"};
94 static constexpr std::string_view tripReset {"TripReset"};
95 static constexpr std::string_view controlLock {"ControlLock"};
96 };
115};
116
117}// namespace iv::mimics::elementsAutomated
118
119#endif//IV_SRC_MIMICS_MODEL_ELEMENTSAUTOMATED_DAMPERAUTOMATED_HPP_
Definition AbstractComponentGUI.hpp:30
Definition CDialog.hpp:21
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition AbstractMimicElement.hpp:21
Definition DamperAutomated.hpp:25
std::shared_ptr< iv::mimics::AbstractMimicElement > clone() const override
Definition DamperAutomated.cpp:138
void drawSpecific(IGraphics *graphics, std::optional< iv::types::color > colorWorkingState, std::optional< iv::types::color > colorControlState, iv::eLanguage drawingLanguage) override
Draws the specific abstract element shape.
Definition DamperAutomated.cpp:238
bool hasRepeatedChannels(const std::unordered_set< iv::types::channelId > &channelsRepeatedOpt) const override
Checks if the current mimic element contains any repeated channels.
Definition DamperAutomated.cpp:108
std::optional< iv::types::color > getColorWorkingState() const override
Retrieves the color representing the current working state of the element.
Definition DamperAutomated.cpp:205
bool removePreviousOnlineVariables(const std::optional< iv::types::control::damper::damperId > &previousDamperId) const
Definition DamperAutomated.cpp:144
std::weak_ptr< iv::model::control::Damper > m_damper
Definition DamperAutomated.hpp:72
bool isRepeatedMimicElement(const std::set< std::shared_ptr< AbstractMimicElement > > &otherMimicsElements) const override
Determines whether the current mimic element shares significant similarities with others.
Definition DamperAutomated.cpp:113
std::optional< iv::mimics::eAlarmState > getAlarmState() const override
Definition DamperAutomated.cpp:233
DamperAutomated()
Definition DamperAutomated.cpp:19
void updateDamperTraits()
Update the damper traits channels with the current damper channels.
Definition DamperAutomated.cpp:599
void getChannels(const std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > &channelsInControl) const override
Añade los canales que el MimicElement tiene enlazado.
Definition DamperAutomated.cpp:72
void executeCommand(const std::string &strAction) const override
Run actions ///.
Definition DamperAutomated.cpp:99
bool checkIntegrity() const override
Definition DamperAutomated.cpp:103
bool save(iv::file::xml::node &nodeControlMimic) const override
Definition DamperAutomated.cpp:54
AbstractComponentGUI * panelEditControl() override
UI methods ///.
Definition DamperAutomated.cpp:255
bool hasAlternativeAction() const override
Definition DamperAutomated.cpp:428
void runAlternativeAction(CDialog *dlgFatherRef) override
Ejecuta código específico del control.
Definition DamperAutomated.cpp:450
iv::mimics::support::Maintenance m_maintenance
Definition DamperAutomated.hpp:71
std::unique_ptr< iv::shapes::DamperSymbol > m_damperSymbol
Definition DamperAutomated.hpp:69
void addOptionsMenu(const std::shared_ptr< iv::mimics::MimicControlMenu > &menu) override
Definition DamperAutomated.cpp:366
bool addOnlineVariables(const std::optional< iv::types::control::damper::damperId > &newDamperId) const
Definition DamperAutomated.cpp:171
bool canShowCircularMenu() const override
Behaviours gets ///.
Definition DamperAutomated.cpp:423
bool load(const iv::file::xml::node &nodeControlMimic) override
Definition DamperAutomated.cpp:34
std::optional< std::string > getStringWorkingState() const override
Definition DamperAutomated.cpp:226
void mapChannels(const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction) override
Processed gets ///.
Definition DamperAutomated.cpp:94
Definition Maintenance.hpp:11
Definition CommandsOpCl.hpp:12
Definition ControlLock.hpp:11
Definition FeedbackOpCl.hpp:12
Definition OrderOpCl.hpp:12
Definition TripReset.hpp:12
constexpr iv::types::color SedniSemiAuto
Definition color.hpp:341
constexpr iv::types::color SedniElementNotWorkingBlack
Definition color.hpp:338
constexpr iv::types::color SedniElementWorkingGreen
Definition color.hpp:337
constexpr iv::types::color SedniElementOfflineBlack
Definition color.hpp:345
constexpr iv::types::color SedniLocal
Definition color.hpp:343
constexpr iv::types::color SedniElementOfflineGrey
Definition color.hpp:346
constexpr iv::types::color SedniElementUndefined
Definition color.hpp:344
constexpr iv::types::color SedniAuto
Definition color.hpp:342
constexpr iv::types::color Gray
Definition color.hpp:91
Definition DamperAutomated.cpp:17
uint32_t color
Definition types.hpp:12
eLanguage
Definition enums.hpp:37
static constexpr iv::types::color controlStateRemoteAuto
Definition DamperAutomated.hpp:111
static constexpr iv::types::color workingStateOffline
Definition DamperAutomated.hpp:107
static constexpr iv::types::color workingStateUndefined
Definition DamperAutomated.hpp:106
static constexpr iv::types::color controlStateOffline
Definition DamperAutomated.hpp:112
static constexpr iv::types::color color
Definition DamperAutomated.hpp:102
static constexpr iv::types::color controlStateLocal
Definition DamperAutomated.hpp:109
static constexpr iv::types::color workingStateOpen
Definition DamperAutomated.hpp:104
static constexpr iv::types::color controlStateRemoteSemiAuto
Definition DamperAutomated.hpp:110
static constexpr iv::types::color workingStateClose
Definition DamperAutomated.hpp:105
static constexpr std::string_view damper
Definition DamperAutomated.hpp:83
static constexpr std::string_view commandsOpCl
Definition DamperAutomated.hpp:91
static constexpr std::string_view controlLock
Definition DamperAutomated.hpp:95
static constexpr std::string_view tripReset
Definition DamperAutomated.hpp:94
static constexpr std::string_view damper
Definition DamperAutomated.hpp:87
static constexpr std::string_view feedbackAutoSemiAuto
Definition DamperAutomated.hpp:90
static constexpr std::string_view feedbackOpCl
Definition DamperAutomated.hpp:89
static constexpr std::string_view maintenance
Definition DamperAutomated.hpp:88
static constexpr std::string_view remoteLocal
Definition DamperAutomated.hpp:93
static constexpr std::string_view orderOpCl
Definition DamperAutomated.hpp:92