LLRS#

class ansys.scade.pyalmgw.llrs.LLRS(llr_export: LLRExport, kind, root)#

Base class for creating a surrogate model for a given product.

Overview#

get_item_attribute

Return the value of an attribute of a model element.

get_item_attributes

Return the built-in attributes of a model element.

get_item_class

Return the class name of a model element.

get_item_links

Return the elements linked to a model element for a given association.

get_item_name

Return the name of a model element.

get_item_oid

Return the oid of a model element.

get_item_pathname

Return the path of a model element.

get_model_name

Return the name of a model.

get_model_oid

Return the oid of a model.

decompose_role

Parse a role expressions and return the role name and the list of classes.

dump_children

Dump the child elements as a tree.

dump_item

Add an entry for a model element.

dump_siblings

Dump the child elements as a list.

dump_sub_elements

Dump the children of a model element to a list.

get_attribute

Return the attribute value of a model element.

get_item_image

Generate the image of a model element and return its path when applicable or None.

get_links

Return the linked elements of a model element for a given path.

get_url

Return the URL corresponding to an oid.

new_section

Create a Section entry.

Import detail#

from ansys.scade.pyalmgw.llrs import LLRS

Attribute detail#

LLRS.V194 = 4#
LLRS.VCUSTOM = 0#
LLRS.kind#
LLRS.llr_export#
LLRS.re_path#
LLRS.root#
LLRS.version = 0#

Method detail#

LLRS.decompose_role(item, role_expression: str)#

Parse a role expressions and return the role name and the list of classes.

The syntax of a role expression is [ '{' [ ',' ]* '}' ].

LLRS.dump_children(container, item, cls, parent_oid)#

Dump the child elements as a tree.

LLRS.dump_item(container: List[Any], item: Any, kind: str, parent_oid: str)#

Add an entry for a model element.

Parameters:
containerList[Any]

List to add the element to.

itemAny

Input model element.

kindstr

Kind of the model element, that overrides the default if not empty.

parent_oidstr

Oid of the element’s parent.

LLRS.dump_siblings(container, item, cls, parent_oid)#

Dump the child elements as a list.

LLRS.dump_sub_elements(container: List[Any], item: Any, cls: str, flatten: bool, parent_oid: str)#

Dump the children of a model element to a list.

Parameters:
containerList[Any]

List to add the child elements to.

itemAny

Input model element.

clsstr

Name of the model element’s class.

flatten

Whether the child elements are in the same list or in a sub-tree.

parent_oidstr

Oid of the parent item.

LLRS.get_attribute(item: Any, path: str) Any#

Return the attribute value of a model element.

Parameters:
itemAny

Input model element.

pathstr

Path of the attribute.

Returns:
Any

The value of the attribute or None if an error occurs.

abstract LLRS.get_item_attribute(item: Any, name: str) Any#

Return the value of an attribute of a model element.

Parameters:
itemAny

Input model element.

namestr

Name of the attribute to consider in the meta-model.

Returns:
Any

Attribute value.

abstract LLRS.get_item_attributes(item: Any) list#

Return the built-in attributes of a model element.

This applies to annotatable elements: the list contains the annotation values tagged as LLR_PROP.

abstract LLRS.get_item_class(item: Any) str#

Return the class name of a model element.

LLRS.get_item_image(item: Any) str | None#

Generate the image of a model element and return its path when applicable or None.

Return the elements linked to a model element for a given association.

Parameters:
itemAny

Input model element.

rolestr

Name of the association end to consider in the meta-model.

sortbool

Whether the output collection should be sorted.

Returns:
List[Any]

List of linked elements.

abstract LLRS.get_item_name(item: Any) str#

Return the name of a model element.

abstract LLRS.get_item_oid(item: Any) str#

Return the oid of a model element.

abstract LLRS.get_item_pathname(item: Any) str#

Return the path of a model element.

Return the linked elements of a model element for a given path.

Parameters:
itemAny

Input model element.

pathstr

Dot-separated list of association ends of the meta-model.

sortbool

Whether the list should be sorted.

Returns:
List[Any]

List of linked elements.

abstract LLRS.get_model_name(model: Any) str#

Return the name of a model.

abstract LLRS.get_model_oid(model: Any) str#

Return the oid of a model.

LLRS.get_url(oid)#

Return the URL corresponding to an oid.

The default implementation uses the generic one.

LLRS.new_section(name: str, elements: List[Any], oid: str) dict#

Create a Section entry.

Parameters:
namestr

Title of the section.

elementsList[Any]

List of contained elements.

oidstr

Oid of the section.

Returns:
dict