diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-06 13:59:21 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-06 13:59:21 +0300 |
| commit | e852b5a6bf11f8bf85a8f59986da170364a3319f (patch) | |
| tree | 7ed02bfe8f0f5272687a69edd6193acc6c1879fc /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems | |
| parent | cd92ad2dc4a8df75c1b955757b07c796b064b7e2 (diff) | |
| download | Tango-e852b5a6bf11f8bf85a8f59986da170364a3319f.tar.gz Tango-e852b5a6bf11f8bf85a8f59986da170364a3319f.zip | |
Machine Studio v2.4
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems')
2 files changed, 50 insertions, 22 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs index d4bdfb7b2..5a3bd0327 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs @@ -79,16 +79,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 +134,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="MultiGraphItem"/> class. /// </summary> public MultiGraphItem() : base() @@ -166,6 +162,24 @@ namespace Tango.MachineStudio.Technician.TechItems }); ToggleRecordingCommand = new RelayCommand(ToggleRecording); + + ResetMinMaxToDefaultCommand = new RelayCommand(() => + { + if (TechMonitor != null) + { + Min = TechMonitor.Min; + Max = TechMonitor.Max; + } + }); + } + + private void OnTechMonitorChanged() + { + if (TechMonitor != null) + { + Min = TechMonitor.Min; + Max = TechMonitor.Max; + } } private void _timer_Tick(object sender, EventArgs e) @@ -210,7 +224,6 @@ namespace Tango.MachineStudio.Technician.TechItems cloned.TechMonitor = TechMonitor; cloned.Min = Min; cloned.Max = Max; - cloned.UseMinMax = UseMinMax; cloned.UseAutoRange = UseAutoRange; return cloned; } 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; } |
