TReK C++
5.3.3
Telemetry/Command API
|
This class calibrates a value using a series of line segments. More...
#include <spline_calibrator.h>
Inherits trek::Calibrator.
Public Member Functions | |
int32_t | LoadFile (const char *filename) |
Loads the SplineCalibrator definition from the specified file. More... | |
int32_t | SaveFile (const char *filename) |
Saves the SplineCalibrator definition to the specified file. More... | |
Constructors, Destructor, and Other Basic Methods | |
SplineCalibrator () | |
Default constructor of the class. | |
SplineCalibrator (SplineCalibrator &input) | |
Copy constructor of the class. | |
virtual | ~SplineCalibrator () |
Class destructor. More... | |
void | operator= (SplineCalibrator &right_side) |
Provides the equal operator. | |
virtual Calibrator * | Clone () |
Creates and returns an extact copy of the object. | |
virtual void | Init () |
Initializes the object. | |
Calibration Methods | |
int32_t | AddPoint (double converted_value, double calibrated_value) |
Adds a point to the calibrator. More... | |
void | ClearAllPoints () |
Removes all points defining the line segments. | |
int32_t | Calibrate (double input_value, double &output_value) |
Performs the calibration on the input value. More... | |
uint32_t | GetNumberOfPoints () |
Returns the number of points in the calibrator. More... | |
void | GetPoints (double **conv_values, double **cal_values, uint32_t &num_values) |
Gets all of the points for the calibrator. More... | |
int32_t | GetPoints (double *conv_values, double *cal_values) |
Gets all of the points for the calibrator. More... | |
Public Member Functions inherited from trek::Calibrator | |
virtual int32_t | Calibrate (double input_value, double &output_value)=0 |
Virtual method for derived classes to calibrate an input value. More... | |
Calibrator () | |
Default constructor of the class. | |
Calibrator (Calibrator &input) | |
Copy constructor of the class. | |
virtual | ~Calibrator () |
Class destructor. More... | |
void | operator= (Calibrator &right_side) |
Provides the equal operator. | |
Public Member Functions inherited from trek::NamedItem | |
void | SetName (const char *input_ptr) |
Sets the name of the item. More... | |
void | SetAlias (const char *input) |
Sets the alias of the item. More... | |
void | SetShortDescription (const char *input_ptr) |
Sets the short description of the item. More... | |
void | SetLongDescription (const char *input_ptr) |
Sets the long description of the item. More... | |
void | SetUserDescription (const char *input_ptr) |
Sets the user description of the item. More... | |
void | SetOwner (const char *input_ptr) |
Sets the owner of the item. More... | |
const char * | GetName () |
Returns the name of the item. | |
const char * | GetAlias () |
Returns the alias of the item. | |
const char * | GetShortDescription () |
Returns the short description of the item. | |
const char * | GetLongDescription () |
Returns the long description of the item. | |
const char * | GetUserDescription () |
Returns the user description of the item. | |
const char * | GetOwner () |
Returns the owner of the item. | |
NamedItem () | |
Default constructor of the class. | |
NamedItem (NamedItem &input) | |
Copy constructor of the class. | |
virtual | ~NamedItem () |
Class destructor. More... | |
void | operator= (NamedItem &right_side) |
Provides the equal operator. | |
bool | operator== (NamedItem &right_side) |
Provides the == operator. | |
This class calibrates a value using a series of line segments.
The number of line segments allowed is unbouded.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
int32_t trek::SplineCalibrator::AddPoint | ( | double | converted_value, |
double | calibrated_value | ||
) |
Adds a point to the calibrator.
Line segments are calculated automatically by the class.
[in] | converted_value | Converted value. |
[in] | calibrated_value | Corresponding calibrated value. |
Example:
|
virtual |
Performs the calibration on the input value.
[in] | input_value | Value to calibrate. |
[out] | output_value | Calibrated value. |
Example:
Implements trek::Calibrator.
uint32_t trek::SplineCalibrator::GetNumberOfPoints | ( | ) |
Returns the number of points in the calibrator.
void trek::SplineCalibrator::GetPoints | ( | double ** | conv_values, |
double ** | cal_values, | ||
uint32_t & | num_values | ||
) |
Gets all of the points for the calibrator.
Returns the number of points and the converted and calibrated value for each point. Memory is created by this function when the number of values returned is non-zero. It is the responsibility of the caller to delete the associated memory.
[out] | conv_values | Converted value array. Valid if num_values > 0. |
[out] | cal_values | Corresponding calibrated value. Valid if num_values > 0. |
[out] | num_values | Number of value pairs returned. |
Example:
int32_t trek::SplineCalibrator::GetPoints | ( | double * | conv_values, |
double * | cal_values | ||
) |
Gets all of the points for the calibrator.
Populates the user allocated arrays with the the points of the spline calibrator. The user of the function should call GetNumberOfPoints() to determine how much memory to allocate.
[out] | conv_values | Converted value array. |
[out] | cal_values | Corresponding calibrated value. |
Example:
int32_t trek::SplineCalibrator::LoadFile | ( | const char * | filename | ) |
Loads the SplineCalibrator definition from the specified file.
Reads an XML format for the SplineCalibrator. It can be written in with SaveFile.
[in] | filename | The file to load the parameter object from. |
Example:
int32_t trek::SplineCalibrator::SaveFile | ( | const char * | filename | ) |
Saves the SplineCalibrator definition to the specified file.
Writes an XML format for the SplineCalibrator. It can be read in with LoadFile.
[in] | filename | The file to save the parameter object to. |
Example: