1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace circuit
5 {
6 // clang-format off
7 
8 enum class PowerState{
9     Invalid,
10     On,
11     Off,
12     PowerCycle,
13 };
14 
15 enum class BreakerStates{
16     Invalid,
17     Normal,
18     Tripped,
19     Off,
20 };
21 
22 enum class PowerRestorePolicyTypes{
23     Invalid,
24     AlwaysOn,
25     AlwaysOff,
26     LastState,
27 };
28 
29 enum class PhaseWiringType{
30     Invalid,
31     OnePhase3Wire,
32     TwoPhase3Wire,
33     OneOrTwoPhase3Wire,
34     TwoPhase4Wire,
35     ThreePhase4Wire,
36     ThreePhase5Wire,
37 };
38 
39 enum class NominalVoltageType{
40     Invalid,
41     AC100To127V,
42     AC100To240V,
43     AC100To277V,
44     AC120V,
45     AC200To240V,
46     AC200To277V,
47     AC208V,
48     AC230V,
49     AC240V,
50     AC240AndDC380V,
51     AC277V,
52     AC277AndDC380V,
53     AC400V,
54     AC480V,
55     DC48V,
56     DC240V,
57     DC380V,
58     DCNeg48V,
59     DC16V,
60     DC12V,
61     DC9V,
62     DC5V,
63     DC3_3V,
64     DC1_8V,
65 };
66 
67 enum class PlugType{
68     Invalid,
69     NEMA_5_15P,
70     NEMA_L5_15P,
71     NEMA_5_20P,
72     NEMA_L5_20P,
73     NEMA_L5_30P,
74     NEMA_6_15P,
75     NEMA_L6_15P,
76     NEMA_6_20P,
77     NEMA_L6_20P,
78     NEMA_L6_30P,
79     NEMA_L14_20P,
80     NEMA_L14_30P,
81     NEMA_L15_20P,
82     NEMA_L15_30P,
83     NEMA_L21_20P,
84     NEMA_L21_30P,
85     NEMA_L22_20P,
86     NEMA_L22_30P,
87     California_CS8265,
88     California_CS8365,
89     IEC_60320_C14,
90     IEC_60320_C20,
91     IEC_60309_316P6,
92     IEC_60309_332P6,
93     IEC_60309_363P6,
94     IEC_60309_516P6,
95     IEC_60309_532P6,
96     IEC_60309_563P6,
97     IEC_60309_460P9,
98     IEC_60309_560P9,
99     Field_208V_3P4W_60A,
100     Field_400V_3P5W_32A,
101 };
102 
103 enum class CircuitType{
104     Invalid,
105     Mains,
106     Branch,
107     Subfeed,
108     Feeder,
109     Bus,
110 };
111 
112 enum class VoltageType{
113     Invalid,
114     AC,
115     DC,
116 };
117 
118 NLOHMANN_JSON_SERIALIZE_ENUM(PowerState, {
119     {PowerState::Invalid, "Invalid"},
120     {PowerState::On, "On"},
121     {PowerState::Off, "Off"},
122     {PowerState::PowerCycle, "PowerCycle"},
123 });
124 
125 NLOHMANN_JSON_SERIALIZE_ENUM(BreakerStates, {
126     {BreakerStates::Invalid, "Invalid"},
127     {BreakerStates::Normal, "Normal"},
128     {BreakerStates::Tripped, "Tripped"},
129     {BreakerStates::Off, "Off"},
130 });
131 
132 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, {
133     {PowerRestorePolicyTypes::Invalid, "Invalid"},
134     {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"},
135     {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"},
136     {PowerRestorePolicyTypes::LastState, "LastState"},
137 });
138 
139 NLOHMANN_JSON_SERIALIZE_ENUM(PhaseWiringType, {
140     {PhaseWiringType::Invalid, "Invalid"},
141     {PhaseWiringType::OnePhase3Wire, "OnePhase3Wire"},
142     {PhaseWiringType::TwoPhase3Wire, "TwoPhase3Wire"},
143     {PhaseWiringType::OneOrTwoPhase3Wire, "OneOrTwoPhase3Wire"},
144     {PhaseWiringType::TwoPhase4Wire, "TwoPhase4Wire"},
145     {PhaseWiringType::ThreePhase4Wire, "ThreePhase4Wire"},
146     {PhaseWiringType::ThreePhase5Wire, "ThreePhase5Wire"},
147 });
148 
149 NLOHMANN_JSON_SERIALIZE_ENUM(NominalVoltageType, {
150     {NominalVoltageType::Invalid, "Invalid"},
151     {NominalVoltageType::AC100To127V, "AC100To127V"},
152     {NominalVoltageType::AC100To240V, "AC100To240V"},
153     {NominalVoltageType::AC100To277V, "AC100To277V"},
154     {NominalVoltageType::AC120V, "AC120V"},
155     {NominalVoltageType::AC200To240V, "AC200To240V"},
156     {NominalVoltageType::AC200To277V, "AC200To277V"},
157     {NominalVoltageType::AC208V, "AC208V"},
158     {NominalVoltageType::AC230V, "AC230V"},
159     {NominalVoltageType::AC240V, "AC240V"},
160     {NominalVoltageType::AC240AndDC380V, "AC240AndDC380V"},
161     {NominalVoltageType::AC277V, "AC277V"},
162     {NominalVoltageType::AC277AndDC380V, "AC277AndDC380V"},
163     {NominalVoltageType::AC400V, "AC400V"},
164     {NominalVoltageType::AC480V, "AC480V"},
165     {NominalVoltageType::DC48V, "DC48V"},
166     {NominalVoltageType::DC240V, "DC240V"},
167     {NominalVoltageType::DC380V, "DC380V"},
168     {NominalVoltageType::DCNeg48V, "DCNeg48V"},
169     {NominalVoltageType::DC16V, "DC16V"},
170     {NominalVoltageType::DC12V, "DC12V"},
171     {NominalVoltageType::DC9V, "DC9V"},
172     {NominalVoltageType::DC5V, "DC5V"},
173     {NominalVoltageType::DC3_3V, "DC3_3V"},
174     {NominalVoltageType::DC1_8V, "DC1_8V"},
175 });
176 
177 NLOHMANN_JSON_SERIALIZE_ENUM(PlugType, {
178     {PlugType::Invalid, "Invalid"},
179     {PlugType::NEMA_5_15P, "NEMA_5_15P"},
180     {PlugType::NEMA_L5_15P, "NEMA_L5_15P"},
181     {PlugType::NEMA_5_20P, "NEMA_5_20P"},
182     {PlugType::NEMA_L5_20P, "NEMA_L5_20P"},
183     {PlugType::NEMA_L5_30P, "NEMA_L5_30P"},
184     {PlugType::NEMA_6_15P, "NEMA_6_15P"},
185     {PlugType::NEMA_L6_15P, "NEMA_L6_15P"},
186     {PlugType::NEMA_6_20P, "NEMA_6_20P"},
187     {PlugType::NEMA_L6_20P, "NEMA_L6_20P"},
188     {PlugType::NEMA_L6_30P, "NEMA_L6_30P"},
189     {PlugType::NEMA_L14_20P, "NEMA_L14_20P"},
190     {PlugType::NEMA_L14_30P, "NEMA_L14_30P"},
191     {PlugType::NEMA_L15_20P, "NEMA_L15_20P"},
192     {PlugType::NEMA_L15_30P, "NEMA_L15_30P"},
193     {PlugType::NEMA_L21_20P, "NEMA_L21_20P"},
194     {PlugType::NEMA_L21_30P, "NEMA_L21_30P"},
195     {PlugType::NEMA_L22_20P, "NEMA_L22_20P"},
196     {PlugType::NEMA_L22_30P, "NEMA_L22_30P"},
197     {PlugType::California_CS8265, "California_CS8265"},
198     {PlugType::California_CS8365, "California_CS8365"},
199     {PlugType::IEC_60320_C14, "IEC_60320_C14"},
200     {PlugType::IEC_60320_C20, "IEC_60320_C20"},
201     {PlugType::IEC_60309_316P6, "IEC_60309_316P6"},
202     {PlugType::IEC_60309_332P6, "IEC_60309_332P6"},
203     {PlugType::IEC_60309_363P6, "IEC_60309_363P6"},
204     {PlugType::IEC_60309_516P6, "IEC_60309_516P6"},
205     {PlugType::IEC_60309_532P6, "IEC_60309_532P6"},
206     {PlugType::IEC_60309_563P6, "IEC_60309_563P6"},
207     {PlugType::IEC_60309_460P9, "IEC_60309_460P9"},
208     {PlugType::IEC_60309_560P9, "IEC_60309_560P9"},
209     {PlugType::Field_208V_3P4W_60A, "Field_208V_3P4W_60A"},
210     {PlugType::Field_400V_3P5W_32A, "Field_400V_3P5W_32A"},
211 });
212 
213 NLOHMANN_JSON_SERIALIZE_ENUM(CircuitType, {
214     {CircuitType::Invalid, "Invalid"},
215     {CircuitType::Mains, "Mains"},
216     {CircuitType::Branch, "Branch"},
217     {CircuitType::Subfeed, "Subfeed"},
218     {CircuitType::Feeder, "Feeder"},
219     {CircuitType::Bus, "Bus"},
220 });
221 
222 NLOHMANN_JSON_SERIALIZE_ENUM(VoltageType, {
223     {VoltageType::Invalid, "Invalid"},
224     {VoltageType::AC, "AC"},
225     {VoltageType::DC, "DC"},
226 });
227 
228 }
229 // clang-format on
230