1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace sensor
5 {
6 // clang-format off
7 
8 enum class VoltageType{
9     Invalid,
10     AC,
11     DC,
12 };
13 
14 enum class ElectricalContext{
15     Invalid,
16     Line1,
17     Line2,
18     Line3,
19     Neutral,
20     LineToLine,
21     Line1ToLine2,
22     Line2ToLine3,
23     Line3ToLine1,
24     LineToNeutral,
25     Line1ToNeutral,
26     Line2ToNeutral,
27     Line3ToNeutral,
28     Line1ToNeutralAndL1L2,
29     Line2ToNeutralAndL1L2,
30     Line2ToNeutralAndL2L3,
31     Line3ToNeutralAndL3L1,
32     Total,
33 };
34 
35 enum class ThresholdActivation{
36     Invalid,
37     Increasing,
38     Decreasing,
39     Either,
40     Disabled,
41 };
42 
43 enum class ReadingType{
44     Invalid,
45     Temperature,
46     Humidity,
47     Power,
48     EnergykWh,
49     EnergyJoules,
50     EnergyWh,
51     ChargeAh,
52     Voltage,
53     Current,
54     Frequency,
55     Pressure,
56     PressurekPa,
57     PressurePa,
58     LiquidLevel,
59     Rotational,
60     AirFlow,
61     AirFlowCMM,
62     LiquidFlow,
63     LiquidFlowLPM,
64     Barometric,
65     Altitude,
66     Percent,
67     AbsoluteHumidity,
68     Heat,
69 };
70 
71 enum class ImplementationType{
72     Invalid,
73     PhysicalSensor,
74     Synthesized,
75     Reported,
76 };
77 
78 enum class ReadingBasisType{
79     Invalid,
80     Zero,
81     Delta,
82     Headroom,
83 };
84 
85 NLOHMANN_JSON_SERIALIZE_ENUM(VoltageType, {
86     {VoltageType::Invalid, "Invalid"},
87     {VoltageType::AC, "AC"},
88     {VoltageType::DC, "DC"},
89 });
90 
91 NLOHMANN_JSON_SERIALIZE_ENUM(ElectricalContext, {
92     {ElectricalContext::Invalid, "Invalid"},
93     {ElectricalContext::Line1, "Line1"},
94     {ElectricalContext::Line2, "Line2"},
95     {ElectricalContext::Line3, "Line3"},
96     {ElectricalContext::Neutral, "Neutral"},
97     {ElectricalContext::LineToLine, "LineToLine"},
98     {ElectricalContext::Line1ToLine2, "Line1ToLine2"},
99     {ElectricalContext::Line2ToLine3, "Line2ToLine3"},
100     {ElectricalContext::Line3ToLine1, "Line3ToLine1"},
101     {ElectricalContext::LineToNeutral, "LineToNeutral"},
102     {ElectricalContext::Line1ToNeutral, "Line1ToNeutral"},
103     {ElectricalContext::Line2ToNeutral, "Line2ToNeutral"},
104     {ElectricalContext::Line3ToNeutral, "Line3ToNeutral"},
105     {ElectricalContext::Line1ToNeutralAndL1L2, "Line1ToNeutralAndL1L2"},
106     {ElectricalContext::Line2ToNeutralAndL1L2, "Line2ToNeutralAndL1L2"},
107     {ElectricalContext::Line2ToNeutralAndL2L3, "Line2ToNeutralAndL2L3"},
108     {ElectricalContext::Line3ToNeutralAndL3L1, "Line3ToNeutralAndL3L1"},
109     {ElectricalContext::Total, "Total"},
110 });
111 
112 NLOHMANN_JSON_SERIALIZE_ENUM(ThresholdActivation, {
113     {ThresholdActivation::Invalid, "Invalid"},
114     {ThresholdActivation::Increasing, "Increasing"},
115     {ThresholdActivation::Decreasing, "Decreasing"},
116     {ThresholdActivation::Either, "Either"},
117     {ThresholdActivation::Disabled, "Disabled"},
118 });
119 
120 NLOHMANN_JSON_SERIALIZE_ENUM(ReadingType, {
121     {ReadingType::Invalid, "Invalid"},
122     {ReadingType::Temperature, "Temperature"},
123     {ReadingType::Humidity, "Humidity"},
124     {ReadingType::Power, "Power"},
125     {ReadingType::EnergykWh, "EnergykWh"},
126     {ReadingType::EnergyJoules, "EnergyJoules"},
127     {ReadingType::EnergyWh, "EnergyWh"},
128     {ReadingType::ChargeAh, "ChargeAh"},
129     {ReadingType::Voltage, "Voltage"},
130     {ReadingType::Current, "Current"},
131     {ReadingType::Frequency, "Frequency"},
132     {ReadingType::Pressure, "Pressure"},
133     {ReadingType::PressurekPa, "PressurekPa"},
134     {ReadingType::PressurePa, "PressurePa"},
135     {ReadingType::LiquidLevel, "LiquidLevel"},
136     {ReadingType::Rotational, "Rotational"},
137     {ReadingType::AirFlow, "AirFlow"},
138     {ReadingType::AirFlowCMM, "AirFlowCMM"},
139     {ReadingType::LiquidFlow, "LiquidFlow"},
140     {ReadingType::LiquidFlowLPM, "LiquidFlowLPM"},
141     {ReadingType::Barometric, "Barometric"},
142     {ReadingType::Altitude, "Altitude"},
143     {ReadingType::Percent, "Percent"},
144     {ReadingType::AbsoluteHumidity, "AbsoluteHumidity"},
145     {ReadingType::Heat, "Heat"},
146 });
147 
148 NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, {
149     {ImplementationType::Invalid, "Invalid"},
150     {ImplementationType::PhysicalSensor, "PhysicalSensor"},
151     {ImplementationType::Synthesized, "Synthesized"},
152     {ImplementationType::Reported, "Reported"},
153 });
154 
155 NLOHMANN_JSON_SERIALIZE_ENUM(ReadingBasisType, {
156     {ReadingBasisType::Invalid, "Invalid"},
157     {ReadingBasisType::Zero, "Zero"},
158     {ReadingBasisType::Delta, "Delta"},
159     {ReadingBasisType::Headroom, "Headroom"},
160 });
161 
162 }
163 // clang-format on
164