Main Content

updateModel

Update AUTOSAR model or architecture with ARXML changes

Description

example

updateModel(ar,modelName) updates the specified open model with changes found in the XML files associated with arxml.importer object ar. The XML files must contain the AUTOSAR software component mapped by the model, and must be suitable for code generation.

When comparing the current version of the XML file with the previous version, the comparison routine applies these rules in order:

  1. If elements have the same UUID and type, the elements match. The function does not update the model.

  2. If elements have different UUIDs, the elements do not match. The function updates the model with the ARXML change.

  3. If elements have the same qualified name, the elements match. The function does not update the model.

  4. Otherwise, elements do not match. The function updates the model with the ARXML changes.

The update generates and opens a report that details the changes made to the model, and required changes that were not made by the function.

AUTOSAR package structure updates affect the stored AR-PACKAGE structure and are applied to future exports. Imported package structure updates do not affect AUTOSAR Dictionary package path XML options. The XML package path options apply to AUTOSAR elements created in Simulink® rather than to imported elements.

example

updateModel(ar,archModelName) updates the specified open architecture model with changes found in the XML files associated with arxml.importer object ar. The XML files must contain the AUTOSAR software composition mapped by the model, and must be suitable for code generation.

Examples

collapse all

Update model mySWC with the AUTOSAR ARXML changes described in updatedSWC.arxml and open an update report.

open_system('mySWC')
ar = arxml.importer('updatedSWC.arxml');
updateModel(ar,'mySWC');
### Updating model mySWC
### Saving original model as mySWC_backup.slx
### Creating HTML report mySWC_update_report.html

Update an architecture model, myArchModel with the AUTOSAR ARXML changes described in updatedArchModel.arxml and open an update report.

arModel = autosar.arch.loadModel("ControllerArchitecture");
impObj = arxml.importer("ControllerArchitecture.arxml");
updateModel(impObj,arModel)
### Updating model autosar_tpc_controller_bus
### Saving original model as autosar_tpc_controller_bus_backup_1.slx
### Creating HTML report autosar_tpc_controller_bus_update_report.html
Updated model 'autosar_tpc_controller_bus' for component 1 of 1: /Components/autosar_tpc_controller_bus
### Saving original model as ControllerArchitecture_backup.slx
Updating composition 1 of 1: /Components/ControllerArchitecture
### Creating HTML report ControllerArchitecture_update_report.html 

Input Arguments

collapse all

AUTOSAR information previously imported from XML files, specified as an arxml.importer object handle.

Name of an open model to be updated with changes in the XML files associated with an arxml.importer object.

Example: "mySWC"

Name of an open architecture model to be updated with changes in the XML files associated with an arxml.importer object.

Example: "myArchModel"

Version History

Introduced in R2014a

expand all