TReK Python  5.3.2
Telemetry/Command API
LimitAlarm Class Reference

This class checks a value for violation of defined limits. More...

Inherits NamedItem.

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

def LimitAlarm ( Optional[LimitAlarm] limit_alarm=None, Optional[c_void_p] native_ptr=None, is_clone: bool=False) -> def 
 Class initializer. More...
 
def clone () -> LimitAlarm 
 Creates a new instance of the object with the same contents.
 
def copy (copy_from: object) -> None 
 Copies the contents of the provided 'copy_from' LimitAlarm. More...
 
def initialize () -> None 
 Initializes the object. More...
 
def load_file (filename: str) -> None 
 Loads the LimitAlarm definition from the specified file. More...
 
def save_file (filename: str) -> None 
 Saves the LimitAlarm definition to the specified file. More...
 
Configuration Functions

Functions handling limit configurations.

def get_limit_name (level: int) -> str 
 Gets the name of the limit level. More...
 
def get_limit_type () -> LimitType 
 Gets data type used. More...
 
def set_limit_name (level: int, name: str) -> None 
 Sets the name for the limit level. More...
 
def set_limit_type ( LimitType limit_type) -> None 
 Sets limit type. More...
 
Set/Get Limit

Functions handling setting/getting limit values.

def get_high_level_in_use (level: int) -> bool 
 Determines if a high limit is being used. More...
 
def get_high_limit (level: int) -> Union[int, float] 
 Gets the value of the high limit for the specified level. More...
 
def get_low_level_in_use (level: int) -> bool 
 Determines if a low limit is being used. More...
 
def get_low_limit (level: int) -> Union[int, float] 
 Gets the value of the low limit for the specified level. More...
 
def set_high_limit (level: int, Union[int, float] limit) -> None 
 Sets the high limit for the specified level. More...
 
def set_low_limit (level: int, Union[int, float] limit) -> None 
 Sets the low limit for the specified level. More...
 
Check / Clear Limit Violations

Functions handling checking and clearing limit violations.

def check ( Union[int, float] value, ParameterStatus status) -> None 
 Checks the supplied value for violations of any limits. More...
 
def clear_high_limit (level: int) -> None 
 Clears the high limit for the specified level. More...
 
def clear_low_limit (level: int) -> None 
 Clears the low limit for the specified level. More...
 
- Public Member Functions inherited from NamedItem
def __eq__ (named_item: object) -> bool 
 Equality operator "==". More...
 
def get_alias () -> str 
 Returns the alias of the item. More...
 
def get_name () -> str 
 Returns the name of the item. More...
 
def get_long_description () -> str 
 Returns the long description of the item. More...
 
def get_short_description () -> str 
 Returns the short description of the item. More...
 
def get_user_description () -> str 
 Returns the user description of the item. More...
 
def get_owner () -> str 
 Returns the owner of the item. More...
 
def set_name (name: str) -> None 
 Sets the name of the item. More...
 
def set_alias (alias: str) -> None 
 Sets the alias of the item. More...
 
def set_short_description (description: str) -> None 
 Sets the short description of the item. More...
 
def set_long_description (description: str) -> None 
 Sets the long description of the item. More...
 
def set_user_description (description: str) -> None 
 Sets the user description of the item. More...
 
def set_owner (owner: str) -> None 
 Sets the owner of the item. More...
 

Detailed Description

This class checks a value for violation of defined limits.

If a limit violation occurs, the check() method updates the provided ParameterStatus instance. Currently the LimitAlarm supports 5 limit levels (1-5) for high and low and each can be named. These alarms are "nested": Level 5 contains Level 4 contains Level 3 contains Level 2 contains Level 1. Attempting to add high/low limits that cross boundaries will return TREK_DATA_LIMIT_VALUE_TOO_LARGE or TREK_DATA_LIMIT_VALUE_TO_SMALL.

Constructor & Destructor Documentation

◆ LimitAlarm()

LimitAlarm (limit_alarm : Optional[LimitAlarm]