![](/media/cache/profiles/altb_JGUSAOG.jpg.50x50_q85.jpg)
corrections altb2
Lib_Misc/LinearCharacteristics.h@0:d2e117716219, 2021-05-02 (annotated)
- Committer:
- altb2
- Date:
- Sun May 02 19:32:30 2021 +0000
- Revision:
- 0:d2e117716219
1st commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 0:d2e117716219 | 1 | // Linear Characteristics for different purposes (map Voltage to acc etc.) |
altb2 | 0:d2e117716219 | 2 | |
altb2 | 0:d2e117716219 | 3 | |
altb2 | 0:d2e117716219 | 4 | #ifndef LINEAR_CHARACTERISTICS_H_ |
altb2 | 0:d2e117716219 | 5 | #define LINEAR_CHARACTERISTICS_H_ |
altb2 | 0:d2e117716219 | 6 | |
altb2 | 0:d2e117716219 | 7 | |
altb2 | 0:d2e117716219 | 8 | class LinearCharacteristics{ |
altb2 | 0:d2e117716219 | 9 | public: |
altb2 | 0:d2e117716219 | 10 | LinearCharacteristics(){}; |
altb2 | 0:d2e117716219 | 11 | LinearCharacteristics(float, float); |
altb2 | 0:d2e117716219 | 12 | LinearCharacteristics(float, float, float, float); |
altb2 | 0:d2e117716219 | 13 | LinearCharacteristics(float, float, float, float, float, float); |
altb2 | 0:d2e117716219 | 14 | float evaluate(float); |
altb2 | 0:d2e117716219 | 15 | void setup(float, float, float, float); |
altb2 | 0:d2e117716219 | 16 | void setup(float, float, float, float, float, float); |
altb2 | 0:d2e117716219 | 17 | float operator()(float x){ |
altb2 | 0:d2e117716219 | 18 | return evaluate(x); |
altb2 | 0:d2e117716219 | 19 | } |
altb2 | 0:d2e117716219 | 20 | //... |
altb2 | 0:d2e117716219 | 21 | virtual ~LinearCharacteristics(); |
altb2 | 0:d2e117716219 | 22 | // here: the calculation function |
altb2 | 0:d2e117716219 | 23 | |
altb2 | 0:d2e117716219 | 24 | private: |
altb2 | 0:d2e117716219 | 25 | // here: private functions and values... |
altb2 | 0:d2e117716219 | 26 | float gain; |
altb2 | 0:d2e117716219 | 27 | float offset; |
altb2 | 0:d2e117716219 | 28 | float ulim; |
altb2 | 0:d2e117716219 | 29 | float llim; |
altb2 | 0:d2e117716219 | 30 | }; |
altb2 | 0:d2e117716219 | 31 | |
altb2 | 0:d2e117716219 | 32 | |
altb2 | 0:d2e117716219 | 33 | #endif // LINEAR_CHARACTERISTICS_H_ |