|
Telescience Resource Kit
TReK Python
5.4.0 ART
|
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 ) -> def |
Class initializer. More... | |
def | clone ( -> LimitAlarm ) -> def |
Creates a new instance of the object with the same contents. | |
def | copy (copy_from: object -> None ) -> def |
Copies the contents of the provided 'copy_from' LimitAlarm. More... | |
def | initialize ( -> None ) -> def |
Initializes the object. More... | |
def | load_file (filename: str -> None ) -> def |
Loads the LimitAlarm definition from the specified file. More... | |
def | save_file (filename: str -> None ) -> def |
Saves the LimitAlarm definition to the specified file. More... | |
Configuration Functions | |
Functions handling limit configurations. | |
def | get_limit_name (level: int -> str ) -> def |
Gets the name of the limit level. More... | |
def | get_limit_type ( -> LimitType ) -> def |
Gets data type used. More... | |
def | set_limit_name (level: int, name: str -> None ) -> def |
Sets the name for the limit level. More... | |
def | set_limit_type (limit_type: LimitType -> None ) -> def |
Sets limit type. More... | |
Set/Get Limit | |
Functions handling setting/getting limit values. | |
def | get_high_level_in_use (level: int -> bool ) -> def |
Determines if a high limit is being used. More... | |
def | get_high_limit (level: int -> Union[int, float] ) -> def |
Gets the value of the high limit for the specified level. More... | |
def | get_low_level_in_use (level: int -> bool ) -> def |
Determines if a low limit is being used. More... | |
def | get_low_limit (level: int -> Union[int, float] ) -> def |
Gets the value of the low limit for the specified level. More... | |
def | set_high_limit (level: int, Union[int, float] limit, inclusive: bool=True -> None ) -> def |
Sets the high limit for the specified level. More... | |
def | set_low_limit (level: int, Union[int, float] limit, inclusive: bool=True -> None ) -> def |
Sets the low limit for the specified level. More... | |
def | get_low_limit_inclusive (level: int -> bool ) -> def |
Determines if low limit comparison is <= (True) or < (False). More... | |
def | get_high_limit_inclusive (level: int -> bool ) -> def |
Determines if high limit comparison is >= (True) or > (False). More... | |
Check / Clear Limit Violations | |
Functions handling checking and clearing limit violations. | |
def | check ( Union[int, float] value, status: ParameterStatus -> None ) -> def |
Checks the supplied value for violations of any limits. More... | |
def | clear_high_limit (level: int -> None ) -> def |
Clears the high limit for the specified level. More... | |
def | clear_low_limit (level: int -> None ) -> def |
Clears the low limit for the specified level. More... | |
![]() | |
def | remove_all_attributes ( -> None ) -> def |
Removes all attributes. | |
def | remove_attribute (name: str -> None ) -> def |
Removes the attribute by name. More... | |
def | __eq__ (named_item: object -> bool ) -> def |
Equality operator "==". More... | |
def | add_attribute (name: str, value: str -> None ) -> def |
Adds an attribute to the item. More... | |
def | get_alias ( -> str ) -> def |
Returns the alias of the item. More... | |
def | get_attribute (name: str -> str ) -> def |
Get the value of the specified attribute. More... | |
def | get_attribute_list ( -> list[str] ) -> def |
Gets a list of the attribute names. More... | |
def | get_name ( -> str ) -> def |
Returns the name of the item. More... | |
def | get_long_description ( -> str ) -> def |
Returns the long description of the item. More... | |
def | get_short_description ( -> str ) -> def |
Returns the short description of the item. More... | |
def | get_user_description ( -> str ) -> def |
Returns the user description of the item. More... | |
def | get_owner ( -> str ) -> def |
Returns the owner of the item. More... | |
def | get_path ( -> str ) -> def |
Returns the path for the item. More... | |
def | set_name (name: str -> None ) -> def |
Sets the name of the item. More... | |
def | set_alias (alias: str -> None ) -> def |
Sets the alias of the item. More... | |
def | set_short_description (description: str -> None ) -> def |
Sets the short description of the item. More... | |
def | set_long_description (description: str -> None ) -> def |
Sets the long description of the item. More... | |
def | set_user_description (description: str -> None ) -> def |
Sets the user description of the item. More... | |
def | set_owner (owner: str -> None ) -> def |
Sets the owner of the item. More... | |
def | set_path (path: str -> None ) -> def |
Sets the path of the item. More... | |
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.
( | limit_alarm | : Optional[LimitAlarm] | |
native_ptr | : Optional[c_void_p] | ||
is_clone | : bool | ||
) | -> def |
Class initializer.
[in] | limit_alarm | (Optional) LimitAlarm to copy. |
[in] | native_ptr | (Optional) Internal parameter, do not provide. |
[in] | is_clone | (Optional) Internal parameter, do not provide. |
Reimplemented from NamedItem.
( | value | : Union[int, float] | |
status | : ParameterStatus | ||
) | -> None |
Checks the supplied 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 for which to check limits. This must match the data type set by set_limit_type() (i.e. either uint, int or float) |
[in] | status | The ParameterStatus to update for any found violations. |
TrekError | 15044 - TREK_DATA_INCORRECT_LIMIT_TYPE |
( | level | : int | ) | -> None |
Clears the high limit for the specified level.
The level is marked as not in use.
[in] | level | Level to clear limit (1-5). |
TrekError | 15048 - TREK_DATA_LIMIT_LEVEL_ERROR |
( | level | : int | ) | -> None |
Clears the low limit for the specified level.
The level is marked as not in use.
[in] | level | Level to clear limit (1-5). |
TrekError | 15048 - TREK_DATA_LIMIT_LEVEL_ERROR |
( | copy_from | : object | ) | -> None |
Copies the contents of the provided 'copy_from' LimitAlarm.
[in] | copy_from | LimitAlarm to copy from. |
TypeError | if 'copy_from' is not a LimitAlarm. |
Reimplemented from NamedItem.
( | level | : int | ) | -> bool |
Determines if a high limit is being used.
[in] | level | The level to query (1-5). |
( | level | : int | ) | -> Union[int, float] |
Gets the value of the high limit for the specified level.
[in] | level | The level for which to get the limit (1-5). |
TrekError | 15044 - TREK_DATA_INCORRECT_LIMIT_TYPE, 15048 - TREK_DATA_LIMIT_LEVEL_ERROR, 15045 - TREK_DATA_LIMIT_LEVEL_NOT_IN_USE |
( | level | : int | ) | -> bool |
Determines if high limit comparison is >= (True) or > (False).
[in] | level | The level for which to get inclusivity value (1-5). |
( | level | : int | ) | -> str |
Gets the name of the limit level.
[in] | level | The level name requested (1-5). |
( | level | : int | ) | -> bool |
Determines if a low limit is being used.
[in] | level | The level to query (1-5). |
( | level | : int | ) | -> Union[int, float] |
Gets the value of the low limit for the specified level.
[in] | level | The level for which to get the limit (1-5). |
TrekError | 15044 - TREK_DATA_INCORRECT_LIMIT_TYPE, 15048 - TREK_DATA_LIMIT_LEVEL_ERROR, 15045 - TREK_DATA_LIMIT_LEVEL_NOT_IN_USE |
( | level | : int | ) | -> bool |
Determines if low limit comparison is <= (True) or < (False).
[in] | level | The level for which to get inclusivity value (1-5). |
( | ) | -> None |
Initializes the object.
Clears any set values in the LimitAlarm. New instances do not need to be initialized.
Reimplemented from NamedItem.
( | filename | : str | ) | -> None |
Loads the LimitAlarm definition from the specified file.
Reads an XML LimitAlarm.
[in] | filename | The file from which to load the LimitAlarm object. |
TrekError | 32007 - TUA_XML_PARSER_ERROR, 1 - FAIL, etc. |
( | filename | : str | ) | -> None |
Saves the LimitAlarm definition to the specified file.
Writes an XML LimitAlarm.
[in] | filename | The file to save the limit alarm object. |
TrekError | 32007 - TUA_XML_PARSER_ERROR, 1 - FAIL, etc. |
( | level | : int | |
limit | : Union[int, float] | ||
inclusive | : bool | ||
) | -> None |
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 for which to get the limit (1-5). |
[in] | limit | The high value for the alarm. |
[in] | inclusive | Determines if comparison is >= (True) or > (False). |
TrekError | 15048 - TREK_DATA_LIMIT_LEVEL_ERROR, 15044 - TREK_DATA_INCORRECT_LIMIT_TYPE, 15046 - TREK_DATA_LIMIT_VALUE_TOO_SMALL, 15047 - TREK_DATA_LIMIT_VALUE_TOO_LARGE |
( | level | : int | |
name | : str | ||
) | -> None |
Sets the name for the limit level.
[in] | level | The level to name (1-5). |
[in] | name | The level name. |
TrekError | 15048 - TREK_DATA_LIMIT_LEVEL_ERROR |
( | limit_type | : LimitType | ) | -> None |
Sets limit type.
[in] | limit_type | Type of limit (int, double uint). |
( | level | : int | |
limit | : Union[int, float] | ||
inclusive | : bool | ||
) | -> None |
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 for which to set the limit (1-5). |
[in] | limit | The low value for the alarm. |
[in] | inclusive | Determines if comparison is <= (True) or < (False). |
TrekError | 15048 - TREK_DATA_LIMIT_LEVEL_ERROR, 15044 - TREK_DATA_INCORRECT_LIMIT_TYPE, 15046 - TREK_DATA_LIMIT_VALUE_TOO_SMALL, 15047 - TREK_DATA_LIMIT_VALUE_TOO_LARGE |