From 583d3716e37a9be80c8bb248215f343ed4fcd2d1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 7 Oct 2019 15:51:21 +0300 Subject: Redundant. --- .../Models/HardwareCollection.cs | 19 +++++++++++ .../Models/HardwareParameter.cs | 39 +++++++++++++++------- .../Models/IHasDifference.cs | 3 ++ 3 files changed, 49 insertions(+), 12 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareCollection.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareCollection.cs index 7c774e65f..79c7fc946 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareCollection.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareCollection.cs @@ -7,11 +7,26 @@ using Tango.Core; namespace Tango.MachineStudio.MachineDesigner.Models { + /// + /// Represents a hardware version collection. + /// + /// + /// public class HardwareCollection : ExtendedObject, IHasDifference { + /// + /// Gets or sets the name of the collection. + /// public String CollectionName { get; set; } + /// + /// Gets or sets the components. + /// public SynchronizedObservableCollection Components { get; set; } + + /// + /// Gets a value indicating whether this instance has differences. + /// public bool HasDifferences { get @@ -19,6 +34,10 @@ namespace Tango.MachineStudio.MachineDesigner.Models return Components.Any(item => item.HasDifferences); } } + + /// + /// Initializes a new instance of the class. + /// public HardwareCollection() { Components = new SynchronizedObservableCollection(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs index 9e30874e9..5bddfb02e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs @@ -12,20 +12,19 @@ namespace Tango.MachineStudio.MachineDesigner.Models /// The HardwareParameter class. /// Contains default/editable/actual value and data type of each hardware parameter reflected in . /// - /// - /// This class provides data state changes. - /// public class HardwareParameter : ExtendedObject, IHasDifference { - #region properties + #region Properties + public HardwareComponent Component { get; set; } public String PropertyName { get; set; } + + private Object _defaultValue; /// /// The default value contains data from database /// - private Object _defaultValue; public Object DefaultValue { get { return _defaultValue; } @@ -34,6 +33,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models _defaultValue = value; } } + /// /// The type of hardware parameter is used for display correct ui element. /// Can be boolean, int32, or Double @@ -43,10 +43,11 @@ namespace Tango.MachineStudio.MachineDesigner.Models get { return DefaultValue.GetType(); } } + + private Object _actualValue = null; /// - /// The value contains modified data, saved in database or immediately after editing in this session + /// The value contains modified data, saved in database or immediately after editing in this session. /// - private Object _actualValue = null; public Object ActualValue { get { return _actualValue; } @@ -59,11 +60,12 @@ namespace Tango.MachineStudio.MachineDesigner.Models } } + + private Object _editableValue = null; /// - /// The editable value contains value displayed in edit box in UI. + /// The editable value contains value displayed in edit box in UI. /// Initialization the value occurs by clicking in UI and the value will be equal actual value if it exists or default value. /// - private Object _editableValue = null; public Object EditableValue { get { return _editableValue; } @@ -91,6 +93,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models } } } + /// /// Used in UI to display modified value /// @@ -101,6 +104,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models return (ActualValue != null); } } + /// /// Used to display warning explanation icon in case actual value equals default value /// @@ -111,14 +115,17 @@ namespace Tango.MachineStudio.MachineDesigner.Models return ActualValue != null && ActualValue.ToString() == DefaultValue.ToString(); } } - #endregion properties + + #endregion #region events + /// /// Occurs when start select mode. /// Used to set in all others Parameter IsSelected to false except this. /// public event EventHandler Selected; + private void OnIsSelectedChanged() { if (IsSelected) @@ -133,20 +140,28 @@ namespace Tango.MachineStudio.MachineDesigner.Models } } } + #endregion - #region constructors + + #region Constructors + public HardwareParameter() { DeleteCommand = new RelayCommand(DeleteValue); } + #endregion - #region commands + + #region Commands + public RelayCommand DeleteCommand { get; set; } + public void DeleteValue() { ActualValue = null; EditableValue = null; } + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/IHasDifference.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/IHasDifference.cs index bd4851867..759f69ce4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/IHasDifference.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/IHasDifference.cs @@ -8,6 +8,9 @@ namespace Tango.MachineStudio.MachineDesigner.Models { interface IHasDifference { + /// + /// Gets a value indicating whether this instance has differences. + /// bool HasDifferences { get;} } } -- cgit v1.3.1