From 2433051636406054c69b6de42806aab50e076e01 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 19 May 2019 12:37:00 +0300 Subject: 2. Update PPC DB Schema and Liquid Types. *** 3. Test preferred index on PPC. *** 3.1. Add Has_Pigment to Liquid Type. *** 4. Add "Use Preferred Index to Machine Studio. *** 4. Enable KeepAlive by default. *** 4. Disable upload HW for TCP by default. *** --- .../ViewModels/MachineConnectionViewVM.cs | 22 +++++++++++++++++++++- .../ViewModels/MainViewVM.cs | 13 +++++++++---- .../Views/MachineConnectionView.xaml | 7 ++++++- 3 files changed, 36 insertions(+), 6 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs index ce49d805e..d1f3cc69e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -36,7 +36,7 @@ namespace Tango.MachineStudio.UI.ViewModels public IExternalBridgeClient SelectedMachine { get { return _selectedMachine; } - set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + set { _selectedMachine = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(RequiresAuthentication)); InvalidateRelayCommands(); } } /// @@ -57,6 +57,7 @@ namespace Tango.MachineStudio.UI.ViewModels EnableDiagnostics = true; UploadHardwareConfiguration = true; + EnableKeepAlive = true; ConnectCommand = new RelayCommand(Connect, (x) => SelectedMachine != null); } @@ -130,6 +131,17 @@ namespace Tango.MachineStudio.UI.ViewModels set { _uploadHardwareConfiguration = value; RaisePropertyChangedAuto(); } } + private bool _enableApplicationLogs; + /// + /// Gets or sets a value indicating whether to enable application logs. + /// + public bool EnableApplicationLogs + { + get { return _enableApplicationLogs; } + set { _enableApplicationLogs = value; RaisePropertyChangedAuto(); } + } + + private bool _enableKeepAlive; /// /// Gets or sets a value indicating whether to use the keep alive mechanism. @@ -140,5 +152,13 @@ namespace Tango.MachineStudio.UI.ViewModels set { _enableKeepAlive = value; RaisePropertyChangedAuto(); } } + public bool RequiresAuthentication + { + get + { + return SelectedMachine != null && SelectedMachine is IExternalBridgeSecureClient; + } + } + } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 3f69ff771..b2faf346e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -447,6 +447,11 @@ namespace Tango.MachineStudio.UI.ViewModels x.SelectedMachine.EnableEventsNotification = x.EnableDiagnostics; x.SelectedMachine.UseKeepAlive = x.EnableKeepAlive; + if (x.SelectedMachine is ExternalBridgeTcpClient) + { + x.SelectedMachine.As().EnableApplicationLogs = x.EnableApplicationLogs; + } + if (x.SelectedMachine.RequiresAuthentication) { //Check machine exist on my database first @@ -483,10 +488,10 @@ namespace Tango.MachineStudio.UI.ViewModels PostMessage(new MachineConnectionChangedMessage() { Machine = x.SelectedMachine }); _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", x.SelectedMachine.SerialNumber)); - if (x.UploadHardwareConfiguration) - { - UploadHardwareConfiguration(false); - } + //if (x.UploadHardwareConfiguration) + //{ + // UploadHardwareConfiguration(false); + //} } catch (ResponseErrorException ex) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml index 7c4e960ec..d39b1226c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -118,11 +118,16 @@ Diagnostics, Debug & Events - + Upload HW Configuration + + + Enable Application Logs + + Keep Alive -- cgit v1.3.1