as2fm.scxml_converter.scxml_entries.scxml_data_model.ScxmlDataModel
- class as2fm.scxml_converter.scxml_entries.scxml_data_model.ScxmlDataModel(data_entries: List[ScxmlData] | None = None)
Bases:
ScxmlBaseThis class represents the variables defined in the model.
Methods
__init__([data_entries])as_plain_scxml(struct_declarations, ...)Convert the object to its plain SCXML version.
as_xml([type_as_attribute])Store the datamodel, containing all model's data entries, as an XML element.
Check if the object 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 ScxmlDataModel object from an XML tree.
Get the container with custom data types.
get_data_entries()Get the tag name of the XML element.
Get the xml_element this object was made from.
is_plain_scxml([verbose])Check if all data entries are already plain-scxml (using only base types).
Replace all data entries of type string (or arrays of strings) to array of ints.
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.
- as_plain_scxml(struct_declarations, ascxml_declarations, **kwargs)
Convert the object to its plain SCXML version.
- Parameters:
struct_declarations – List of custom structures defined in the model
ascxml_declarations – Additional declarations, like ROS or BT specific ones
kwargs – Additional framework specific entries, e.g. the BT plugin ID.
- as_xml(type_as_attribute: bool = True) _Element | None
Store the datamodel, containing all model’s data entries, as an XML element.
- Parameters:
type_as_attribute – If True, store data types as arguments, if False as Comments
- check_validity() bool
Check if the object 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]) ScxmlDataModel
Create a ScxmlDataModel object from an XML tree.
- get_custom_data_types() Dict[str, StructDefinition]
Get the container with custom data types.
- static get_tag_name() str
Get the tag name of the XML element.
- get_xml_origin() _Element | None
Get the xml_element this object was made from.
- is_plain_scxml(verbose: bool = False) bool
Check if all data entries are already plain-scxml (using only base types).
- replace_strings_types_with_integer_arrays() None
Replace all data entries of type string (or arrays of strings) to array of ints.
- 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.