8.1 Description
The expgdiff tool compares two EXPRESS-G diagrams. It can report results in two different ways. It can apply color to the entities that the two schemas share or color all of the entities that differ between the two schemas.
8.2 Command Line (All Platforms)
expgdiff [options] <old-expg> <new-expg>
The EXPRESS-G diagram comparison tool accepts the following options:
-help- Print this list of options. The tool performs no other action and ignores all other options.
-cs / -colorsim (default)- Apply color1 (blue) to all entities that appear in both old and new EXPRESS-G diagrams. This will overwrite the original files, so you might want to be careful if you have colored some of the entities yourself.
-cd / -colordiff- Highlight all of the entities that are different between the old and new EXPRESS-G diagrams. Deleted entities will be colored red (color3), new entities will be colored green (color2). This will overwrite the original files, so you might want to be careful if you have colored some of the entities yourself.
-retainold- Prevent the tool from changing the old diagram.
-setaddcolor <color>- Specify the color for objects added to the new diagram.
-setdeletecolor <color>- Specify the color for objects deleted from the old diagram.
-setmatchcolor <color>- Specify the color for objects shared between the two diagrams.
-v / verbose- Give more information about the conversion process. This will print all of the matches that it found, (and the likely hood that the two are supposed to be matched).
The color specifications used for options can be any of the following. The numbers are important since it is possible to override the color values in an Xdefaults file for the UNIX version of expgedit , and they also correspond to the pen number used in HP-GL devices.
0, black, blk, none, normal
1, green, grn
2, blue, blu
3, red
4, gray, gry
8.3 Control Panel (Windows Only)
Click
EXPRESS-G Diff
in the ST-Developer Control Panel window. The
EXPRESS-G Diff
dialog box will appear as shown in Figure 8.1. Specify two diagram files to compare, select the options, then click the
OK
button. The EXPRESS-G files will be colored to indicate similarities and/or differences between them. Any old color information in an EXPRESS-G file is lost when the tool is run.
After the comparison is complete, you will be asked if you wish to start the EXPRESS-G editor to view the differences.
Control Panel Options
Diagram 1
Provides a space to type the name of the first EXPRESS-G file to compare. The [...] button displays the Open File dialog box that can be used to browse the file system and locate the files.
Diagram 2
Provides a space to type the name of the second EXPRESS-G file to compare. The [...] button displays the Open File dialog box that can be used to browse the file system and locate the files.
Colors
Provides three list to set the colors for matching, added and deleted objects. Each of the lists contains 5 colors -- black, blue, green, red, and gray.
Retain first diagram
If selected, forbids changes to the first diagram during the comparison. This is equivalent to the -retainold command-line option.
Verbose output
Select if you want more information about the conversion process. This will display all of the matches that it found, (and the likelihood that the two are supposed to be matched). This is equivalent to the -v command-line option.
Use Defaults
Resets all of the options to their default values. The default value for each option is shown below:
Matching objects Black
Added objects Blue
Deleted objects Red
Retain first diagram No
Verbose output No
Option settings are saved in the system registry when you click the OK button, and will be reloaded from the registry next time you open the control panel. Settings are not saved if you click the Cancel button.
8.4 Overview
The expgdiff tool simplifies the comparison of large EXPRESS schemas. The tool considers two entities, attributes, selects, or enumerations to be the same if they have the same or similar name. When it compares names, it looks for common substrings. For example, it would find a strong match between "location" and "new-location." This tool only examines the names of attributes, and therefore will not detect a change in the underlying type of an attribute.
The expgdiff tool uses the same comparison engine as expgupdate . Since expgupdate was the driving force behind this utility, the differencing capabilities are somewhat limited (because expgupdate is oriented towards finding similarities).
Here is an example of how one might use the expgdiff tool to find the similarities between STEP Part 42 and Part 203.
% express2expg part-42.exp
% express2expg part-203.exp
% expgupdate part-42.exg part-203.exg -v
The first two lines generates the EXPRESS-G for the schemas. The third line compares the two schemas and highlights all of the entities the two models share.