Main Content

apply

Apply interface dictionary migration changes from analysis of a model or an architecture

Since R2022b

In R2023b the Architectural Data section of data dictionaries was introduced. When managing interfaces, data types, constants, and software address methods consider using the Simulink.dictionary.ArchitecturalData programmatic interfaces instead. For more information, see Programmatically Manage AUTOSAR Architectural Data.

Description

apply(migratorObj) applies migration to an interface dictionary from the analysis by the analyze function of a model or an architecture. The analysis identifies the data types and interfaces in the model and data dictionaries for migration to an interface dictionary. The analysis also identifies conflict issues that affect migration.

example

Examples

collapse all

After creating a Simulink.interface.dictionary.Migrator object, you can analyze data type and interface content in the model for migration to the interface dictionary and apply the migration.

Select a model that is linked to a data dictionary or an architecture that is linked to an interface dictionary. See figure. The goal of the migration is to add content to the interface dictionary and link the models and dictionaries.

Before Linking Sources and Data Migration

Image of unlinked models, data dictionary, and interface dictionary

In this example migration, there are no conflicting data types or interfaces. The analysis identifies:

  • The data types to migrate are MyAlias, AliasOfMyAlias, NonInterfaceBus, and LinkedAlias.

  • The interfaces to migrate are MyBus and AnotherMyBus.

The architecture consists of SWC1, SWC2, and Composition. The architecture uses a data dictionary hierarchy of dDictionary.sldd --> dLinkedDictionary.sldd.

Load the model and load the base workspace data.

load_system("mArchitectureWithDataDictionary");
load('hWorkspaceData.mat',...
    'MyBus','AnotherMyBus','NonInterfaceBus');

Create a Simulink.interface.dictionary.Migrator object.

myMigratorObj = Simulink.interface.dictionary.Migrator( ...
    "mArchitectureWithDataDictionary", ...
    'InterfaceDictionaryName',"interfaceDictionary.sldd");

Perform migration analysis and display analysis results.

analyze(myMigratorObj);

disp('Imported interfaces')
cellfun(@(x) x.Name,myMigratorObj.InterfacesToMigrate, ...
    'UniformOutput',false)
disp('Imported datatypes')
cellfun(@(x) x.Name,myMigratorObj.DataTypesToMigrate, ...
    'UniformOutput',false)
disp('Objects in conflict')
cellfun(@(x) strcat(x{1}.Name,' -> ',x{1}.Source), ...
    myMigratorObj.ConflictObjects,'UniformOutput',false)
disp('Unused objects')
cellfun(@(x) x.Name,myMigratorObj.UnusedObjects, ...
    'UniformOutput',false)

Apply migration analysis results.

apply(myMigratorObj);

To save the interface dictionary, use the save function. To revert applying the migration analysis, use the revert function.

save(myMigratorObj);

After migration (the apply step), the models and dictionaries are linked. See figure.

After Sources have been linked and data has been migrated

Image of linked models, data dictionary, and interface dictionary

Input Arguments

collapse all

Migrator object, specified by a Simulink.interface.dictionary.Migratorfunction.

Version History

Introduced in R2022b

collapse all

R2023b: Migrator to be Removed

Before R2023a, the Simulink.interface.Dictionary.Migrator function was used to move data types and interfaces from the base workspace data dictionaries to interface dictionaries. Starting in R2023b, dedicated architectural data sections in Simulink® data dictionaries replace interface dictionaries. As a result, the Migrator object and its programmatic interfaces are no longer needed. Data in an existing interface dictionary will automatically migrate to the architectural data section of the Simulink data dictionary when the data dictionary is loaded.