メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

add

AUTOSAR 要素へのプロパティの追加

説明

add(arProps,parentPath,property,name) は、property の指定に基づいて、name が指定された複合子要素を、parentPath 上の AUTOSAR 要素に追加します。

add(arProps,parentPath,property,name,childproperty,value) は、追加する子プロパティ要素の指定されたプロパティの値を設定します。

すべて折りたたむ

送信側インターフェイス Interface1 にデータ要素 DE3 を追加します。

hModel = "autosar_swc_expfcns";
open_system(hModel);
arProps = autosar.api.getAUTOSARProperties(hModel);
add(arProps,"Interface1","DataElements","DE3");
get(arProps,"Interface1","DataElements")
ans = 1×3 cell
    {'Interface1/DE1'}    {'Interface1/DE2'}    {'Interface1/DE3'}

完全修飾パスを使用してモード スイッチ インターフェイスを追加し、IsService プロパティを true に設定します。複合プロパティ ModeGroup を使用して、モード スイッチ インターフェイスにモード グループ mgMode を追加します。

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'}

add(arProps,'/pkg/if/Interface3','ModeGroup','mgModes');
get(arProps,'Interface3','ModeGroup')
ans = 
'Interface3/mgModes'

入力引数

すべて折りたたむ

事前に arProps = autosar.api.getAUTOSARProperties(model) によって返されたモデルの AUTOSAR プロパティの情報。model は、モデル名を表すハンドル、文字ベクトル、または string スカラーです。

例: arProps

指定した子プロパティ要素を追加する親 AUTOSAR 要素のパス。

例: 'Input'

AUTOSAR 要素の有効なプロパティのうち、追加するプロパティのタイプ。

例: 'DataElements'

追加する子プロパティ要素の名前。

例: 'DE1'

設定する子プロパティとその値。表AUTOSAR 要素のプロパティに、AUTOSAR 要素に関連付けられているプロパティを示しています。プロパティの詳細については、AUTOSAR Element Propertiesを参照してください。

例: 'Name','event1'

バージョン履歴

R2013b で導入