Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
ComparisonDependency Class Reference

This class determine a parameter's dependency based on a numeric comparison. More...

Inherits Dependency.

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

def ComparisonDependency ( Optional[ComparisonDependency] comparison_dependency=None, Optional[c_void_p] native_ptr=None, is_clone: bool=False -> def ) -> def 
 Class initializer. More...
 
def clone ( -> ComparisonDependency ) -> 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' ComparisonDependency. More...
 
def load_file (filename: str -> None ) -> def 
 Loads the ComparisonDependency definition from the specified file. More...
 
def save_file (filename: str -> None ) -> def 
 Saves the ComparisonDependency definition to the specified file. More...
 
ComparisonDependency Settings

Functions handling ComparisonDependency Settings.

def check ( -> bool ) -> def 
 Checks for if the dependency is met. More...
 
def configure (name: str, comp_type: ComparisonType, value: float, use_cal: bool, samp_num: int -> None ) -> def 
 Configures the comparison dependency. More...
 
def get_value ( -> float ) -> def 
 Returns the value for the comparison dependency.
 
def get_comparison_type ( -> ComparisonType ) -> def 
 Returns the comparison type for the comparison dependency.
 
def get_sample_number ( -> int ) -> def 
 Returns the sample number for the comparison dependency.
 
def get_use_calibrated_value ( -> bool ) -> def 
 Returns if the calibrated value should be used in the comparison.
 
- Public Member Functions inherited from Dependency
def ComparisonDependency ( -> None ) -> def 
 Class initializer. More...
 
def get_type ( -> DependencyType ) -> def 
 Gets the type of Dependency. 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 initialize ( -> None ) -> def 
 Initializes the object. 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 determine a parameter's dependency based on a numeric comparison.

A simple comparison class used to determine inclusion of a parameter based on the comparison with a value from a second parameter. Comparison operators supported are equal, not equal, greater than, great than or equal to, less than, and less than or equal to.

Constructor & Destructor Documentation

◆ ComparisonDependency()

(comparison_dependency : Optional[ComparisonDependency]  
native_ptr : Optional[c_void_p]  
is_clone : bool  
) -> def

Class initializer.

Parameters
[in]comparison_dependencyComparisonDependency to create a copy (optional). By default, initializes a new instance.
[in]native_ptr(Optional) Internal parameter, do not provide.
[in]is_clone(Optional) Internal parameter, do not provide.

Reimplemented from Dependency.

Member Function Documentation

◆ check()

() -> bool

Checks for if the dependency is met.

Compares dependency parameter value to the configured data to see if the parameter is included in the packet.

Returns
true if parameter dependency is met.

◆ configure()

(name : str 
comp_type : ComparisonType 
value : float 
use_cal : bool 
samp_num : int 
) -> None

Configures the comparison dependency.

Sets the parameter to check for dependency as well as the required attributes. The parameter name is not checked on input for existence in the containing packet. Also, the sample number is not checked to see if it exists. These checks will be performed when validation is available at the packet level.

Parameters
[in]nameThe name of the parameter whose value is checked.
[in]comp_typeThe comparison type.
[in]valueThe value to comparison against.
[in]use_calUse calibrated value.
[in]samp_numThe sample number of the parameter to use. Sample numbers begin with 1.

◆ copy()

(copy_from : object ) -> None

Copies the contents of the provided 'copy_from' ComparisonDependency.

Parameters
[in]copy_fromComparisonDependency to copy from.
Exceptions
TypeErrorif 'copy_from' is not a ComparisonDependency.

Reimplemented from NamedItem.

◆ load_file()

(filename : str ) -> None

Loads the ComparisonDependency definition from the specified file.

Reads an XML ComparisonDependency.

Parameters
[in]filenameThe file from which to load the ComparisonDependency object.

◆ save_file()

(filename : str ) -> None

Saves the ComparisonDependency definition to the specified file.

Writes an XML ComparisonDependency.

Parameters
[in]filenameThe file to save the and dependency object.