pymasep.common.object_state =========================== .. py:module:: pymasep.common.object_state Classes ------- .. autoapisummary:: pymasep.common.object_state.ObjectState Module Contents --------------- .. py:class:: ObjectState(environment, name = None, parent = None, xml_node = None, template=None, src_copy = None) Bases: :py:obj:`pymasep.common.BaseObject` Class to handle an ObjectState of an Object :param environment: an Environment instance :param name: name of the ObjectState. Not used in this case, 'state' is set for ObjectState :param xml_node: XML used to create the object. :param template: Template of the object. Needed if no xml_node. If the template is present, must include a value_type (see :ref:`templates`) :param src_copy: The ObjectState to copy. Needed if no xml_node or template. The copy is not made into the constructor. :raise pymasep.common.exception.CreationException: If no XML or no template or src_copy is present .. py:attribute:: name :value: 'state' name of the object state .. py:attribute:: characteristics Characteristics of the object state .. py:method:: state() State of the ObjectState. "Init" if the ObjectState or one of its characteristics is in init state. :return: The state of the ObjectState .. py:method:: add_characteristic(characteristic) Adding a characteristic object inside the ObjectState. The key id of the characteristic is its name attribute :param characteristic: Characteristic to add. .. py:method:: id_str() Create a string unique ID of the ObjectState. Return a concatenation of the id_str of the base object and the id_str of all characteristics :return: The string unique ID .. py:method:: to_xml() Transform the ObjectState to XML including all Characteristics. See :ref:`serialization` for more information. :return: XML version of the ObjectState .. py:method:: from_xml(environment, xml_node) Transform an XML to an ObjectState. The instance must be created before (with __init__(), passing the xml_node). See :ref:`serialization` for more information. :param environment: The environment where the ObjectState is created. :param xml_node: The XML node that contains the ObjectState data. :raise pymasep.common.exception.CreationException: SubElement must be present if initializer is not present. At creation, Initializer must be present for all characteristics if initializer is not present for ObjectState .. py:method:: check_all_init_charac_have_initializer(initializer) DEPRECATED ? .. py:method:: copy_obs(params) Deep copy the ObjectState to a new instance. :param params: Not used in this method. Note : this method copy the reference of the parent. The parent should do the parent copy and assignment