|
Telescience Resource Kit
TReK Python
5.4.0 ART
|
This class is the abstraction for sets of information that can be switched by the value of a parameter. More...
Inherits NamedItem.
Inherited by CalibratorSwitchSet, EnumeratorSwitchSet, ExpectedStateAlarmSwitchSet, and LimitAlarmSwitchSet.
Public Member Functions | |
Initialize / Finalize | |
Functions handling class initialization and finalization. | |
def | SwitchSet ( -> def ) -> def |
Class initializer. More... | |
def | copy (copy_from: object -> None ) -> def |
Abstract method. More... | |
def | initialize ( -> None ) -> def |
Initializes the object. More... | |
SwitchSet Settings | |
Functions handling class settings | |
def | set_default_set_name (name: str -> None ) -> def |
Sets the default set name. More... | |
def | get_default_set_name ( -> str ) -> def |
Gets the default set name. More... | |
def | set_switch_parameter_name (par_name: str -> None ) -> def |
Sets the name of the parameter to use as a switch. More... | |
def | get_switch_parameter_name ( -> str ) -> def |
Gets the switch parameter name. More... | |
def | set_switch_type (switch_type: SwitchType -> None ) -> def |
Sets the type of switch to use. More... | |
def | get_switch_type ( -> SwitchType ) -> def |
Returns the current switch type. More... | |
def | get_item_names ( -> list[str] ) -> def |
Retrieves an array of the (e.g., calibrator) names from the set. More... | |
Enumeration Switch | |
Functions handling Enumeration Switches. | |
def | add_enumeration_switch (enum_name: str, name: str -> None ) -> def |
Adds an enumeration switch. More... | |
def | get_enumeration_switches ( -> list[str] ) -> def |
Gets the enumeration values for the switch. More... | |
def | get_enumeration_info (enum_name: str -> str ) -> def |
Gets the name for a switch based on its enumerated value. More... | |
def | get_enumeration_info_length (enum_name: str -> int ) -> def |
Gets the length for returned info of input parameter. More... | |
def | delete_enumeration_switch (enum_name: str -> None ) -> def |
Deletes the specified enumeration switch. More... | |
Range Switch | |
Functions handling Range Switches. | |
def | add_range_switch (low: float, high: float, name: str -> None ) -> def |
Adds a range switch. More... | |
def | get_range_switches ( -> list[float] ) -> def |
Gets the low value for each range switch. | |
def | get_range_switch_info (low: float -> RangeSwitchInfo ) -> def |
Gets the high value and name for a range switch based on its low value. More... | |
def | get_range_switch_info_length (low: float -> int ) -> def |
Gets the length for returned info of input parameter. More... | |
def | delete_range_switch (low: float -> None ) -> def |
Deletes the specified range switch. More... | |
Validation | |
Functions handling set validation. | |
def | validate ( -> int ) -> def |
Determines if it is safe to use the switched set. More... | |
def | get_validation_errors ( -> str ) -> def |
Gets a string of the last validation errors. 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 is the abstraction for sets of information that can be switched by the value of a parameter.
The switch parameter can be used to determine which set of information to use. Used for enumeration, calbiration, limits, and expected states. Two types of switching are supported: range switching and enumeration switching.
( | ) | -> def |
Class initializer.
Reimplemented from NamedItem.
Reimplemented in CalibratorSwitchSet, EnumeratorSwitchSet, ExpectedStateAlarmSwitchSet, and LimitAlarmSwitchSet.
( | enum_name | : str | |
name | : str | ||
) | -> None |
Adds an enumeration switch.
Adds the specified enumeration switch. Checks are performed to make sure the specified enumeration does not already exist.
[in] | enum_name | The enumerated value to use for switching. |
[in] | name | The name of the item to switch to when the switch parameter has the specified enumeration. |
TrekError | 15110 - TREK_DATA_INCORRECT_SWITCH_TYPE, 15005 - TREK_DATA_ALREADY_EXISTS |
( | low | : float | |
high | : float | ||
name | : str | ||
) | -> None |
Adds a range switch.
Adds the specified range switch. Checks are performed to make sure the specified range does not overlap with a current range. Ranges are evaluated by low < value <= high.
[in] | low | The low value for the range. |
[in] | high | The high value for the range. |
[in] | name | The name of the item to switch to when the switch parameter fall within range. |
TrekError | 15110 - TREK_DATA_INCORRECT_SWITCH_TYPE, 15111 - TREK_DATA_LOW_TO_HIGH, 15112 - TREK_DATA_NEED_UNIQUE_RANGE |
( | copy_from | : object | ) | -> None |
Abstract method.
Reimplemented from NamedItem.
Reimplemented in CalibratorSwitchSet, EnumeratorSwitchSet, ExpectedStateAlarmSwitchSet, and LimitAlarmSwitchSet.
( | enum_name | : str | ) | -> None |
Deletes the specified enumeration switch.
[in] | enum_name | The enumerated value to delete. |
TrekError | 15007 - TREK_DATA_DOES_NOT_EXIST |
( | low | : float | ) | -> None |
Deletes the specified range switch.
Only need to specify the low range as ranges are not allowed to overlap.
[in] | low | The low range of the switch to delete. |
TrekError | 15007 - TREK_DATA_DOES_NOT_EXIST |
( | ) | -> str |
Gets the default set name.
( | enum_name | : str | ) | -> str |
Gets the name for a switch based on its enumerated value.
All of the enumerations can be found by calling GetEnumerationSwitches.
[in] | enum_name | The enumerated value to retrieve a switch name. |
TrekError | 15007 - TREK_DATA_DOES_NOT_EXIST |
( | enum_name | : str | ) | -> int |
Gets the length for returned info of input parameter.
If the input does not exist, zero is returned.
[in] | enum_name | The enumerated value for which to search. |
( | ) | -> list[str] |
Gets the enumeration values for the switch.
The input array will be cleared prior to values being added.
( | ) | -> list[str] |
Retrieves an array of the (e.g., calibrator) names from the set.
( | low | : float | ) | -> RangeSwitchInfo |
Gets the high value and name for a range switch based on its low value.
All of the low ranges can be found by calling get_range_switches(). The caller of the function is responsible for deleting the memory that is created.
TrekError | 15007 - TREK_DATA_DOES_NOT_EXIST |
( | low | : float | ) | -> int |
Gets the length for returned info of input parameter.
If the input does not exist, zero is returned.
[in] | low | The value for which to search. |
( | ) | -> str |
Gets the switch parameter name.
( | ) | -> SwitchType |
Returns the current switch type.
( | ) | -> str |
Gets a string of the last validation errors.
( | ) | -> None |
( | name | : str | ) | -> None |
Sets the default set name.
The name of the item (e.g., calibrator) to use if no other set can be identified by switching.
[in] | name | The name of the set. |
( | par_name | : str | ) | -> None |
Sets the name of the parameter to use as a switch.
[in] | par_name | The name of the switch parameter. |
( | switch_type | : SwitchType | ) | -> None |
Sets the type of switch to use.
[in] | switch_type | The new switch type. |
( | ) | -> int |
Determines if it is safe to use the switched set.
Insures that class is properly configured. Safe to use if 0 is returned.