MATLAB 帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
查找 AUTOSAR 元素
paths = find(arProps,rootPath,category)
paths = find(arProps,rootPath,category,'PathType',value)
paths = find(arProps,rootPath,category,property,value)
paths = find(arProps,rootPath,category) 返回与 category 匹配的 AUTOSAR 元素的 paths,从路径 rootPath 开始。
paths
arProps
rootPath
category
paths = find(arProps,rootPath,category,'PathType',value) 指定返回的 paths 是完全限定还是部分限定。
'PathType',value
示例
paths = find(arProps,rootPath,category,property,value) 对元素的指定 category 属性指定约束值,从而缩小搜索范围。
property,value
全部折叠
对于模型,查找属性 IsService 为 false 的发送方-接收方接口,并返回完全限定路径。
IsService
false
hModel = 'autosar_swc_expfcns'; open_system(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); ifPaths = find(arProps,[],'SenderReceiverInterface',... 'IsService',false,'PathType','FullyQualified')
ifPaths = 1×2 cell {'/pkg/if/Interface1'} {'/pkg/if/Interface2'}
对于模型,添加模式切换接口,然后使用 find 列出了模型中模型切换接口的路径。
find
hModel = 'mAutosarMsConfigAfter'; open_system(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); addPackageableElement(arProps,'ModeSwitchInterface','/pkg/if','Interface3',... 'IsService',true); ifPaths = find(arProps,[],'ModeSwitchInterface','PathType','FullyQualified')
ifPaths = 1×3 cell {'/pkg/if/myMsIf'} {'/pkg/if/MsIf2'} {'/pkg/if/Interface3'}
模型的 AUTOSAR 属性信息,以前由 arProps = autosar.api.getAUTOSARProperties(model) 返回。model 是一个表示模型名称的句柄、字符向量或字符串标量。
arProps = autosar.api.getAUTOSARProperties(model)
model
示例: arProps
[]
指定查找指定类型的 AUTOSAR 元素的起点的路径。[] 表示组件的根。
示例: []
要为其返回路径的 AUTOSAR 元素的类型。
示例: 'SenderReceiverInterface'
'SenderReceiverInterface'
'PartiallyQualified'
'FullyQualified'
指定 FullyQualified 以返回完全限定路径。
FullyQualified
示例: 'PathType','FullyQualified'
'PathType','FullyQualified'
指定元素类别的有效属性,以及搜索中该属性要匹配的值。表 AUTOSAR 元素的属性 列出了与 AUTOSAR 元素关联的属性,有关这些属性的详细信息,请参阅 AUTOSAR Element Properties。
示例: 'IsService',true
'IsService',true
返回 AUTOSAR 元素路径的变量。
示例: ifPaths
ifPaths
在 R2013b 中推出
autosar.api.getAUTOSARProperties | add | delete | get | set
autosar.api.getAUTOSARProperties
add
delete
get
set
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处