Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Dial.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MIMICS_INDICATORS_DIAL_HPP_
2#define IV_SRC_MIMICS_INDICATORS_DIAL_HPP_
3
6
8{
9
11{
12public:
13 Dial();
14 ~Dial() override = default;
15
16 bool load(const iv::file::xml::node &nodeControlMimic) override;
17 bool save(iv::file::xml::node &nodeControlMimic) const override;
18
19 //controller
20 void getChannels(const std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>>
21 &channelsInControl) const override;
22 void mapChannels(const std::function<void(std::weak_ptr<iv::channels::AbstractChannel> &)> &mapFunction) override;
23 std::shared_ptr<iv::mimics::AbstractMimicElement> clone() const override;
24
25 std::optional<iv::mimics::eAlarmState> getAlarmState() const override;
26 std::optional<iv::types::color> getColorWorkingState() const override;
27 std::optional<std::string> getStringWorkingState() const override;
28
29 void executeCommand(const std::string &strAction) const override;
30
31 // Draw
33 {
34 Auto,
35 In,
36 Out
37 };
38 void drawSpecific(IGraphics *graphics, std::optional<iv::types::color> colorWorkingState,
39 std::optional<iv::types::color> colorControlState, iv::eLanguage drawingLanguage) override;
40
41 // UI
43
44private:
45 Dial(const Dial &other);
46
48
51 double m_factor;
52
53 //Alarm limits indicators
56
57 //Scale
60
61 // View
62 static void prvGetDataClock(EDispatcherTextsMarks dispatcherTextsMarks, uint64_t sizeMaxValues,
63 iv::types::radius radiusClock, iv::types::radius &radiusSeparationsOut,
64 double &longLineHourSmallOut, double &longLineHourLargeOut);
65 static void prvGetDataCounter(iv::types::radius radiusHours, bool isModernRectangle, iv::types::coord &xCounterOut,
66 iv::types::coord &yCounterOut, iv::types::width &widthCounterOut,
67 iv::types::height &heightCounterOut);
68 static std::vector<std::shared_ptr<CDrawText>>
69 prvTextValuesClock(Dial::EDispatcherTextsMarks dispatcherTextsMarks, uint64_t sizeMaxValues,
70 iv::types::radius radiusClock, iv::types::channelValue valueMin,
71 iv::types::channelValue valueMax, iv::types::height heightText, double separationMarkLarge,
72 uint64_t numDec, bool isAllNumber, bool showLimits);
74 iv::types::channelValue HEL, bool isModernRectangle, uint64_t sizeMaxValues,
75 iv::types::radius radiusSeparations, iv::types::radius radiusClock, bool isAllNumbers,
76 double separationMarkLarge, uint16_t numDecimals) const;
77
78 mutable std::unique_ptr<CDrawText> m_textFactorOpt {nullptr};
79 mutable std::unique_ptr<CDrawText> m_textValueOpt {nullptr};
80 mutable std::unique_ptr<CDrawText> m_textUnit {nullptr};
81 mutable std::vector<std::shared_ptr<CDrawText>> m_textValuesClock {};
82
83 struct Keys
84 {
85 static constexpr std::string_view color {"Color"};
86 static constexpr std::string_view showTextValue {"ShowTextValue"};
87 static constexpr std::string_view factor {"Factor"};
88 static constexpr std::string_view showAlarmLimits {"ShowAlarmLimits"};
89 static constexpr std::string_view showFactor {"ShowFactor"};
90 static constexpr std::string_view divisionsNumber {"DivisionsNumber"};
91 static constexpr std::string_view subdivisionsNumber {"SubdivisionsNumber"};
92 };
94 {
95 static constexpr std::string string {};
97 static constexpr bool showTextValue {false};
98 static constexpr double factor {100.0};
99 static constexpr bool showAlarmLimits {false};
100 static constexpr bool showFactor {false};
101 static constexpr uint8_t divisionsNumber {3};
102 static constexpr uint8_t subdivisionsNumber {2};
103 };
104 struct Sections
105 {
106 static constexpr std::string_view dialIndicator {"DialIndicator"};
107 static constexpr std::string_view channel {"Channel"};
108 };
109};
110
111}// namespace iv::mimics::elements
112
113#endif//IV_SRC_MIMICS_INDICATORS_DIAL_HPP_
Definition AbstractComponentGUI.hpp:30
Definition IGraphics.hpp:20
Definition xmlFile.hpp:15
Definition AbstractMimicElement.hpp:21
Definition Channel.hpp:12
Definition Dial.hpp:11
static std::vector< std::shared_ptr< CDrawText > > prvTextValuesClock(Dial::EDispatcherTextsMarks dispatcherTextsMarks, uint64_t sizeMaxValues, iv::types::radius radiusClock, iv::types::channelValue valueMin, iv::types::channelValue valueMax, iv::types::height heightText, double separationMarkLarge, uint64_t numDec, bool isAllNumber, bool showLimits)
Definition Dial.cpp:747
iv::types::color m_color
Definition Dial.hpp:49
std::optional< iv::types::color > getColorWorkingState() const override
Retrieves the color representing the current working state of the element.
Definition Dial.cpp:138
std::unique_ptr< CDrawText > m_textUnit
Definition Dial.hpp:80
std::optional< std::string > getStringWorkingState() const override
Definition Dial.cpp:152
uint8_t m_divisionsNumber
Definition Dial.hpp:58
void executeCommand(const std::string &strAction) const override
Run actions ///.
Definition Dial.cpp:162
std::unique_ptr< CDrawText > m_textFactorOpt
Definition Dial.hpp:78
Dial()
Definition Dial.cpp:30
std::vector< std::shared_ptr< CDrawText > > m_textValuesClock
Definition Dial.hpp:81
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 Dial.cpp:255
static void prvGetDataCounter(iv::types::radius radiusHours, bool isModernRectangle, iv::types::coord &xCounterOut, iv::types::coord &yCounterOut, iv::types::width &widthCounterOut, iv::types::height &heightCounterOut)
Definition Dial.cpp:547
uint8_t m_subdivisionsNumber
Definition Dial.hpp:59
AbstractComponentGUI * panelEditControl() override
UI methods ///.
Definition Dial.cpp:427
iv::mimics::Channel m_channel
Definition Dial.hpp:47
std::shared_ptr< iv::mimics::AbstractMimicElement > clone() const override
Definition Dial.cpp:117
~Dial() override=default
void mapChannels(const std::function< void(std::weak_ptr< iv::channels::AbstractChannel > &)> &mapFunction) override
Processed gets ///.
Definition Dial.cpp:112
bool load(const iv::file::xml::node &nodeControlMimic) override
Definition Dial.cpp:56
bool m_showAlarmLimits
Definition Dial.hpp:54
static void prvGetDataClock(EDispatcherTextsMarks dispatcherTextsMarks, uint64_t sizeMaxValues, iv::types::radius radiusClock, iv::types::radius &radiusSeparationsOut, double &longLineHourSmallOut, double &longLineHourLargeOut)
Definition Dial.cpp:512
std::optional< iv::mimics::eAlarmState > getAlarmState() const override
Definition Dial.cpp:122
std::unique_ptr< CDrawText > m_textValueOpt
Definition Dial.hpp:79
EDispatcherTextsMarks
Definition Dial.hpp:33
double m_factor
Definition Dial.hpp:51
bool save(iv::file::xml::node &nodeControlMimic) const override
Definition Dial.cpp:81
bool m_showFactor
Definition Dial.hpp:55
bool m_showTextValue
Definition Dial.hpp:50
void prvCalculateTexts(Dial::EDispatcherTextsMarks dispatcherTextsMarks, iv::types::channelValue LEL, iv::types::channelValue HEL, bool isModernRectangle, uint64_t sizeMaxValues, iv::types::radius radiusSeparations, iv::types::radius radiusClock, bool isAllNumbers, double separationMarkLarge, uint16_t numDecimals) const
Calculates the position of the texts for the dial.
Definition Dial.cpp:833
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 Dial.cpp:105
constexpr iv::types::color White
Definition color.hpp:222
Definition enums.hpp:95
double height
Definition types.hpp:14
double radius
Definition types.hpp:17
double channelValue
Definition types.hpp:67
double width
Definition types.hpp:23
uint32_t color
Definition types.hpp:12
double coord
Definition types.hpp:13
eLanguage
Definition enums.hpp:37
static constexpr bool showAlarmLimits
Definition Dial.hpp:99
static constexpr uint8_t subdivisionsNumber
Definition Dial.hpp:102
static constexpr bool showFactor
Definition Dial.hpp:100
static constexpr bool showTextValue
Definition Dial.hpp:97
static constexpr double factor
Definition Dial.hpp:98
static constexpr iv::types::color color
Definition Dial.hpp:96
static constexpr uint8_t divisionsNumber
Definition Dial.hpp:101
Definition Dial.hpp:84
static constexpr std::string_view divisionsNumber
Definition Dial.hpp:90
static constexpr std::string_view showAlarmLimits
Definition Dial.hpp:88
static constexpr std::string_view color
Definition Dial.hpp:85
static constexpr std::string_view showTextValue
Definition Dial.hpp:86
static constexpr std::string_view factor
Definition Dial.hpp:87
static constexpr std::string_view showFactor
Definition Dial.hpp:89
static constexpr std::string_view subdivisionsNumber
Definition Dial.hpp:91
static constexpr std::string_view dialIndicator
Definition Dial.hpp:106
static constexpr std::string_view channel
Definition Dial.hpp:107