Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
EnumeratorSwitchSet Class Reference

This class switches calibrator sets. More...

Inherits SwitchSet.

Public Member Functions

Initialize / Finalize

Functions handling class initialization and destruction.

def EnumeratorSwitchSet ( Optional[EnumeratorSwitchSet] enum_set=None, Optional[c_void_p] native_ptr=None, is_clone: bool=False -> def ) -> def 
 Class initializer. More...
 
def clone ( -> EnumeratorSwitchSet ) -> def 
 Creates and returns an extact copy of the object.
 
def copy (copy_from: object -> None ) -> def 
 Copies contents from EnumeratorSwitchSet. More...
 
def load_file (filename: str -> None ) -> def 
 Loads the EnumeratorSwitchSet definition from the specified file. More...
 
def save_file (filename: str -> None ) -> def 
 Saves the EnumeratorSwitchSet definition to the specified file. More...
 
Switch Management

Functions handling managing the switch set.

def add_enumerator (enumerator: BaseEnumerator -> None ) -> def 
 Adds the enumerator that can be referenced by a switch. More...
 
def delete_all_enumerators ( -> None ) -> def 
 Deletes all of the enumerators.
 
def delete_enumerator (name: str -> None ) -> def 
 Deletes the specified enumerator. More...
 
def get_enumerator (name: str -> Optional[BaseEnumerator] ) -> def 
 Returns the enumerator with the specified name. More...
 
Enumeration

Functions handling enumeration values.

def get_enum_name (enum_value: int -> str ) -> def 
 Finds the corresponding string value for the specified unsigned integer. More...
 
def get_enum_value (enum_name: str -> int ) -> def 
 Finds the corresponding unsigned integer value for the specified string. More...
 
- Public Member Functions inherited from SwitchSet
def initialize ( -> None ) -> def 
 Initializes the object. More...
 
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...
 
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...
 
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...
 
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...
 
- Public Member Functions inherited from NamedItem
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...
 

Detailed Description

This class switches calibrator sets.

The details of switching are defined in SwitchSet. This class limits the type of information that is in the set and provides the serialization of the data.

Note
set_default_set_name() must be set for the default switch class or TREK_DATA_SWITCH_ERROR will occur.

Constructor & Destructor Documentation

◆ EnumeratorSwitchSet()

(enum_set : Optional[EnumeratorSwitchSet]  
native_ptr : Optional[c_void_p]  
is_clone : bool  
) -> def

Class initializer.

Parameters
[in]enum_set(Optional) The EnumeratorSwitchSet to copy construct from.
[in]native_ptr(Optional) Internal parameter, do not provide.
[in]is_clone(Optional) Internal parameter, do not provide.

Reimplemented from SwitchSet.

Member Function Documentation

◆ add_enumerator()

(enumerator : BaseEnumerator ) -> None

Adds the enumerator that can be referenced by a switch.

The name of the enumerator is used for the reference.

Note
A copy of provided Enumerator is made.
Parameters
[in]enumeratorEnumerator to add.
Exceptions
TrekError15005 - TREK_DATA_ALREADY_EXISTS
TypeErrorif 'enumerator' is not a subclass of BaseEnumerator.

◆ copy()

(copy_from : object ) -> None

Copies contents from EnumeratorSwitchSet.

Parameters
[in]copy_fromEnumeratorSwitchSet to copy.
Exceptions
TypeErrorif 'copy_from' is not a EnumeratorSwitchSet.

Reimplemented from SwitchSet.

◆ delete_enumerator()

(name : str ) -> None

Deletes the specified enumerator.

Parameters
[in]nameThe name of the enumerator to delete.
Exceptions
TrekError15007 - TREK_DATA_DOES_NOT_EXIST

◆ get_enum_name()

(enum_value : int ) -> str

Finds the corresponding string value for the specified unsigned integer.

Parameters
[in]enum_valueInteger to find.
Exceptions
TrekError15007 - TREK_DATA_DOES_NOT_EXIST,

15113 - TREK_DATA_SWITCH_ERROR
Note
This method is typically only used internally.

◆ get_enum_value()

(enum_name : str ) -> int

Finds the corresponding unsigned integer value for the specified string.

Parameters
[in]enum_nameThe name for which a value is desired.
Returns
Enumaration value.
Exceptions
TrekError15007 - TREK_DATA_DOES_NOT_EXIST,

15113 - TREK_DATA_SWITCH_ERROR
Note
This method is typically only used internally.

◆ get_enumerator()

(name : str ) -> Optional[BaseEnumerator]

Returns the enumerator with the specified name.

Parameters
[in]nameThe name of the enumerator to find.
Returns
Subclass of BaseEnumerator requested or None if not found.

◆ load_file()

(filename : str ) -> None

Loads the EnumeratorSwitchSet definition from the specified file.

Reads an XML format EnumeratorSwitchSet.

Parameters
[in]filenameThe file from which to load the enumerator switch set object.

◆ save_file()

(filename : str ) -> None

Saves the EnumeratorSwitchSet definition to the specified file.

Writes an XML format EnumeratorSwitchSet.

Parameters
[in]filenameThe file to save the enumerator switch set.