2019-09-24 18:11:41 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sensor.h"
|
|
|
|
|
|
|
|
struct SensorConverter {
|
2020-04-06 06:00:26 -07:00
|
|
|
// Trying to copy a converter func by value is almost guaranteed to be a bug - disallow it
|
|
|
|
SensorConverter(const SensorConverter&) = delete;
|
|
|
|
// ...but doing so requires explicitly declaring the default constructor, so do that too.
|
|
|
|
SensorConverter() = default;
|
|
|
|
|
2019-09-24 18:11:41 -07:00
|
|
|
virtual SensorResult convert(float raw) const = 0;
|
2021-04-18 17:02:32 -07:00
|
|
|
virtual void showInfo(float testRawValue) const {
|
2020-04-12 06:39:14 -07:00
|
|
|
// Unused base - nothing to print
|
|
|
|
(void)testRawValue;
|
|
|
|
}
|
2019-09-24 18:11:41 -07:00
|
|
|
};
|