Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Digital.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_INDICATORS_DIGITAL_HPP_
2#define IV_SRC_MIMICS_INDICATORS_DIGITAL_HPP_
3
4#include "mimics/enums.hpp"
9
11{
12
14{
15public:
16 Digital();
17 ~Digital() override = default;
18
19 bool load(const iv::file::xml::node &nodeControlMimic) override;
20 bool save(iv::file::xml::node &nodeControlMimic) const override;
21
22 void updateEnabledLanguages(const std::set<iv::eLanguage> &enabledLanguages) override;
23
24 // Controller
25 void getChannels(const std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>>
26 &channelsInControl) const override;
27 void mapChannels(const std::function<void(std::weak_ptr<iv::channels::AbstractChannel> &)> &mapFunction) override;
28 [[nodiscard]] std::shared_ptr<iv::mimics::AbstractMimicElement> clone() const override;
29 void executeCommand(const std::string &strAction) const override;
30 [[nodiscard]] std::optional<bool> isStateActive() const;
31
32 [[nodiscard]] std::optional<iv::mimics::eAlarmState> getAlarmState() const override;
33 [[nodiscard]] std::optional<iv::types::color> getColorWorkingState() const override;
34 [[nodiscard]] std::optional<std::string> getStringWorkingState() const override;
35
36 // View
37 void drawSpecific(IGraphics *graphics, std::optional<iv::types::color> colorWorkingState,
38 std::optional<iv::types::color> colorControlState, iv::eLanguage drawingLanguage) override;
39
40 // UI
42
43private:
44 Digital(const Digital &other);
45
46public:
47 // Visualization
54
56
57private:
58 // View
60 std::unique_ptr<CRectangleGraphics> m_rectangleDrawOpt {nullptr};
61 std::unique_ptr<CDrawText> m_drawActiveText {nullptr};
62 std::unique_ptr<CDrawText> m_drawInactiveText {nullptr};
63
64 struct Keys
65 {
66 static constexpr std::string_view textHeight {"TextHeight"};
67 static constexpr std::string_view ledType {"LedType"};
68 static constexpr std::string_view activeLedColor {"OpenLedColor"};
69 static constexpr std::string_view inactiveLedColor {"CloseLedColor"};
70 };
88 struct Sections
89 {
90 static constexpr std::string_view digitalIndicator {"DigitalIndicator"};
91 static constexpr std::string_view feedbackOpCl {"FeedbackOpCl"};
92 static constexpr std::string_view activeTexts {"OpenTexts"};
93 static constexpr std::string_view activeText {"OpenText"};
94 static constexpr std::string_view inactiveTexts {"CloseTexts"};
95 static constexpr std::string_view inactiveText {"CloseText"};
96 static constexpr std::string_view maintenance {"Maintenance"};
97 };
98};
99
100}// namespace iv::mimics::elements
101
102#endif//IV_SRC_MIMICS_INDICATORS_DIGITAL_HPP_
Definition AbstractComponentGUI.hpp:30
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition AbstractMimicElement.hpp:21
Definition Digital.hpp:14
std::optional< bool > isStateActive() const
Definition Digital.cpp:222
std::shared_ptr< iv::mimics::AbstractMimicElement > clone() const override
Definition Digital.cpp:153
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 Digital.cpp:242
void updateEnabledLanguages(const std::set< iv::eLanguage > &enabledLanguages) override
Definition Digital.cpp:99
iv::model::LocalizedText m_activeText
Definition Digital.hpp:51
std::unique_ptr< CRectangleGraphics > m_rectangleDrawOpt
Definition Digital.hpp:60
~Digital() override=default
Digital()
Definition Digital.cpp:17
AbstractComponentGUI * panelEditControl() override
UI methods ///.
Definition Digital.cpp:345
std::optional< iv::mimics::eAlarmState > getAlarmState() const override
Definition Digital.cpp:158
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 Digital.cpp:134
iv::types::color m_activeLedColor
Definition Digital.hpp:50
iv::mimics::support::Maintenance m_maintenance
Definition Digital.hpp:55
std::optional< std::string > getStringWorkingState() const override
Definition Digital.cpp:211
bool m_isCalculatedRectangle
Definition Digital.hpp:59
std::unique_ptr< CDrawText > m_drawInactiveText
Definition Digital.hpp:62
bool load(const iv::file::xml::node &nodeControlMimic) override
Definition Digital.cpp:40
void executeCommand(const std::string &strAction) const override
Run actions ///.
Definition Digital.cpp:218
bool save(iv::file::xml::node &nodeControlMimic) const override
Definition Digital.cpp:73
iv::mimics::elements::eLedType m_ledType
Definition Digital.hpp:49
std::unique_ptr< CDrawText > m_drawActiveText
Definition Digital.hpp:61
void mapChannels(const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction) override
Processed gets ///.
Definition Digital.cpp:146
iv::types::height m_textHeight
Definition Digital.hpp:48
iv::types::color m_inactiveLedColor
Definition Digital.hpp:52
iv::model::LocalizedText m_inactiveText
Definition Digital.hpp:53
std::optional< iv::types::color > getColorWorkingState() const override
Retrieves the color representing the current working state of the element.
Definition Digital.cpp:175
Definition Maintenance.hpp:11
Definition FeedbackOpCl.hpp:12
constexpr iv::types::color SedniElementWorkingGreen
Definition color.hpp:337
constexpr iv::types::color SedniElementNotWorkingGrey
Definition color.hpp:339
constexpr iv::types::color White
Definition color.hpp:222
constexpr iv::types::color SedniElementOfflineGrey
Definition color.hpp:346
constexpr iv::types::color Red
Definition color.hpp:179
constexpr iv::types::color SedniElementUndefined
Definition color.hpp:344
constexpr iv::types::color ControlClosed
Definition color.hpp:429
Definition enums.hpp:95
eLedType
Definition enums.hpp:164
double height
Definition types.hpp:14
uint32_t color
Definition types.hpp:12
eLanguage
Definition enums.hpp:37
static constexpr iv::types::color outsider
Definition Digital.hpp:80
static constexpr iv::types::color workingStateClose
Definition Digital.hpp:83
static constexpr iv::types::color workingStateOpen
Definition Digital.hpp:82
static constexpr iv::types::color workingStateUndefined
Definition Digital.hpp:84
static constexpr iv::types::color text
Definition Digital.hpp:81
static constexpr iv::types::color workingStateOffline
Definition Digital.hpp:85
static constexpr iv::types::height textHeight
Definition Digital.hpp:74
static constexpr iv::types::color inactiveLedColor
Definition Digital.hpp:77
static constexpr iv::types::color activeLedColor
Definition Digital.hpp:76
static constexpr auto ledType
Definition Digital.hpp:75
Definition Digital.hpp:65
static constexpr std::string_view textHeight
Definition Digital.hpp:66
static constexpr std::string_view inactiveLedColor
Definition Digital.hpp:69
static constexpr std::string_view activeLedColor
Definition Digital.hpp:68
static constexpr std::string_view ledType
Definition Digital.hpp:67
static constexpr std::string_view feedbackOpCl
Definition Digital.hpp:91
static constexpr std::string_view maintenance
Definition Digital.hpp:96
static constexpr std::string_view inactiveText
Definition Digital.hpp:95
static constexpr std::string_view inactiveTexts
Definition Digital.hpp:94
static constexpr std::string_view activeTexts
Definition Digital.hpp:92
static constexpr std::string_view activeText
Definition Digital.hpp:93
static constexpr std::string_view digitalIndicator
Definition Digital.hpp:90
Definition structs.hpp:29