主要内容

delete

删除 AUTOSAR 元素

说明

delete(arProps,elementPath) 删除位于 elementPath 的 AUTOSAR 元素。

示例

示例

全部折叠

从模型的 AUTOSAR 配置中删除发送方-接收方接口 Interface1

hModel = 'autosar_swc_expfcns';
openExample(hModel);
arProps = autosar.api.getAUTOSARProperties(hModel);

% Add Interface3
addPackageableElement(arProps,'SenderReceiverInterface','/pkg/if','Interface3');
ifPaths = find(arProps,[],'SenderReceiverInterface','PathType','FullyQualified')
ifPaths =
  1×3 cell array
    {'/pkg/if/Interface1'}    {'/pkg/if/Interface2'}    {'/pkg/if/Interface3'}
% Find AUTOSAR DataReceiverPort and change its interface from Interface1 to Interface3
arPortType = 'DataReceiverPort';
aswcPath = find(arProps,[],'AtomicComponent','PathType','FullyQualified');
rPorts = find(arProps,aswcPath{1},arPortType,'PathType','FullyQualified');
rPort = rPorts{1};
set(arProps,rPort,'Interface','Interface3')

% Delete Interface1
delete(arProps,'Interface1');
ifPaths = find(arProps,[],'SenderReceiverInterface','PathType','FullyQualified')
ifPaths =
  1×2 cell array
    {'/pkg/if/Interface2'}    {'/pkg/if/Interface3'}

输入参数

全部折叠

模型的 AUTOSAR 属性信息,以前由 arProps = autosar.api.getAUTOSARProperties(model) 返回。model 是一个表示模型名称的句柄、字符向量或字符串标量。

示例: arProps

要删除的 AUTOSAR 元素的路径。

示例: 'Input'

版本历史记录

在 R2013b 中推出