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.
Command Line
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
Windows Control Panel
The EXPRESS-G Difference Windows control panel is shown below. Run this by selecting EXPRESS-G Difference from the Start Menu. The following sections describe the fields and setting on this control panel.
Comparing Diagrams
At the top of the EXPRESS-G Difference control panel are text fields for two EXPRESS-G diagrams. You can open the file dialog using Ctrl+O or the [...] button to the right of either field. You can also drag and drop files from the Windows Explorer into the text fields.
When you run the tool, these 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.
The Do not change Diagram #1 option or the -retainold flag prevents any changes to the first diagram. Only the second diagram will be updated with new colors.
The Verbose output option or the -v flag gives more information about the comparison process. This will display all matches found and the likelihood that the two are supposed to be matched.
The Diagram Coloring area controls the colors for matching, added and deleted objects. Each of the lists contains 5 colors -- black, blue, green, red, and gray. From the command line, these can be controlled by the -setaddcolor, -setmatchcolor, and -setdeletecolor flags.
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).
The following example shows 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.