TReK C++
5.3.3
Telemetry/Command API
|
This class describes the status associated with a parameter value. More...
#include <parameter_status.h>
Public Member Functions | |
ParameterStatus () | |
Default constructor. | |
ParameterStatus (uint32_t trek_status, uint32_t src_status) | |
Constructor to set the values for the status. | |
virtual | ~ParameterStatus () |
Class destructor. More... | |
void | operator= (ParameterStatus &right_side) |
Provides the equal operator. | |
uint32_t | GetTrekStatus () |
Gets the current TReK status value. More... | |
uint32_t | GetSourceStatus () |
Gets the current source status value. More... | |
void | SetStatus (uint32_t trek_status, uint32_t src_status) |
Sets the status with two integers. More... | |
const char * | GetStatusString () |
Returns the status as a string. More... | |
void | Reset () |
Resets the parameter status values to zero. More... | |
void | ResetTrekStatus () |
Resets the TReK status value to zero. More... | |
void | ResetSourceStatus () |
Resets the source status value to zero. More... | |
void | SetLevel5HighLimit () |
Sets the status bit to indicate that a level 5 high error has occured. More... | |
void | SetLevel4HighLimit () |
Sets the status bit to indicate that a level 4 high error has occured. More... | |
void | SetLevel3HighLimit () |
Sets the status bit to indicate that a level 3 high error has occured. More... | |
void | SetLevel2HighLimit () |
Sets the status bit to indicate that a level 2 high error has occured. More... | |
void | SetLevel1HighLimit () |
Sets the status bit to indicate that a level 1 high error has occured. More... | |
void | SetLevel5LowLimit () |
Sets the status bit to indicate that a level 5 low error has occured. More... | |
void | SetLevel4LowLimit () |
Sets the status bit to indicate that a level 4 low error has occured. More... | |
void | SetLevel3LowLimit () |
Sets the status bit to indicate that a level 3 low error has occured. More... | |
void | SetLevel2LowLimit () |
Sets the status bit to indicate that a level 2 low error has occured. More... | |
void | SetLevel1LowLimit () |
Sets the status bit to indicate that a level 1 low error has occured. More... | |
void | SetLevel5DeltaLimit () |
Sets the status bit to indicate that a level 5 delta error has occured. More... | |
void | SetLevel4DeltaLimit () |
Sets the status bit to indicate that a level 4 delta error has occured. More... | |
void | SetLevel3DeltaLimit () |
Sets the status bit to indicate that a level 3 delta error has occured. More... | |
void | SetLevel2DeltaLimit () |
Sets the status bit to indicate that a level 2 delta error has occured. More... | |
void | SetLevel1DeltaLimit () |
Sets the status bit to indicate that a level 1 delta error has occured. More... | |
void | SetExpectedStateError () |
Sets the status bit to indicate that an expected state error has occured. More... | |
void | SetLowRangeError () |
Sets the status bit to indicate that a low range error has occured. More... | |
void | SetHighRangeError () |
Sets the status bit to indicate that a high range error has occured. More... | |
void | SetCalibrationIllegalDatatypeError () |
Sets the status bit to indicate that an illegal data type for calibration error has occured. More... | |
void | SetCalibrationGeneralError () |
Sets the status bit to indicate that a calibration error has occured. More... | |
void | SetDataQualityChecksumError () |
Sets the status bit to indicate that a checksum error has occured. More... | |
void | SetDataQualityBadLengthError () |
Sets the status bit to indicate that a length error has occured. More... | |
void | SetConversionError () |
Sets the status bit to indicate that a conversion error has occured. More... | |
void | SetStaleData () |
Sets the status bit to indicate that data is stale. More... | |
void | SetProcessingError () |
Sets the status bit to indicate that a processing error has occured. More... | |
void | SetDataLossPossibleError () |
Sets the status bit to indicate that data may have been lost (e.g., getting a float value as an integer). More... | |
void | SetCalibrationSwitchError () |
Sets the status bit to indicate that a calibration switch error occurred. More... | |
void | SetAlarmSwitchError () |
Sets the status bit to indicate that an alarm switch error occurred. More... | |
void | ClearAllLimits () |
Clears all bits assoicated with low, high, and delta limits status. | |
void | ClearAllExpectedStates () |
Clears all bits assoicated with expected states in the status. | |
void | SetSourceStatusError (uint32_t error_mask) |
Sets the source status. More... | |
bool | HasHighLimitError () |
Determines if a high limit error is set. More... | |
bool | HasLowLimitError () |
Determines if a low limit error is set. More... | |
bool | HasDeltaLimitError () |
Determines if a delta limit error is set. More... | |
bool | HasLimitError () |
Determines if any limit error is set. More... | |
bool | HasRangeError () |
Determines if there is a range error. More... | |
bool | HasTrekError () |
Determines if there is any TReK error. More... | |
bool | HasLevel5HighLimitError () |
Determines if there is a level 5 high limit error. More... | |
bool | HasLevel4HighLimitError () |
Determines if there is a level 4 high limit error. More... | |
bool | HasLevel3HighLimitError () |
Determines if there is a level 3 high limit error. More... | |
bool | HasLevel2HighLimitError () |
Determines if there is a level 2 high limit error. More... | |
bool | HasLevel1HighLimitError () |
Determines if there is a level 1 high limit error. More... | |
bool | HasLevel5LowLimitError () |
Determines if there is a level 5 low limit error. More... | |
bool | HasLevel4LowLimitError () |
Determines if there is a level 4 low limit error. More... | |
bool | HasLevel3LowLimitError () |
Determines if there is a level 3 low limit error. More... | |
bool | HasLevel2LowLimitError () |
Determines if there is a level 2 low limit error. More... | |
bool | HasLevel1LowLimitError () |
Determines if there is a level 1 low limit error. More... | |
bool | HasLevel5DeltaLimitError () |
Determines if there is a level 5 delta limit error. More... | |
bool | HasLevel4DeltaLimitError () |
Determines if there is a level 4 delta limit error. More... | |
bool | HasLevel3DeltaLimitError () |
Determines if there is a level 3 delta limit error. More... | |
bool | HasLevel2DeltaLimitError () |
Determines if there is a level 2 delta limit error. More... | |
bool | HasLevel1DeltaLimitError () |
Determines if there is a level 1 delta limit error. More... | |
bool | HasExpectedStateError () |
Determines if there is an expected state error. More... | |
bool | HasCalibrationError () |
Determines if there is a calbration error. More... | |
bool | HasStaleData () |
Determines if the data is stale. More... | |
bool | HasSourceWarningLimit () |
Determines if the source data indicates a warning limit. More... | |
bool | HasSourceCautionLimit () |
Determines if the source data indicates a caution limit. More... | |
void | SetSourceStatusAsString (bool input) |
Sets whether or not the source status is interpreted as characters. More... | |
This class describes the status associated with a parameter value.
The parameter status is a series of bit fields and associated status characters that describe important processing information with a parameter's value.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
uint32_t trek::ParameterStatus::GetSourceStatus | ( | ) |
Gets the current source status value.
Example:
const char * trek::ParameterStatus::GetStatusString | ( | ) |
Returns the status as a string.
The returned string will be in the format of XXX(YYY) where XXX is zero or more status characters corresponding to the TReK status and YYY is is the status source status value. See SetSourceStatusAsString for more information on the format. The TReK status characters are defined in parameter_status.h. Source status characters, if available, are defined by the source of the data. If no source status is available or the status is 'ok', the parentheses enclosing the source status characters are omitted. If no error of any kind occurs, an empty string is returned.
Status bits that are "levels" are mutually exclusive (e.g., only one "High" error can be returned). Level 5 is considered the most severe error and is returned first. Level 1 is considered the least severe error and is returned only if no other levels of errors are detected.
Example:
uint32_t trek::ParameterStatus::GetTrekStatus | ( | ) |
Gets the current TReK status value.
Example:
bool trek::ParameterStatus::HasCalibrationError | ( | ) |
Determines if there is a calbration error.
Returns true if any calibration error bit is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasDeltaLimitError | ( | ) |
Determines if a delta limit error is set.
Returns true if any of the 5 delta level limit bits are set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasExpectedStateError | ( | ) |
Determines if there is an expected state error.
Returns true if expected state error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasHighLimitError | ( | ) |
Determines if a high limit error is set.
Returns true if any of the 5 high level limit bits are set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel1DeltaLimitError | ( | ) |
Determines if there is a level 1 delta limit error.
Returns true if level 1 delta limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel1HighLimitError | ( | ) |
Determines if there is a level 1 high limit error.
Returns true if level 1 high limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel1LowLimitError | ( | ) |
Determines if there is a level 1 low limit error.
Returns true if level 1 low limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel2DeltaLimitError | ( | ) |
Determines if there is a level 2 delta limit error.
Returns true if level 2 delta limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel2HighLimitError | ( | ) |
Determines if there is a level 2 high limit error.
Returns true if level 2 high limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel2LowLimitError | ( | ) |
Determines if there is a level 2 low limit error.
Returns true if level 2 low limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel3DeltaLimitError | ( | ) |
Determines if there is a level 3 delta limit error.
Returns true if level 3 delta limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel3HighLimitError | ( | ) |
Determines if there is a level 3 high limit error.
Returns true if level 3 high limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel3LowLimitError | ( | ) |
Determines if there is a level 3 low limit error.
Returns true if level 3 low limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel4DeltaLimitError | ( | ) |
Determines if there is a level 4 delta limit error.
Returns true if level 4 delta limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel4HighLimitError | ( | ) |
Determines if there is a level 4 high limit error.
Returns true if level 4 high limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel4LowLimitError | ( | ) |
Determines if there is a level 4 low limit error.
Returns true if level 4 low limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel5DeltaLimitError | ( | ) |
Determines if there is a level 5 delta limit error.
Returns true if level 5 delta limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel5HighLimitError | ( | ) |
Determines if there is a level 5 high limit error.
Returns true if level 5 high limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLevel5LowLimitError | ( | ) |
Determines if there is a level 5 low limit error.
Returns true if level 5 low limit error is set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLimitError | ( | ) |
Determines if any limit error is set.
Returns true if any of the high, low, or delta level limit bits are set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasLowLimitError | ( | ) |
Determines if a low limit error is set.
Returns true if any of the 5 low level limit bits are set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasRangeError | ( | ) |
Determines if there is a range error.
Returns true if a high or low range error bit are set. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasSourceCautionLimit | ( | ) |
Determines if the source data indicates a caution limit.
Returns true if data is in a caution state. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasSourceWarningLimit | ( | ) |
Determines if the source data indicates a warning limit.
Returns true if data is in a warning state. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasStaleData | ( | ) |
Determines if the data is stale.
Returns true if data is stale. Otherwise, returns false.
Example:
bool trek::ParameterStatus::HasTrekError | ( | ) |
Determines if there is any TReK error.
Returns true if any of the TReK error bits are set (TReK status != 0). Otherwise, returns false.
Example:
void trek::ParameterStatus::Reset | ( | ) |
Resets the parameter status values to zero.
Example:
void trek::ParameterStatus::ResetSourceStatus | ( | ) |
Resets the source status value to zero.
Example:
void trek::ParameterStatus::ResetTrekStatus | ( | ) |
Resets the TReK status value to zero.
Example:
void trek::ParameterStatus::SetAlarmSwitchError | ( | ) |
Sets the status bit to indicate that an alarm switch error occurred.
The bit correlating to the error is set. GetStatusString() will return the ALARM_SWITCH_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetCalibrationGeneralError | ( | ) |
Sets the status bit to indicate that a calibration error has occured.
The bit correlating to the error is set. GetStatusString() will return the CAL_GENERAL_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetCalibrationIllegalDatatypeError | ( | ) |
Sets the status bit to indicate that an illegal data type for calibration error has occured.
The bit correlating to the error is set. GetStatusString() will return the CAL_ILLEGAL_DATATYPE_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetCalibrationSwitchError | ( | ) |
Sets the status bit to indicate that a calibration switch error occurred.
The bit correlating to the error is set. GetStatusString() will return the CAL_SWITCH_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetConversionError | ( | ) |
Sets the status bit to indicate that a conversion error has occured.
The bit correlating to the error is set. GetStatusString() will return the CONVERSION_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetDataLossPossibleError | ( | ) |
Sets the status bit to indicate that data may have been lost (e.g., getting a float value as an integer).
The bit correlating to the error is set. GetStatusString() will return the DATA_LOSS_POSSIBLE_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetDataQualityBadLengthError | ( | ) |
Sets the status bit to indicate that a length error has occured.
The bit correlating to the error is set. GetStatusString() will return the DQ_BAD_LENGTH_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetDataQualityChecksumError | ( | ) |
Sets the status bit to indicate that a checksum error has occured.
The bit correlating to the error is set. GetStatusString() will return the DQ_CHECKSUM_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetExpectedStateError | ( | ) |
Sets the status bit to indicate that an expected state error has occured.
The bit correlating to the error is set. GetStatusString() will return the EXPECTED_STATE_ERROR_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetHighRangeError | ( | ) |
Sets the status bit to indicate that a high range error has occured.
The bit correlating to the error is set. GetStatusString() will return the HIGH_RANGE_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel1DeltaLimit | ( | ) |
Sets the status bit to indicate that a level 1 delta error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_1_DELTA_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel1HighLimit | ( | ) |
Sets the status bit to indicate that a level 1 high error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_1_HIGH_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel1LowLimit | ( | ) |
Sets the status bit to indicate that a level 1 low error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_1_LOW_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel2DeltaLimit | ( | ) |
Sets the status bit to indicate that a level 2 delta error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_2_DELTA_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel2HighLimit | ( | ) |
Sets the status bit to indicate that a level 2 high error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_2_HIGH_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel2LowLimit | ( | ) |
Sets the status bit to indicate that a level 2 low error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_2_LOW_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel3DeltaLimit | ( | ) |
Sets the status bit to indicate that a level 3 delta error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_3_DELTA_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel3HighLimit | ( | ) |
Sets the status bit to indicate that a level 3 high error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_3_HIGH_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel3LowLimit | ( | ) |
Sets the status bit to indicate that a level 3 low error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_3_LOW_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel4DeltaLimit | ( | ) |
Sets the status bit to indicate that a level 4 delta error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_4_DELTA_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel4HighLimit | ( | ) |
Sets the status bit to indicate that a level 4 high error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_4_HIGH_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel4LowLimit | ( | ) |
Sets the status bit to indicate that a level 4 low error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_4_LOW_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel5DeltaLimit | ( | ) |
Sets the status bit to indicate that a level 5 delta error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_5_DELTA_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel5HighLimit | ( | ) |
Sets the status bit to indicate that a level 5 high error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_5_HIGH_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLevel5LowLimit | ( | ) |
Sets the status bit to indicate that a level 5 low error has occured.
The bit correlating to the error is set. GetStatusString() will return the LEVEL_5_LOW_LIMIT_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetLowRangeError | ( | ) |
Sets the status bit to indicate that a low range error has occured.
The bit correlating to the error is set. GetStatusString() will return the LOW_RANGE_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetProcessingError | ( | ) |
Sets the status bit to indicate that a processing error has occured.
The bit correlating to the error is set. GetStatusString() will return the PROCESSING_ERROR_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetSourceStatusAsString | ( | bool | input | ) |
Sets whether or not the source status is interpreted as characters.
Sets how the source status should be interpreted. If true, each byte of the source status is interpreted as an ASCII character. If false, the source status is interpretend as an unsigned integer and the unsigned integer value displayed in the status string.
Example:
void trek::ParameterStatus::SetSourceStatusError | ( | uint32_t | error_mask | ) |
Sets the source status.
If the errors can be intepreted as characters, GetStatusString() will return the source status characters as part of the status string.
Example:
void trek::ParameterStatus::SetStaleData | ( | ) |
Sets the status bit to indicate that data is stale.
The bit correlating to the error is set. GetStatusString() will return the STALE_STATUS_CHAR as part of the status string.
Example:
void trek::ParameterStatus::SetStatus | ( | uint32_t | trek_status, |
uint32_t | src_status | ||
) |
Sets the status with two integers.
[in] | trek_status | The new TReK status |
[in] | src_status | The new source status |
Example: