主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

使用 System Composer 比较工具比较配置文件差异

此示例展示了如何使用 System Composer 比较工具 来比较两个 System Composer™ 配置文件。您可以比较配置文件以生成比较报告,其中包括已添加、已修改或已删除的配置文件、构造型和属性。

在此示例中,模型代表移动机器人硬件架构。有关配置文件的更多信息,请参阅使用配置文件扩展 System Composer 语言元素

打开 System Composer 比较工具

要比较配置文件,请为包含配置文件的 XML 文件创建比较报告。在此示例中,您可以比较原始版本的 MobileRobotProfile 配置文件与 MobileRobotProfileEdited 配置文件。

要打开 System Composer 比较工具,请输入以下命令。

visdiff("MobileRobotProfile.xml","MobileRobotProfileEdited.xml");

或者,从“文件”面板中选择两个配置文件,右键点击,然后选择比较选定的文件/文件夹

了解配置文件比较的变化

查看比较报告,探索配置文件之间的差异。比较报告根据差异类型突出显示行:

  • 插入 Blue highlight - 右侧新增元素,左侧不存在

  • 删除 Yellow highlight - 左侧存在,但右侧已删除的元素

  • 修改 Purple highlight - 左右两侧都存在,但内容发生变化的元素

比较配置文件差异

System Composer 比较报告包括配置文件、构造型和属性的更改。

在此报告中,该工具选择 MobileRobotProfile 节点,并在报告底部的窗格中显示详细信息。在详细信息窗格中,修改后的名称以紫色显示。您可以看到,配置文件中的 Name 属性在 MobileRobotProfileEdited 配置文件中被修改为 MobileRobotProfileEdited

The System Composer Comparison Tool open with the comparison report of two profiles.

要逐步查看差异,请在比较选项卡中的导航部分使用下一个上一个按钮。或者,使用键盘上的向上和向下箭头浏览报告。

该工具选择 CriticalProcess 节点,并将其设置为蓝色以表示插入此元素。您可以看到,具有 SafetyFactor 属性的 CriticalProcess 构造型被插入到 MobileRobotProfileEdited 配置文件中。

The System Composer Comparison Tool open with the CriticalProcess stereotype highlighted in blue. The Profile Property panel displays the Name, UUID, AppliesTo, and Color properties of the CriticalProcess stereotype.

点击下一个,直到工具选择 TypeOfConnection 节点,该节点将显示为紫色,表示该元素已修改。在详细信息窗格中,您可以看到 <Default> 属性在 MobileRobotProfileEdited 配置文件中已修改为 'USB'

The System Composer Comparison Tool open with the TypeOfConnection property highlighted in purple. The Profile Property panel displays the <Default> property of the TypeOfConnection stereotype property.

点击下一个,直到工具选择 UnitCost 节点,该节点将显示为蓝色,表示该元素已插入。您可以看到,UnitCost 属性被插入到 MobileRobotProfileEdited 配置文件中的 MechanicalComponent 构造型下。

The System Composer Comparison Tool open with the UnitCost property highlighted in blue. The Profile Property panel displays the Name, UUID, Units, and Minimum properties of the UnitCost stereotype property.

点击下一个,直到工具选择 PowerSupply 节点,该节点将显示为黄色,表示该元素已被删除。您可以看到,PowerSupply 构造型的 NameUUIDApplies ToColor 属性在 MobileRobotProfileEdited 配置文件中已被删除。

The System Composer Comparison Tool open with the PowerSupply stereotype highlighted in yellow. The Profile Property panel displays the Name, UUID, Applies To, and Color properties of the PowerSupply stereotype.

另请参阅

函数

工具

主题