addStereotype
Add stereotype to profile
Description
adds a new stereotype with a specified namestereotype
= addStereotype(profile
,name
)name
to a profileprofile
.
adds a new stereotype with the previous input arguments and specifies properties for the stereotype.stereotype
= addStereotype(___,Name,Value
)
Examples
Add Component Stereotype
Add a component stereotype to a profile.
profile = systemcomposer.profile.Profile.createProfile('LatencyProfile'); stereotype = addStereotype(profile,'electricalComponent','AppliesTo','Component')
stereotype = Stereotype with properties: Name: 'electricalComponent' Description: '' Parent: [0x0 systemcomposer.profile.Stereotype] AppliesTo: 'Component' Abstract: 0 Icon: 'default' ComponentHeaderColor: [210 210 210] ConnectorLineColor: [168 168 168] ConnectorLineStyle: 'Default' FullyQualifiedName: 'LatencyProfile.electricalComponent' Profile: [1x1 systemcomposer.profile.Profile] OwnedProperties: [0x0 systemcomposer.profile.Property] Properties: [0x0 systemcomposer.profile.Property]
Input Arguments
profile
—Profile
profile object
Profile, specified as asystemcomposer.profile.Profile
object.
name
—Stereotype name
character vector|string
Stereotype name, specified as a character vector or string. The name of the stereotype must be unique within the profile.
Data Types:char
|string
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, whereName
is the argument name andValue
is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and encloseName
in quotes.
Example:addStereotype(profile,'electricalComponent',AppliesTo="Component")
Description
—Description text for stereotype
character vector|string
Description text for stereotype, specified as a character vector or string.
Example:addStereotype(profile,'electricalComponent',Description="These components are electrical")
Data Types:char
|string
Icon
—Icon name for stereotype
character vector|string
Icon name for stereotype, specified as a character vector or string. Built in options include:
"default"
"application"
"channel"
"controller"
"database"
"devicedriver"
"memory"
"network"
"plant"
"sensor"
"subsystem"
"transmitter"
This name-value argument is only valid for component stereotypes. The element a stereotype applies to is set with theAppliesTo
name-value argument.
Example:addStereotype(profile,"electricalComponent",Icon="default")
Data Types:char
|string
Parent
—从w刻板印象hich stereotype inherits properties
stereotype object
从w刻板印象hich stereotype inherits properties, specified as asystemcomposer.profile.Stereotype
object.
Example:addStereotype(profile,"electricalComponent",Parent=baseStereotype)
AppliesTo
—Element type to which stereotype can be applied
""
(default) |“组件”
|"Port"
|"Connector"
|"Interface"
|"Function"
Element type to which stereotype can be applied, specified one of these options:
""
to apply stereotype to all element types“组件”
"Port"
"Connector"
"Interface"
"Function"
, which is only available for software architectures
Example:addStereotype(profile,"electricalComponent",AppliesTo="Port")
Data Types:char
|string
Abstract
—Whether stereotype is abstract
false
or 0(default) |true
or 1
Whether stereotype is abstract, specified as a logical. Iftrue
, then the stereotype cannot be directly applied on model elements, but instead serves as a parent for other stereotypes.
Example:addStereotype(profile,'electricalComponent','Abstract',true)
Data Types:logical
ComponentHeaderColor
—Component header color
1x3uint32
row vector
Component header color, specified as a 1x3uint32
row vector in the form[Red Green Blue]
.
This name-value argument is only valid for component stereotypes. The element a stereotype applies to is set with theAppliesTo
name-value argument.
Example:addStereotype(profile,'electricalComponent','ComponentHeaderColor',[206 232 246])
Data Types:uint32
ConnectorLineColor
—Connector line color
1x3uint32
row vector
Connector line color, specified as a 1x3uint32
row vector in the form[Red Green Blue]
.
这个名称参数只是有效连接or, port, and interface stereotypes. The element a stereotype applies to is set with theAppliesTo
name-value argument.
Example:addStereotype(profile,'electricalComponent','ConnectorLineColor',[206 232 246])
Data Types:uint32
ConnectorLineStyle
—Connector line style
character vector|string
Connector line style name, specified as a character vector or string. Options include:
"Default"
"Dot"
"Dash"
"Dash Dot"
"Dash Dot Dot"
这个名称参数只是有效连接or, port, and interface stereotypes. The element a stereotype applies to is set with theAppliesTo
name-value argument.
Data Types:char
|string
Output Arguments
stereotype
— Created stereotype
stereotype object
Created stereotype, returned as asystemcomposer.profile.Stereotype
object.
More About
Definitions
Term | Definition | Application | More Information |
---|---|---|---|
stereotype | Astereotypeis a custom extension of the modeling language. Stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata. |
Apply stereotypes to model elements such as root-level architecture, component architecture, connectors, ports, data interfaces, value types, and functions. Functions only apply to software architectures. A model element can have multiple stereotypes. Stereotypes provide model elements with a common set of property fields, such as mass, cost, and power. |
Extend Architectural Design Using Stereotypes |
property | Apropertyis a field in a stereotype. You can specify property values for each element to which the stereotype is applied. |
Use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. Properties can also be descriptive or represent a status. You can view and edit the properties of each element in the architecture model using the Property Inspector. |
|
profile | Aprofileis a package of stereotypes to create a self-consistent domain of element types. |
Author profiles and apply profiles to a model using theProfile Editor. You can store stereotypes for a project in one profile or in several. When you save profiles, they are stored in XML files. |
Version History
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)