LLRS#
- class ansys.scade.pyalmgw.llrs.LLRS(llr_export: LLRExport, kind, root)#
Base class for creating a surrogate model for a given product.
Overview#
Return the value of an attribute of a model element. |
|
Return the built-in attributes of a model element. |
|
Return the class name of a model element. |
|
Return the elements linked to a model element for a given association. |
|
Return the name of a model element. |
|
Return the oid of a model element. |
|
Return the path of a model element. |
|
Return the name of a model. |
|
Return the oid of a model. |
Parse a role expressions and return the role name and the list of classes. |
|
Dump the child elements as a tree. |
|
Add an entry for a model element. |
|
Dump the child elements as a list. |
|
Dump the children of a model element to a list. |
|
Return the attribute value of a model element. |
|
Generate the image of a model element and return its path when applicable or None. |
|
Return the linked elements of a model element for a given path. |
|
Return the URL corresponding to an oid. |
|
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.
- abstractmethod 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.
- abstractmethod 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.
- LLRS.get_item_image(item: Any) str | None#
Generate the image of a model element and return its path when applicable or None.
- abstractmethod LLRS.get_item_links(item: Any, role: str, sort: bool) List[Any]#
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.
- LLRS.get_links(item: Any, path: str, sort: bool) List[Any]#
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.
- LLRS.get_url(oid)#
Return the URL corresponding to an oid.
The default implementation uses the generic one.