Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
CounterDependency Class Reference

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

Inherits Dependency.

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

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

Functions handling CounterDependency Settings.

def configure (name: str, mod_value: int, remainder_value: int -> None ) -> def 
 Configures the counter dependency. More...
 
def get_modulo ( -> int ) -> def 
 Returns the modulo value for the counter dependency. More...
 
def get_remainder ( -> int ) -> def 
 Returns the remainder value for the counter dependency. More...
 
def get_start_counter ( -> int ) -> def 
 Returns the start counter value for the counter dependency. More...
 
def get_dependency_parameter ( -> str ) -> def 
 Returns the parameter to use for the counter.
 
def set_start_counter (counter: int=0 -> None ) -> def 
 Sets a start counter for the dependency. More...
 
- Public Member Functions inherited from Dependency
def CounterDependency ( -> 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 counter.

For parameter X with a dependency on Parameter Y, the remainder from the modulo operator on the counter value (Y) determines if the parameter should be included. value(Y) % mod_value == remainder

Constructor & Destructor Documentation

◆ CounterDependency()

(counter_dependency : Optional[CounterDependency]  
native_ptr : Optional[c_void_p]  
is_clone : bool  
) -> def

Class initializer.

Parameters
[in]counter_dependencyCounterDependency 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

◆ configure()

(name : str 
mod_value : int 
remainder_value : int 
) -> None

Configures the counter 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. This check will be performed when validation is available at the packet level.

Parameters
[in]nameThe name of the parameter whose value is checked.
[in]mod_valueThe modulo value (mod_value > remainder_value).
[in]remainder_valueThe remainder that must match the value % mod_value.
Exceptions
TrekError15103 - TREK_DATA_REMAINDER_TOO_LARGE

◆ copy()

(copy_from : object ) -> None

Copies the contents of the provided 'copy_from' CounterDependency.

Parameters
[in]copy_fromCounterDependency to copy from.
Exceptions
TypeErrorif 'copy_from' is not a CounterDependency.

Reimplemented from NamedItem.

◆ get_modulo()

() -> int

Returns the modulo value for the counter dependency.

Returns
Modulo value.

◆ get_remainder()

() -> int

Returns the remainder value for the counter dependency.

Returns
Remainder value.

◆ get_start_counter()

() -> int

Returns the start counter value for the counter dependency.

Returns
Start counter.

◆ load_file()

(filename : str ) -> None

Loads the CounterDependency definition from the specified file.

Reads an XML CounterDependency.

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

◆ save_file()

(filename : str ) -> None

Saves the CounterDependency definition to the specified file.

Writes an XML CounterDependency.

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

◆ set_start_counter()

(counter : int  ) -> None

Sets a start counter for the dependency.

If a start counter is defined, then the dependency check will return false (fail) if the counter value is not greater than or equal to the value specified. The default start counter value is 0.

Parameters
[in]counterCounter start value > 0.