From f3feeac903885d92ea5828d68fc91654db62bea9 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 10 Oct 2019 13:57:49 +0300 Subject: Added comments to hardware comparison code. --- .../Comparison/HardwareCompareResult.cs | 13 +++++++++- .../HardwareComponentCollectionCompareResult.cs | 6 ++++- .../Comparison/HardwareComponentCompareResult.cs | 20 ++++++++++++++-- .../Comparison/HardwareComponentPropertyResult.cs | 28 ++++++++++++++++++++-- .../Comparison/IHasDifference.cs | 16 +++++++++++++ 5 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/IHasDifference.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs index 6021f309e..b596862da 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs @@ -7,9 +7,20 @@ using Tango.Core; namespace Tango.MachineStudio.HardwareDesigner.Comparison { - public class HardwareCompareResult + /// + /// class HardwareCompareResult contains collection of HardwareComponentCollectionCompareResult + /// + /// + public class HardwareCompareResult: IHasDifference { + /// + /// Gets or sets the collections. + /// + /// + /// The collections. + /// public SynchronizedObservableCollection Collections { get; set; } + public bool HasDifferences { get diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs index c3c370f7a..871136bbc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs @@ -7,7 +7,11 @@ using Tango.Core; namespace Tango.MachineStudio.HardwareDesigner.Comparison { - public class HardwareComponentCollectionCompareResult + /// + /// class HardwareComponentCollectionCompareResult contains list of HardwareComponentCompareResult + /// + /// + public class HardwareComponentCollectionCompareResult: IHasDifference { public String CollectionName { get; set; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs index 447984a5f..2d89c9cea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs @@ -7,12 +7,28 @@ using Tango.Core; namespace Tango.MachineStudio.HardwareDesigner.Comparison { - public class HardwareComponentCompareResult + /// + /// class HardwareComponentCompareResult contains collection of HardwareComponentPropertyResult + /// + /// + public class HardwareComponentCompareResult: IHasDifference { public String ComponentName { get; set; } + /// + /// Gets or sets a value indicating whether this instance has component1 of a hardware version ( from left panel). + /// + /// + /// true if this instance has component1; otherwise, false. + /// public bool HasComponent1 { get; set; } + /// + /// Gets or sets a value indicating whether this instance has component2 of a hardware version ( from right panel). + /// + /// + /// true if this instance has component2; otherwise, false. + /// public bool HasComponent2 { get; set; } public SynchronizedObservableCollection Properties { get; set; } @@ -21,7 +37,7 @@ namespace Tango.MachineStudio.HardwareDesigner.Comparison { get { - return Properties.Any(item => item.IsDifferent); + return Properties.Any(item => item.HasDifferences); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs index d57413af1..f2e006270 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs @@ -6,13 +6,37 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.HardwareDesigner.Comparison { - public class HardwareComponentPropertyResult + /// + /// class HardwareComponentPropertyResult contains 2 values of a property for the comparison hardware versions + /// + /// + public class HardwareComponentPropertyResult: IHasDifference { + /// + /// Gets or sets the name of the property. + /// + /// + /// The name of the property. + /// public String PropertyName { get; set; } + + /// + /// Gets or sets the value1 of one ( left panel) hardware version + /// + /// + /// The value1. + /// public String Value1 { get; set; } + + /// + /// Gets or sets the value2 of the second ( right panel) hardware version + /// + /// + /// The value2. + /// public String Value2 { get; set; } - public bool IsDifferent + public bool HasDifferences { get { return Value1 != Value2; } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/IHasDifference.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/IHasDifference.cs new file mode 100644 index 000000000..a452c07f8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/IHasDifference.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.HardwareDesigner.Comparison +{ + interface IHasDifference + { + /// + /// Gets a value indicating whether this instance has differences. + /// + bool HasDifferences { get; } + } +} -- cgit v1.3.1