Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Command.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_CONTROLS_COMMAND_HPP_
2#define IV_SRC_MIMICS_CONTROLS_COMMAND_HPP_
3
4#include "core/color.hpp"
8#include "model/structs.hpp"
10
12{
13
15
16{
17public:
18 Command();
19 ~Command() override = default;
20
21 bool load(const iv::file::xml::node &nodeControlMimic) override;
22 bool save(iv::file::xml::node &nodeControlMimic) const override;
23
24 void updateEnabledLanguages(const std::set<iv::eLanguage> &enabledLanguages) override;
25
26 //controller
27 void getChannels(const std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>>
28 &channelsInControl) const override;
29 void mapChannels(const std::function<void(std::weak_ptr<iv::channels::AbstractChannel> &)> &mapFunction) override;
30 void executeCommand(const std::string &strAction) const override;
31 [[nodiscard]] std::shared_ptr<iv::mimics::AbstractMimicElement> clone() const override;
32
33 // View
34 void drawSpecific(IGraphics *graphics, std::optional<iv::types::color> colorWorkingState,
35 std::optional<iv::types::color> colorControlState, iv::eLanguage drawingLanguage) override;
36
37 // UI
39 void addOptionsMenu(const std::shared_ptr<iv::mimics::MimicControlMenu> &menu) override;
40
41private:
42 Command(const Command &other);
43
46
49
53
55
56 // View
58 std::unique_ptr<CRectangleGraphics> m_rectangleOpt {nullptr};
59 std::unique_ptr<CDrawText> m_drawText {nullptr};
60
61 struct Keys
62 {
63 static constexpr std::string_view textHeight {"TextHeight"};
64 static constexpr std::string_view messageColor {"MessageColor"};
65 static constexpr std::string_view hasConfirmation {"HasConfirmation"};
66 static constexpr std::string_view confirmationMessageColor {"ConfirmationMessageColor"};
67 };
69 {
70 static constexpr std::string string {};
71 static constexpr iv::types::height textHeight {20};
73 static constexpr bool hasConfirmation {false};
75 static constexpr bool hasPassword {false};
76 };
77 struct Sections
78 {
79 static constexpr std::string_view commandControl {"CommandControl"};
80 static constexpr std::string_view command {"CommandChannel"};
81 static constexpr std::string_view closeChannel {"CloseChannel"};
82 static constexpr std::string_view tripReset {"TripReset"};
83 static constexpr std::string_view messages {"Messages"};
84 static constexpr std::string_view message {"Message"};
85 static constexpr std::string_view confirmationMessages {"ConfirmationMessages"};
86 static constexpr std::string_view confirmationMessage {"ConfirmationMessage"};
87 static constexpr std::string_view hasPassword {"HasPassword"};
88 };
89 struct Constants
90 {
91 struct Colors
92 {
94 };
95 };
96};
97
98}// namespace iv::mimics::elements
99
100#endif//IV_SRC_MIMICS_CONTROLS_COMMAND_HPP_
Definition AbstractComponentGUI.hpp:30
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition AbstractMimicElement.hpp:21
Definition Channel.hpp:12
Definition Command.hpp:16
iv::types::height m_textHeight
Definition Command.hpp:57
bool save(iv::file::xml::node &nodeControlMimic) const override
Definition Command.cpp:75
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 Command.cpp:170
void executeCommand(const std::string &strAction) const override
Run actions ///.
Definition Command.cpp:160
bool load(const iv::file::xml::node &nodeControlMimic) override
Definition Command.cpp:42
bool m_hasConfirmation
Definition Command.hpp:50
iv::mimics::Channel m_command
Definition Command.hpp:44
Command()
Definition Command.cpp:20
iv::mimics::Channel m_closeChannel
Definition Command.hpp:45
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 Command.cpp:141
void mapChannels(const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction) override
Processed gets ///.
Definition Command.cpp:153
iv::types::color m_messageColor
Definition Command.hpp:47
~Command() override=default
bool m_hasPassword
Definition Command.hpp:54
AbstractComponentGUI * panelEditControl() override
UI methods ///.
Definition Command.cpp:210
std::unique_ptr< CDrawText > m_drawText
Definition Command.hpp:59
iv::model::LocalizedText m_message
Definition Command.hpp:48
std::shared_ptr< iv::mimics::AbstractMimicElement > clone() const override
Definition Command.cpp:165
iv::types::color m_confirmationMessageColor
Definition Command.hpp:51
void updateEnabledLanguages(const std::set< iv::eLanguage > &enabledLanguages) override
Definition Command.cpp:105
void addOptionsMenu(const std::shared_ptr< iv::mimics::MimicControlMenu > &menu) override
Definition Command.cpp:302
iv::model::LocalizedText m_confirmationMessage
Definition Command.hpp:52
std::unique_ptr< CRectangleGraphics > m_rectangleOpt
Definition Command.hpp:58
Definition TripReset.hpp:12
constexpr iv::types::color White
Definition color.hpp:222
constexpr iv::types::color Red
Definition color.hpp:179
Definition enums.hpp:95
double height
Definition types.hpp:14
uint32_t color
Definition types.hpp:12
eLanguage
Definition enums.hpp:37
static constexpr iv::types::color text
Definition Command.hpp:93
static constexpr iv::types::height textHeight
Definition Command.hpp:71
static constexpr iv::types::color confirmationMessageColor
Definition Command.hpp:74
static constexpr bool hasConfirmation
Definition Command.hpp:73
static constexpr iv::types::color messageColor
Definition Command.hpp:72
static constexpr bool hasPassword
Definition Command.hpp:75
Definition Command.hpp:62
static constexpr std::string_view hasConfirmation
Definition Command.hpp:65
static constexpr std::string_view confirmationMessageColor
Definition Command.hpp:66
static constexpr std::string_view textHeight
Definition Command.hpp:63
static constexpr std::string_view messageColor
Definition Command.hpp:64
static constexpr std::string_view confirmationMessage
Definition Command.hpp:86
static constexpr std::string_view commandControl
Definition Command.hpp:79
static constexpr std::string_view hasPassword
Definition Command.hpp:87
static constexpr std::string_view tripReset
Definition Command.hpp:82
static constexpr std::string_view command
Definition Command.hpp:80
static constexpr std::string_view message
Definition Command.hpp:84
static constexpr std::string_view confirmationMessages
Definition Command.hpp:85
static constexpr std::string_view messages
Definition Command.hpp:83
static constexpr std::string_view closeChannel
Definition Command.hpp:81
Definition structs.hpp:29