主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

getStereotypes

获取应用于架构模型元素的构造型

说明

stereotypes = getStereotypes(element) 获取一个数组,其中包含已应用于架构模型元素的完全限定的构造型名称。

示例

示例

全部折叠

创建一个带有名为 Component 的组件的模型。

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
arch = get(model,"Architecture");
comp = addComponent(arch,"Component");

创建带有构造型和属性的配置文件,打开配置文件编辑器,然后将配置文件应用到模型。

profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
latencybase = profile.addStereotype("LatencyBase");
latencybase.addProperty("latency",Type="double");
latencybase.addProperty("dataRate",Type="double",DefaultValue="10");
systemcomposer.profile.editor(profile)
model.applyProfile("LatencyProfile");

将构造型应用于组件,并获取组件上的构造型。

comp.applyStereotype("LatencyProfile.LatencyBase");
stereotypes = getStereotypes(comp)
stereotypes =

  1×1 cell array

    {'LatencyProfile.LatencyBase'}

输出参量

全部折叠

构造型变量列表,以 '<profile>.<stereotype>' 形式的字符向量元胞数组形式返回。

数据类型: char

详细信息

全部折叠

版本历史记录

在 R2019a 中推出