From e852b5a6bf11f8bf85a8f59986da170364a3319f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 6 Aug 2018 13:59:21 +0300 Subject: Machine Studio v2.4 --- .../TechItems/MultiGraphItem.cs | 35 +++++++++++++------- .../TechItems/SingleGraphItem.cs | 37 +++++++++++++++------- 2 files changed, 50 insertions(+), 22 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems') 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; - /// - /// Gets or sets a value indicating whether [use minimum maximum]. - /// - public bool UseMinMax - { - get { return _useMinMax; } - set { _useMinMax = value; RaisePropertyChangedAuto(); } - } - private bool _useAutoRange; /// /// Gets or sets a value indicating whether [use automatic range]. @@ -143,6 +133,12 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlIgnore] public RelayCommand ToggleRecordingCommand { get; set; } + /// + /// Gets or sets the reset minimum maximum to default command. + /// + [XmlIgnore] + public RelayCommand ResetMinMaxToDefaultCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -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; - /// - /// Gets or sets a value indicating whether [use minimum maximum]. - /// - public bool UseMinMax - { - get { return _useMinMax; } - set { _useMinMax = value; RaisePropertyChangedAuto(); } - } - private bool _useAutoRange; /// /// Gets or sets a value indicating whether [use automatic range]. @@ -143,6 +135,12 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlIgnore] public RelayCommand ToggleRecordingCommand { get; set; } + /// + /// Gets or sets the reset minimum maximum to default command. + /// + [XmlIgnore] + public RelayCommand ResetMinMaxToDefaultCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -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; + } + } + /// /// Clones this instance. /// @@ -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; } -- cgit v1.3.1