SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
linear.cpp
Go to the documentation of this file.
1#include "linear.h"
2
3namespace sensesp {
4
5// Keys and descriptions of constant parameters
6
7const ParamInfo Linear::param_info_[] = {{"multiplier", "Multiplier"},
8 {"offset", "Constant offset"}};
9
10// Function implementing the linear transform
11
12float (*Linear::function_)(float, float, float) =
13 [](float input, float multiplier, float offset) {
14 return multiplier * input + offset;
15 };
16
17// Constructor definition
18
19Linear::Linear(float multiplier, float offset, const String& config_path)
20 : LambdaTransform<float, float, float, float>(function_, multiplier, offset,
21 param_info_, config_path) {}
22
23} // namespace sensesp
Construct a new transform based on a single function.
Linear(float multiplier, float offset, const String &config_path="")
Definition linear.cpp:19