|
roo_monitoring
API Documentation for roo_monitoring
|
Maps application-domain floats to 16-bit stored values. More...
#include <transform.h>
Public Member Functions | |
| uint16_t | apply (float value) const |
| Applies the transform and clamps to [0, 65535]. | |
| float | unapply (uint16_t value) const |
| Recovers the application-domain value from encoded data. | |
| float | multiplier () const |
| Returns the multiplier used by the transform. | |
| float | offset () const |
| Returns the offset used by the transform. | |
Static Public Member Functions | |
| static Transform | Linear (float multiplier, float offset) |
| Creates a linear transformation ax+b. | |
| static Transform | LinearRange (float min_value, float max_value) |
| Creates a linear transform from min/max representable values. | |
Maps application-domain floats to 16-bit stored values.
Currently implemented as a linear transformation.
Definition at line 10 of file transform.h.
| uint16_t roo_monitoring::Transform::apply | ( | float | value | ) | const |
Applies the transform and clamps to [0, 65535].
Definition at line 13 of file transform.cpp.
Referenced by roo_monitoring::WriteTransaction::write().
|
static |
Creates a linear transformation ax+b.
The result is rounded to the nearest integer.
Definition at line 5 of file transform.cpp.
References multiplier(), and offset().
|
static |
Creates a linear transform from min/max representable values.
The minimum maps to 0 and the maximum maps to 65535.
Definition at line 9 of file transform.cpp.
|
inline |
Returns the multiplier used by the transform.
Definition at line 29 of file transform.h.
Referenced by Linear().
|
inline |
Returns the offset used by the transform.
Definition at line 31 of file transform.h.
Referenced by Linear().
| float roo_monitoring::Transform::unapply | ( | uint16_t | value | ) | const |
Recovers the application-domain value from encoded data.
Definition at line 24 of file transform.cpp.