diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareParameter.cs | 39 |
1 files changed, 27 insertions, 12 deletions
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 } } |
