-
From the Behavior Tools section of the action bar, click Open Comparison
Tool
.
The Library Comparison Tool
appears.
-
In the Library Comparison Tool, load the first
class or library to be compared in any of the following ways:
- To load a class or library in session, drag it from the
Package Browser into the comparison
tool.
- To load a library from the database, do the following:
- From the dialog box, click Load Library to
Compare from the Data Base
. The Content
Chooser dialog box appears. For more about the Content
Chooser, see Selecting Objects Using the Content Chooser.
- From the top bar, search for the Modelica library.
For information on how to search for a Modelica
library, see the search part of Open with Search.
The Search Results
panel appears.
- From the panel, select the library.
The first source class is loaded in the
tool. The following is displayed in the dialog:
- In the first column:
- A collapsed class tree of the loaded class.
- If the class is a library and has resources, also a
collapsed tree of the resources.
- In the second column, the name of the class.
-
Select the second version of the 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:
- In the dialog, click Load Another Version of This
Library from the Database
.The Revision
Selector dialog box appears. This dialog
box displays all revisions of the selected library in
the database. Notes:
- The library of the revision you already
selected in the previous step is displayed with
gray text and cannot be selected.
- For the library, currently only the revisions
are displayed. To see both revisions and the
corresponding Modelica versions, perform, from the
top bar, a search for the library. As an example, to
search for a library MyLib, enter
dbl:*MyLib* and then click
Search.
- For more information about
the Revision Selector, see
Collaborative
Lifecycle
User's Guide: Creating Revisions and Branches: Revision
Explorer.
- Select the library to compare.
- Click OK to validate.
The second source class is loaded in the Library
Comparison Tool. The following is changed and added in
the dialog:
- In the first column:
- The class tree is changed to be the union of the two classes
compared, to display the difference between the
classes.
- If present, the second tree, the resources tree, is changed to be the union of the resources, to
display the differences between the resources of the
libraries.
- A third column is added, with the name of the second class.
- The second and the third column display the differences found
between the classes.
-
Use the tool to investigate any differences between the compared
classes.
The following color indications are possible:
Color |
Meaning |
White |
The node is present in both classes and have
exactly the same content. |
Yellow |
There is at least one difference in the children
of the node. You can expand the node to
investigate. |
Blue |
- For the class tree: The Modelica text inside this class differs.
See the below steps for possible action.
- For the resource tree: The resource differs, last modification time
and resource size is presented in the cells.
|
Green |
The node exists in this class, but not in the
compared class. |
Red |
The node does not exist in this class, but exists
in the compared class. |
-
To compare Modelica text for a class, select, in the dialog box, in the
tree, the node of the class to compare, and click Compare
Modelica Text.
The node must be blue with the text Modelica text is
different.
A Compare Class Panel appears, comparing
the Modelica text of two instances of the class. Differences are
indicated the following way:
- Any line that differs, is indicated by a blue line in the
beginning of the text.
- Any difference in the text is underlined and colored red.
The following table illustrates
the comparison between Text 1 (the leftmost column) and Text 2 (the
rightmost column). The middle columns illustrate the displayed
result in the Compare Class Panel.
Text 1 in class |
Text 1 in tool |
Text 2 in tool |
Text 2 in class |
A |
A |
A |
A |
B1 |
B1 |
B |
B |
C1 |
C1 |
C |
C |
D |
D |
D |
D |
G |
|
E |
E |
H |
|
F |
F |
J |
G |
G |
G |
K |
H |
H1 |
H1 |
|
|
I1 |
I1 |
|
|
J1 |
J1 |
|
K |
K |
K |
- Optional:
To merge two versions of the same library using an external tool, do
the following:
Only libraries colored blue with the text Modelica text is
different can be merged.
Note:
Merging is actually performed by using the functionality of the
command Merge Modelica Classes, which is
integrated in the comparison tool.
-
Make sure that you have installed and selected any supported
external tool for merging corresponding to the command
Merge Modelica Classes. For details, see Comparing and Merging Classes.
-
Make sure that you have created a target class for the result
of the merge.
-
In the dialog, select the class to be merged.
-
In the dialog, click Compare And Merge Modelica
Classes Using an External Comparison Tool
.
The Compare and Merge Modelica
Classes dialog box appears, prefilled with the
two classes to merge.
-
In the Compare and Merge Modelica Classes
dialog box, do the following:
- Click the Target class input
field to select it.
- From the Package Browser, click the
class where the merged class is to be stored.
- Click OK to perform the
merge.
- Optional:
To merge two libraries of different versions without using an external
tool, do the following:
Notes:
- You can only merge libraries, not classes.
- If a library in session is used for the merge, changes you
have not saved before activating the merge are included, for
the classes selected for the merge.
- When working with merging, you cannot perform any other
action.
-
Click Activate Merge.
The following is the result:
- A third column appears in the middle of the pane,
representing the library that is the result of the
merge.
- By default, the middle column is a copy of the library
version in the left column.
- For any nodes that differs between the two versions to
merge, two radio buttons appear in the middle column,
one to the left and one to the right.
-
For the middle column, configure the merge. For the lines that
have radio buttons, you can:
The following is the result:
- The radio buttons in the middle column display the
selected merges in the following way:
- Activated, with blue circle: The class is
selected for the merge, with all its children, if
any.
- Activated, with orange circle: The class is
selected for the merge, but with some child
classes selected from the other merge source or
not selected for the merge.
- Cleared, white: The class is not selected for
the merge.
- The colors of the nodes and classes in the middle column
change dynamically depending on your selections.
Note:
The expanded items in the panel is the lowest level
of merging. You cannot, for example, merge Modelica text in
classes.
-
When finished editing, click Save Library and Load
It in Session.
The Save Merge
Action dialog box appears.
-
Specify the revision of the library that is the result of the
merge, in any of the following ways:
-
Click OK.
The result is depending on the selection in the previous step:
- If you selected to overwrite the library in session,
that library revision is overwritten both in session and
in the database by the merge.
- If you selected to create a new revision, two results
are possible:
|