DUECA/DUSIME
|
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...
#include <OutputCalibrator.hxx>
Public Member Functions | |
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. | |
~OutputCalibrator () | |
Destructor. | |
operator double () const | |
Obtain the converted value. | |
R | raw () const |
Obtain the raw integer value. | |
OutputCalibrator & | operator= (const double x) |
Assignment operator. | |
OutputCalibrator & | operator+= (const double x) |
Summation with current value. | |
R | newConversion () |
Get a new converted value (integer) from the calibrator. | |
unsigned int | index () const |
The index is a variable for programmer convenience, e.g. | |
std::ostream & | print (std::ostream &os) const |
Print to stream, for debugging purposes. | |
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< 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.
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. |
|
inline |
Assignment operator.
Has the effect of taking the input value, and storing it for later output.
|
inline |
Summation with current value.
Has the effect of taking the input value, summing it with the present value and storing it for later output.
|
inline |
The index is a variable for programmer convenience, e.g.
to remember where in an array of raw data the input value is stored.