You can add the
unitPrice property to an electrical component using a
stereotype. A stereotype extends the modeling language with domain-specific metadata. A
stereotype adds properties to the root-level architecture, component architecture, ports,
connectors, data interfaces, and value types. You can also apply a stereotype to only a
specific element type, such as component architectures. When a model element has a stereotype
applied, you can specify property values as part of its architectural definition. In addition
to allowing you to manage properties relevant to the system specification within the
architecture model, stereotypes and associated properties also allow you to analyze an
A profile contains a set of model element stereotypes with custom properties.
Each profile contains a set of stereotypes, and each stereotype contains a set of properties.
This example will show you how to compute the total cost of the system given the cost of its constituent parts. The example profile is limited to this goal.
Start this tutorial with the following mobile robot architecture model without a profile applied. Use the model to follow the steps and populate its elements with stereotypes and properties.
This example shows a mobile robot architecture model with no properties defined. You can apply the stereotypes from the profile
Use the Property Inspector to set the properties on each component.
Load a profile to make stereotypes available for model elements. This procedure uses the
ex_RobotArch.slx. Navigate to Modeling > Profiles > Profile Editor to open the Profile Editor. Open the profile file
simpleProfile.xml to load the profile in the Profile Editor.
In the profile, observe these stereotypes.
|components, ports, connectors|
Importing the profile makes stereotypes available to their applicable elements.
sysGeneral is a general stereotype, applicable to all element
types, that enables adding generic properties such as a
project members can use to track any issues with the element.
sysComponent stereotype applies only to components, and includes
properties such as
cost that contribute
to the total weight and cost specifications of the robot system.
sysConnector stereotype applies to connectors and includes
weight properties defined per
meter of length (assuming a physical connector, such as a wire). These properties help
compute the total weight and cost of the design.
sysPort stereotype applies to ports and does not include any
You can add a stereotype icon to all component-level stereotypes. You can choose from a set of default icons, or you can create your own icons.
Add custom properties to a model element by applying a stereotype from a loaded profile.
Navigate to Modeling > Profiles > Import .
Navigate to Modeling > Profiles > Apply Stereotypes to open the Apply Stereotypes dialog box.
In Apply Stereotypes, from Apply stereotype(s) to, select
All elements. From Scope, select
In the list of available stereotypes, select
Click Apply and close the window to exit the dialog box.
GPS component. Right-click, then click Apply
Stereotype. Select the
sysComponent stereotype is used for managing physical
properties and cost.
Repeat these steps for the
Navigate to the top of the model. Apply the
stereotype to the
components and the top-level architecture model. Right-click each component or a space
in the top-level, then select Apply Stereotype to ensure
simpleProfile.sysComponent is selected.
sysConnector stereotype to all connectors in the
Sensors layer, the
Trajectory Planning layer,
and the top model layer. Press and hold Shift to select multiple
connectors. Right-click the selection, click Apply Stereotype, and
Set the property values to enable cost analysis. Follow this example for the
Sensors component, select the
Open the Property Inspector by navigating to Modeling > Design > Property Inspector.
sysComponent stereotype to see the properties.
5 and press
GPSData port connector. Check that
length is set to
0.05 and that
unitPrice is set to
Complete the model using the values in this table. If a property is not in the table, it has no effect on the analysis, so you can leave it blank. Pin the Property Inspector to the editor to keep the Property Inspector visible during this operation.
The model below reflects the final result of this tutorial. Use this finalized model to perform an analysis and create custom views.
This example shows a mobile robot architecture model with stereotypes applied to components and properties defined.