def __init__(self, name='', comment='', visible=True): '''Constructor. @param name Name of the port. @type name str @param comment A comment about the port. @type comment str @param visible If this port is visible in graphical displays. @type visible bool ''' validate_attribute(name, 'dataPort.name', expected_type=string_types(), required=False) self._name = name validate_attribute(comment, 'component.ext.comment', expected_type=string_types(), required=False) self._comment = comment validate_attribute(visible, 'component.ext.visible', expected_type=bool, required=False) self._visible = visible self._properties = {}
def __init__(self, id='', kind='', rate=0.0): '''Constructor. @param id The ID of this execution context. @type id str @param kind The action execution type used by this context. @type kind str @param rate The execution rate of this context, if it is periodic. @type float ''' validate_attribute(id, 'execution_context.id', expected_type=string_types(), required=False) self._id = id validate_attribute(kind, 'execution_context.kind', expected_type=string_types(), required=False) self._kind = kind validate_attribute(rate, 'execution_context.rate', expected_type=[int, float], required=False) self._rate = rate self._participants = [] self._properties = {}
def __init__(self, id='', path_uri='', active_configuration_set='', instance_name='', composite_type=comp_type.NONE, is_required=False, comment='', visible=True, location=Location()): '''@param id Component ID. @type id str @param path_uri Path to the component. @type path_uri str @param active_configuration_set Name of the active configuration set. @type active_configuration_set str @param instance_name Component's instance name. @type instance_name str @param composite_type Type of composition the component is in. @type composite_type CompositeType @param is_required If the component is optional in the system. @type is_required bool @param comment A comment about the component. @type comment str @param visible If this component is visible in graphical displays. @type visible bool @param location The location of this component in graphical displays. @type location Location ''' self._reset() validate_attribute(id, 'component.id', expected_type=string_types(), required=False) self._id = id validate_attribute(path_uri, 'component.pathUri', expected_type=string_types(), required=False) self._path_uri = path_uri validate_attribute(active_configuration_set, 'component.activeConfigurationSet', expected_type=string_types(), required=False) self._active_config_set = active_configuration_set validate_attribute(instance_name, 'component.instanceName', expected_type=string_types(), required=False) self._instance_name = instance_name validate_attribute(composite_type, 'component.compositeType', expected_type=comp_type.const_type, required=False) self._composite_type = composite_type validate_attribute(is_required, 'component.isRequired', expected_type=bool) self._is_required = is_required validate_attribute(comment, 'component.ext.comment', expected_type=string_types(), required=False) self._comment = comment validate_attribute(visible, 'component.ext.visible', expected_type=bool, required=False) self._visible = visible validate_attribute(location, 'component.ext.Location', expected_type=Location, required=True) self._location = location
def __init__(self, name='', data=''): '''Constructor. @param name The name of the parameter. @type name str @param data The parameter's value, if any. @type data str ''' validate_attribute(name, 'configuration_set.name', expected_type=string_types(), required=False) self._name = name validate_attribute(data, 'configuration_set.data', expected_type=string_types(), required=False) self._data = data
def __init__(self, component_id='', instance_name=''): '''Constructor. @param component_id The ID of the target component. @type component_id str @param instance_name The instance name of the target component. @type instance_name str ''' validate_attribute(component_id, 'target_component.componentID', expected_type=string_types(), required=False) self._component_id = component_id validate_attribute(instance_name, 'target_component.instanceName', expected_type=string_types(), required=False) self._instance_name = instance_name self._properties = {}
def __init__(self, sequence=0, target_component=TargetExecutionContext(), timeout=0, sending_timing='', preceding_components=[]): '''Constructor. @param sequence Execution order of the target component. @type sequence int @param target_component The target of the condition. @type target_component TargetComponent @param timeout Status check timeout. @type timeout int @param sending_timing Timing for executing actions. @type sending_timing str @param preceding_components Preceding components of the condition. @type preceding components list(TargetExecutionContext) ''' super(Preceding, self).__init__(sequence, target_component) validate_attribute(timeout, 'preceding.timeout', expected_type=int, required=False) self._timeout = timeout validate_attribute(sending_timing, 'preceding.sendingTiming', expected_type=string_types(), required=False) self._sending_timing = sending_timing validate_attribute(preceding_components, 'preceding.PrecedingComponents', expected_type=list, required=False) self._preceding_components = preceding_components
def parse_from_xml(self, xml_spec): '''Parse a string or file containing an XML specification.''' if type(xml_spec) in string_types(): dom = xml.dom.minidom.parseString(xml_spec) else: dom = xml.dom.minidom.parse(xml_spec) self._parse_xml(dom) dom.unlink()
def __init__(self, connector_id='', name='', trans_method='', source_service_port=TargetPort(), target_service_port=TargetPort(), comment='', visible=True): '''Constructor. @param connector_id ID of the connector. @type connector_id str @param name Name of the connector. @type name str @param trans_method Transport method used by the ports. @type trans_method str @param source_service_port The source port in the connection. @type source_service_port TargetPort @param target_service_port The target port in the connection. @type target_service_port TargetPort @param comment A comment about the port connector. @type comment str @param visible If this connector is visible in graphical displays. @type visible bool ''' validate_attribute(connector_id, 'serviceport_connector.connectorID', expected_type=string_types(), required=False) self._connector_id = connector_id validate_attribute(name, 'serviceport_connector.name', expected_type=string_types(), required=False) self._name = name validate_attribute(trans_method, 'serviceport_connector.transMethod', expected_type=string_types(), required=False) self._trans_method = trans_method validate_attribute(source_service_port, 'serviceport_connector.sourceServicePort', expected_type=TargetPort, required=True) self._source_service_port = source_service_port validate_attribute(target_service_port, 'serviceport_connector.targetServicePort', expected_type=TargetPort, required=True) self._target_service_port = target_service_port validate_attribute(comment, 'component.ext.comment', expected_type=string_types(), required=False) self._comment = comment validate_attribute(visible, 'component.ext.visible', expected_type=bool, required=False) self._visible = visible self._properties = {}
def __init__(self, id=''): '''Constructor. @param id The configuration set ID. @type id str ''' validate_attribute(id, 'configuration_set.id', expected_type=string_types(), required=False) self._id = id self._config_data = []
def __init__(self, component_id='', instance_name='', port_name=''): '''Constructor. See also the @ref TargetComponent constructor. @param port_name The name of the target port. @type port_name str ''' super(TargetPort, self).__init__(component_id, instance_name) validate_attribute(port_name, 'target_port.portName', expected_type=string_types(), required=False) self._port_name = port_name
def __init__(self, component_id='', instance_name='', id=''): '''Constructor. See also the @ref TargetComponent constructor. @param id The ID of the target execution context. @type id str ''' super(TargetExecutionContext, self).__init__(component_id, instance_name) validate_attribute(id, 'target_executioncontext.id', expected_type=string_types(), required=False) self._id = id self._properties = {}
def __init__(self, group_id='', members=[]): '''Constructor. @param group_id ID of the group. @type group_id str @param members Members of the group. At least one must be present. @type members list ''' validate_attribute(group_id, 'component_group.groupID', expected_type=string_types(), required=False) self._group_id = group_id validate_attribute(members, 'component_group.Members', expected_type=list, required=False) self._members = members
def parse_from_xml(self, xml_spec): '''Parse a string or file containing an XML specification. Example: >>> s = RtsProfile() >>> s.parse_from_xml(open('test/rtsystem.xml')) >>> len(s.components) 3 Load of invalid data should throw exception: >>> s.parse_from_xml('non-XML string') Traceback (most recent call last): ... ExpatError: syntax error: line 1, column 0 ''' if type(xml_spec) in string_types(): dom = xml.dom.minidom.parseString(xml_spec) else: dom = xml.dom.minidom.parse(xml_spec) self._parse_xml(dom) dom.unlink()
def trans_method(self, trans_method): validate_attribute(trans_method, 'serviceport_connector.transMethod', expected_type=string_types(), required=False) self._trans_method = trans_method
def creation_date(self, creation_date): validate_attribute(creation_date, 'rts_profile.creationDate', expected_type=string_types(), required=True) self._creation_date = creation_date
def comment(self, comment): validate_attribute(comment, 'component.ext.comment', expected_type=string_types(), required=False) self._comment = comment
def active_configuration_set(self, active_config_set): validate_attribute(active_config_set, 'component.activeConfigurationSet', expected_type=string_types(), required=False) self._active_config_set = active_config_set
def id(self, id): validate_attribute(id, 'component.id', expected_type=string_types(), required=True) self._id = id
def group_id(self, group_id): validate_attribute(group_id, 'component_group.groupID', expected_type=string_types(), required=True) self._group_id = group_id
def id(self, id): validate_attribute(id, 'target_executioncontext.id', expected_type=string_types(), required=True) self._id = id
def update_date(self, update_date): validate_attribute(update_date, 'rts_profile.updateDate', expected_type=string_types(), required=True) self._update_date = update_date
def port_name(self, port_name): validate_attribute(port_name, 'target_port.portName', expected_type=string_types(), required=True) self._port_name = port_name
def id(self, id): validate_attribute(id, 'rts_profile.id', expected_type=string_types(), required=True) self._id = id
def comment(self, comment): validate_attribute(comment, 'serviceport_connector.ext.comment', expected_type=string_types(), required=False) self._comment = comment
def data(self, data): validate_attribute(data, 'configuration_set.data', expected_type=string_types(), required=False) self._data = data
def version(self, version): validate_attribute(version, 'rts_profile.version', expected_type=string_types(), required=True) self._version = version
def name(self, name): validate_attribute(name, 'serviceport_connector.name', expected_type=string_types(), required=True) self._name = name
def name(self, name): validate_attribute(name, 'configuration_set.name', expected_type=string_types(), required=True) self._name = name
def __init__(self, connector_id='', name='', data_type='', interface_type='', data_flow_type='', subscription_type='', push_interval=0.0, source_data_port=TargetPort(), target_data_port=TargetPort(), comment='', visible=True): '''Constructor. @param connector_id ID of the connector. @type connector_id str @param name Name of the connector. @type name str @param data_type Data type that this connector transports. @type data_type str @param interface_type Interface type of the connected ports. @type interface_type str @param data_flow_type Type of data flow between the ports. @type data_flow_type str @param subscription_type Type of subscription between the ports. @type subscription_type str @param push_interval Rate at which data is sent between the ports. @type push_interval float @param source_data_port The source port in the connection. @type source_data_port TargetPort @param target_data_port The target port in the connection. @type target_data_port TargetPort @param comment A comment about the port connector. @type comment str @param visible If this connector is visible in graphical displays. @type visible bool ''' validate_attribute(connector_id, 'dataport_connector.connectorID', expected_type=string_types(), required=False) self._connector_id = connector_id validate_attribute(name, 'dataport_connector.name', expected_type=string_types(), required=False) self._name = name validate_attribute(data_type, 'dataport_connector.dataType', expected_type=string_types(), required=False) self._data_type = data_type validate_attribute(interface_type, 'dataport_connector.interfaceType', expected_type=string_types(), required=False) self._interface_type = interface_type validate_attribute(data_flow_type, 'dataport_connector.dataflowType', expected_type=string_types(), required=False) self._data_flow_type = data_flow_type validate_attribute(subscription_type, 'dataport_connector.subscriptionType', expected_type=string_types(), required=False) self._subscription_type = subscription_type validate_attribute(push_interval, 'dataport_connector.pushInterval', expected_type=[int, float], required=False) self._push_interval = push_interval validate_attribute(source_data_port, 'dataport_connector.sourceDataPort', expected_type=TargetPort, required=False) self._source_data_port = source_data_port validate_attribute(target_data_port, 'dataport_connector.targetDataPort', expected_type=TargetPort, required=False) self._target_data_port = target_data_port validate_attribute(comment, 'component.ext.comment', expected_type=string_types(), required=False) self._comment = comment validate_attribute(visible, 'component.ext.visible', expected_type=bool, required=False) self._visible = visible self._properties = {}
def id(self, id): validate_attribute(id, 'configuration_set.id', expected_type=string_types(), required=True) self._id = id
def name(self, name): validate_attribute(name, 'dataPort.name', expected_type=string_types(), required=True) self._name = name
def path_uri(self, path_uri): validate_attribute(path_uri, 'component.pathUri', expected_type=string_types(), required=True) self._path_uri = path_uri
def connector_id(self, connector_id): validate_attribute(connector_id, 'serviceport_connector.connectorID', expected_type=string_types(), required=True) self._connector_id = connector_id
def instance_name(self, instance_name): validate_attribute(instance_name, 'component.instanceName', expected_type=string_types(), required=True) self._instance_name = instance_name
def abstract(self, abstract): validate_attribute(abstract, 'rts_profile.abstract', expected_type=string_types(), required=False) self._abstract = abstract
def sending_timing(self, sending_timing): validate_attribute(sending_timing, 'preceding.sendingTiming', expected_type=string_types(), required=False) self._sending_timing = sending_timing
def component_id(self, component_id): validate_attribute(component_id, 'target_component.componentID', expected_type=string_types(), required=True) self._component_id = component_id
def data_flow_type(self, data_flow_type): validate_attribute(data_flow_type, 'dataport_connector.dataflowType', expected_type=string_types(), required=True) self._data_flow_type = data_flow_type
def subscription_type(self, subscription_type): validate_attribute(subscription_type, 'dataport_connector.subscriptionType', expected_type=string_types(), required=False) self._subscription_type = subscription_type