|
Telescience Resource Kit
TReK C++
5.4.0 ART
|
This class calibrates a value using a mathematical equation. More...
#include <math_calibrator.h>
Inherits trek::Calibrator.
Public Member Functions | |
int32_t | LoadFile (const char *filename) |
Loads the MathCalibrator definition from the specified file. More... | |
int32_t | SaveFile (const char *filename) |
Saves the MathCalibrator definition to the specified file. More... | |
Constructors, Destructor, and Other Basic Methods | |
MathCalibrator () | |
Default constructor of the class. | |
MathCalibrator (MathCalibrator &input) | |
Copy constructor of the class. | |
virtual | ~MathCalibrator () |
Class destructor. More... | |
virtual Calibrator * | Clone () |
Creates and returns an extact copy of the object. | |
void | operator= (MathCalibrator &right_side) |
Provides the equal operator. | |
virtual void | Init () |
Initializes the object. | |
Calibration Methods | |
void | AddConstant (double input_value) |
Adds a constant value for the calibration. More... | |
void | AddThisValue () |
Adds the value for this parameter to the calibration. More... | |
int32_t | AddAnotherParameterValue (const char *name, uint32_t instance=1, bool calibrated=true) |
Adds the value for another parameter to the calibration. More... | |
void | AddOperator (enum math_cal_op_type input) |
Adds a mathematical operator to the calibration. More... | |
int32_t | SetPacket (Packet *input) |
int32_t | Calibrate (double input_value, double &output_value) |
Performs the calibration on the input value. More... | |
bool | IsValid () |
Validates the math calibrator. If it is invalid GetValidationError can be used to see the validation errors.. More... | |
const char * | GetValidationError () |
Return a string for any errors discovered by IsValid. | |
uint32_t | GetNumberOfItems () |
Returns the number of in calibration. More... | |
int32_t | GetItem (uint32_t item_num, math_cal_item &item) |
Gets the specified item for the calibrator. More... | |
![]() | |
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. | |
![]() | |
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... | |
void | SetPath (const char *input_ptr) |
Sets the path for 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. | |
const char * | GetPath () |
Returns the path for the item. | |
int32_t | AddAttribute (const char *name, const char *value) |
Adds an attribute to the item. More... | |
void | GetAttributeList (StringArray &attr_array) |
Gets a list of the attribute names. More... | |
int32_t | GetAttribute (const char *name, char *value, uint32_t &value_len) |
Get the value of the specified attribute. More... | |
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 mathematical equation.
The math calibrator uses reverse Polish notation and is limited to the following operators: +, -, *, /, ^, and ln. The math calibrator can use the value of this parameter, the converted or calbirated value of another parameter in the same packet, and constants.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
int32_t trek::MathCalibrator::AddAnotherParameterValue | ( | const char * | name, |
uint32_t | instance = 1 , |
||
bool | calibrated = true |
||
) |
Adds the value for another parameter to the calibration.
[in] | name | The name of the other parameter. |
[in] | instance | The sample number to use (first sample is 1). |
[in] | calibrator | Indicates to use the calibrated value of parameter if set to true. |
Example:
void trek::MathCalibrator::AddConstant | ( | double | input_value | ) |
Adds a constant value for the calibration.
[in] | input_value | The value to add. |
Example:
void trek::MathCalibrator::AddOperator | ( | enum math_cal_op_type | input | ) |
Adds a mathematical operator to the calibration.
[in] | input | - The math operator to add. |
Example:
void trek::MathCalibrator::AddThisValue | ( | ) |
Adds the value for this parameter to the calibration.
Example:
|
virtual |
Performs the calibration on the input value.
[in] | input_value | Value to calibrate. |
[out] | output_value | Calibrated value. |
Example:
Implements trek::Calibrator.
int32_t trek::MathCalibrator::GetItem | ( | uint32_t | item_num, |
math_cal_item & | item | ||
) |
Gets the specified item for the calibrator.
Example:
uint32_t trek::MathCalibrator::GetNumberOfItems | ( | ) |
Returns the number of in calibration.
Example:
bool trek::MathCalibrator::IsValid | ( | ) |
Validates the math calibrator. If it is invalid GetValidationError can be used to see the validation errors..
Example:
int32_t trek::MathCalibrator::LoadFile | ( | const char * | filename | ) |
Loads the MathCalibrator definition from the specified file.
Reads an XML format for the MathCalibrator. It can be written in with SaveFile.
[in] | filename | The file to load the parameter object from. |
Example:
int32_t trek::MathCalibrator::SaveFile | ( | const char * | filename | ) |
Saves the MathCalibrator definition to the specified file.
Writes an XML format for the MathCalibrator. It can be read in with LoadFile.
[in] | filename | The file to save the parameter object to. |
Example: