Comparing and Merging Classes

You can compare and merge Modelica classes. You can select the source classes from the classes in session as well as from the ones in the database. By default WinMerge and KDiff3 are supported for comparing and merging classes, you can also provide a command line for a custom tool.

Note: If you want to compare libraries or other classes of different version, that is, having the same name, you can also use the command Open Comparison Tool. This tool also supports comparing resources of libraries, as well as merging libraries.


Before you begin: Make sure that you have:
  1. Installed the external tool for comparing and merging.
  2. Specified the corresponding preferences for the tool from select Me > Preferences > App Preferences > 3D Modeling > Systems Modeling and Execution > Dymola Behavior Modeling , the Comparison tab.
    Note: For more information about these preferences, see Native Apps Preferences Guide: Comparison.
Important: This task does not cover the handling of the classes in the compare and merge tool. For information on that, see the documentation of the tools.
  1. From the Behavior Tools section of the action bar, click Compare and Merge Modelica Classes
  2. In the dialog box, select the first source class any of the following way:
    • To select a class in the session, do the following:
      1. Click the First source class input box to select it.
      2. From the Package Browser, click the class.
    • To select a class from the database, do the following:
      1. From the Compare and Merge Modelica Classes dialog box, from the first line, click .

        The Content Chooser dialog box appears.

      2. From the top bar, search for the Modelica library that contains the wanted class.

        For information on how to search for a Modelica library, see the search part of Open with Search.

        The Search Results panel appears.

      3. Use the Content Chooser to select, from the Search Results panel, the library that contains the wanted class.
        Note: For more about the Content Chooser, see Selecting Objects Using the Content Chooser.

        The Explore Modelica Library in database browser appears.

      4. In this browser, browse for the wanted class and select it.
    The first source class is selected.
  3. In the dialog box, select the second source class any of the following ways:
    • To select a class in the session, perform, for the second source class, the corresponding action as in Step 2.
    • To select a class from the database, perform, for the second source class, the corresponding action as in Step 2.
    • To select, as the second source class, another version of a class already selected as the first source class, do the following:
      1. Select, in the Compare and Merge Modelica Classes, the first line, the input box with the first source class already selected.
      2. From the second line, click .

        The Explore Modelica Library in database browser appears. This browser displays all different versions in the database of the selected class.

      3. In this browser, browse for the wanted class and select it.
    The second source class is selected.
  4. Optional: To merge the two source classes and store the merge in a third class, do the following:
    1. Make sure that you have created a target class that is loaded in session.

      Notes:

    2. Click the Target class input box to select it.
    3. From the Package Browser, click the class to select it.
    The target class is selected.
  5. To start the comparison tool, click OK.
    You can compare the source models, and if you have selected a target class, you can use the comparison tool to create a merged class that is stored in the target class.
    Important:
    • Dymola Behavior Modeling cannot be used while the external tool is running.
    • If you create a merged file, you must save the result in the external tool before closing it.