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 };
41 
42 enum class ReadingType{
43     Invalid,
44     Temperature,
45     Humidity,
46     Power,
47     EnergykWh,
48     EnergyJoules,
49     EnergyWh,
50     ChargeAh,
51     Voltage,
52     Current,
53     Frequency,
54     Pressure,
55     PressurekPa,
56     LiquidLevel,
57     Rotational,
58     AirFlow,
59     LiquidFlow,
60     Barometric,
61     Altitude,
62     Percent,
63     AbsoluteHumidity,
64 };
65 
66 enum class ImplementationType{
67     Invalid,
68     PhysicalSensor,
69     Synthesized,
70     Reported,
71 };
72 
73 NLOHMANN_JSON_SERIALIZE_ENUM(VoltageType, {
74     {VoltageType::Invalid, "Invalid"},
75     {VoltageType::AC, "AC"},
76     {VoltageType::DC, "DC"},
77 });
78 
79 NLOHMANN_JSON_SERIALIZE_ENUM(ElectricalContext, {
80     {ElectricalContext::Invalid, "Invalid"},
81     {ElectricalContext::Line1, "Line1"},
82     {ElectricalContext::Line2, "Line2"},
83     {ElectricalContext::Line3, "Line3"},
84     {ElectricalContext::Neutral, "Neutral"},
85     {ElectricalContext::LineToLine, "LineToLine"},
86     {ElectricalContext::Line1ToLine2, "Line1ToLine2"},
87     {ElectricalContext::Line2ToLine3, "Line2ToLine3"},
88     {ElectricalContext::Line3ToLine1, "Line3ToLine1"},
89     {ElectricalContext::LineToNeutral, "LineToNeutral"},
90     {ElectricalContext::Line1ToNeutral, "Line1ToNeutral"},
91     {ElectricalContext::Line2ToNeutral, "Line2ToNeutral"},
92     {ElectricalContext::Line3ToNeutral, "Line3ToNeutral"},
93     {ElectricalContext::Line1ToNeutralAndL1L2, "Line1ToNeutralAndL1L2"},
94     {ElectricalContext::Line2ToNeutralAndL1L2, "Line2ToNeutralAndL1L2"},
95     {ElectricalContext::Line2ToNeutralAndL2L3, "Line2ToNeutralAndL2L3"},
96     {ElectricalContext::Line3ToNeutralAndL3L1, "Line3ToNeutralAndL3L1"},
97     {ElectricalContext::Total, "Total"},
98 });
99 
100 NLOHMANN_JSON_SERIALIZE_ENUM(ThresholdActivation, {
101     {ThresholdActivation::Invalid, "Invalid"},
102     {ThresholdActivation::Increasing, "Increasing"},
103     {ThresholdActivation::Decreasing, "Decreasing"},
104     {ThresholdActivation::Either, "Either"},
105 });
106 
107 NLOHMANN_JSON_SERIALIZE_ENUM(ReadingType, {
108     {ReadingType::Invalid, "Invalid"},
109     {ReadingType::Temperature, "Temperature"},
110     {ReadingType::Humidity, "Humidity"},
111     {ReadingType::Power, "Power"},
112     {ReadingType::EnergykWh, "EnergykWh"},
113     {ReadingType::EnergyJoules, "EnergyJoules"},
114     {ReadingType::EnergyWh, "EnergyWh"},
115     {ReadingType::ChargeAh, "ChargeAh"},
116     {ReadingType::Voltage, "Voltage"},
117     {ReadingType::Current, "Current"},
118     {ReadingType::Frequency, "Frequency"},
119     {ReadingType::Pressure, "Pressure"},
120     {ReadingType::PressurekPa, "PressurekPa"},
121     {ReadingType::LiquidLevel, "LiquidLevel"},
122     {ReadingType::Rotational, "Rotational"},
123     {ReadingType::AirFlow, "AirFlow"},
124     {ReadingType::LiquidFlow, "LiquidFlow"},
125     {ReadingType::Barometric, "Barometric"},
126     {ReadingType::Altitude, "Altitude"},
127     {ReadingType::Percent, "Percent"},
128     {ReadingType::AbsoluteHumidity, "AbsoluteHumidity"},
129 });
130 
131 NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, {
132     {ImplementationType::Invalid, "Invalid"},
133     {ImplementationType::PhysicalSensor, "PhysicalSensor"},
134     {ImplementationType::Synthesized, "Synthesized"},
135     {ImplementationType::Reported, "Reported"},
136 });
137 
138 }
139 // clang-format on
140