as2fm.scxml_converter.scxml_entries.scxml_data.ScxmlData
- class as2fm.scxml_converter.scxml_entries.scxml_data.ScxmlData(id_: str, expr: BtGetValueInputPort | str | int | float | bool, data_type: str, lower_bound: BtGetValueInputPort | str | int | float | None = None, upper_bound: BtGetValueInputPort | str | int | float | None = None)
Bases:
ScxmlBase
This class represents the variables defined in the model.
- __init__(id_: str, expr: BtGetValueInputPort | str | int | float | bool, data_type: str, lower_bound: BtGetValueInputPort | str | int | float | None = None, upper_bound: BtGetValueInputPort | str | int | float | None = None)
Methods
__init__
(id_, expr, data_type[, ...])as_plain_scxml
(struct_declarations, ...)Convert the object to its plain SCXML version.
as_xml
([type_as_attribute])Generate the XML element representing the single data entry.
Check if the current scxml data instance is valid.
from_xml_tree
(xml_tree, custom_data_types, ...)External interface to create a ScxmlBase object from an XML tree.
from_xml_tree_impl
(xml_tree, custom_data_types)Create a ScxmlData object from an XML tree.
get_body
()Get the body of the object.
Get the container with custom data types.
get_expr
()get_id
()Get the ID of the object.
get_name
()Get the tag name of the XML element.
Get the type of the data as a string.
Get the xml_element this object was made from.
Check if the data type is a base type.
set_custom_data_types
(custom_data_types)Save container with custom data types.
set_xml_origin
(xml_origin)Set the xml_element this object was made from.
update_bt_ports_values
(bt_ports_handler)Update the values of potential entries making use of BT ports.
- as_plain_scxml(struct_declarations: ScxmlStructDeclarationsContainer, ros_declarations: ScxmlRosDeclarationsContainer) List[ScxmlData]
Convert the object to its plain SCXML version.
- as_xml(type_as_attribute: bool = True) _Element
Generate the XML element representing the single data entry.
- Parameters:
type_as_attribute – If True, the type of the data is added as an attribute.
- check_validity() bool
Check if the current scxml data instance is valid.
- classmethod from_xml_tree(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition], **kwargs) Self
External interface to create a ScxmlBase object from an XML tree.
- classmethod from_xml_tree_impl(xml_tree: _Element, custom_data_types: Dict[str, StructDefinition], comment_above: str | None = None) ScxmlData
Create a ScxmlData object from an XML tree.
- get_body()
Get the body of the object.
- get_custom_data_types() Dict[str, StructDefinition]
Get the container with custom data types.
- get_id() str
Get the ID of the object.
- static get_tag_name() str
Get the tag name of the XML element.
- get_type_str() str
Get the type of the data as a string.
- get_xml_origin() _Element | None
Get the xml_element this object was made from.
- is_plain_scxml() bool
Check if the data type is a base type.
- set_custom_data_types(custom_data_types: Dict[str, StructDefinition])
Save container with custom data types.
- set_xml_origin(xml_origin: _Element)
Set the xml_element this object was made from.
- update_bt_ports_values(bt_ports_handler: BtPortsHandler)
Update the values of potential entries making use of BT ports.