This performs a conversion of some (engineering units) value to an integer suitable for control of a D/A converter or other output device.
More...
template<class T, class R = int>
class OutputCalibrator< T, R >
This performs a conversion of some (engineering units) value to an integer suitable for control of a D/A converter or other output device.
◆ OutputCalibrator()
template<class T , class R = int>
OutputCalibrator< T, R >::OutputCalibrator |
( |
const double |
out_min, |
|
|
const double |
out_max, |
|
|
const R |
int_min, |
|
|
const R |
int_max, |
|
|
const T & |
c, |
|
|
const double |
rem_weight = 0.0 , |
|
|
unsigned int |
idx = 0 |
|
) |
| |
Constructor.
Takes a converter as argument.
- Parameters
-
out_min | Minimum value for the engineering units side. |
out_max | Maximum value for the engineering units side. |
int_min | Minimum value for the converted signal. |
int_max | Maximum value for the converted signal. Take care that the int_min and int_max ranges do not fall outside the range for your D/whatever converter! |
c | Converter. |
rem_weight | If you have an output value it can almost never be converted exactly, there is a remainder of less than half a bit at each conversion. The rem_weight parameter determines how much this remainder is counted at the next conversion. With 0 it will simply not carry over, with 1 it will count fully. |
idx | Optional index to be stored with the calibrator. |
◆ ~OutputCalibrator()
template<class T , class R = int>
◆ operator double()
template<class T , class R = int>
Obtain the converted value.
◆ raw()
template<class T , class R = int>
Obtain the raw integer value.
◆ operator=()
template<class T , class R = int>
Assignment operator.
Has the effect of taking the input value, and storing it for later output.
◆ operator+=()
template<class T , class R = int>
Summation with current value.
Has the effect of taking the input value, summing it with the present value and storing it for later output.
◆ newConversion()
template<class T , class R = int>
Get a new converted value (integer) from the calibrator.
◆ index()
template<class T , class R = int>
The index is a variable for programmer convenience, e.g.
to remember where in an array of raw data the input value is stored.
The documentation for this class was generated from the following file:
- /usr/src/packages/BUILD/extra/OutputCalibrator.hxx