主要内容

getPlatformProperty

从数据字典获取 AUTOSAR 平台属性

自 R2022b 起

说明

propValue = getPlatformProperty(platformMapping,dictElementObj,propName) 从映射到 AUTOSAR Classic 平台的数据字典中获取指定字典元素的指定属性。指定的字典元素可以是数据接口对象或数据元素对象。

示例

示例

全部折叠

要获取为指定数据接口定义的 AUTOSAR 通信接口的类型,请使用带 propName 参量 InterfaceKindgetPlatformProperty 函数。有关显示相关函数工作流的更多信息的示例,请参阅在数据字典中配置 AUTOSAR Classic 数据接口和属性

archDataObj = Simulink.dictionary.archdata.open("MyInterfaces.sldd");
platformMapping = getPlatformMapping(archDataObj,"AUTOSARClassic");
interfaceObj = getInterface(archDataObj,"DataInterface");
propValue_Interface = ...
   getPlatformProperty(platformMapping,interfaceObj,"InterfaceKind")
propValue_Interface =

    'NvDataInterface'

要获取为指定数据元素定义的标定和测量工具访问权限,请使用带 propName 参量 SwCalibrationAccessgetPlatformProperty 函数。

dataElemObj = interfaceObj.Elements(1);
propValue_Sw_CalAccess = ...
    getPlatformProperty(platformMapping,dataElemObj,"SwCalibrationAccess")
propValue_Sw_CalAccess =

    'ReadWrite'

输入参数

全部折叠

平台映射对象,指定为 autosar.dictionary.ARClassicPlatformMapping 对象。

您从中访问 AUTOSAR 特定于平台的属性和值的字典对象中的元素,指定为 Simulink.dictionary.archdata.DataInterface 对象或 Simulink.dictionary.archdata.DataElement 对象。

该参量可以是数据接口对象(由先前调用 addDataInterfacegetInterface 返回),也可以是数据元素对象(由先前调用 addElementgetElement 返回)。

字典元素中属性的属性名称。

对于数据接口对象,有效的参量值为 "IsService""Package""InterfaceKind"

对于数据元素对象,有效的参量值为 "SwAddrMethod""SwCalibrationAccess""DisplayFormat"

示例: "InterfaceKind"

输出参量

全部折叠

字典元素中属性的属性值。

对于数据接口对象,返回的属性包括:

属性返回值
IsService对于服务接口,设置为 true。以 Boolean 形式返回。
Package元素包的完全限定路径。以 character vector 形式返回。
InterfaceKindAUTOSAR 通信接口。以 character vector 形式返回。有效值为 'SenderReceiverInterface''NvDataInterface''ModeSwitchInterface'

对于数据元素对象,返回的属性包括:

属性返回值
SwAddrMethod先前定义的软件寻址方法的名称。以 character vector 形式返回。
SwCalibrationAccess标定和测量工具对数据对象的访问权限。以 character vector 形式返回。有效值为 'ReadOnly''ReadWrite''NotAccessible'
DisplayFormatAUTOSAR 显示格式设定。以 character vector 形式返回。

版本历史记录

在 R2022b 中推出