TReK C++
5.3.2
Telemetry/Command API
|
This class describes a single parameter within a telemetry or command message including its value. More...
#include <parameter.h>
Inherits trek::NamedItem.
Public Member Functions | |
Parameter () | |
Default constructor. | |
Parameter (Parameter &input) | |
Copy constructor. | |
virtual | ~Parameter () |
Class destructor. More... | |
int32_t | FindLastBit (uint32_t &last_bit) |
Finds the last bit used when building the parameter. More... | |
int32_t | Build (uint8_t *input_ptr, uint32_t *last_bit_ptr) |
Builds the parameter and places it in the specified buffer. More... | |
int32_t | Extract (uint8_t *input_ptr, uint32_t input_length, uint32_t &last_bit_used) |
Extracts the parameter from the specified buffer. More... | |
Parameter * | Clone () |
Creates and returns an extact copy of the object. | |
void | operator= (Parameter &right_side) |
Provides the equal operator. | |
BaseEnumerator * | GetEnumerator () |
Returns a copy of the enumerator. More... | |
EnumeratorSwitchSet * | GetEnumeratorSwitchSet () |
Returns a copy of the enumerator switch set. More... | |
Calibrator * | GetCalibrator () |
Returns a copy of the calibrator. More... | |
CalibratorSwitchSet * | GetCalibratorSwitchSet () |
Returns a copy of the calibrator switch set. More... | |
LimitAlarm * | GetLimits () |
Returns a copy of the limit alarm. More... | |
LimitAlarmSwitchSet * | GetLimitAlarmSwitchSet () |
Returns a copy of the limit alarm switch set. More... | |
ExpectedStateAlarm * | GetExpectedStateAlarm () |
Returns a copy of the expected state alarm. More... | |
ExpectedStateAlarmSwitchSet * | GetExpectedStateAlarmSwitchSet () |
Returns a copy of the expected state alarm switch set. More... | |
void | ClearDefaultCalibrator () |
Removes the default calibrator from the Parameter. | |
void | ClearCalibratorSwitchSet () |
Removes the calibrator switch set from the Parameter. | |
void | ClearEnumerator () |
Removes the enumerator from the Parameter. | |
void | ClearEnumeratorSwitchSet () |
Removes the enumerator switch set from the Parameter. | |
void | ClearLimits () |
Removes limits from the Parameter. | |
void | ClearLimitAlarmSwitchSet () |
Removes the enumerator switch set from the Parameter. | |
void | ClearExpectedStateAlarm () |
Removes expected state alarm from the Parameter. | |
void | ClearExpectedStateAlarmSwitchSet () |
Removes the enumerator switch set from the Parameter. | |
void | Init () |
Initializes the object. More... | |
virtual const char * | GetElementName () |
The name used for identifying this class in XML. | |
void | SetParentPacket (Packet *input) |
Sets the parent of this parameter to allow look up of external dependencies. | |
Configure Methods | |
These methods configure the parameter object. | |
int32_t | SetDataType (parameter_data_type input_type, uint32_t input_len, byte_order_type input_order=BIG_ENDIAN_BYTE_ORDER, bool var_len=false) |
Sets the data type, length, and byte order for the parameter. More... | |
void | SetEngineeringUnits (const char *input_ptr) |
Sets the engineering units for the parameter. More... | |
int32_t | SetStartBit (uint32_t input) |
Sets the start location for the parameter as bits. More... | |
int32_t | SetNumberOfSamples (uint32_t input) |
Sets the number of samples for the parameter. More... | |
void | SetSampleOffset (uint32_t input) |
Sets the sample offset for the parameter. More... | |
int32_t | SetNumberOfSyllables (uint32_t input) |
Sets the number of syllables for the parameter. More... | |
int32_t | SetSyllableInfo (uint32_t syll_num, uint32_t start_bit, uint32_t length) |
Sets the start bit and length for a syllable in a parameter. More... | |
void | SetModifiableFlag (bool input) |
Sets the modifiable flag for the parameter. More... | |
void | SetLowRangeFlag (bool input) |
Sets the low range flag for the parameter. More... | |
void | SetHighRangeFlag (bool input) |
Sets the high range flag for the parameter. More... | |
int32_t | SetIntegerLowRange (int64_t input) |
Sets the low range value for a parameter that is stored as a signed integer (ST_SIGNED_64). More... | |
int32_t | SetIntegerHighRange (int64_t input) |
Sets the high range value for a parameter that is stored as a signed integer (ST_SIGNED_64). More... | |
int32_t | SetUnsignedLowRange (uint64_t input) |
Sets the low range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64). More... | |
int32_t | SetUnsignedHighRange (uint64_t input) |
Sets the high range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64). More... | |
int32_t | SetDoubleLowRange (double input) |
Sets the low range value for a parameter that is stored as a floating point (ST_DOUBLE). More... | |
int32_t | SetDoubleHighRange (double input) |
Sets the high range value for a parameter that is stored as a floating point (ST_DOUBLE). More... | |
int32_t | AddDependency (Dependency &input) |
Adds a dependency for the parameter. More... | |
void | ClearDependencies () |
Removes all dependencies for a parameter. More... | |
uint32_t | GetNumberOfDependencies () |
Gets the number of dependencies for a parameter. More... | |
Dependency * | GetDependency (uint32_t num) |
Gets the specified dependency for a parameter. More... | |
void | SetEnumerator (Enumerator &input) |
Sets the enumerator to be used for this parameter. More... | |
void | SetRangeEnumerator (RangeEnumerator &input) |
Sets the range enumerator to be used for this parameter. More... | |
void | SetEnumeratorSwitchSet (EnumeratorSwitchSet *input) |
Sets the enumerator switch set to be used for this parameter. More... | |
void | SetEnumeratorSwitchSet (EnumeratorSwitchSet &input) |
Sets the enumerator switch set to be used for this parameter. More... | |
void | SetDefaultCalibrator (Calibrator &input) |
Sets the calibrator to be used for this parameter. More... | |
void | SetDefaultCalibrator (Calibrator *input) |
Sets the calibrator to be used for this parameter. More... | |
void | SetCalibratorSwitchSet (CalibratorSwitchSet &input) |
Sets the calibrator switch set to be used for this parameter. More... | |
void | SetCalibratorSwitchSet (CalibratorSwitchSet *input) |
Sets the calibrator switch set to be used for this parameter. More... | |
void | SetLimits (LimitAlarm &input) |
Sets the limits to be used for this parameter. More... | |
void | SetLimitAlarmSwitchSet (LimitAlarmSwitchSet &input) |
Sets the limit alarm switch set to be used for this parameter. More... | |
void | SetExpectedStateAlarm (ExpectedStateAlarm &input) |
Sets the expected state to be used for this parameter. More... | |
void | SetExpectedStateAlarmSwitchSet (ExpectedStateAlarmSwitchSet &input) |
Sets the expected state switch set to be used for this parameter. More... | |
void | SetFullName (const char *input) |
Sets the full name for the parameter. More... | |
int32_t | SetDataFormat (parameter_data_format input) |
Sets the data format for the printing the parameter to a string. More... | |
void | SetExternalNumSamplesParameter (const char *name) |
Sets the name of the parameter to use as the number of samples available for the parameter. More... | |
void | SetExternalStatusParameter (const char *name) |
Sets the name of the parameter to use as the source status for the parameter. More... | |
void | ClearExternalNumSamples () |
Clears the external number of samples parameter. More... | |
void | ClearExternalStatus () |
Clears the external status parameter. More... | |
const char * | GetExternalNumSamplesParameter () |
Gets the name of the external number of samples parameter. More... | |
const char * | GetExternalStatusParameter () |
Gets the name of the external status parameter. More... | |
void | SetCalibrateBeforeAlarmCheck (bool input=true) |
Sets a flag to indicate if alarm checks are performed prior to or after calibration. More... | |
void | SetContinueOnRangeError (bool input=false) |
Sets a flag to indicate if processing can continue if a range error is detected. More... | |
void | AllowInvalidData () |
Sets the Parameter to allow invalid combinations of input. More... | |
bool | IsValid () |
Checks to see if a parameter is valid. More... | |
bool | Validate (uint32_t &num_errors, uint32_t &num_warnings, const char **validation_messages=0) |
Validates the parameter. More... | |
void | SetAutoClear (bool input) |
Sets the auto clear behavior of the parameter instance. More... | |
bool | GetAutoClear () |
Gets the auto clear behavior of the parameter instance. More... | |
Set Value Methods | |
These methods set the value of the parameter. | |
int32_t | SetValue (int8_t input, uint16_t sample_number=1) |
Sets the value of the parameter with an 8-bit signed integer. More... | |
int32_t | SetValue (int16_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 16-bit signed integer. More... | |
int32_t | SetValue (int32_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 32-bit signed integer. More... | |
int32_t | SetValue (int64_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 64-bit signed integer. More... | |
int32_t | SetValue (uint8_t input, uint16_t sample_number=1) |
Sets the value of the parameter with an 8-bit unsigned integer. More... | |
int32_t | SetValue (uint16_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 16-bit unsigned integer. More... | |
int32_t | SetValue (uint32_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 32-bit unsigned integer. More... | |
int32_t | SetValue (uint64_t input, uint16_t sample_number=1) |
Sets the value of the parameter with a 64-bit unsigned integer. More... | |
int32_t | SetValue (float input, uint16_t sample_number=1) |
Sets the value of the parameter with a 32-bit floating point. More... | |
int32_t | SetValue (double input, uint16_t sample_number=1) |
Sets the value of the parameter with a 64-bit floating point. More... | |
int32_t | SetValue (bool input, uint16_t sample_number=1) |
Sets the value of the parameter with a boolean. More... | |
int32_t | SetValue (const char *input_ptr, uint16_t sample_number=1) |
Sets the value of the parameter with a NULL terminated string. More... | |
int32_t | SetValue (uint8_t *input_ptr, uint32_t input_len, uint16_t sample_number=1) |
Sets the value of the parameter with binary data. More... | |
int32_t | SetValue (TrekTime &input, uint16_t sample_number=1) |
Sets the value of the parameter with a TrekTime object. More... | |
int32_t | SetValueFromString (const char *value_str, parameter_data_format data_fmt, uint16_t sample_number=1) |
Sets the value of the parameter from a string by interpreting the format. More... | |
void | ClearValue () |
Removes the value for the parameter. More... | |
Get Value Methods | |
These methods get the value of the parameter. | |
int32_t | GetValue (int8_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as an 8-bit signed integer. More... | |
int32_t | GetValue (int8_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as an 8-bit signed integer and its associated status. More... | |
int32_t | GetValue (int16_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 16-bit signed integer. More... | |
int32_t | GetValue (int16_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 16-bit signed integer and its associated status. More... | |
int32_t | GetValue (int32_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit signed integer. More... | |
int32_t | GetValue (int32_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit signed integer and its associated status. More... | |
int32_t | GetValue (int64_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit signed integer. More... | |
int32_t | GetValue (int64_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit signed integer and its associated status. More... | |
int32_t | GetValue (uint8_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as an 8-bit unsigned integer. More... | |
int32_t | GetValue (uint8_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as an 8-bit unsigned integer and its associated status. More... | |
int32_t | GetValue (uint16_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 16-bit unsigned integer. More... | |
int32_t | GetValue (uint16_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 16-bit unsigned integer and its associated status. More... | |
int32_t | GetValue (uint32_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit unsigned integer. More... | |
int32_t | GetValue (uint32_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit unsigned integer and its associated status. More... | |
int32_t | GetValue (uint64_t &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit unsigned integer. More... | |
int32_t | GetValue (uint64_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit unsigned integer and its associated status. More... | |
int32_t | GetValue (float &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit floating point. More... | |
int32_t | GetValue (float &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 32-bit floating point and its associated status. More... | |
int32_t | GetValue (double &input, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit floating point. More... | |
int32_t | GetValue (double &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a 64-bit floating point and its associated status. More... | |
int32_t | GetValue (bool &input, uint16_t sample_number=1) |
Gets the value of a parameter as a boolean. More... | |
int32_t | GetValue (bool &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a boolean and its associated status. More... | |
int32_t | GetValue (char *input_ptr, uint32_t length, uint16_t sample_number=1) |
Gets the value of a parameter as a char array. More... | |
int32_t | GetValue (char *input_ptr, uint32_t length, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a char array. More... | |
int32_t | GetValue (TrekTime &input, uint16_t sample_number=1) |
Gets the value of a parameter as a TrekTime. More... | |
int32_t | GetValue (TrekTime &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the value of a parameter as a TrekTime. More... | |
int32_t | GetValue (uint8_t *input_ptr, uint32_t *num_bits_ptr, uint16_t sample_number=1) |
Gets the "raw" value of a parameter. More... | |
int32_t | GetValue (uint8_t *input_ptr, uint32_t *num_bits_ptr, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the "raw" value of a parameter and its associated status. More... | |
int32_t | GetEnumeratedValue (char *output_str, uint32_t *size_of_output, uint16_t sample_number=1) |
Get the enumerated value for a parameter. More... | |
int32_t | GetEnumeratedValue (char *output_str, uint32_t *size_of_output, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the enumerated value of a parameter and its associated status. More... | |
int32_t | GetCalibratedValue (double &output, uint16_t sample_number=1) |
Gets the calibrated value of a parameter as a 64-bit floating point. More... | |
int32_t | GetCalibratedValue (double &output, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Gets the calibrated value of a parameter as a 64-bit floating point and its associated status. More... | |
const char * | GetValueAsString (uint16_t sample_number=1) |
Returns the value of the parameter as a string. More... | |
const char * | GetValueAsString (uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1) |
Returns the value of the parameter as a string and its associated status. More... | |
![]() | |
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. | |
Figure Methods | |
These methods help you figure out how the parameter is configured. | |
parameter_data_type | GetDataType () |
Gets the data type for the parameter. More... | |
uint32_t | GetLength () |
Gets the length of the parameter. More... | |
const char * | GetEngineeringUnits () |
Gets the engineering units of the parameter. More... | |
uint32_t | GetStartBit () |
Gets the start bit of the parameter. More... | |
byte_order_type | GetByteOrder () |
Gets the byte order for the parameter. More... | |
uint32_t | GetNumberOfSamples () |
Gets the number of samples for the parameter. More... | |
uint32_t | GetSampleOffset () |
Gets the sample offset for the parameter. More... | |
uint32_t | GetNumberOfSyllables () |
Gets the number of syllables for the parameter. More... | |
int32_t | GetSyllableInfo (uint32_t syll_num, uint32_t &start_bit, uint32_t &length) |
Gets the start bit and length for a syllable in a parameter. More... | |
const char * | GetFullName () |
Returns the full name for the parameter. | |
parameter_data_format | GetDataFormat () |
Returns the data format enumeration. | |
const char * | GetDataTypeAsString () |
Returns the data type for the parameter as a string. More... | |
const char * | GetByteOrderAsString () |
Returns the byte order for the parameter as a string. More... | |
const char * | GetDataFormatAsString () |
Returns the data format for the parameter as a string. More... | |
bool | IsVariableLength () |
Identifies if the parameter can have a variable length. More... | |
bool | IsModifiable () |
Identifies if the parameter can be modified. More... | |
bool | HasValue () |
Identifies if the parameter currently has a value. More... | |
bool | HasLimits () |
Identifies if the parameter currently has limits defined. More... | |
bool | HasExpectedState () |
Identifies if the parameter currently has an expected state defined. More... | |
bool | HasEnumerator () |
Identifies if the parameter currently has an enumerator defined. More... | |
bool | HasCalibrator () |
Identifies if the parameter currently has calibration defined. More... | |
bool | UseLowRange () |
Identifies if a low range value is currently in use. More... | |
bool | UseHighRange () |
Identifies if a high range value is currently in use. More... | |
int64_t | GetIntegerLowRange () |
Returns the low range value of a data type that is stored as a signed integer (ST_SIGNED_64). More... | |
int64_t | GetIntegerHighRange () |
Returns the high range value of a data type that is stored as a signed integer (ST_SIGNED_64). More... | |
uint64_t | GetUnsignedLowRange () |
Returns the low range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64). More... | |
uint64_t | GetUnsignedHighRange () |
Returns the high range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64). More... | |
double | GetDoubleLowRange () |
Returns the low range value of a data type that is stored as a double (ST_DOUBLE). More... | |
double | GetDoubleHighRange () |
Returns the high range value of a data type that is stored as a double (ST_DOUBLE). More... | |
bool | GetCalibrateBeforeAlarmCheck () |
Identifies if the parameter value is calibrated prior to alarm checking the value. More... | |
bool | GetContinueOnRangeError () |
Identifies if parameter processing will continue on a range error. More... | |
Serialization Methods | |
These methods help read and write the class to disk or memory. Most users will not be interested in these. Those that are can continue reading. | |
int32_t | LoadFile (const char *filename) |
Loads the Parameter definition from the specified file. More... | |
int32_t | SaveFile (const char *filename) |
Saves the Parameter definition to the specified file. More... | |
This class describes a single parameter within a telemetry or command message including its value.
The parameter can have one or more samples. Most users will only use the Get/Set value methods along with Build and Extract.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
int32_t trek::Parameter::AddDependency | ( | Dependency & | input | ) |
Adds a dependency for the parameter.
Adds the dependency specified for this parameter. If all dependency checks are positive, the parameter will be placed in the packet (Packet::Build()) or retrieved from the packet (Packet::Extract()).
[in] | input | The dependency to add. |
Example:
void trek::Parameter::AllowInvalidData | ( | ) |
Sets the Parameter to allow invalid combinations of input.
The Parameter class by default will not allow invalid input. Calling this method will allow invalid data, but will require that the Parameter::Validate() method returns true prior to using many of the other methods (e.g., GetValue(), Build(), ToXml()). This allows input of data in any order.
Example:
int32_t trek::Parameter::Build | ( | uint8_t * | input_ptr, |
uint32_t * | last_bit_ptr | ||
) |
Builds the parameter and places it in the specified buffer.
The parameter is converted to the data type specified from the local representation of the data. The last bit used in the buffer is returned as last_bit_ptr. The data is placed according to the start bit, length, number of samples, and sample offset.
[out] | input_ptr | The buffer to place the parameter. |
[out] | last_bit_ptr | Set to the last bit used if SUCCESS is returned. |
Example:
void trek::Parameter::ClearDependencies | ( | ) |
Removes all dependencies for a parameter.
Parameter will always appear in the packet when dependencies are removed.
Example:
void trek::Parameter::ClearExternalNumSamples | ( | ) |
Clears the external number of samples parameter.
The value set by SetNumberOfSamples will be used to retrieve data.
void trek::Parameter::ClearExternalStatus | ( | ) |
Clears the external status parameter.
The source status returned from calls to GetValue() will always be 0.
void trek::Parameter::ClearValue | ( | ) |
Removes the value for the parameter.
This can be used as a cheat to get around parameters that aren't modifiable.
int32_t trek::Parameter::Extract | ( | uint8_t * | input_ptr, |
uint32_t | input_length, | ||
uint32_t & | last_bit_used | ||
) |
Extracts the parameter from the specified buffer.
The parameter is converted from the data type specified to the local representation of the data. The last bit read from in the buffer is returned as last_bit_used. The data is extracted according to the start bit, length, number of samples, sample offset, etc.
[in] | input_ptr | The buffer to extract the parameter from. |
[in] | input_length | The valid number of bits that can be read from this buffer. |
[out] | last_bit_used | Set to the last bit read from if SUCCESS is returned. |
Example:
int32_t trek::Parameter::FindLastBit | ( | uint32_t & | last_bit | ) |
Finds the last bit used when building the parameter.
last_bit | If successful, set to the last bit used when building the parameter. |
Example:
bool trek::Parameter::GetAutoClear | ( | ) |
Gets the auto clear behavior of the parameter instance.
See SetAutoClear for details.
byte_order_type trek::Parameter::GetByteOrder | ( | ) |
Gets the byte order for the parameter.
Can call GetByteOrderAsString() to get the byte order in a printable format.
Example:
const char * trek::Parameter::GetByteOrderAsString | ( | ) |
Returns the byte order for the parameter as a string.
Example:
bool trek::Parameter::GetCalibrateBeforeAlarmCheck | ( | ) |
Identifies if the parameter value is calibrated prior to alarm checking the value.
Returns true is the parameter is calibrated prior to checking alarms. Otherwise, returns false.
Example:
int32_t trek::Parameter::GetCalibratedValue | ( | double & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the calibrated value of a parameter as a 64-bit floating point.
A calibrator must be defined for the parameter or TREK_DATA_CALIBRATOR_NOT_DEFINED is returned.
[out] | input | The variable to be populated with the Parameter's calibrated value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetCalibratedValue | ( | double & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the calibrated value of a parameter as a 64-bit floating point and its associated status.
A calibrator must be defined for the parameter or TREK_DATA_CALIBRATOR_NOT_DEFINED is returned. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's calibrated value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
Calibrator * trek::Parameter::GetCalibrator | ( | ) |
Returns a copy of the calibrator.
Value will be NULL (0) if calibrator does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
CalibratorSwitchSet * trek::Parameter::GetCalibratorSwitchSet | ( | ) |
Returns a copy of the calibrator switch set.
Value will be NULL (0) if calibrator switch set does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
bool trek::Parameter::GetContinueOnRangeError | ( | ) |
Identifies if parameter processing will continue on a range error.
Returns true if processing will continue on detection of a range error. Otherwise, returns false.
Example:
const char * trek::Parameter::GetDataFormatAsString | ( | ) |
Returns the data format for the parameter as a string.
Example:
parameter_data_type trek::Parameter::GetDataType | ( | ) |
Gets the data type for the parameter.
You can get the value as a string by calling GetDataTypeAsString().
Example:
const char * trek::Parameter::GetDataTypeAsString | ( | ) |
Returns the data type for the parameter as a string.
Example:
Dependency * trek::Parameter::GetDependency | ( | uint32_t | num | ) |
Gets the specified dependency for a parameter.
Dependency numbers are zero based. This method will return a NULL value if the dependency does not exist. The caller of this method is responsible for deleting the pointer when it is no longer needed.
Example:
double trek::Parameter::GetDoubleHighRange | ( | ) |
Returns the high range value of a data type that is stored as a double (ST_DOUBLE).
You should check UseHighRange to see if the value is being used.
Example:
double trek::Parameter::GetDoubleLowRange | ( | ) |
Returns the low range value of a data type that is stored as a double (ST_DOUBLE).
You should check UseLowRange to see if the value is being used.
Example:
const char * trek::Parameter::GetEngineeringUnits | ( | ) |
Gets the engineering units of the parameter.
Example:
int32_t trek::Parameter::GetEnumeratedValue | ( | char * | output_str, |
uint32_t * | size_of_output, | ||
uint16_t | sample_number = 1 |
||
) |
Get the enumerated value for a parameter.
[out] | output_str | The enumerated value if SUCCESS is returned |
[in,out] | size_of_output | The size of the output buffer. If return code is TREK_DATA_NOT_ENOUGH_SPACE, then this value is reset to the number of bytes required for the given enumerated value. |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetEnumeratedValue | ( | char * | output_str, |
uint32_t * | size_of_output, | ||
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the enumerated value of a parameter and its associated status.
The trek_status and src_status can be used with ParameterStatus.
[out] | output_str | The enumerated value if SUCCESS is returned |
[in,out] | size_of_output | The size of the output buffer. If return code is TREK_DATA_NOT_ENOUGH_SPACE, then this value is reset to the number of bytes required for the given enumerated value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
BaseEnumerator * trek::Parameter::GetEnumerator | ( | ) |
Returns a copy of the enumerator.
Value will be NULL (0) if enumerator does not exist. The caller of this method is responsible for deleting the associated memory. You can call the Enumerator::GetElementName() method to determine the type of enumerator as needed.
Example:
EnumeratorSwitchSet * trek::Parameter::GetEnumeratorSwitchSet | ( | ) |
Returns a copy of the enumerator switch set.
Value will be NULL (0) if enumerator switch set does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
ExpectedStateAlarm * trek::Parameter::GetExpectedStateAlarm | ( | ) |
Returns a copy of the expected state alarm.
Value will be NULL (0) if an expected state alarm does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
ExpectedStateAlarmSwitchSet * trek::Parameter::GetExpectedStateAlarmSwitchSet | ( | ) |
Returns a copy of the expected state alarm switch set.
Value will be NULL (0) if expected state alarm switch set does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
const char * trek::Parameter::GetExternalNumSamplesParameter | ( | ) |
Gets the name of the external number of samples parameter.
Will return an empty string if no parameter is defined.
const char * trek::Parameter::GetExternalStatusParameter | ( | ) |
Gets the name of the external status parameter.
Will return an empty string if no parameter is defined.
int64_t trek::Parameter::GetIntegerHighRange | ( | ) |
Returns the high range value of a data type that is stored as a signed integer (ST_SIGNED_64).
You should check UseHighRange to see if the value is being used.
Example:
int64_t trek::Parameter::GetIntegerLowRange | ( | ) |
Returns the low range value of a data type that is stored as a signed integer (ST_SIGNED_64).
You should check UseLowRange to see if the value is being used.
Example:
uint32_t trek::Parameter::GetLength | ( | ) |
LimitAlarmSwitchSet * trek::Parameter::GetLimitAlarmSwitchSet | ( | ) |
Returns a copy of the limit alarm switch set.
Value will be NULL (0) if limit alarm switch set does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
LimitAlarm * trek::Parameter::GetLimits | ( | ) |
Returns a copy of the limit alarm.
Value will be NULL (0) if limit alarm does not exist. The caller of this method is responsible for deleting the associated memory.
Example:
uint32_t trek::Parameter::GetNumberOfDependencies | ( | ) |
Gets the number of dependencies for a parameter.
Parameter will always appear in the packet when dependencies are removed.
Example:
uint32_t trek::Parameter::GetNumberOfSamples | ( | ) |
Gets the number of samples for the parameter.
Example:
uint32_t trek::Parameter::GetNumberOfSyllables | ( | ) |
Gets the number of syllables for the parameter.
Example:
uint32_t trek::Parameter::GetSampleOffset | ( | ) |
Gets the sample offset for the parameter.
Only applicable for parameters with number of samples greater than 1.
Example:
uint32_t trek::Parameter::GetStartBit | ( | ) |
Gets the start bit of the parameter.
Example:
int32_t trek::Parameter::GetSyllableInfo | ( | uint32_t | syll_num, |
uint32_t & | start_bit, | ||
uint32_t & | length | ||
) |
Gets the start bit and length for a syllable in a parameter.
[in] | syll_num | The syllable number to change for the parameter. Syllable numbers start at 1. |
[in] | start_bit | The start bit for the syllable. |
[in] | length | The length for the syllable. |
Example:
uint64_t trek::Parameter::GetUnsignedHighRange | ( | ) |
Returns the high range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).
You should check UseHighRange to see if the value is being used.
Example:
uint64_t trek::Parameter::GetUnsignedLowRange | ( | ) |
Returns the low range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).
You should check UseLowRange to see if the value is being used.
Example:
int32_t trek::Parameter::GetValue | ( | bool & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a boolean.
The Parameter's data type must be a boolean.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | bool & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a boolean and its associated status.
The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | char * | input_ptr, |
uint32_t | length, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a char array.
The Parameter's data type must be either DT_NULL_TERMINATED_STRING or DT_FIXED_LENGTH_STRING.
[out] | input_ptr | The variable to be populated with the Parameter's value. |
[in] | length | The number of bytes available in input. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | char * | input_ptr, |
uint32_t | length, | ||
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a char array.
The Parameter's data type must be either DT_NULL_TERMINATED_STRING or DT_FIXED_LENGTH_STRING.
[out] | input_ptr | The variable to be populated with the Parameter's value. |
[in] | length | The number of bytes available in input. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | double & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit floating point.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | double & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit floating point and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | float & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit floating point.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | float & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit floating point and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int16_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 16-bit signed integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int16_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 16-bit signed integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int32_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit signed integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int32_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit signed integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int64_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit signed integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int64_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit signed integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int8_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as an 8-bit signed integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | int8_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as an 8-bit signed integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | TrekTime & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a TrekTime.
The Parameter's data type must be a time type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | TrekTime & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a TrekTime.
The Parameter's data type must be a time type.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint16_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 16-bit unsigned integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint16_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 16-bit unsigned integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint32_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit unsigned integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint32_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 32-bit unsigned integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint64_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit unsigned integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint64_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as a 64-bit unsigned integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint8_t & | input, |
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as an 8-bit unsigned integer.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.
[out] | input | The variable to be populated with the Parameter's value. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint8_t & | input, |
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the value of a parameter as an 8-bit unsigned integer and its associated status.
If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.
[out] | input | The variable to be populated with the Parameter's value. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint8_t * | input_ptr, |
uint32_t * | num_bits_ptr, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the "raw" value of a parameter.
For Parameters with a data type of DT_UNSPECIFIED_BYTES this is the only way to get its value.
[out] | input_ptr | The variable to be populated with the Parameter's value. For non-byte boundary data, the data is right justified. |
[in,out] | num_bits_ptr | The number of bits available in input. Also the number of bits of valid data on the output. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::GetValue | ( | uint8_t * | input_ptr, |
uint32_t * | num_bits_ptr, | ||
uint32_t & | trek_status, | ||
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Gets the "raw" value of a parameter and its associated status.
For Parameters with a data type of DT_UNSPECIFIED_BYTES this is the only way to get its value. The trek_status and src_status can be used with ParameterStatus.
[out] | input_ptr | The variable to be populated with the Parameter's value. For non-byte boundary data, the data is right justified. |
[in,out] | num_bits_ptr | The number of bits available in input. Also the number of bits of valid data on the output. |
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
const char * trek::Parameter::GetValueAsString | ( | uint16_t | sample_number = 1 | ) |
Returns the value of the parameter as a string.
The format of the string is based on the data type and the value set for data format (SetDataFormat). If the parameter has no value, an empty string is returned. If the sample is not found, "?" is returned...sans quotes. If a parameter is invalid, the string "!" is returned.
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
const char * trek::Parameter::GetValueAsString | ( | uint32_t & | trek_status, |
uint32_t & | src_status, | ||
uint16_t | sample_number = 1 |
||
) |
Returns the value of the parameter as a string and its associated status.
The format of the string is based on the data type and the value set for data format (SetDataFormat). If the parameter has no value, an empty string is returned. If the sample is not found, "?" is returned...sans quotes. If a parameter is invalid, the string "!" is returned. The trek_status and src_status can be used with ParameterStatus.
[out] | trek_status | The status associated with TReK processing. |
[out] | src_status | The status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0. |
[in] | sample_number | Optional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample). |
Example:
bool trek::Parameter::HasCalibrator | ( | ) |
Identifies if the parameter currently has calibration defined.
Returns true is the parameter has calibration. Otherwise, returns false.
Example:
bool trek::Parameter::HasEnumerator | ( | ) |
Identifies if the parameter currently has an enumerator defined.
Returns true is the parameter has an enumerator. Otherwise, returns false.
Example:
bool trek::Parameter::HasExpectedState | ( | ) |
Identifies if the parameter currently has an expected state defined.
Returns true is the parameter has an expected state. Otherwise, returns false.
Example:
bool trek::Parameter::HasLimits | ( | ) |
Identifies if the parameter currently has limits defined.
Returns true is the parameter has limits. Otherwise, returns false.
Example:
bool trek::Parameter::HasValue | ( | ) |
|
virtual |
Initializes the object.
This method can be called to reinitialize a parameter to its default configuration. It is useful if you want to reuse the same object as shown in the example below.
Example:
Reimplemented from trek::NamedItem.
bool trek::Parameter::IsModifiable | ( | ) |
Identifies if the parameter can be modified.
Returns true is the parameter can be modified. Otherwise, returns false.
Example:
bool trek::Parameter::IsValid | ( | ) |
Checks to see if a parameter is valid.
Example:
bool trek::Parameter::IsVariableLength | ( | ) |
Identifies if the parameter can have a variable length.
Returns true is the parameter has a variable length. Otherwise, returns false.
Example:
int32_t trek::Parameter::LoadFile | ( | const char * | filename | ) |
Loads the Parameter definition from the specified file.
Reads an XML format for the Parameter. It can be written in with SaveFile.
[in] | filename | The file to load the parameter object from. |
Example:
int32_t trek::Parameter::SaveFile | ( | const char * | filename | ) |
Saves the Parameter definition to the specified file.
Writes an XML format for the Parameter. It can be read in with LoadFile.
[in] | filename | The file to save the parameter object to. |
Example:
void trek::Parameter::SetAutoClear | ( | bool | input | ) |
Sets the auto clear behavior of the parameter instance.
By default a parameter value is cleared prior to extracting new values so that the parameter will not have a value if extraction fails (e.g., the parameter does not exist in that packet instance). This behavior can be turned off by passing in false to this method. When turned off the parameter will contain the previous value if extraction fails.
[in] | input | New value for auto clear. |
void trek::Parameter::SetCalibrateBeforeAlarmCheck | ( | bool | input = true | ) |
Sets a flag to indicate if alarm checks are performed prior to or after calibration.
True indicates that the parameter is calibrated prior to checking for alarm violations if calibration is available. If false, alarm violations are checked on the non-calibrated value. The default value is true.
[in] | input | The new calibrate before sensing option for the parameter. |
Example:
void trek::Parameter::SetCalibratorSwitchSet | ( | CalibratorSwitchSet & | input | ) |
Sets the calibrator switch set to be used for this parameter.
The calibrator switch set can contain any of the supplied TReK calibrators such as PolynomialCalibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.
[in] | input | The new calibrator switch set. |
Example:
void trek::Parameter::SetCalibratorSwitchSet | ( | CalibratorSwitchSet * | input | ) |
Sets the calibrator switch set to be used for this parameter.
The calibrator switch set can contain any of the supplied TReK calibrators such as PolynomialCalibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.
[in] | input | The new calibrator switch set. |
Example:
void trek::Parameter::SetContinueOnRangeError | ( | bool | input = false | ) |
Sets a flag to indicate if processing can continue if a range error is detected.
True indicates that a range error will not stop processing of the data (including calibration). False will stop processing of the parameter when a range error is detected The default value is false.
[in] | input | The new continue on range error option for the parameter. |
Example:
int32_t trek::Parameter::SetDataFormat | ( | parameter_data_format | input | ) |
Sets the data format for the printing the parameter to a string.
Will create the format for GetValueAsString. Currently ignored.
[in] | input | The new data format. |
Example:
int32_t trek::Parameter::SetDataType | ( | parameter_data_type | input_type, |
uint32_t | input_len, | ||
byte_order_type | input_order = BIG_ENDIAN_BYTE_ORDER , |
||
bool | var_len = false |
||
) |
Sets the data type, length, and byte order for the parameter.
The allowed length for each data type is shown in the table below. A byte order of LITTLE_ENDIAN_BYTE_ORDER is only allowed for certain data types when they are on byte boundaries. The number of samples will be reset to 1. Only a single variable length parameter is supported in a Packet. Multiple variable length parameters within a Packet will cause the Packet::Validate() method to fail.
[in] | input_type | The data type for the parameter |
[in] | input_len | The length of the parameter in bits |
[in] | input_order | The byte order of the data type |
[in] | var_len | Boolean indicating if the data can be variable length |
Data Type | Description | Valid Length (bits) | Byte Order Allowed | Variable Length |
DT_TWOS_COMPLEMENT | Two's complement signed integer | 2-64 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER | No |
DT_UNSIGNED_INTEGER | Unsigned integer | 1-64 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER | No |
DT_BINARY_CODED_DECIMAL | Binary coded decimal | 4, 8, 12, 16 | BIG_ENDIAN_BYTE_ORDER | No |
DT_DISTENDED_SIGNED_INTEGER | Distended signed integer | 16 or 32 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER | No |
DT_SIGN_AND_MAGNITUDE_INTEGER | Sign and magnitude integer | 2-32 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER | No |
DT_IEEE_FLOATING_POINT | Single or double precision IEEE floating point | 32 or 64 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER | No |
DT_NULL_TERMINATED_STRING | ASCII string terminated by a NULL (0x00) character | 16-524,288* | BIG_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER | Yes |
DT_FIXED_LENGTH_STRING | ASCII string of fixed length that may or may not contain a terminating character | 8-524,288* | BIG_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER | No |
DT_BOOLEAN | Single bit value where 1 indicates true and 0 indicates false | 1 | BIG_ENDIAN_BYTE_ORDER | No |
DT_UNSPECIFIED_BYTES | Binary data that has no type | 8-524,288* | BIG_ENDIAN_BYTE_ORDER | Yes |
DT_GPS_EPOCH_TIME | Number of seconds since 1980-01-06 | 32 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER | No |
DT_EHS_TIME | Time found in the EHS Primary Protocol Header. 52 and 56 bit versions have resolution to one tenth of a second. Flag fields are not processed. | 48, 52, 56 | BIG_ENDIAN_BYTE_ORDER | No |
DT_ISS_TIME | 40 bits (32-bit seconds since GPS plus 8 bit fractional time...1 bit = ~4ms) | 40 | BIG_ENDIAN_BYTE_ORDER | No |
DT_FASTSAT_TIME | 32-bit seconds since GPS with 16-bit millisec (max value 999) | 48 | BIG_ENDIAN_BYTE_ORDER | No |
DT_DEM_TIME | 32-bit seconds since GPS with 10-bit millisec (max value 999) | 42 | BIG_ENDIAN_BYTE_ORDER | No |
DT_UNIX_TIME | Number of seconds since 1970-01-01 | 32 | BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER | No |
DT_EHS_CONV_TIME | Special time conversion provided by EHS GSE time data. | 320 | BIG_ENDIAN_BYTE_ORDER | No |
DT_ISAT_TIME | 32-bit seconds since 1970-01-01 with 16-bit millisec (max value 999). | 48 | BIG_ENDIAN_BYTE_ORDER | No |
Length must be on a byte boundary.
Example:
void trek::Parameter::SetDefaultCalibrator | ( | Calibrator & | input | ) |
Sets the calibrator to be used for this parameter.
The calibrator can be on of the supplied TReK calibrators such as PolynomialCalibrator or a user calibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.
[in] | input | The new calibrator. |
Example:
void trek::Parameter::SetDefaultCalibrator | ( | Calibrator * | input | ) |
Sets the calibrator to be used for this parameter.
The calibrator can be on of the supplied TReK calibrators such as PolynomialCalibrator or a user calibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.
[in] | input | The new calibrator. |
Example:
int32_t trek::Parameter::SetDoubleHighRange | ( | double | input | ) |
Sets the high range value for a parameter that is stored as a floating point (ST_DOUBLE).
The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.
[in] | input | The new high range value for the parameter. |
Example:
int32_t trek::Parameter::SetDoubleLowRange | ( | double | input | ) |
Sets the low range value for a parameter that is stored as a floating point (ST_DOUBLE).
The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.
[in] | input | The new low range value for the parameter. |
Example:
void trek::Parameter::SetEngineeringUnits | ( | const char * | input | ) |
Sets the engineering units for the parameter.
Although there is no predefined maximum length for the engineering units, it may be truncated to fit in a selected schema. The engineering units are for reference/display only and do not affect the parameter's value.
[in] | input | The new engineering units for the parameter. |
Example:
void trek::Parameter::SetEnumerator | ( | Enumerator & | input | ) |
Sets the enumerator to be used for this parameter.
If the data type cannot be retrieved with a 32-bit unsigned integer, calls to GetEnumeratedValue will fail.
[in] | input | The new enumerator. If a enumerator already exists, it will be replaced. |
Example:
void trek::Parameter::SetEnumeratorSwitchSet | ( | EnumeratorSwitchSet & | input | ) |
Sets the enumerator switch set to be used for this parameter.
The enumerator switched set can contain any of the supplied TReK enumerators such as RangeEnumerator. The Parameter class makes a copy of the enumerator switch set. If an enumerator or enumerator switched set already exists, it will be replaced.
[in] | input | The new enumerator switch set. |
Example:
void trek::Parameter::SetEnumeratorSwitchSet | ( | EnumeratorSwitchSet * | input | ) |
Sets the enumerator switch set to be used for this parameter.
The enumerator switched set can contain any of the supplied TReK enumerators such as RangeEnumerator. The Parameter class makes a copy of the enumerator switch set. If an enumerator or enumerator switch set already exists, it will be replaced.
[in] | input | The new enumerator switch set. |
Example:
void trek::Parameter::SetExpectedStateAlarm | ( | ExpectedStateAlarm & | input | ) |
Sets the expected state to be used for this parameter.
[in] | input | The new expected state alarm. If an alarm already exists, it will be replaced. If any limits exist, they will be deleted. |
Example:
void trek::Parameter::SetExpectedStateAlarmSwitchSet | ( | ExpectedStateAlarmSwitchSet & | input | ) |
Sets the expected state switch set to be used for this parameter.
The expected state switched set can contains on or more ExpectedStateAlarm objects. The Parameter class makes a copy of the expected state alarm. If a expected state alarm or expected state alarm switch set already exists, it will be replaced.
[in] | input | The new expected state alarm switch set. |
Example:
void trek::Parameter::SetExternalNumSamplesParameter | ( | const char * | name | ) |
Sets the name of the parameter to use as the number of samples available for the parameter.
If the external number of samples parameter is set, the value set with SetNumberOfSamples will be considered the maximum number of samples allowed.
[in] | name | The name of the parameter holding the external number of samples (full name???) |
void trek::Parameter::SetExternalStatusParameter | ( | const char * | name | ) |
Sets the name of the parameter to use as the source status for the parameter.
If the external status parameter is set, parameter will return the value referenced by the name as the source status in calls to GetValue().
[in] | name | The name of the parameter holding the external number of samples (full name???) |
void trek::Parameter::SetFullName | ( | const char * | input | ) |
Sets the full name for the parameter.
Only used internally to TReK.
[in] | input | The full name for the parameter. |
Example:
void trek::Parameter::SetHighRangeFlag | ( | bool | input | ) |
Sets the high range flag for the parameter.
A value of true indicates that the parameter's value has a high range that should be checked. The default value is false.
[in] | input | The new high range flag for the parameter. |
Example:
int32_t trek::Parameter::SetIntegerHighRange | ( | int64_t | input | ) |
Sets the high range value for a parameter that is stored as a signed integer (ST_SIGNED_64).
The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.
[in] | input | The new high range value for the parameter. |
Example:
int32_t trek::Parameter::SetIntegerLowRange | ( | int64_t | input | ) |
Sets the low range value for a parameter that is stored as a signed integer (ST_SIGNED_64).
The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.
[in] | input | The new low range value for the parameter. |
Example:
void trek::Parameter::SetLimitAlarmSwitchSet | ( | LimitAlarmSwitchSet & | input | ) |
Sets the limit alarm switch set to be used for this parameter.
The limit alarm switched set can contains on or more LimitAlarm objects. The Parameter class makes a copy of the limit alarm. If a limit alarm or limit alarm switch set already exists, it will be replaced.
[in] | input | The new limit alarm switch set. |
Example:
void trek::Parameter::SetLimits | ( | LimitAlarm & | input | ) |
Sets the limits to be used for this parameter.
[in] | input | The new limits. If limits already exists, they will be replaced. This will also remove any expected state alarms. |
Example:
void trek::Parameter::SetLowRangeFlag | ( | bool | input | ) |
Sets the low range flag for the parameter.
A value of true indicates that the parameter's value has a low range that should be checked. The default value is false.
[in] | input | The new low range flag for the parameter. |
Example:
void trek::Parameter::SetModifiableFlag | ( | bool | input | ) |
Sets the modifiable flag for the parameter.
True indicates that the parameter can be modified. The default value is true.
[in] | input | The new modifiable flag for the parameter. |
Example:
int32_t trek::Parameter::SetNumberOfSamples | ( | uint32_t | input | ) |
Sets the number of samples for the parameter.
Memory will be allocated to store all of the samples. Any previous values stored will be lost. The default number of samples is 1.
[in] | input | The new number of samples for the parameter. |
Example:
int32_t trek::Parameter::SetNumberOfSyllables | ( | uint32_t | input | ) |
Sets the number of syllables for the parameter.
If the number of syllables is set the 'start bit' set by SetStartBit() will be ignored for processing. A parameter can have one or more syllables. Each syllable must have a length and start bit set using SetSyllableInfo(). The sum of the lengths for the syllables must be equal to the length of the parameter's data type as set by SetDataType(). Variable length data types cannot be multi sampled. If the number of syllables changes, all previous information about the syallables is lost.
[in] | input | The new number of syllables for the parameter. A value of zero will erase all syllable information and use locations as set by SetStartBit(). |
Example:
void trek::Parameter::SetRangeEnumerator | ( | RangeEnumerator & | input | ) |
Sets the range enumerator to be used for this parameter.
If the data type cannot be retrieved with a 32-bit unsigned integer, calls to GetEnumeratedValue will fail.
[in] | input | The new enumerator. If a enumerator already exists, it will be replaced. |
Example:
void trek::Parameter::SetSampleOffset | ( | uint32_t | input | ) |
Sets the sample offset for the parameter.
The sample offset is the number of bits between the end of one sample and the beginning of the next sample. The default value is 0. Only applicable for parameters with number of samples greater than 1.
[in] | input | The new sample offset for the parameter. |
Example:
int32_t trek::Parameter::SetStartBit | ( | uint32_t | input | ) |
Sets the start location for the parameter as bits.
Bit numbers begin at 0. The default start bit is 0.
[in] | input | The new start bit for the parameter. |
Example:
int32_t trek::Parameter::SetSyllableInfo | ( | uint32_t | syll_num, |
uint32_t | start_bit, | ||
uint32_t | length | ||
) |
Sets the start bit and length for a syllable in a parameter.
[in] | syll_num | The syllable number to change for the parameter. Syllable numbers start at 1. |
[in] | start_bit | The new start bit for the syllable. |
[in] | length | The new length for the syllable. |
Example:
int32_t trek::Parameter::SetUnsignedHighRange | ( | uint64_t | input | ) |
Sets the high range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).
The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.
[in] | input | The new high range value for the parameter. |
Example:
int32_t trek::Parameter::SetUnsignedLowRange | ( | uint64_t | input | ) |
Sets the low range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).
The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.
[in] | input | The new low range value for the parameter. |
Example:
int32_t trek::Parameter::SetValue | ( | bool | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a boolean.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | const char * | input_ptr, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a NULL terminated string.
If input is larger than the parameter's size allows, the value will be truncated and TREK_DATA_POSSIBLE_LOSS_OF_DATA returned.
[in] | input_ptr | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | double | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 64-bit floating point.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | float | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 32-bit floating point.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | int16_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 16-bit signed integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | int32_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 32-bit signed integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | int64_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 64-bit signed integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | int8_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with an 8-bit signed integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | TrekTime & | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a TrekTime object.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | uint16_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 16-bit unsigned integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | uint32_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 32-bit unsigned integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | uint64_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with a 64-bit unsigned integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | uint8_t * | input_ptr, |
uint32_t | input_len, | ||
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with binary data.
If input is larger than the parameter's size allows, the value will be truncated and TREK_DATA_POSSIBLE_LOSS_OF_DATA returned.
[in] | input_ptr | The new value. |
[in] | input_len | The length of the input in bits. |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValue | ( | uint8_t | input, |
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter with an 8-bit unsigned integer.
[in] | input | the new value |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
int32_t trek::Parameter::SetValueFromString | ( | const char * | value_str, |
parameter_data_format | data_fmt, | ||
uint16_t | sample_number = 1 |
||
) |
Sets the value of the parameter from a string by interpreting the format.
The valid data type - data format combinations are shown in the table below.
Data Type | DF_ASCII | DF_BINARY | DF_DECIMAL | DF_SCIENTIFIC* | DF_HEX | DF_BOOLEAN | DF_DATE_TIME |
DT_TWOS_COMPLEMENT | X | ||||||
DT_UNSIGNED_INTEGER | X | X | X | ||||
DT_DISTENDED_SIGNED_INTEGER | X | ||||||
DT_SIGN_AND_MAGNITUDE_INTEGER | X | ||||||
DT_BINARY_CODED_DECIMAL | X | ||||||
DT_IEEE_FLOATING_POINT | X | ||||||
DT_NULL_TERMINATED_STRING | X | ||||||
DT_FIXED_LENGTH_STRING | X | ||||||
DT_BOOLEAN | X | ||||||
DT_UNSPECIFIED_BYTES | X | X | |||||
DT_GPS_EPOCH_TIME | X | ||||||
DT_EHS_TIME | X | ||||||
DT_ISS_TIME | X | ||||||
DT_FASTSAT_TIME | X | ||||||
DT_DEM_TIME | X | ||||||
DT_UNIX_TIME | X | ||||||
DT_EHS_CONV_TIME | X | ||||||
DT_ISAT_TIME | X |
Not currently implemented.
[in] | value_str | The new value formatted according to data_fmt. |
[in] | data_fmt | The format that value_str should be interpreted as. |
[in] | sample_number | Optional parameter to set the specified sample number. Default value is 1 (first sample). |
Example:
bool trek::Parameter::UseHighRange | ( | ) |
Identifies if a high range value is currently in use.
Returns true is high range is in use. Otherwise, returns false.
Example:
bool trek::Parameter::UseLowRange | ( | ) |
Identifies if a low range value is currently in use.
Returns true is low range is in use. Otherwise, returns false.
Example:
bool trek::Parameter::Validate | ( | uint32_t & | num_errors, |
uint32_t & | num_warnings, | ||
const char ** | validation_messages = 0 |
||
) |
Validates the parameter.
The Parameter class by default will not allow invalid input. If you call Parameter::AllowInvalidData() then you must call this method and it must return true prior to using many of the other methods (e.g., GetValue(), Build(), ToXml()). This allows input of data in any order. A parameter is considered valid if only warnings are found.
[out] | validation_messages | A character string of all validation messages. Memory is owned by parameter object. |
[out] | num_errors | Number of errors found. |
[out] | num_warnings | Number of warnings found. |
Example: