Main Content

getComponentNames

ARXML ファイルからの AUTOSAR ソフトウェア コンポーネント名の取得

説明

names = getComponentNames(ar) は、arxml.importer オブジェクト ar に関連付けられている XML ファイルで見つかった AUTOSAR ソフトウェア コンポーネント名を返します。既定では、この関数によって、アプリケーション、センサー/アクチュエータ、複雑なデバイス ドライバー、ECU 抽象化、およびサービス プロキシ ソフトウェア コンポーネントなどのアトミック ソフトウェア コンポーネントの名前が返されます。

names = getComponentNames(ar,compKind)compKind 引数を使用して、返されるソフトウェア コンポーネントのタイプを指定します。検索を 'Application''SensorActuator' などの特定の種類のアトミック ソフトウェア コンポーネントに絞り込んだり、'Composition''Parameter' などの非アトミック コンポーネントを指定したりすることもできます。

すべて折りたたむ

ARXML ファイルに存在する AUTOSAR アトミック ソフトウェア コンポーネントの名前を取得します。ARXML ファイルは、既定の MATLAB® 検索パス上の matlabroot/examples/autosarblockset/data にあります。

Controller コンポジションの初期の Simulink® 表現を作成します。

ar = arxml.importer('ThrottlePositionControlComposition.arxml');
names = getComponentNames(ar)
names =
  5×1 cell array
    {'/Company/Components/Controller'                     }
    {'/Company/Components/ThrottlePositionMonitor'        }
    {'/Company/Components/AccelerationPedalPositionSensor'}
    {'/Company/Components/ThrottlePositionActuator'       }
    {'/Company/Components/ThrottlePositionSensor'         }
createComponentAsModel(ar,'/Company/Components/Controller',...
    'ModelPeriodicRunnablesAs','AtomicSubsystem');

ARXML ファイルに存在する AUTOSAR センサー/アクチュエータ ソフトウェア コンポーネントの名前を取得します。ARXML ファイルは、既定の MATLAB 検索パス上の matlabroot/examples/autosarblockset/data にあります。

ar = arxml.importer('ThrottlePositionControlComposition.arxml');
names = getComponentNames(ar,'SensorActuator')
names =
  3×1 cell array
    {'/Company/Components/AccelerationPedalPositionSensor'}
    {'/Company/Components/ThrottlePositionActuator'       }
    {'/Company/Components/ThrottlePositionSensor'         }

ARXML ファイルに存在する AUTOSAR ソフトウェア コンポジションの名前を取得します。ARXML ファイルは、既定の MATLAB 検索パス上の matlabroot/examples/autosarblockset/data にあります。

リストされたコンポジションの初期の Simulink 表現を作成します。

ar = arxml.importer('ThrottlePositionControlComposition.arxml');
names = getComponentNames(ar,'Composition')
names =
  1×1 cell array
    {'/Company/Components/ThrottlePositionControlComposition'}
createCompositionAsModel(ar,'/Company/Components/ThrottlePositionControlComposition');

入力引数

すべて折りたたむ

XML ファイルから以前にインポートした AUTOSAR 情報。arxml.importer オブジェクト ハンドルとして指定されます。

返されるソフトウェア コンポーネントの種類。

出力引数

すべて折りたたむ

コンポーネント名の配列を返す変数。各配列の要素は AUTOSAR ソフトウェア コンポーネントの短縮名の絶対パスです。

例: {'/pkg/swc/tpSensor','/pkg/swc/tpActuator'}

バージョン履歴

R2008a で導入