主要内容

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

systemcomposer.interface.ServiceInterface

客户端-服务器接口

自 R2022a 起

    说明

    ServiceInterface 对象描述了客户端-服务器接口的结构和属性。

    创建对象

    使用 addServiceInterface 函数创建服务接口。

    interface = addServiceInterface(model.InterfaceDictionary,"newServiceInterface")

    属性

    全部展开

    服务接口字典,指定为 systemcomposer.interface.Dictionary 对象。

    服务接口的父模型,指定为 systemcomposer.arch.Model 对象。

    服务接口名称,指定为字符向量或字符串。该属性必须是有效的 MATLAB® 标识符。

    示例: "newInterface"

    数据类型: char | string

    接口中的元素,指定为 systemcomposer.interface.FunctionElement 对象数组。

    服务接口描述,指定为字符向量或字符串。

    数据类型: char | string

    唯一外部标识符,指定为字符向量。外部 ID 在元素的整个生命周期以及所有保留 UUID 的操作中都会被保留。

    数据类型: char

    统一唯一标识符,指定为字符向量

    示例: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

    数据类型: char

    对象函数

    moveInterface将接口移至另一个数据字典
    addElement添加元素
    getElement获取元素对象
    removeElement移除元素
    setName为值类型、函数参量、接口或元素设置名称
    setDescription为数值类型或接口设置说明
    applyStereotype为架构模型元素应用构造型
    getStereotypes获取应用于架构模型元素的构造型
    getStereotypeProperties获取元素上的构造型属性名称
    removeStereotype从模型元素中移除构造型
    getProperty获取与应用于元素的构造型相对应的属性值
    getPropertyValue获取架构属性值
    getEvaluatedPropertyValue从元素中获取属性的计算值
    setProperty设置与应用于元素的构造型相对应的属性值
    hasStereotype查找元素是否已应用构造型
    hasProperty查找元素是否具有属性
    destroy移除模型元素

    示例

    全部折叠

    创建一个新模型。

    model = systemcomposer.createModel("archModel","SoftwareArchitecture");
    systemcomposer.openModel("archModel");

    创建一个服务接口。

    interface = addServiceInterface(model.InterfaceDictionary,"newServiceInterface");

    创建一个函数元素。

    element = addElement(interface,"newFunctionElement");

    设置一个函数原型以添加函数参量。

    setFunctionPrototype(element,"y=f0(u)")

    获取一个函数参量。

    argument = getFunctionArgument(element,"y")
    argument = 
    
      FunctionArgument with properties:
    
          Interface: [1×1 systemcomposer.interface.ServiceInterface]
            Element: [1×1 systemcomposer.interface.FunctionElement]
               Name: 'y'
               Type: [1×1 systemcomposer.ValueType]
         Dimensions: '1'
        Description: ''
               UUID: '018b4e55-fa8f-4250-ac2b-df72bf620feb'
        ExternalUID: ''

    详细信息

    全部展开

    版本历史记录

    在 R2022a 中推出