revert
Revert interface dictionary migration changes applied from analysis of a model or an architecture
Since R2022b
Syntax
Description
revert(
reverts changes that
resolve conflicts in data types and interfaces that were migrated to an interface
dictionary. The migration analysis from the migratorObj
)analyze
function identifies these conflicts.
Examples
Revert Changes from Interface Dictionary Migration
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
In this example migration, there are no conflicting data types or interfaces. The analysis identifies:
The data types to migrate are
MyAlias
,AliasOfMyAlias
,NonInterfaceBus
, andLinkedAlias
.The interfaces to migrate are
MyBus
andAnotherMyBus
.
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);
After migration (the apply step), the models and dictionaries are linked. See figure.
After sources have been linked and data has been migrated
To revert the migration to the interface dictionary and undo changes to sources, use
the revert
function. To keep the migration and changes, use the save
function.
revert(myMigratorObj);
After reverting migration, unlinking sources, and undoing data migration
Input Arguments
migratorObj
— Migrator object
Migrator
object
Migrator
object, specified by a
Simulink.interface.dictionary.Migrator
function.
Version History
Introduced in R2022b
See Also
Migrator
| analyze
| analyzeAndApply
| apply
| save
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)