主要内容

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

applyProfile

将配置文件应用到模型

说明

applyProfile(model,profileFile) 将配置文件应用于架构模型,并提供所有组成的构造型。

示例

applyProfile(dictionary,profileFile) 将配置文件应用于数据字典,并提供所有组成构造型。

applyProfile(allocSet,profileFile) 将配置文件应用于分配集,并使所有组成构造型可用。

applyProfile(model,profileFile,Name=Value) 使用一个或多个名称-值参量指定附加选项。

示例

全部折叠

创建一个模型。

model = systemcomposer.createModel("archModel");

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

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");

输入参数

全部折叠

架构模型,指定为 systemcomposer.arch.Model 对象。

数据字典,指定为 systemcomposer.interface.Dictionary 对象。有关如何创建数据字典的信息,请参阅 createDictionary

分配集,指定为 systemcomposer.allocation.AllocationSet 对象。

配置文件的名称,指定为字符向量或字符串。

示例: "SystemProfile"

数据类型: char | string

名称-值参数

全部折叠

Name1=Value1,...,NameN=ValueN 的形式指定可选参量对组,其中 Name 是参量名称,Value 是对应的值。名称-值参量必须出现在其他参量之后,但对各个参量对组的顺序没有要求。

在 R2021a 之前,使用逗号分隔每个名称和值,并用引号将 Name 引起来

示例: applyProfile(model,profileFile,IncludeReferenceModels=true)

将配置文件应用于所有引用组件模型的选项,指定为逻辑。

示例: applyProfile(model,profileFile,IncludeReferenceModels=true)

数据类型: logical

详细信息

全部折叠

版本历史记录

在 R2019a 中推出