diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs index 67266ee66..8a9cba883 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ControllerItem.cs @@ -30,7 +30,19 @@ namespace Tango.MachineStudio.Technician.TechItems public TechController TechController { get { return _techController; } - set { _techController = value; RaisePropertyChangedAuto(); TechName = _techController != null ? _techController.Description : null; ItemGuid = value != null ? value.Guid : null; } + set + { + _techController = value; + RaisePropertyChangedAuto(); + TechName = _techController != null ? _techController.Description : null; ItemGuid = value != null ? value.Guid : null; + + if (_techController != null && !IsSetToDefault) + { + OptimalRangeMinimum = _techController.Min; + OptimalRangeMaximum = _techController.Min + ((_techController.Max - _techController.Min) * 0.7d); + IsSetToDefault = true; + } + } } private double _value; @@ -64,7 +76,6 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlIgnore] public DateTime LastUpdateTime { get; set; } - private double _effectiveValue; /// <summary> /// Gets or sets the effective value received from the embedded device. @@ -85,6 +96,29 @@ namespace Tango.MachineStudio.Technician.TechItems } } + private double _optimalRangeMinimum; + /// <summary> + /// Gets or sets the optimal range. + /// </summary> + public double OptimalRangeMinimum + { + get { return _optimalRangeMinimum; } + set + { + _optimalRangeMinimum = value; + RaisePropertyChangedAuto(); + } + } + + private double _optimalRangeMaximum; + public double OptimalRangeMaximum + { + get { return _optimalRangeMaximum; } + set { _optimalRangeMaximum = value; RaisePropertyChangedAuto(); } + } + + public bool IsSetToDefault { get; set; } + /// <summary> /// Initializes a new instance of the <see cref="ControllerItem"/> class. /// </summary> @@ -115,6 +149,10 @@ namespace Tango.MachineStudio.Technician.TechItems { ControllerItem cloned = base.Clone() as ControllerItem; cloned.TechController = TechController; + cloned.OptimalRangeMinimum = OptimalRangeMinimum; + cloned.OptimalRangeMaximum = OptimalRangeMaximum; + cloned.IsSetToDefault = IsSetToDefault; + return cloned; } } |
