diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs index c175f1138..aa404b215 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs @@ -50,6 +50,8 @@ namespace Tango.MachineStudio.Technician.TechItems ItemGuid = value != null ? value.Guid : null; TechName = _techMonitor != null ? _techMonitor.Description : null; + + OnTechMonitorChanged(); } } @@ -79,16 +81,6 @@ namespace Tango.MachineStudio.Technician.TechItems set { _max = value; RaisePropertyChangedAuto(); } } - private bool _useMinMax; - /// <summary> - /// Gets or sets a value indicating whether [use minimum maximum]. - /// </summary> - public bool UseMinMax - { - get { return _useMinMax; } - set { _useMinMax = value; RaisePropertyChangedAuto(); } - } - private bool _useAutoRange; /// <summary> /// Gets or sets a value indicating whether [use automatic range]. @@ -144,6 +136,12 @@ namespace Tango.MachineStudio.Technician.TechItems public RelayCommand ToggleRecordingCommand { get; set; } /// <summary> + /// Gets or sets the reset minimum maximum to default command. + /// </summary> + [XmlIgnore] + public RelayCommand ResetMinMaxToDefaultCommand { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="SingleGraphItem"/> class. /// </summary> public SingleGraphItem() : base() @@ -166,6 +164,15 @@ namespace Tango.MachineStudio.Technician.TechItems }); ToggleRecordingCommand = new RelayCommand(ToggleRecording); + + ResetMinMaxToDefaultCommand = new RelayCommand(() => + { + if (TechMonitor != null) + { + Min = TechMonitor.Min; + Max = TechMonitor.Max; + } + }); } private void _timer_Tick(object sender, EventArgs e) @@ -200,6 +207,15 @@ namespace Tango.MachineStudio.Technician.TechItems TechMonitor = techMonitor; } + private void OnTechMonitorChanged() + { + if (TechMonitor != null) + { + Min = TechMonitor.Min; + Max = TechMonitor.Max; + } + } + /// <summary> /// Clones this instance. /// </summary> @@ -210,7 +226,6 @@ namespace Tango.MachineStudio.Technician.TechItems cloned.TechMonitor = TechMonitor; cloned.Min = Min; cloned.Max = Max; - cloned.UseMinMax = UseMinMax; cloned.UseAutoRange = UseAutoRange; return cloned; } |
