1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors
#pragma once
#include <nlohmann/json.hpp>
namespace control
{
// clang-format off
enum class ControlType{
Invalid,
Temperature,
Power,
Frequency,
FrequencyMHz,
Pressure,
PressurekPa,
Valve,
Percent,
DutyCycle,
LinearPosition,
LinearVelocity,
LinearAcceleration,
RotationalPosition,
RotationalVelocity,
RotationalAcceleration,
LiquidFlowLPM,
Voltage,
};
enum class SetPointType{
Invalid,
Single,
Range,
Monitor,
};
enum class ControlMode{
Invalid,
Automatic,
Override,
Manual,
Disabled,
};
enum class ImplementationType{
Invalid,
Programmable,
Direct,
Monitored,
};
NLOHMANN_JSON_SERIALIZE_ENUM(ControlType, {
{ControlType::Invalid, "Invalid"},
{ControlType::Temperature, "Temperature"},
{ControlType::Power, "Power"},
{ControlType::Frequency, "Frequency"},
{ControlType::FrequencyMHz, "FrequencyMHz"},
{ControlType::Pressure, "Pressure"},
{ControlType::PressurekPa, "PressurekPa"},
{ControlType::Valve, "Valve"},
{ControlType::Percent, "Percent"},
{ControlType::DutyCycle, "DutyCycle"},
{ControlType::LinearPosition, "LinearPosition"},
{ControlType::LinearVelocity, "LinearVelocity"},
{ControlType::LinearAcceleration, "LinearAcceleration"},
{ControlType::RotationalPosition, "RotationalPosition"},
{ControlType::RotationalVelocity, "RotationalVelocity"},
{ControlType::RotationalAcceleration, "RotationalAcceleration"},
{ControlType::LiquidFlowLPM, "LiquidFlowLPM"},
{ControlType::Voltage, "Voltage"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(SetPointType, {
{SetPointType::Invalid, "Invalid"},
{SetPointType::Single, "Single"},
{SetPointType::Range, "Range"},
{SetPointType::Monitor, "Monitor"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(ControlMode, {
{ControlMode::Invalid, "Invalid"},
{ControlMode::Automatic, "Automatic"},
{ControlMode::Override, "Override"},
{ControlMode::Manual, "Manual"},
{ControlMode::Disabled, "Disabled"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(ImplementationType, {
{ImplementationType::Invalid, "Invalid"},
{ImplementationType::Programmable, "Programmable"},
{ImplementationType::Direct, "Direct"},
{ImplementationType::Monitored, "Monitored"},
});
// clang-format on
} // namespace control
|