主要内容

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

getStereotype

按名称查找配置文件中的构造型

    说明

    stereotype = getStereotype(profile,name) 通过名称查找配置文件中的构造型。

    示例

    示例

    全部折叠

    创建延迟特征配置文件。

    profile = systemcomposer.profile.Profile.createProfile("LatencyProfileB");
    
    connLatency = profile.addStereotype("ConnectorLatency",AppliesTo="Connector");
    connLatency.addProperty("secure",Type="boolean");
    connLatency.addProperty("linkDistance",Type="double");
    
    nodeLatency = profile.addStereotype("NodeLatency",AppliesTo="Component");
    nodeLatency.addProperty("resources",Type="double",DefaultValue="1");
    
    portLatency = profile.addStereotype("PortLatency",AppliesTo="Port");
    portLatency.addProperty("queueDepth",Type="double");
    portLatency.addProperty("dummy",Type="int32");

    获取配置文件中的 ConnectorLatency 构造型。

    stereotype = getStereotype(profile,"ConnectorLatency")
    stereotype = 
      Stereotype with properties:
    
                        Name: 'ConnectorLatency'
                 Description: ''
                      Parent: [0×0 systemcomposer.profile.Stereotype]
                   AppliesTo: 'Connector'
                    Abstract: 0
                        Icon: ''
        ComponentHeaderColor: [210 210 210]
          ConnectorLineColor: [168 168 168]
          ConnectorLineStyle: 'Default'
          FullyQualifiedName: 'LatencyProfileB.ConnectorLatency'
                     Profile: [1×1 systemcomposer.profile.Profile]
             OwnedProperties: [1×2 systemcomposer.profile.Property]
                  Properties: [1×2 systemcomposer.profile.Property]
    
    

    关闭配置文件,重新运行此示例。

    profile.close(true)
    

    输入参数

    全部折叠

    配置文件,指定为 systemcomposer.profile.Profile 对象。

    构造型名称,指定为字符向量或字符串。构造型的名称在配置文件中必须是唯一的。

    示例: "electricalComponent"

    数据类型: char | string

    输出参量

    全部折叠

    找到的构造型,以 systemcomposer.profile.Stereotype 对象形式返回。

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出