Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
TankChannels.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_TANKS_TANKCHANNELS_HPP_
2#define IV_SRC_TANKS_TANKCHANNELS_HPP_
3
4#include "tanks/structs.hpp"
5
6#include <fmt/core.h>
7#include <memory>
8#include <optional>
9#include <vector>
10
11namespace iv::tanks
12{
13
15{
16public:
18
19 void update(const TankChannels &other);
20 void load(const iv::file::xml::node &nodeTankChannel);
21 void save(iv::file::xml::node &nodeTankChannel) const;
22
23 std::vector<std::shared_ptr<iv::tanks::SensorChannelData>> m_channels;
24
25 std::weak_ptr<iv::channels::AbstractChannel> m_alarmDifferenceChannelRef;
26 std::weak_ptr<iv::channels::AbstractChannel> m_valueChannelRef;
27
30
34 std::optional<iv::types::height> m_calculatedContentHeight;
35
36private:
37 struct Keys
38 {
39 static constexpr std::string_view hasAlarmDifference {"HasAlarmDifference"};
40 static constexpr std::string_view alarmDifferenceThreshold {"AlarmDifferenceThreshold"};
41 static constexpr std::string_view valueChannel {"ValueChannel"};
42 static constexpr std::string_view alarmDifferenceChannel {"AlarmDifferenceChannel"};
43 static constexpr std::string_view atmosphericBar {"AtmosphericBar"};
44 static constexpr std::string_view sensorType {"SensorType"};
45 static constexpr std::string_view sensorChannelTag {"SensorChannelTag"};
46 };
48 {
49 static constexpr std::string string {};
50 static constexpr bool hasAlarmDifference {false};
51 static constexpr double alarmDifferenceThreshold {0.5};
53 static constexpr double atmosphericBar {0.};
54 };
55 struct Sections
56 {
57 static constexpr std::string_view tankSensor {"TankSensor"};
58 };
59};
60
61}// namespace iv::tanks
62
63#endif//IV_SRC_TANKS_TANKCHANNELS_HPP_
Definition xmlFile.hpp:15
Definition TankChannels.hpp:15
TankChannels()
Definition TankChannels.cpp:8
std::weak_ptr< iv::channels::AbstractChannel > m_valueChannelRef
Definition TankChannels.hpp:26
std::weak_ptr< iv::channels::AbstractChannel > m_alarmDifferenceChannelRef
Definition TankChannels.hpp:25
iv::types::channelValue m_alarmDifferenceThreshold
Definition TankChannels.hpp:29
std::optional< iv::types::height > m_calculatedContentHeight
Definition TankChannels.hpp:34
void load(const iv::file::xml::node &nodeTankChannel)
Definition TankChannels.cpp:14
void save(iv::file::xml::node &nodeTankChannel) const
Definition TankChannels.cpp:39
void update(const TankChannels &other)
Definition TankChannels.cpp:60
std::vector< std::shared_ptr< iv::tanks::SensorChannelData > > m_channels
Definition TankChannels.hpp:23
bool m_hasAlarmDifference
Definition TankChannels.hpp:28
Definition enums.hpp:5
eSensorType
Definition enums.hpp:8
double channelValue
Definition types.hpp:67
Definition TankChannels.hpp:48
static constexpr iv::tanks::eSensorType sensorType
Definition TankChannels.hpp:52
static constexpr double alarmDifferenceThreshold
Definition TankChannels.hpp:51
static constexpr bool hasAlarmDifference
Definition TankChannels.hpp:50
static constexpr double atmosphericBar
Definition TankChannels.hpp:53
Definition TankChannels.hpp:38
static constexpr std::string_view hasAlarmDifference
Definition TankChannels.hpp:39
static constexpr std::string_view atmosphericBar
Definition TankChannels.hpp:43
static constexpr std::string_view alarmDifferenceThreshold
Definition TankChannels.hpp:40
static constexpr std::string_view sensorType
Definition TankChannels.hpp:44
static constexpr std::string_view sensorChannelTag
Definition TankChannels.hpp:45
static constexpr std::string_view alarmDifferenceChannel
Definition TankChannels.hpp:42
static constexpr std::string_view valueChannel
Definition TankChannels.hpp:41
Definition TankChannels.hpp:56
static constexpr std::string_view tankSensor
Definition TankChannels.hpp:57