addStereotype - Add stereotype to profile - MATLAB (original) (raw)
Add stereotype to profile
Syntax
Description
[stereotype](#mw%5F93acdb68-6fd7-4e8e-8ca9-cf30db71c7ed) = addStereotype([profile](#mw%5Fc4d3bd4e-2b84-4308-9d3a-b9d3c68cd122%5Fsep%5Fmw%5F73d78862-b7e6-40f6-94d5-96768f6c6121),[name](#mw%5Fc4d3bd4e-2b84-4308-9d3a-b9d3c68cd122%5Fsep%5Fmw%5F6d0bb099-02ea-424a-88b3-7bc51c4a973a))
adds a new stereotype with a specified name name
to a profileprofile
.
[stereotype](#mw%5F93acdb68-6fd7-4e8e-8ca9-cf30db71c7ed) = addStereotype(___,[Name=Value](#namevaluepairarguments))
adds a new stereotype with the previous input arguments and specifies properties for the stereotype.
Examples
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: [0×0 systemcomposer.profile.Stereotype]
AppliesTo: 'Component'
Abstract: 0
Icon: ''
ComponentHeaderColor: [210 210 210]
ConnectorLineColor: [168 168 168]
ConnectorLineStyle: 'Default'
FullyQualifiedName: 'LatencyProfile.electricalComponent'
Profile: [1×1 systemcomposer.profile.Profile]
OwnedProperties: [0×0 systemcomposer.profile.Property]
Properties: [0×0 systemcomposer.profile.Property]
Input Arguments
Stereotype name, specified as a character vector or string. The name of the stereotype must be unique within the profile.
Example: "electricalComponent"
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, where Name
is the argument name and Value
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 enclose Name
in quotes.
Example: addStereotype(profile,'electricalComponent',AppliesTo="Component")
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 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 the AppliesTo
name-value argument.
Example: addStereotype(profile,"electricalComponent",Icon="default")
Data Types: char
| string
Stereotype from which stereotype inherits properties, specified as a systemcomposer.profile.Stereotype object.
Example: addStereotype(profile,"electricalComponent",Parent=baseStereotype)
Data Types: char
| string
Whether stereotype is abstract, specified as 1
(true
) or 0
(false
). 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
Component header color, specified as a 1x3 uint32
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 the AppliesTo
name-value argument.
Example: addStereotype(profile,'electricalComponent','ComponentHeaderColor',[206 232 246])
Data Types: uint32
Connector line color, specified as a 1x3 uint32
row vector in the form [Red Green Blue]
.
This name-value argument is only valid for connector, 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
Connector line style name, specified as a character vector or string. Options include:
"Default"
"Dot"
"Dash"
"Dash Dot"
"Dash Dot Dot"
This name-value argument is only valid for connector, port, and interface stereotypes. The element a stereotype applies to is set with theAppliesTo
name-value argument.
Data Types: char
| string
Output Arguments
More About
Version History
Introduced in R2019a
See Also
Tools
Blocks
Objects
- systemcomposer.profile.Profile | systemcomposer.profile.Stereotype | systemcomposer.profile.Property
Functions
- systemcomposer.profile.Profile.createProfile | systemcomposer.loadProfile | applyProfile | removeProfile | renameProfile | systemcomposer.profile.editor | systemcomposer.profile.Profile.find | systemcomposer.profile.Profile.load | save | open | close | systemcomposer.profile.Profile.closeAll | systemcomposer.profile.Stereotype.find | getDefaultStereotype | setDefaultStereotype | getDefaultElementStereotype | setDefaultElementStereotype | removeStereotype | getStereotype | applyStereotype | batchApplyStereotype | getStereotypes | changeStereotype | removeStereotype | hasStereotype | addProperty | removeProperty | hasProperty | setProperty | getProperty | getPropertyValue | getEvaluatedPropertyValue | getStereotypeProperties | applyStereotypeOrder | getStereotypeNamesByOrder | increaseStereotypeOrder | decreaseStereotypeOrder