This example shows how to import architecture specifications into System Composer using the systemcomposer.io.modelBuilder() utility class. These architecture specifications can be defined in external source such as Excel file.
In system composer, an architecture is fully defined by three sets of information:
Components and its position in architecture hierarchy
Ports and its mapping to components
Connections between the components through ports In this example, we also import interface data definitions from external source.
Interfaces in architecture models and its mapping to ports
This example uses systemcomposer.modelBuilder class to pass all of the above architecture information and import a System Composer model.
In this example, architecture information of a small UAV system is defined in an Excel spreadsheet and is used to create a System Composer architecture model.
External Source Files
# Element : Name of the element. Either can be component or port name.
# Parent : Name of the parent element.
# Class : Can be either component or port(Input/Output direction of the port).
# Domain : Mapped as component property. Property "Manufacturer" defined in the
profile UAVComponent under Stereotype PartDescriptor maps to Domain values in excel source file.
# Kind : Mapped as component property. Property "ModelName" defined in the
profile UAVComponent under Stereotype PartDescriptor maps to Kind values in excel source file.
# InterfaceName : If class is of port type. InterfaceName maps to name of the interface linked to port.
# ConnectedTo : In case of port type, it specifies the connection to
other port defined in format "ComponentName::PortName".
# Name : Name of the interface or element.
# Parent : Name of the parent interface Name(Applicable only for elements) .
# Datatype : Datatype of element. Can be another interface in format
Bus: InterfaceName
# Dimensions : Dimensions of the element.
# Units : Unit property of the element.
# Minimum : Minimum value of the element.
# Maximum : Maximum value of the element.
Step 1. Instantiate the model builder class
You can instantiate the model builder class with a profile name.
Make sure the current directory is writable because this example will be creating files.
Step 2. Build Interface Data Definitions.
Reading the information in external source file DataDefinitions.xlsx, we build the interface data model.
Create MATLAB tables from source Excel file.
Step 3. Build Architecture Specifications.
Architecture specifications de Create MATLAB tables from source Excel file.
Step 3. Builder build method imports model from populated tables.
Close Model