主要内容

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

getDefaultStereotype

获取配置文件的默认构造型

    说明

    stereotype = getDefaultStereotype(profile) 获取配置文件的默认构造型。

    示例

    示例

    全部折叠

    创建延迟特征配置文件。

    profile = systemcomposer.profile.Profile.createProfile("LatencyProfileA");
    
    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");

    设置默认构造型,然后获取默认构造型。

    profile.setDefaultStereotype("NodeLatency");
    default = getDefaultStereotype(profile)
    default = 
      Stereotype with properties:
    
                        Name: 'NodeLatency'
                 Description: ''
                      Parent: [0×0 systemcomposer.profile.Stereotype]
                   AppliesTo: 'Component'
                    Abstract: 0
                        Icon: ''
        ComponentHeaderColor: [210 210 210]
          ConnectorLineColor: [168 168 168]
          ConnectorLineStyle: 'Default'
          FullyQualifiedName: 'LatencyProfileA.NodeLatency'
                     Profile: [1×1 systemcomposer.profile.Profile]
             OwnedProperties: [1×1 systemcomposer.profile.Property]
                  Properties: [1×1 systemcomposer.profile.Property]
    
    

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

    profile.close(true)
    

    输入参数

    全部折叠

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

    输出参量

    全部折叠

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

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出