Main Content

Use Stereotypes and Profiles

Use profiles to add properties to components, ports, and connectors in System Composer™. Import an existing profile, apply stereotypes, and add property values. To create a profile, seeDefine Profiles and Stereotypes.

In this topic, you will learn how to:

  1. Import profiles into a model or a dictionary.

  2. Apply a stereotype to a model element and add property values.

  3. Remove stereotypes using the Property Inspector.

  4. Extend stereotypes with other stereotypes to include their properties through an inherited mechanism. For example, aUserInterfacestereotype can be an extension of aSoftwareComponentstereotype, and add a property calledScreenResolution.

Import Profiles

TheProfile Editoris independent from the model that opens it, so you must explicitly import a new profile into a model. The profile must first be saved with an.xmlextension. Navigate toModeling>Profiles>Importimport icon. Select the profile to import. An architecture model can use multiple profiles at once.

Alternatively, open theProfile Editorby navigating toModeling>Profile Editor. You can import a profile into any open dictionaries or models.

Import into selections for model and dictionary from the Profile Editor.

Note

For a System Composer component that is linked to a Simulink®behavior model, the profile must be imported into the Simulink model before applying a stereotype from it to the component. Since the Property Inspector on the Simulink side does not display stereotypes, this workflow is not finalized.

管理概要文件导入后,navigate toModeling>Profiles>Manageicon.

Linked profiles dialog with profile linked to a model and a dictionary with options to import and remove.

Apply Stereotypes

Apply stereotypes to architecture model elements using the Property Inspector or the Apply Stereotypes dialog. You can also quick-insert a new component with the stereotype applied. For information about applying stereotypes to functions in software architectures, seeApply Stereotypes to Functions of Software Architectures.

Apply a Stereotype using the Property Inspector

Once the profile is available in the model, open the Property Inspector by navigating toModeling>Property Inspector. Select a model element.

Using the property inspector on a port.

In theStereotypefield, use the drop-down to select the stereotype. Only the stereotypes that apply to the current element type (for example, a port) are available for selection. If no stereotype exists, you can use theoption to open theProfile Editorand create one.

Selecting a stereotype from the Property Inspector for the 'Sensor Data' port.

When you apply a stereotype to an element, a new set of properties appears in the Property Inspector under the name of the stereotype. To edit the properties, expand this set.

Setting properties for a 'Data Port' stereotype assigned to the 'Sensor Data' port.

You can set multiple stereotypes for each element.

Setting multiple stereotypes in the Property Inspector.

Use Apply Stereotypes Dialog to Batch Apply Stereotypes

You can also apply component, port, connector, and interface stereotypes to all applicable elements at the same architecture level. Navigate toModeling>Apply Stereotypes. In Apply Stereotypes, fromApply stereotype(s) to, selectTop-level architecture,All elements,Components,Ports,Connectors, orInterfaces.

Note

TheInterfacesoption is only available if interfaces are defined in theInterface Editor. For more information, seeCreate Interfaces.

Apply stereotypes dialog displaying Apply stereotypes to top level architecture, all elements, components, ports, connectors, or interfaces.

你也可以应用原型通过选择一个唱歌le model element. FromScope, selectSelection,This layer, orEntire model.

Apply stereotypes dialog displaying scope for selection, this layer, and entire model.

You can also apply stereotypes to data interfaces or value types. When interfaces are locally defined and you select one or more interfaces in theInterface Editor, the options forScopeareSelectionandLocal interfaces.

Apply stereotypes dialog displaying scope for selection, and local interfaces.

When interfaces are stored and shared across a data dictionary and you select one or more interfaces in theInterface Editor, the options forScopeareSelectionand eitherdictionary.slddor the name of the dictionary currently in use.

Apply stereotypes dialog displaying scope for selection, and dictionary.

Note

For the stereotypes to display for interfaces in a dictionary, in the Apply Stereotypes dialog box, the profile must be imported into the dictionary.

Quick-Insert New Component with Stereotype Applied

You can also create a new component with an applied stereotype using the quick-insert menu. Select the stereotype as a fully qualified name. A component with that stereotype is created.

In the quick-insert menu, select below other component types, fully qualified name of stereotype and a new component is created with that stereotype applied.

Remove Stereotypes

If a stereotype is no longer required for an element, remove it using the Property Inspector. ClickSelectnext to the stereotype and chooseRemove.

Removing a stereotype in the property inspector.

Extend Stereotypes

You can extend a stereotype by creating a new stereotype based on the existing one, allowing you to control properties in a structural manner. For example, all components in a project may have a part number, but only electrical components have a power rating, and only electronic components — a subset of electrical components — have manufacturer information. You can use an abstract stereotype to serve solely as a base for other stereotypes and not as a stereotype for any architecture model elements.

For example, create a new stereotype calledElectronicComponentin theProfile Editor. Select its base stereotype asFunctionalArchitecture.ElectricalComponent. Define properties you are adding to those of the base stereotype. CheckShow inherited propertiesat the bottom of the property list to show the properties of the base stereotype. You can edit only the properties of the selected stereotype, not the base stereotype.

Adding a base stereotype in the Profile Editor to make the stereotype inherit properties from it.

When you apply the new stereotype, it carries its defined properties in addition to those of its base stereotype.

The stereotype for the component named 'Sensor' called 'Electronic Component' inherits properties from its base stereotype displayed below on the property inspector.

See Also

|||||

Related Topics