35#ifndef SBL_CONTROL_PANEL_REPORT_HPP_
36#define SBL_CONTROL_PANEL_REPORT_HPP_
52template<
typename Target,
size_t N,
size_t LINE = 128>
59 template<
size_t COUNT>
60 PanelReport(
const Target (¶ms)[N],
const char*
const (&names)[COUNT]) : params_(params), values_(
"PANEL") {
61 for (
size_t slot = 0; slot < N; ++slot) {
62 const auto index =
static_cast<size_t>(params[slot]);
63 values_.name(slot, index < COUNT ? names[index] :
nullptr);
67 void set_interval_ms(uint32_t ms) { values_.set_interval_ms(ms); }
68 void set_threshold(
float threshold) { values_.set_threshold(threshold); }
69 void set_decimals(uint8_t decimals) { values_.set_decimals(decimals); }
72 void update(Target target,
float value) {
73 for (
size_t slot = 0; slot < N; ++slot) {
74 if (params_[slot] == target) {
75 values_.set(slot, value);
82 template<
typename Output>
83 bool poll(uint32_t now_ms) {
84 return values_.template poll<Output>(now_ms);
88 void force() { values_.force(); }
91 const Target (¶ms_)[N];
95template<
typename Target,
size_t N,
size_t COUNT>
96PanelReport(
const Target (&)[N],
const char*
const (&)[COUNT]) -> PanelReport<Target, N>;
The values of the parameters a panel shows, as #PANEL lines.
void update(Target target, float value)
bool poll(uint32_t now_ms)
PanelReport(const Target(¶ms)[N], const char *const (&names)[COUNT])
Named values written under one tag, on change, at a capped rate.
The control stack: scheduler, event queue, merge, CC mapping, calibration.
Tagged output lines: a builder and a throttled value report.