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
3
namespace
sensesp
{
4
5
// Keys and descriptions of constant parameters
6
7
const
ParamInfo Linear::param_info_[] = {{
"multiplier"
,
"Multiplier"
},
8
{
"offset"
,
"Constant offset"
}};
9
10
// Function implementing the linear transform
11
12
float (*Linear::function_)(float, float, float) =
13
[](
float
input,
float
multiplier,
float
offset) {
14
return
multiplier * input + offset;
15
};
16
17
// Constructor definition
18
19
Linear::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
sensesp::LambdaTransform
Construct a new transform based on a single function.
Definition
lambda_transform.h:42
sensesp::Linear::Linear
Linear(float multiplier, float offset, const String &config_path="")
Definition
linear.cpp:19
linear.h
sensesp
Definition
sensesp.cpp:7
src
sensesp
transforms
linear.cpp
Generated by
1.12.0