Tekvel Magic
Loading...
Searching...
No Matches
NSD Class Reference

Namespace definition processing. More...

Public Member Functions

def __init__ (self, nsd_path)
 
def get_trgops_da_names (self, str trgname)
 Get grouped Data Attribute names with a specific trigger operation. More...
 
def get_dchg_da_names (self)
 Get Data Attribute names with dchg trigger operation. More...
 
def get_qchg_da_names (self)
 Get Data Attribute names with qchg trigger operation. More...
 
def get_dupd_da_names (self)
 Get Data Attribute names with dupd trigger operation. More...
 
def get_ln_class_list (self)
 Get LN class list. More...
 
def get_ln_name_list (self)
 DEPRECATED! Get LN class list. More...
 
def get_do_dict_list (self, str ln_class, bool mandatory_only=False, bool optional_only=False, str condition=None)
 Get list of DOs as dictionaries by condition. More...
 
def get_do_name_list (self, str ln_class, bool mandatory_only=False, bool optional_only=False, str condition=None)
 Get DO name list for specific LN class. More...
 
def get_do_spec_by_path (self, str do_path)
 Get DO specification by path. More...
 
def get_lnclass_spec (self, str lnClass)
 Get LN class specification. More...
 
def get_cdc_spec (self, str cdcName, str variant=None)
 Get CDC specification. More...
 
def get_constructedAttribute_spec (self, str datype)
 Get Constructed Attribute specification. More...
 
def get_enumtype_spec (self, enumtype)
 Get Enumeration type specification. More...
 

Public Attributes

 namespaces
 
 default_namespace
 
 dom
 

Detailed Description

Namespace definition processing.

This class allows to work with namespace definition files. The class shall be initialized with nsd_path specifing the path to specific namespace definition file.

Note
The script context already contains pre-initialized NSD instances, such as NSD_7_4. It is not required to initialize pre-initialized NSD isntances, and you can directly call it's functions.
See also
NSD_7_4

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  nsd_path 
)

Member Function Documentation

◆ get_cdc_spec()

def get_cdc_spec (   self,
str  cdcName,
str  variant = None 
)

Get CDC specification.

Retrieves the specification of a Common Data Class (CDC) by its name. If a variant is provided, it retrieves the specification for that particular variant.

Parameters
cdcNameCDC name.
variantOptional parameter specifying the variant of the CDC.
Returns
List of dictionaries containing the specification of the CDC.

◆ get_constructedAttribute_spec()

def get_constructedAttribute_spec (   self,
str  datype 
)

Get Constructed Attribute specification.

Retrieves the specification of a Constructed Attribute by its type name.

Parameters
datypeConstructed Attribute type name.
Returns
List of dictionaries containing the specification of the Constructed Attribute.

◆ get_dchg_da_names()

def get_dchg_da_names (   self)

Get Data Attribute names with dchg trigger operation.

This function retrieves Data Attribute names grouped by functional constraints (fc) where the dchg trigger operation is set to true in the NSD DOM.

See also
get_trgops_da_names

◆ get_do_dict_list()

def get_do_dict_list (   self,
str  ln_class,
bool  mandatory_only = False,
bool  optional_only = False,
str  condition = None 
)

Get list of DOs as dictionaries by condition.

Retrieves a list of Data Objects (DOs) for a specific Logical Node (LN) class based on the given conditions. The DOs are returned as dictionaries containing their attributes.

Parameters
ln_classThe class of the Logical Node to retrieve the DOs for.
mandatory_onlyIf True, only mandatory DOs are included in the list. Default is False.
optional_onlyIf True, only optional DOs are included in the list. Default is False.
conditionAn optional condition string to filter the DOs. Default is None.
Returns
A list of dictionaries representing the attributes of the DOs.

◆ get_do_name_list()

def get_do_name_list (   self,
str  ln_class,
bool  mandatory_only = False,
bool  optional_only = False,
str  condition = None 
)

Get DO name list for specific LN class.

Retrieves a list of Data Object (DO) names for a specific Logical Node (LN) class based on the given conditions.

Parameters
ln_classLN class identification
mandatory_onlyCondition for mandatory only attributes to be extracted
optional_onlyCondition for optional only attributes to be extracted
conditionSpecifies a condition for extracted DOs as a string (eg. "M", "O", "Omulti", etc.)
Returns
A list of DO names

◆ get_do_spec_by_path()

def get_do_spec_by_path (   self,
str  do_path 
)

Get DO specification by path.

Retrieves the specification of a Data Object (DO) by its path, which includes the LN class and DO name.

Parameters
do_pathPath to DO, including LN class and DO name in the following format: LNclass.DOname (e.g.: XCBR.Pos).
Exceptions
ExceptionRaised if the specified do_path is incorrect or if no DO with the specified name is found.
Returns
The specification of the DO as a dictionary.

◆ get_dupd_da_names()

def get_dupd_da_names (   self)

Get Data Attribute names with dupd trigger operation.

This function retrieves Data Attribute names grouped by functional constraints (fc) where the dupd trigger operation is set to true in the NSD DOM.

See also
get_trgops_da_names

◆ get_enumtype_spec()

def get_enumtype_spec (   self,
  enumtype 
)

Get Enumeration type specification.

Retrieves the specification of an Enumeration type by its name.

Parameters
enumtypeEnumeration type name.
Exceptions
ExceptionRaised if the method is not implemented.
Returns
None

◆ get_ln_class_list()

def get_ln_class_list (   self)

Get LN class list.

◆ get_ln_name_list()

def get_ln_name_list (   self)

DEPRECATED! Get LN class list.

◆ get_lnclass_spec()

def get_lnclass_spec (   self,
str  lnClass 
)

Get LN class specification.

Retrieves the specification of a Logical Node (LN) class, which is represented by a 4-symbol string.

Parameters
lnClassLN class, a 4-symbol string.
Returns
The specification of the LN class.

◆ get_qchg_da_names()

def get_qchg_da_names (   self)

Get Data Attribute names with qchg trigger operation.

This function retrieves Data Attribute names grouped by functional constraints (fc) where the qchg trigger operation is set to true in the NSD DOM.

See also
get_trgops_da_names

◆ get_trgops_da_names()

def get_trgops_da_names (   self,
str  trgname 
)

Get grouped Data Attribute names with a specific trigger operation.

Retrieves names of DataAttribute elements from the NSD DOM, grouped by their fc (functional constraint), that are marked as true for the specified trigger operation attribute (e.g., dchg, qchg, dupd). The result is returned as a sorted list of tuples where each tuple contains the functional constraint (fc) and a sorted list of corresponding names.

Example:

trgops_names = nsd_instance.get_trgops_da_names("dchg")
for fc, names in trgops_names:
print(f"Functional Constraint: {fc}, Data Attribute Names: {names}")
Parameters
trgnameThe name of the trigger operation attribute to search for (dchg, qchg, dupd).
Returns
A sorted list of tuples. Each tuple contains:
  • fc: Functional constraint (string)
  • A sorted list of unique names (list of strings).

Member Data Documentation

◆ default_namespace

default_namespace

◆ dom

dom

◆ namespaces

namespaces