onboardsdk
Loading...
Searching...
No Matches
IndicatorsSetpoint.hpp
1#pragma once
2#include <fmt/format.h>
3
4namespace blunux::pmu {
5
14 bool green = false;
15 bool yellow = false;
16 bool orange = false;
17 bool red = false;
18};
19} // namespace blunux::pmu
20
24template <>
25struct fmt::formatter<blunux::pmu::IndicatorsSetpoint> {
32 template <typename ParseContext>
33 // NOLINTNEXTLINE(runtime/references)
34 constexpr auto parse(ParseContext& ctx) {
35 return ctx.begin();
36 }
37
45 template <typename FormatContext>
47 FormatContext& ctx) const { // NOLINT(runtime/references)
48 return fmt::format_to(ctx.out(), "g: {} y: {} o: {} r: {}", data.green,
49 data.yellow, data.orange, data.red);
50 }
51};
52
60inline std::ostream& operator<<(std::ostream& os,
62 return os << fmt::format("{}", data);
63}
Structure representing setpoint values for indicators.
Definition IndicatorsSetpoint.hpp:13
bool red
Status of the red indicator LED.
Definition IndicatorsSetpoint.hpp:17
bool green
Status of the green indicator LED.
Definition IndicatorsSetpoint.hpp:14
bool yellow
Status of the yellow indicator LED.
Definition IndicatorsSetpoint.hpp:15
bool orange
Status of the orange indicator LED.
Definition IndicatorsSetpoint.hpp:16
constexpr auto parse(ParseContext &ctx)
Parses the format string.
Definition IndicatorsSetpoint.hpp:34
auto format(blunux::pmu::IndicatorsSetpoint const &data, FormatContext &ctx) const
Formats the IndicatorsSetpoint object.
Definition IndicatorsSetpoint.hpp:46