TReK C++
5.3.3
Telemetry/Command API
|
This class checks a value for violation of defined limits. More...
#include <limit_alarm.h>
Inherits trek::NamedItem.
Public Member Functions | |
Constructors, Destructor, and Other Basic Methods | |
LimitAlarm () | |
Default constructor of the class. | |
virtual | ~LimitAlarm () |
Class destructor. More... | |
LimitAlarm * | Clone () |
Creates and returns an extact copy of the object. | |
void | operator= (LimitAlarm &right_side) |
Provides the equal operator. | |
virtual void | Init () |
Initializes the object. | |
Configuration Methods | |
void | SetLimitType (limit_type type) |
Sets the limit type. More... | |
int32_t | SetLimitName (uint32_t level, const char *name) |
Sets the name for the limit level. More... | |
int32_t | SetHighLimit (uint32_t level, double value) |
Sets the high limit for the specified level. More... | |
int32_t | SetHighLimit (uint32_t level, int64_t value) |
Sets the high limit for the specified level. More... | |
int32_t | SetHighLimit (uint32_t level, uint64_t value) |
Sets the high limit for the specified level. More... | |
int32_t | SetLowLimit (uint32_t level, double value) |
Sets the low limit for the specified level. More... | |
int32_t | SetLowLimit (uint32_t level, int64_t value) |
Sets the low limit for the specified level. More... | |
int32_t | SetLowLimit (uint32_t level, uint64_t value) |
Sets the low limit for the specified level. More... | |
int32_t | ClearHighLimit (uint32_t level) |
Clears the high limit for the specified level. More... | |
int32_t | ClearLowLimit (uint32_t level) |
Clears the low limit for the specified level. More... | |
bool | GetHighLevelInUse (uint32_t level) |
Determines if a high limit is being used. More... | |
bool | GetLowLevelInUse (uint32_t level) |
Determines if a low limit is being used. More... | |
Get Methods | |
limit_type | GetLimitType () |
Gets the limit type for the alarm. More... | |
int32_t | GetLimitName (uint32_t level, char *name, uint32_t *size_of_output) |
Gets the name of the limit for the specified level. More... | |
const char * | GetLimitName (uint32_t level) |
Gets the name of the limit for the specified level. More... | |
int32_t | GetHighLimit (uint32_t level, double &value) |
Gets the value of the high limit for the specified level. More... | |
int32_t | GetHighLimit (uint32_t level, int64_t &value) |
Gets the value of the high limit for the specified level. More... | |
int32_t | GetHighLimit (uint32_t level, uint64_t &value) |
Gets the value of the high limit for the specified level. More... | |
int32_t | GetLowLimit (uint32_t level, double &value) |
Gets the value of the low limit for the specified level. More... | |
int32_t | GetLowLimit (uint32_t level, int64_t &value) |
Gets the value of the low limit for the specified level. More... | |
int32_t | GetLowLimit (uint32_t level, uint64_t &value) |
Gets the value of the low limit for the specified level. More... | |
Methods to Check for Violations | |
int32_t | Check (double value, ParameterStatus &status) |
Checks the supplied double value for violations of any limits. More... | |
int32_t | Check (int64_t value, ParameterStatus &status) |
Checks the supplied integer value for violations of any limits. More... | |
int32_t | Check (uint64_t value, ParameterStatus &status) |
Checks the supplied unsigned integer value for violations of any limits. 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 LimitAlarm definition from the specified file. More... | |
int32_t | SaveFile (const char *filename) |
Saves the LimitAlarm definition to the specified file. More... | |
Public Member Functions inherited from trek::NamedItem | |
void | SetName (const char *input_ptr) |
Sets the name of the item. More... | |
void | SetAlias (const char *input) |
Sets the alias of the item. More... | |
void | SetShortDescription (const char *input_ptr) |
Sets the short description of the item. More... | |
void | SetLongDescription (const char *input_ptr) |
Sets the long description of the item. More... | |
void | SetUserDescription (const char *input_ptr) |
Sets the user description of the item. More... | |
void | SetOwner (const char *input_ptr) |
Sets the owner of the item. More... | |
const char * | GetName () |
Returns the name of the item. | |
const char * | GetAlias () |
Returns the alias of the item. | |
const char * | GetShortDescription () |
Returns the short description of the item. | |
const char * | GetLongDescription () |
Returns the long description of the item. | |
const char * | GetUserDescription () |
Returns the user description of the item. | |
const char * | GetOwner () |
Returns the owner of the item. | |
NamedItem () | |
Default constructor of the class. | |
NamedItem (NamedItem &input) | |
Copy constructor of the class. | |
virtual | ~NamedItem () |
Class destructor. More... | |
void | operator= (NamedItem &right_side) |
Provides the equal operator. | |
bool | operator== (NamedItem &right_side) |
Provides the == operator. | |
This class checks a value for violation of defined limits.
If a limit violation occurs, the parameter status is updated.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
int32_t trek::LimitAlarm::Check | ( | double | value, |
ParameterStatus & | status | ||
) |
Checks the supplied double value for violations of any limits.
If any limit is violated, the parameter status is updated to reflect the violation. If no limit violations are found, the corresponding status is cleared.
[in] | value | The value to check for limit violations |
[out] | status | The parameter status associated with the Parameter |
int32_t trek::LimitAlarm::Check | ( | int64_t | value, |
ParameterStatus & | status | ||
) |
Checks the supplied integer value for violations of any limits.
If any limit is violated, the parameter status is updated to reflect the violation. If no limit violations are found, the corresponding status is cleared.
[in] | value | The value to check for limit violations |
[out] | status | The parameter status associated with the Parameter |
int32_t trek::LimitAlarm::Check | ( | uint64_t | value, |
ParameterStatus & | status | ||
) |
Checks the supplied unsigned integer value for violations of any limits.
If any limit is violated, the parameter status is updated to reflect the violation. If no limit violations are found, the corresponding status is cleared.
[in] | value | The value to check for limit violations |
[out] | status | The parameter status associated with the Parameter |
int32_t trek::LimitAlarm::ClearHighLimit | ( | uint32_t | level | ) |
Clears the high limit for the specified level.
The level is marked as not in use.
[in] | level | The level to clear the limit for |
Example:
int32_t trek::LimitAlarm::ClearLowLimit | ( | uint32_t | level | ) |
Clears the low limit for the specified level.
The level is marked as not in use.
[in] | level | The level to clear the limit for |
Example:
bool trek::LimitAlarm::GetHighLevelInUse | ( | uint32_t | level | ) |
Determines if a high limit is being used.
[in] | level | The level to query |
Example:
int32_t trek::LimitAlarm::GetHighLimit | ( | uint32_t | level, |
double & | value | ||
) |
Gets the value of the high limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
int32_t trek::LimitAlarm::GetHighLimit | ( | uint32_t | level, |
int64_t & | value | ||
) |
Gets the value of the high limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
int32_t trek::LimitAlarm::GetHighLimit | ( | uint32_t | level, |
uint64_t & | value | ||
) |
Gets the value of the high limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
const char * trek::LimitAlarm::GetLimitName | ( | uint32_t | level | ) |
Gets the name of the limit for the specified level.
[in] | level | The level to get the name for |
Example:
int32_t trek::LimitAlarm::GetLimitName | ( | uint32_t | level, |
char * | name, | ||
uint32_t * | size_of_output | ||
) |
Gets the name of the limit for the specified level.
[in] | level | The level to get the name for |
[out] | name | The name for the level |
[in,out] | size_of_output | The number of bytes allocated for the buffer on input. If return code is set to TREK_DATA_NOT_ENOUGH_SPACE, then the value is reset to the number of bytes required for the data to be copied. |
Example:
limit_type trek::LimitAlarm::GetLimitType | ( | ) |
Gets the limit type for the alarm.
bool trek::LimitAlarm::GetLowLevelInUse | ( | uint32_t | level | ) |
Determines if a low limit is being used.
[in] | level | The level to query |
Example:
int32_t trek::LimitAlarm::GetLowLimit | ( | uint32_t | level, |
double & | value | ||
) |
Gets the value of the low limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
int32_t trek::LimitAlarm::GetLowLimit | ( | uint32_t | level, |
int64_t & | value | ||
) |
Gets the value of the low limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
int32_t trek::LimitAlarm::GetLowLimit | ( | uint32_t | level, |
uint64_t & | value | ||
) |
Gets the value of the low limit for the specified level.
[in] | level | The level to get the limit for |
[out] | value | The value for the level |
Example:
int32_t trek::LimitAlarm::LoadFile | ( | const char * | filename | ) |
Loads the LimitAlarm definition from the specified file.
Reads an XML format for the LimitAlarm. It can be written in with SaveFile.
[in] | filename | The file to load the limit alarm object from. |
Example:
int32_t trek::LimitAlarm::SaveFile | ( | const char * | filename | ) |
Saves the LimitAlarm definition to the specified file.
Writes an XML format for the LimitAlarm. It can be read in with LoadFile.
[in] | filename | The file to save the limit alarm object to. |
Example:
int32_t trek::LimitAlarm::SetHighLimit | ( | uint32_t | level, |
double | value | ||
) |
Sets the high limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example:
int32_t trek::LimitAlarm::SetHighLimit | ( | uint32_t | level, |
int64_t | value | ||
) |
Sets the high limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example:
int32_t trek::LimitAlarm::SetHighLimit | ( | uint32_t | level, |
uint64_t | value | ||
) |
Sets the high limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example:
int32_t trek::LimitAlarm::SetLimitName | ( | uint32_t | level, |
const char * | name | ||
) |
Sets the name for the limit level.
[in] | level | The level to set the name for |
[in] | name | The new name for the alarm level |
Example:
void trek::LimitAlarm::SetLimitType | ( | limit_type | type | ) |
Sets the limit type.
The limit type should correspond to the data type for a parameter to allow all values to be represented.
[in] | type | The type of limit (double, etc.) to use |
int32_t trek::LimitAlarm::SetLowLimit | ( | uint32_t | level, |
double | value | ||
) |
Sets the low limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example:
int32_t trek::LimitAlarm::SetLowLimit | ( | uint32_t | level, |
int64_t | value | ||
) |
Sets the low limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example:
int32_t trek::LimitAlarm::SetLowLimit | ( | uint32_t | level, |
uint64_t | value | ||
) |
Sets the low limit for the specified level.
The input value is checked to ensure that it is the correct limit type and also would not violate any other limits previously set.
[in] | level | The level to set the limit for |
[in] | value | The value for the alarm level |
Example: