From 4ca2cb29d8bf2b93c35ac12e6d629a3537bb4a0b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 14 Jan 2019 12:48:33 +0200 Subject: Machine Studio v4.0.0.0 Added reset all graphs to tech board. --- .../ViewModels/MachineTechViewVM.cs | 12 +++++++++++ .../Views/MachineTechView.xaml | 5 +++++ .../Properties/AssemblyInfo.cs | 2 +- .../DefaultStudioApplicationManager.cs | 24 +++++++++++++--------- 4 files changed, 32 insertions(+), 11 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index adf85516e..e1fddac83 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -281,6 +281,12 @@ namespace Tango.MachineStudio.Technician.ViewModels /// Gets or sets the upload partial hardware configuration command. /// public RelayCommand UploadPartialHardwareConfigurationCommand { get; set; } + + /// + /// Gets or sets the reset command. + /// + public RelayCommand ResetGraphsCommand { get; set; } + #endregion #region Constructors @@ -356,6 +362,7 @@ namespace Tango.MachineStudio.Technician.ViewModels RenameTabCommand = new RelayCommand(RenameTab); ImportProjectTabsCommand = new RelayCommand(ImportProjectTabs); UploadPartialHardwareConfigurationCommand = new RelayCommand(UploadPartialHardwareConfiguration); + ResetGraphsCommand = new RelayCommand(ClearAllGraphs); } #endregion @@ -375,6 +382,8 @@ namespace Tango.MachineStudio.Technician.ViewModels { ResetHardwareConfiguration(false); } + + ClearAllGraphs(); } /// @@ -2462,6 +2471,9 @@ namespace Tango.MachineStudio.Technician.ViewModels public void ClearAllGraphs() { + _start_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); + _last_time = DateTime.Now; + foreach (var controller in _singleControllers) { controller.Value.Clear(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 3072ea98c..92e2b292a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -234,6 +234,11 @@ + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index c311df44b..96b1290b0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("3.5.79.18305")] +[assembly: AssemblyVersion("4.0.0.0")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 90a2e34e7..6146d8f45 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -89,18 +89,22 @@ namespace Tango.MachineStudio.UI.StudioApplication get { return _connectedMachine; } private set { - _connectedMachine = value; - RaisePropertyChangedAuto(); - RaisePropertyChanged(nameof(IsMachineConnected)); - RaisePropertyChanged(nameof(IsMachineConnectedViaTCP)); - - if (_connectedMachine != null) + if (_connectedMachine != value) { - _connectedMachine.StateChanged -= ConnectedMachine_StateChanged; - _connectedMachine.StateChanged += ConnectedMachine_StateChanged; - } + _connectedMachine = value; + RaisePropertyChangedAuto(); + RaisePropertyChanged(nameof(IsMachineConnected)); + RaisePropertyChanged(nameof(IsMachineConnectedViaTCP)); - ConnectedMachineChanged?.Invoke(this, _connectedMachine); + if (_connectedMachine != null) + { + _connectedMachine.StateChanged -= ConnectedMachine_StateChanged; + _connectedMachine.StateChanged += ConnectedMachine_StateChanged; + } + + + ConnectedMachineChanged?.Invoke(this, _connectedMachine); + } } } -- cgit v1.3.1