diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models')
3 files changed, 49 insertions, 12 deletions
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 { + /// <summary> + /// Represents a hardware version collection. + /// </summary> + /// <seealso cref="Tango.Core.ExtendedObject" /> + /// <seealso cref="Tango.MachineStudio.MachineDesigner.Models.IHasDifference" /> public class HardwareCollection : ExtendedObject, IHasDifference { + /// <summary> + /// Gets or sets the name of the collection. + /// </summary> public String CollectionName { get; set; } + /// <summary> + /// Gets or sets the components. + /// </summary> public SynchronizedObservableCollection<HardwareComponent> Components { get; set; } + + /// <summary> + /// Gets a value indicating whether this instance has differences. + /// </summary> public bool HasDifferences { get @@ -19,6 +34,10 @@ namespace Tango.MachineStudio.MachineDesigner.Models return Components.Any(item => item.HasDifferences); } } + + /// <summary> + /// Initializes a new instance of the <see cref="HardwareCollection"/> class. + /// </summary> public HardwareCollection() { Components = new SynchronizedObservableCollection<HardwareComponent>(); 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 . /// </summary> - /// <remarks> - /// This class provides data state changes. - /// </remarks> public class HardwareParameter : ExtendedObject, IHasDifference { - #region properties + #region Properties + public HardwareComponent Component { get; set; } public String PropertyName { get; set; } + + private Object _defaultValue; /// <summary> /// The default value contains data from database /// </summary> - private Object _defaultValue; public Object DefaultValue { get { return _defaultValue; } @@ -34,6 +33,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models _defaultValue = value; } } + /// <summary> /// 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; /// <summary> - /// 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. /// </summary> - private Object _actualValue = null; public Object ActualValue { get { return _actualValue; } @@ -59,11 +60,12 @@ namespace Tango.MachineStudio.MachineDesigner.Models } } + + private Object _editableValue = null; /// <summary> - /// 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. /// </summary> - private Object _editableValue = null; public Object EditableValue { get { return _editableValue; } @@ -91,6 +93,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models } } } + /// <summary> /// Used in UI to display modified value /// </summary> @@ -101,6 +104,7 @@ namespace Tango.MachineStudio.MachineDesigner.Models return (ActualValue != null); } } + /// <summary> /// Used to display warning explanation icon in case actual value equals default value /// </summary> @@ -111,14 +115,17 @@ namespace Tango.MachineStudio.MachineDesigner.Models return ActualValue != null && ActualValue.ToString() == DefaultValue.ToString(); } } - #endregion properties + + #endregion #region events + /// <summary> /// Occurs when start select mode. /// Used to set in all others Parameter IsSelected to false except this. /// </summary> 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 { + /// <summary> + /// Gets a value indicating whether this instance has differences. + /// </summary> bool HasDifferences { get;} } } |
