How to programmatically determine if a Simulink model represents an AUTOSAR software component or composition?

In AUTOSAR, we have ARXMLs that can be either for a Software Component (SWC) or a grouping of SWCs called a composition. In both cases, after using the arxml.importer, the result is a Simulink model. Is it possible to know, by only inspecting the Simulink model, if it is a SWC or a Composition? What is the API for determining this?

回答 (1 件)

Noufal Thangal Rahim
Noufal Thangal Rahim 2023 年 5 月 25 日
names = getComponentNames(ar,compKind)
uses the compKind argument to specify the type of software component to return. You can narrow the search to a specific type of atomic software component, such as 'Application' or 'SensorActuator', or specify a nonatomic component, such as 'Composition' or 'Parameter'.
compKind Component type
'Atomic' (default) | 'Application' | 'ComplexDeviceDriver' | 'Composition' | 'EcuAbstraction' | 'Parameter' | 'SensorActuator' | 'ServiceProxy'
in your case,
to get the list of Compositions:
ar = arxml.importer('xxxxx.arxml');
names = getComponentNames(ar,'Composition')

カテゴリ

ヘルプ センター および File ExchangeAUTOSAR Blockset についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 9 月 22 日

回答済み:

2023 年 5 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by