Model builder for System Composer architecture models
Build System Composer™ models using the model builder utility class. Build System Composer models with these sets of information: components and their position in architecture hierarchy, ports and their mappings to components, connections between the components through ports, and interfaces in architecture models and their mappings to ports.
Components | Description |
---|---|
addComponent(compName, ID, ParentID) | Add component with name and ID as a child of component with ID as
ParentID . In case of root, ParentID is
0. |
setComponentProperty(ID, varargin) | Set stereotype on component with ID. Key value pair of property name and value defined in the stereotype can be passed as input. In this example builder.setComponentProperty(ID, 'StereotypeName',... 'UAVComponent.PartDescriptor','ModelName',kind,'Manufacturer',domain) ModelName and Manufacturer are properties
under stereotype PartDescriptor . |
Ports | Description |
---|---|
addPort(portName, direction, ID, compID) | Add port with name and ID with direction (either Input or Output) to component
with ID as compID . |
setPropertyOnPort(ID, varargin) | Set stereotype on port with ID. Key value pair of the property name and the value defined in the stereotype can be passed as input. |
Connections | Description |
---|---|
addConnection(connName, ID, sourcePortID,destPortID) | Add connection with name and ID between ports with
sourcePortID (direction: Output) and
destPortID (direction: Input) defined in the ports table. |
setPropertyOnConnection(ID, varargin) | Set stereotype on connection with ID. Key value pair of the property name and the value defined in the stereotype can be passed as input. |
Interfaces | Description |
---|---|
addInterface(interfaceName, ID) | Add interface with name and ID to a data dictionary. |
addElementInInterface(elementName, ID, interfaceID, datatype,
dimensions, units, complexity, Maximum, Minimum) | Add element with name and ID under an interface with ID as
interfaceID . Data types, dimensions, units, complexity, and
maximum and minimum are properties of an element. These properties are specified as
strings. |
addAnonymousInterface(ID, datatype, dimensions, units, complexity,
Maximum, Minimum) | Add anonymous interface with ID and element properties like data type, dimensions, units, complexity, maximum and minimum. Data type of an anonymous interface cannot be another interface name. Anonymous interfaces do not have elements like other interfaces. |
Interfaces and Ports | Description |
---|---|
addInterfaceToPort(interfaceID, portID) | Link an interface with ID specified as InterfaceID to a port
with ID specified as PortID . |
Models | Description |
---|---|
build(modelName) | Build model with model name passed as input. |
Logging and Reporting | Description |
---|---|
getImportErrorLog() | Get ErrorLogs generated while importing the model . Called
after the build() function |
getImportReport() | Get a report of the import. Called after the build()
function. |