1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace power
5 {
6 // clang-format off
7 
8 enum class PowerLimitException{
9     Invalid,
10     NoAction,
11     HardPowerOff,
12     LogEventOnly,
13     Oem,
14 };
15 
16 enum class PowerSupplyType{
17     Invalid,
18     Unknown,
19     AC,
20     DC,
21     ACorDC,
22 };
23 
24 enum class LineInputVoltageType{
25     Invalid,
26     Unknown,
27     ACLowLine,
28     ACMidLine,
29     ACHighLine,
30     DCNeg48V,
31     DC380V,
32     AC120V,
33     AC240V,
34     AC277V,
35     ACandDCWideRange,
36     ACWideRange,
37     DC240V,
38 };
39 
40 enum class InputType{
41     Invalid,
42     AC,
43     DC,
44 };
45 
46 NLOHMANN_JSON_SERIALIZE_ENUM(PowerLimitException, {
47     {PowerLimitException::Invalid, "Invalid"},
48     {PowerLimitException::NoAction, "NoAction"},
49     {PowerLimitException::HardPowerOff, "HardPowerOff"},
50     {PowerLimitException::LogEventOnly, "LogEventOnly"},
51     {PowerLimitException::Oem, "Oem"},
52 });
53 
54 NLOHMANN_JSON_SERIALIZE_ENUM(PowerSupplyType, {
55     {PowerSupplyType::Invalid, "Invalid"},
56     {PowerSupplyType::Unknown, "Unknown"},
57     {PowerSupplyType::AC, "AC"},
58     {PowerSupplyType::DC, "DC"},
59     {PowerSupplyType::ACorDC, "ACorDC"},
60 });
61 
62 NLOHMANN_JSON_SERIALIZE_ENUM(LineInputVoltageType, {
63     {LineInputVoltageType::Invalid, "Invalid"},
64     {LineInputVoltageType::Unknown, "Unknown"},
65     {LineInputVoltageType::ACLowLine, "ACLowLine"},
66     {LineInputVoltageType::ACMidLine, "ACMidLine"},
67     {LineInputVoltageType::ACHighLine, "ACHighLine"},
68     {LineInputVoltageType::DCNeg48V, "DCNeg48V"},
69     {LineInputVoltageType::DC380V, "DC380V"},
70     {LineInputVoltageType::AC120V, "AC120V"},
71     {LineInputVoltageType::AC240V, "AC240V"},
72     {LineInputVoltageType::AC277V, "AC277V"},
73     {LineInputVoltageType::ACandDCWideRange, "ACandDCWideRange"},
74     {LineInputVoltageType::ACWideRange, "ACWideRange"},
75     {LineInputVoltageType::DC240V, "DC240V"},
76 });
77 
78 NLOHMANN_JSON_SERIALIZE_ENUM(InputType, {
79     {InputType::Invalid, "Invalid"},
80     {InputType::AC, "AC"},
81     {InputType::DC, "DC"},
82 });
83 
84 }
85 // clang-format on
86