主要内容

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

getStereotypeProperties

获取元素上的构造型属性名称

    说明

    propNames = getStereotypeProperties(archElement) 返回元素指定架构上的构造型属性名称数组。

    示例

    示例

    全部折叠

    创建配置文件,添加组件构造型,并添加带有默认值的属性。

    profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
    stereotype = addStereotype(profile,"electricalComponent",AppliesTo="Component");
    stereotype.addProperty("latency",Type="double",DefaultValue="10");
    stereotype.addProperty("mass",Type="double",DefaultValue="20");

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

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

    将配置文件应用于模型,并将构造型应用于组件。打开配置文件编辑器

    model.applyProfile("LatencyProfile");
    comp.applyStereotype("LatencyProfile.electricalComponent");
    systemcomposer.profile.editor(profile)

    获取组件架构的构造型属性。

    properties = getStereotypeProperties(comp.Architecture)
    properties =
    
        1×2 string array
    
        "LatencyProfile.electricalComponent.latency"    "LatencyProfile.electricalComponent.mass"

    输入参数

    全部折叠

    输出参量

    全部折叠

    属性名称,以字符串数组形式返回,每个字符串的形式为 "<profile>.<stereotype>.<property>"

    数据类型: string

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出