Skip to main content

Command: Compare

Symbol: _icon_project_compare.png

Function: The command opens the Project Comparison dialog. In this dialog, you define the reference project to compare with the current project. You configure the comparison process by means of options. When you close the dialog, the comparison starts and the results are displayed in the Project Comparison – Differences view.

Call: Project → Compare

Requirement: A project is open.

For more information, see: Comparing Projects

Dialog: Project Comparison

Table 93. Compare the currently open project with

Project on disk

Path of the reference project on the file system

Project in a source control database

Host: Name of the host where the source code management is located

Port: Number of the port for connecting to the source code management

Location: Path of the reference project

Requirement: The project is linked to source code management (for example, CODESYS SVN).



Table 94. Compare Options

Ignore whitespace

standard icon: Whitespace differences between the current project and the reference project are ignored.

Ignore comments

standard icon: Comments in the programming code are excluded from the comparison.

Ignore properties

standard icon: Object properties are excluded from the comparison.



OK

Starts the project compare and displays the result in the Project Comparison – Differences view

View: Project Comparison – Differences

The project comparison view opens when you click OK to close the Project Comparison dialog.

_cds_img_view_project_compare_differences.png

(1) Object tree of the current project

(2) Object tree of the reference project

(3) Accept Block command, Accept Single command

(4) Comparison options, configured in the Project Comparison dialog; Comparison statistics: additions, deletions, and changes

Table 95. Toolbar
_icon_cmd_project_comp_back.png

Switches to the detailed Project Comparison – <object name> Differences comparison view for the object selected in the tree

Alternative: Double-click the object

_icon_cmd_project_comp_down.png

Selects the next bottom object in the device tree where differences were detected

_icon_cmd_project_comp_up.png

Selects the next top object in the device tree where differences were detected

_icon_accept_block.pngAccept Block

The block (selected object with all subordinate objects and units) is selected for acceptance from the reference block to the current block.

Repeated clicking of _icon_accept_block.pngAccept Block undoes the effects of its last change.

_icon_accept_single.pngAccept Single

The object is selected in the current object for acceptance from the reference line.

_icon_cmd_accept_properties.png

Requirement: The properties, permission, or contents of the object selected in the object tree are different.

Opens the Accept dialog



Table 96. Display of differences with colors and symbols

Object name with _svn_icon_status_modified_children.png

The child objects of the objects are different.

Black font

The objects are identical.

Gray highlight

The objects are different.

Gray highlight + bold blue font

The object only exists in the reference project.

Gray highlight + bold green font

The object only exists in the open project (not in reference project).

Gray highlight + red font + _icon_project_comp_diff_prop.png

The object has different properties.

Gray highlight + red font + _cds_icon_different_access_rights.png

The permissions of the object and the reference object are different.

Gray highlight + bold red font + _icon_project_comp_diff_impl.png

The implementation of the objects is different.

Double-click the line to show the object-specific comparison view.

Yellow highlight

The object is set for acceptance.

Yellow highlight + _icon_project_comp_unit_added.png

Adding the reference object to the open project is set.

Yellow highlight + _icon_project_comp_unit_deleted.png

Deleting the object (in the open project) is set.

Yellow highlight + _cds_icon_accepted_properties.png

The acceptance of the properties of the reference project is set.

Yellow highlight + red font + _cds_icn_accepted_access_rights.png

The acceptance of the access rights of the reference project is activated.

Gray highlight + bold red font + _cds_icon_accepted_contents.png

The acceptance of the implementation of the reference project is set.



Table 97. Display in the footer of the view

Compare Options

The compare options which are defined in the Project Comparison dialog

Compare statistics

Number of additions, deletions, and changes in the current project, as compared to the reference project

Change means differences of an object available in both projects.



_cds_icon_delete_editor.png

The Do you want to commit the changes which you made in the diff view? dialog prompt opens.

Yes: The contents, properties, or permissions of the objects highlighted in yellow are changed in the project. Now they correspond to the reference project. Then the project comparison view is closed completely.

View: Project Comparison – <object name> Differences

Function: Detailed comparison view

. Call in the project comparison view
  • Select an object which is identified as having different contents whose you need to view in detail, and click _icon_cmd_project_comp_back.png.

  • Double-click the object

Table 98. Toolbar
_icon_cmd_project_comp_forward.png

Switches back to the project comparison view

_icon_cmd_project_comp_down.png

Selects the next line below in the code where differences were detected

_icon_cmd_project_comp_up.png

Selects the next line above in the code where differences were detected

_icon_accept_block.pngAccept Block2

The block (with all subordinate lines) is selected for acceptance of the reference blocks into the current project.

A block in the detailed comparison view consists of the unit where the cursor is located and all corresponding units which have the same difference markers. A unit is a line, network, or element. Subsequent lines of a line are examples of corresponding units.

Repeated clicking of _icon_accept_block.pngAccept Block undoes the effects of its last change.

_icon_accept_single.pngAccept Single

The line is selected in the current object for acceptance of the reference line.

_icon_cmd_project_comp_switch.png

This button is available only within the detailed comparison view:

Switches between the following displays for the different units (lines, networks, elements):

  • They are highlighted in red and placed directly opposite each other at the same height

  • Depending on which case it is, they are displayed as deleted or inserted in the currently opened project or reference project.

Note: Depending on the display, the detected differences in the statistics are counted as changed, inserted, or deleted.

_cds_icon_threewaymerge_toggle.png

Third view in the detailed comparison view

The button opens or closes a third view below the comparison of the current and reference views (see figure below). This third view shows the result of the actions taken to resolve the detected differences. Affected lines are flagged with a yellow bar at the beginning of the line.



_cds_img_threemergeview.png

(1) Third comparison view

(2) Result of the Use right line action

(3) Button: Use right line

_cds_icon_threewaymerge_useleft.png

The left line (the implementation in the current project) is used.

_cds_icon_threewaymerge_useleftblock.png

The left block (the implementation of the block in the current project) is used.

_cds_icon_threewaymerge_useright.png

The right line (the implementation in the reference project) is used.

_cds_icon_threewaymerge_userightblock.png

The right block (the implementation of the block in the reference project) is used.

_cds_icon_threewaymerge_useleftbeforeright.png

Only available if the differences are not directly compared (_icon_cmd_project_comp_switch.png):

The left line is inserted above the right one in the third (result) view.

_cds_icon_threewaymerge_userightbeforeleft.png

Only available if the differences are not directly compared (_icon_cmd_project_comp_switch.png) :

The right line is inserted above the left line in the third (result) view.

Table 99. Display of differences with colors and symbols

Black font

The objects are identical.

Object name with _svn_icon_status_modified_children.png

The child objects of the objects are different.

Gray highlight + bold blue font

The code only exists in the reference project.

Gray highlight + bold green font

The code only exists in the current project (not in reference project).

Yellow highlight

The object is set for acceptance.

_cds_icon_delete_editor.png

The Do you want to commit the changes which you made in the diff view? dialog prompt opens.

Yes: The code highlighted in yellow is accepted into the project. The code corresponds to the reference project. Then the detailed view is closed and the project view is displayed. You can continue working with the project comparison.



Dialog: Accept

Table 100. Which meta data should be accepted?

Access Rights

standard icon: Permissions which are selected for acceptance



Accepted groups

Grouping with permissions accepted by the reference project

A group is accepted if it exists in both projects with different permissions.

Example: Group_A

Unaccepted groups (missing in a project)

The group is not accepted if it does not exist in one of the two projects.

Properties

standard icon: Properties set for acceptance

Requirement: The properties of the reference object and object are different.

OK

The settings are applied.