主要内容

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

systemcomposer.interface.FunctionArgument

客户端-服务器接口中函数元素的函数参量

自 R2022a 起

    说明

    一个 FunctionArgument 对象描述了函数元素 systemcomposer.interface.FunctionElement 中一个参量的属性。

    创建对象

    使用 setFunctionPrototype 函数设置函数原型,然后使用 getFunctionArgument 函数获取函数参量。

    setFunctionPrototype(element,"y=f0(u)")
    argument = getFunctionArgument(functionElement,"y")

    属性

    全部展开

    函数参量的父服务接口,指定为 systemcomposer.interface.ServiceInterface 对象。

    函数参量名称,指定为字符向量或字符串。

    示例: "y"

    数据类型: char | string

    函数参量类型,指定为 systemcomposer.ValueType 对象。

    函数参量的维度,指定为字符向量或字符串。

    数据类型: char | string

    函数参量描述,指定为字符向量或字符串。

    数据类型: char | string

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

    数据类型: char

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

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

    数据类型: char

    对象函数

    setName为值类型、函数参量、接口或元素设置名称
    setType为数据元素或函数参量设置共享类型
    setDimensions设置值类型维度
    setUnits设置值类型的单位
    setComplexity设置值类型复杂度
    setMinimum设置值类型的最小值
    setMaximum设置值类型的最大值
    setDescription为数值类型或接口设置说明
    createOwnedType在数据元素或函数参量上创建专属值类型
    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 中推出