From 7a016e9ef678fb92b1412a1bfcb9d840d588274e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 6 Mar 2019 18:39:41 +0200 Subject: Machine Studio v4.10.0 --- .../MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') 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 f313e9073..8440c88b2 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("4.0.9.0")] +[assembly: AssemblyVersion("4.0.10.0")] [assembly: ComVisible(false)] \ No newline at end of file -- cgit v1.3.1 From db5c4418d90840ec033a8eacc948419b72755857 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 12 Mar 2019 15:26:36 +0200 Subject: Machine Studio v4.0.10 PPC v1.0.6 --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Integration/ExternalBridgeLoginIntent.proto | 6 +- .../Notifications/DefaultNotificationProvider.cs | 399 ++++++++++++--------- .../Notifications/DialogWindow.xaml | 2 +- .../Notifications/MessageBoxWindow.xaml | 2 +- .../Notifications/TextInputBoxWindow.xaml | 2 +- .../Tango.MachineStudio.UI/ViewModelLocator.cs | 2 - .../ViewModels/MachineConnectionViewVM.cs | 46 ++- .../ViewModels/MachineLoginViewVM.cs | 7 + .../ViewModels/MainViewVM.cs | 32 +- .../Views/MachineLoginView.xaml | 23 +- .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 1 + .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../ViewModels/ExternalBridgeViewVM.cs | 14 +- .../Tango.Core/ExtensionMethods/EnumExtensions.cs | 13 + .../ExternalBridge/ExternalBridgeScanner.cs | 2 +- .../ExternalBridge/ExternalBridgeService.cs | 202 +++++++---- .../ExternalBridge/ExternalBridgeTcpClient.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 11 + .../Visual_Studio/Tango.PMR/ExtensionMethods.cs | 68 ++-- .../Integration/ExternalBridgeLoginIntent.cs | 12 +- .../Tango.Transport/TransporterBase.cs | 5 +- 25 files changed, 543 insertions(+), 310 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 5474d352a..e88a5f3bd 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 5c2d42e86..0d682e1a5 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 49b53bdea..bc0ad0be8 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 4f8a38dec..5743a4d12 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/PMR/Messages/Integration/ExternalBridgeLoginIntent.proto b/Software/PMR/Messages/Integration/ExternalBridgeLoginIntent.proto index 43887ebc5..8e7def71e 100644 --- a/Software/PMR/Messages/Integration/ExternalBridgeLoginIntent.proto +++ b/Software/PMR/Messages/Integration/ExternalBridgeLoginIntent.proto @@ -5,7 +5,7 @@ option java_package = "com.twine.tango.pmr.integration"; enum ExternalBridgeLoginIntent { - Basic = 0; - Override = 1; - Diagnostics = 2; + ColorProfile = 0; + Diagnostics = 1; + FullControl = 2; } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index 161177bf1..7c56115e3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -105,109 +105,148 @@ namespace Tango.MachineStudio.UI.Notifications } /// - /// Creates a new instance of the specified View type and displays it as a modal dialog. + /// Shows the specified view with the specified view model as it's data context. /// + /// The type of the mm. /// The type of the view. - /// The type of the view model. - /// Accept button callback. - /// Cancel button callback. - public void ShowModalDialog(Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + /// The view model. + /// The view. + /// The accept action. + /// The cancel action. + public void ShowModalDialog(VM vm, View view, Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM { - var view = Activator.CreateInstance(); - DialogWindow dialog = new DialogWindow(); - dialog.Owner = Application.Current.MainWindow; - dialog.InnerContent = view; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - view.Loaded += (x, y) => + try { - VM context = view.DataContext as VM; - dialog.DataContext = context; + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + try + { + VM context = vm; + dialog.DataContext = context; - Action onAcceptAction = null; - Action onCancelAction = null; + Action onAcceptAction = null; + Action onCancelAction = null; - onAcceptAction = new Action(() => - { - dialog.Close(); - onAccept(context); - context.Accepted -= onAcceptAction; - context.Canceled -= onCancelAction; - }); + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + context.Canceled -= onCancelAction; + }); - onCancelAction = new Action(() => - { - dialog.Close(); + onCancelAction = new Action(() => + { + dialog.Close(); - if (onCancel != null) - { - onCancel(); - } + if (onCancel != null) + { + onCancel(); + } - context.Accepted -= onAcceptAction; - context.Canceled -= onCancelAction; - }); + context.Canceled -= onCancelAction; + context.Accepted -= onAcceptAction; + }); - context.Accepted += onAcceptAction; - context.Canceled += onCancelAction; + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; - context.OnShow(); - }; - dialog.ShowDialog(); - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + context.OnShow(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + }; + + dialog.ShowDialog(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + finally + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } } /// - /// Shows the specified view with the specified view model as it's data context. + /// Creates a new instance of the specified View type and displays it as a modal dialog. /// - /// The type of the mm. /// The type of the view. - /// The view model. - /// The view. - /// The accept action. - /// The cancel action. - public void ShowModalDialog(VM vm, Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + /// The type of the view model. + /// Accept button callback. + /// Cancel button callback. + public void ShowModalDialog(Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM { - var view = Activator.CreateInstance(); - DialogWindow dialog = new DialogWindow(); - dialog.Owner = Application.Current.MainWindow; - dialog.InnerContent = view; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - view.Loaded += (x, y) => + try { - VM context = vm; - dialog.DataContext = context; + var view = Activator.CreateInstance(); + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + try + { + VM context = view.DataContext as VM; + dialog.DataContext = context; - Action onAcceptAction = null; - Action onCancelAction = null; + Action onAcceptAction = null; + Action onCancelAction = null; - onAcceptAction = new Action(() => - { - dialog.Close(); - onAccept(context); - context.Accepted -= onAcceptAction; - context.Canceled -= onCancelAction; - }); + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + context.Canceled -= onCancelAction; + }); - onCancelAction = new Action(() => - { - dialog.Close(); + onCancelAction = new Action(() => + { + dialog.Close(); - if (onCancel != null) - { - onCancel(); - } + if (onCancel != null) + { + onCancel(); + } - context.Accepted -= onAcceptAction; - context.Canceled -= onCancelAction; - }); + context.Accepted -= onAcceptAction; + context.Canceled -= onCancelAction; + }); - context.Accepted += onAcceptAction; - context.Canceled += onCancelAction; + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; - context.OnShow(); - }; - dialog.ShowDialog(); - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + context.OnShow(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + }; + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + finally + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } } /// @@ -219,48 +258,68 @@ namespace Tango.MachineStudio.UI.Notifications /// The view. /// The accept action. /// The cancel action. - public void ShowModalDialog(VM vm, View view, Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + public void ShowModalDialog(VM vm, Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM { - DialogWindow dialog = new DialogWindow(); - dialog.Owner = Application.Current.MainWindow; - dialog.InnerContent = view; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - view.Loaded += (x, y) => + try { - VM context = vm; - dialog.DataContext = context; + var view = Activator.CreateInstance(); + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + try + { + VM context = vm; + dialog.DataContext = context; - Action onAcceptAction = null; - Action onCancelAction = null; + Action onAcceptAction = null; + Action onCancelAction = null; - onAcceptAction = new Action(() => - { - dialog.Close(); - onAccept(context); - context.Accepted -= onAcceptAction; - context.Canceled -= onCancelAction; - }); + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + context.Canceled -= onCancelAction; + }); - onCancelAction = new Action(() => - { - dialog.Close(); + onCancelAction = new Action(() => + { + dialog.Close(); - if (onCancel != null) - { - onCancel(); - } + if (onCancel != null) + { + onCancel(); + } - context.Canceled -= onCancelAction; - context.Accepted -= onAcceptAction; - }); + context.Accepted -= onAcceptAction; + context.Canceled -= onCancelAction; + }); - context.Accepted += onAcceptAction; - context.Canceled += onCancelAction; + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; - context.OnShow(); - }; - dialog.ShowDialog(); - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + context.OnShow(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + }; + dialog.ShowDialog(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + finally + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } } /// @@ -272,67 +331,87 @@ namespace Tango.MachineStudio.UI.Notifications /// Could not locate view " + viewName public void ShowModalDialog(Action onAccept, Action onCancel) where VM : DialogViewVM { - String viewName = typeof(VM).Name.Replace("VM", ""); - - if (viewTypes == null) - { - viewTypes = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.Contains("MachineStudio")).SelectMany(x => x.GetTypes()).ToList(); - } - - var viewType = viewTypes.SingleOrDefault(x => x.Name == viewName); - - if (viewType == null) + try { - throw new NullReferenceException("Could not locate view " + viewName); - } + String viewName = typeof(VM).Name.Replace("VM", ""); - var view = Activator.CreateInstance(viewType) as FrameworkElement; - DialogWindow dialog = new DialogWindow(); - dialog.Owner = Application.Current.MainWindow; - dialog.InnerContent = view; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - view.Loaded += (x, y) => - { - VM context = view.DataContext as VM; - if (context == null) + if (viewTypes == null) { - context = Activator.CreateInstance(); + viewTypes = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.Contains("MachineStudio")).SelectMany(x => x.GetTypes()).ToList(); } - dialog.DataContext = context; - Action onCancelAction = null; - Action onAcceptAction = null; + var viewType = viewTypes.SingleOrDefault(x => x.Name == viewName); - onAcceptAction = new Action(() => + if (viewType == null) { - dialog.Close(); - onAccept(context); - - context.Canceled -= onCancelAction; - context.Accepted -= onAcceptAction; - }); + throw new NullReferenceException("Could not locate view " + viewName); + } - onCancelAction = new Action(() => + var view = Activator.CreateInstance(viewType) as FrameworkElement; + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => { - dialog.Close(); - - if (onCancel != null) + try { - onCancel(); + VM context = view.DataContext as VM; + if (context == null) + { + context = Activator.CreateInstance(); + } + dialog.DataContext = context; + + Action onCancelAction = null; + Action onAcceptAction = null; + + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + + context.Canceled -= onCancelAction; + context.Accepted -= onAcceptAction; + }); + + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + context.Accepted -= onAcceptAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + return; + } + }; - context.Canceled -= onCancelAction; - context.Accepted -= onAcceptAction; - }); - - context.Accepted += onAcceptAction; - context.Canceled += onCancelAction; - - context.OnShow(); - }; - - dialog.ShowDialog(); - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + dialog.ShowDialog(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error display modal dialog. {typeof(VM).Name}"); + onCancel?.Invoke(); + } + finally + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } } /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index c11e2e11b..2eb1080cb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -7,7 +7,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Windows" mc:Ignorable="d" - Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> + Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml index a89f8eeca..8f9512236 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" - Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> + Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml index d2aad7cee..5e27071ec 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" - Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> + Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 7fbb0008c..3fffd69fd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -61,7 +61,6 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); - TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); @@ -79,7 +78,6 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); - TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); 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 7737911e0..ce49d805e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -19,18 +19,16 @@ namespace Tango.MachineStudio.UI.ViewModels /// public class MachineConnectionViewVM : DialogViewVM { - private EmulatorExternalBridge _emulator; - - private ExternalBridgeScanner _scanner; - /// - /// Gets or sets the machine scanner. - /// + private static ExternalBridgeScanner _scanner; public ExternalBridgeScanner Scanner { get { return _scanner; } set { _scanner = value; RaisePropertyChangedAuto(); } } + + private EmulatorExternalBridge _emulator; + private IExternalBridgeClient _selectedMachine; /// /// Gets or sets the selected machine. @@ -50,11 +48,15 @@ namespace Tango.MachineStudio.UI.ViewModels /// Initializes a new instance of the class. /// /// The scanner. - public MachineConnectionViewVM(ExternalBridgeScanner scanner) + public MachineConnectionViewVM() { + if (_scanner == null) + { + _scanner = new ExternalBridgeScanner(); + } + EnableDiagnostics = true; UploadHardwareConfiguration = true; - Scanner = scanner; ConnectCommand = new RelayCommand(Connect, (x) => SelectedMachine != null); } @@ -65,7 +67,7 @@ namespace Tango.MachineStudio.UI.ViewModels { if (SelectedMachine != null) { - Scanner.Stop(); + _scanner.Stop(); Accept(); } } @@ -75,7 +77,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// protected override void Cancel() { - Scanner.Stop(); + _scanner.Stop(); base.Cancel(); } @@ -85,19 +87,27 @@ namespace Tango.MachineStudio.UI.ViewModels public override void OnShow() { base.OnShow(); - Scanner.AvailableMachines.Clear(); - if (SettingsManager.Default.GetOrCreate().UseExternalBridgeEmulator) + try { - if (_emulator != null) + _scanner.AvailableMachines.Clear(); + + if (SettingsManager.Default.GetOrCreate().UseExternalBridgeEmulator) { - _emulator.Disconnect(); + if (_emulator != null) + { + _emulator.Disconnect(); + } + _emulator = new EmulatorExternalBridge(); } - _emulator = new EmulatorExternalBridge(); - } - Scanner.AvailableMachines.Add(_emulator); - Scanner.Start(); + _scanner.AvailableMachines.Add(_emulator); + _scanner.Start(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error starting external bridge scanner."); + } } private bool _enableDiagnostics; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs index 2b1acdbe6..7584617ed 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.MachineStudio.Common.Notifications; +using Tango.PMR.Integration; using Tango.SharedUI; namespace Tango.MachineStudio.UI.ViewModels @@ -20,6 +21,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// public String Password { get; set; } + /// + /// Gets or sets the intent. + /// + public ExternalBridgeLoginIntent Intent { get; set; } + /// /// Gets or sets the login command. /// @@ -35,6 +41,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// public MachineLoginViewVM() { + Intent = ExternalBridgeLoginIntent.FullControl; LoginCommand = new RelayCommand(Login); CancelCommand = new RelayCommand(Cancel); } 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 986bf483f..3f69ff771 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Input; using System.Windows.Media; using Tango.BL; using Tango.BL.Builders; @@ -467,7 +468,7 @@ namespace Tango.MachineStudio.UI.ViewModels HostName = Environment.MachineName, Password = login.Password, UserGuid = AuthenticationProvider.CurrentUser.Guid, - Intent = PMR.Integration.ExternalBridgeLoginIntent.Override, + Intent = login.Intent, }); ApplicationManager.SetConnectedMachine(x.SelectedMachine); @@ -892,25 +893,28 @@ namespace Tango.MachineStudio.UI.ViewModels { if (!IsApplicationReady) { - var settings = SettingsManager.Default.GetOrCreate(); - - foreach (var item in settings.StudioModulesBounds) + if (!Keyboard.IsKeyDown(Key.LeftCtrl)) { - var module = StudioModuleLoader.AllModules.SingleOrDefault(x => x.Name == item.Name); + var settings = SettingsManager.Default.GetOrCreate(); - if (module != null && !module.InNewWindow) + foreach (var item in settings.StudioModulesBounds) { - OpenModuleInWindow(module, item.Bounds, item.State); - } - } + var module = StudioModuleLoader.AllModules.SingleOrDefault(x => x.Name == item.Name); - if (settings.LastMainModuleName != null) - { - var m = StudioModuleLoader.UserModules.SingleOrDefault(x => x.Name == settings.LastMainModuleName); + if (module != null && !module.InNewWindow) + { + OpenModuleInWindow(module, item.Bounds, item.State); + } + } - if (m != null) + if (settings.LastMainModuleName != null) { - StartModule(m); + var m = StudioModuleLoader.UserModules.SingleOrDefault(x => x.Name == settings.LastMainModuleName); + + if (m != null) + { + StartModule(m); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml index 04f787c41..14967686f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml @@ -5,9 +5,16 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:pmr="clr-namespace:Tango.PMR.Integration;assembly=Tango.PMR" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" d:DesignHeight="200" d:DesignWidth="550" Background="White" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}"> + + + + + @@ -26,12 +33,18 @@ - - - - Enter machine password - + + + + Enter machine password + + + + Intent + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index 961901d2c..cc9202b30 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -420,6 +420,7 @@ namespace Tango.PPC.Jobs.ViewModels job.CreationDate = DateTime.UtcNow; job.JobStatus = JobStatuses.Draft; job.JobType = vm.SelectedJobType; + job.EnableLubrication = true; job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == vm.SelectedColorSpace.ToInt32()).Guid; job.MachineGuid = MachineProvider.Machine.Guid; job.UserGuid = AuthenticationProvider.CurrentUser.Guid; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 19e758a19..fa54f491e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.5.0")] +[assembly: AssemblyVersion("1.0.6.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index a8faeea7b..83f629159 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -7,6 +7,7 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.ExternalBridge; +using Tango.PMR.Integration; using Tango.PPC.Common; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.Navigation; @@ -132,7 +133,7 @@ namespace Tango.PPC.UI.ViewModels { LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}"); - if (e.Request.Password == Settings.ExternalBridgePassword) + if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword) { e.Confirmed = true; @@ -145,11 +146,14 @@ namespace Tango.PPC.UI.ViewModels LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}"); } - LogManager.Log("Navigating to external bridge view..."); - InvokeUI(() => + if (e.Request.Intent == ExternalBridgeLoginIntent.FullControl) { - NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); - }); + LogManager.Log("Navigating to external bridge view..."); + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false); + }); + } } else { diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/EnumExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/EnumExtensions.cs index db3f7dc3d..97256faa5 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/EnumExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/EnumExtensions.cs @@ -44,4 +44,17 @@ public static class EnumExtensions { return (int)((object)value); } + + /// + /// Gets all the flags from a bitwise enumeration. + /// + /// + /// The enum. + /// + public static IEnumerable GetFlags(this Enum input) + { + foreach (Enum value in Enum.GetValues(input.GetType())) + if (input.HasFlag(value)) + yield return (T)(object)value; + } } diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs index 388e42eed..25ecd7d09 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs @@ -147,7 +147,7 @@ namespace Tango.Integration.ExternalBridge ThreadsHelper.InvokeUINow(() => { - AvailableMachines.Add(newMachine); + AvailableMachines.Insert(1, newMachine); }); } diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs index 2a18aff57..c4f559c58 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs @@ -17,6 +17,7 @@ using Tango.Transport.Adapters; using Tango.PMR.Connection; using Tango.PMR.Diagnostics; using Tango.PMR.Debugging; +using System.Security.Authentication; namespace Tango.Integration.ExternalBridge { @@ -26,6 +27,7 @@ namespace Tango.Integration.ExternalBridge private TcpServer _tcpServer; private bool _send_app_logs; private String _app_logs_token; + private Dictionary> _messageHandlers; #region Events @@ -116,6 +118,9 @@ namespace Tango.Integration.ExternalBridge /// public ExternalBridgeService() { + _messageHandlers = new Dictionary>(); + RegisterMessageHandlers(); + _tcpServer = new TcpServer(1984); _tcpServer.ClientConnected += _tcpServer_ClientConnected; @@ -274,31 +279,46 @@ namespace Tango.Integration.ExternalBridge { //Do nothing ! } - else if (container.Type == MessageType.ExternalBridgeLoginRequest) - { - OnExternalBridgeLoginRequest(container); - } - else if (container.Type == MessageType.ExternalBridgeLogoutRequest) - { - OnExternalBridgeLogoutRequest(container); - } - else if (container.Type == MessageType.StartApplicationLogsRequest) - { - _app_logs_token = container.Token; - _send_app_logs = true; - SendResponse(new StartApplicationLogsResponse(), container.Token); - } - else if (container.Type == MessageType.StopApplicationLogsRequest) - { - _send_app_logs = false; - SendResponse(new StopApplicationLogsResponse() { }, container.Token); - SendResponse(new StartApplicationLogsResponse() { }, _app_logs_token, true); - } else { - if (IsInSession && SessionIntent == ExternalBridgeLoginIntent.Override) + if (IsInSession) { - OnAnyRequest(container); + if (_messageHandlers.ContainsKey(container.Type)) + { + try + { + try + { + _messageHandlers[container.Type](container); + } + catch (Exception ex) + { + SendErrorResponse(ex, container.Token); + } + } + catch (Exception ex) + { + if (ex is ResponseErrorException) + { + SendResponse((ex as ResponseErrorException).Container); + } + else + { + SendErrorResponse(ex, container.Token); + } + } + } + else + { + OnAnyRequest(container); + } + } + else + { + if (container.Type == MessageType.ExternalBridgeLoginRequest) + { + OnExternalBridgeLoginRequest(container); + } } } } @@ -380,16 +400,21 @@ namespace Tango.Integration.ExternalBridge #region Message Handlers + private void RegisterMessageHandlers() + { + _messageHandlers.Add(MessageType.ExternalBridgeLogoutRequest, OnExternalBridgeLogoutRequest); + + _messageHandlers.Add(MessageType.StartApplicationLogsRequest, OnStartApplicationLogsRequest); + _messageHandlers.Add(MessageType.StopApplicationLogsRequest, OnStopApplicationLogsRequest); + + _messageHandlers.Add(MessageType.JobRequest, OnJobRequest); + } + protected virtual async void OnAnyRequest(MessageContainer container) { - if (MachineOperator.Status == MachineStatuses.Disconnected) + if (SessionIntent == ExternalBridgeLoginIntent.ColorProfile) { - try - { - await SendErrorResponse(new Exception("Machine operator is disconnected."), container.Token); - } - catch { } - + await SendErrorResponse(new AuthenticationException("The specified intent does not grant the specified action."), container.Token); return; } @@ -411,42 +436,31 @@ namespace Tango.Integration.ExternalBridge } else { - MachineOperator.SendContinuousRequest(container).Subscribe((response) => + try { - if (Enabled && IsInSession) + MachineOperator.SendContinuousRequest(container).Subscribe((response) => { - SendResponse(response); - } + if (Enabled && IsInSession) + { + SendResponse(response); + } - }, (ex) => - { - if (Enabled) + }, (ex) => { - if (ex is ResponseErrorException) + if (Enabled) { - SendResponse((ex as ResponseErrorException).Container); + if (ex is ResponseErrorException) + { + SendResponse((ex as ResponseErrorException).Container); + } } - } - }); - } - } - - protected async virtual void OnExternalBridgeLogoutRequest(MessageContainer container) - { - try - { - await SendResponse(new ExternalBridgeLogoutResponse(), container.Token); - } - catch (Exception ex) - { - LogManager.Log(ex); - } - finally - { - ClearQueues(); + }); + } + catch (Exception ex) + { + await SendErrorResponse(ex, container.Token); + } } - - OnClientDisconnected(); } protected async virtual void OnExternalBridgeLoginRequest(MessageContainer container) @@ -454,9 +468,9 @@ namespace Tango.Integration.ExternalBridge var request = MessageFactory.ParseTangoMessageFromContainer(container); - LogManager.Log(String.Format("External bridge login attempt:{0}{1}", Environment.NewLine, request.Message.ToJsonString())); + LogManager.Log($"External bridge login attempt:\nIntent: {request.Message.Intent}\nMessage:\n{request.Message.ToJsonString()}"); - if (MachineOperator.Status != MachineStatuses.Printing || request.Message.Intent != ExternalBridgeLoginIntent.Override) + if (MachineOperator.Status != MachineStatuses.Printing || request.Message.Intent != ExternalBridgeLoginIntent.FullControl) { ExternalBridgeClientConnectedEventArgs args = new ExternalBridgeClientConnectedEventArgs(); args.Request = request; @@ -482,12 +496,74 @@ namespace Tango.Integration.ExternalBridge LogManager.Log("External bridge client login failed, invalid password."); } - await SendResponse(response, container.Token); + await SendResponse(response, container.Token, null, null, IsInSession ? null : "Invalid password or intent."); + } + else + { + LogManager.Log($"External bridge client login failed because the machine is currently printing and '{ExternalBridgeLoginIntent.FullControl}' intent was requested."); + await SendResponse(new ExternalBridgeLoginResponse(), container.Token, false, ErrorCode.GeneralError, $"Machine connection with '{ExternalBridgeLoginIntent.FullControl}' intent is not permitted while printing."); + } + } + + protected async virtual void OnExternalBridgeLogoutRequest(MessageContainer container) + { + try + { + await SendResponse(new ExternalBridgeLogoutResponse(), container.Token); + } + catch (Exception ex) + { + LogManager.Log(ex); + } + finally + { + ClearQueues(); + } + + OnClientDisconnected(); + } + + protected virtual void OnStartApplicationLogsRequest(MessageContainer container) + { + if (SessionIntent == ExternalBridgeLoginIntent.Diagnostics || SessionIntent == ExternalBridgeLoginIntent.FullControl) + { + _app_logs_token = container.Token; + _send_app_logs = true; + SendResponse(new StartApplicationLogsResponse(), container.Token); + } + else + { + throw new AuthenticationException("The specified intent does not grant the specified action."); + } + } + + protected virtual void OnStopApplicationLogsRequest(MessageContainer container) + { + if (SessionIntent == ExternalBridgeLoginIntent.Diagnostics || SessionIntent == ExternalBridgeLoginIntent.FullControl) + { + _send_app_logs = false; + SendResponse(new StopApplicationLogsResponse() { }, container.Token); + SendResponse(new StartApplicationLogsResponse() { }, _app_logs_token, true); + } + else + { + throw new AuthenticationException("The specified intent does not grant the specified action."); + } + } + + protected virtual void OnJobRequest(MessageContainer container) + { + if (SessionIntent != ExternalBridgeLoginIntent.FullControl) + { + throw new InvalidOperationException($"Job execution is disabled while session intent is '{SessionIntent}'."); + } + if (MachineOperator.Status != MachineStatuses.ReadyToDye) + { + throw new InvalidOperationException($"Could not execute job while machine operator status is '{MachineOperator.Status}'."); } else { - LogManager.Log("External bridge client login failed because the machine is currently printing."); - await SendResponse(new ExternalBridgeLoginResponse(), container.Token, false, ErrorCode.GeneralError, "Machine connection override is not permitted while printing."); + OnAnyRequest(container); } } diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs index 887242961..2839c2df1 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs @@ -111,7 +111,7 @@ namespace Tango.Integration.ExternalBridge if (!response.Message.Authenticated) { await Adapter.Disconnect(); - throw new AuthenticationException("The machine password is invalid."); + throw new AuthenticationException(response.Container.ErrorMessage); } Status = MachineStatuses.ReadyToDye; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index c13961191..520b06626 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1196,6 +1196,16 @@ namespace Tango.Integration.Operation throw new InvalidOperationException($"Unsupported color space {stop.BrushColorSpace}."); } } + + if (job.EnableLubrication) + { + var lubricantVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack != null && x.IdsPack.LiquidType != null && x.IdsPack.LiquidType.Code == LiquidTypes.Lubricant.ToInt32()); + + if (lubricantVolume != null) + { + lubricantVolume.Volume = 100; + } + } } return Print(job, processParameters); @@ -1248,6 +1258,7 @@ namespace Tango.Integration.Operation ticket.Guid = originalJob.Guid; ticket.EnableInterSegment = job.EnableInterSegment; ticket.InterSegmentLength = job.InterSegmentLength; + ticket.EnableLubrication = job.EnableLubrication; ticket.Length = job.Length; ticket.WindingMethod = (JobWindingMethod)job.WindingMethod.Code; ticket.Spool = new JobSpool(); diff --git a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs index e80b45ade..83667da72 100644 --- a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs +++ b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs @@ -8,38 +8,52 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.PMR.Common; +using Tango.PMR.Integration; +/// +/// Contains PMR extension methods. +/// +public static class ExtensionMethods +{ /// - /// Contains PMR extension methods. + /// Gets the protobuf attribute value from the message type. /// - public static class ExtensionMethods + /// The value. + /// + public static String ToOriginalName(this MessageType value) { - /// - /// Gets the protobuf attribute value from the message type. - /// - /// The value. - /// - public static String ToOriginalName(this MessageType value) - { - FieldInfo fi = value.GetType().GetField(value.ToString()); + FieldInfo fi = value.GetType().GetField(value.ToString()); - OriginalNameAttribute[] attributes = (OriginalNameAttribute[])fi.GetCustomAttributes(typeof(OriginalNameAttribute), false); + OriginalNameAttribute[] attributes = (OriginalNameAttribute[])fi.GetCustomAttributes(typeof(OriginalNameAttribute), false); - if (attributes != null && - attributes.Length > 0) - return attributes[0].Name; - else - return value.ToString(); - } + if (attributes != null && + attributes.Length > 0) + return attributes[0].Name; + else + return value.ToString(); + } - /// - /// Gets the message parser. - /// - /// The message. - /// - public static MessageParser GetParser(this IMessage message) - { - MessageParser parser = message.GetType().GetProperty("Parser").GetValue(message) as MessageParser; - return parser; - } + /// + /// Gets the message parser. + /// + /// The message. + /// + public static MessageParser GetParser(this IMessage message) + { + MessageParser parser = message.GetType().GetProperty("Parser").GetValue(message) as MessageParser; + return parser; + } + + /// + /// Determines whether the specified intent requires a password. + /// + /// The intent. + /// + public static bool RequiresPassword(this ExternalBridgeLoginIntent intent) + { + return + intent == ExternalBridgeLoginIntent.Diagnostics + || + intent == ExternalBridgeLoginIntent.FullControl; } +} diff --git a/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeLoginIntent.cs b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeLoginIntent.cs index 63455d8f2..3205ff168 100644 --- a/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeLoginIntent.cs +++ b/Software/Visual_Studio/Tango.PMR/Integration/ExternalBridgeLoginIntent.cs @@ -23,9 +23,9 @@ namespace Tango.PMR.Integration { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Ch9FeHRlcm5hbEJyaWRnZUxvZ2luSW50ZW50LnByb3RvEhVUYW5nby5QTVIu", - "SW50ZWdyYXRpb24qRQoZRXh0ZXJuYWxCcmlkZ2VMb2dpbkludGVudBIJCgVC", - "YXNpYxAAEgwKCE92ZXJyaWRlEAESDwoLRGlhZ25vc3RpY3MQAkIhCh9jb20u", - "dHdpbmUudGFuZ28ucG1yLmludGVncmF0aW9uYgZwcm90bzM=")); + "SW50ZWdyYXRpb24qTwoZRXh0ZXJuYWxCcmlkZ2VMb2dpbkludGVudBIQCgxD", + "b2xvclByb2ZpbGUQABIPCgtEaWFnbm9zdGljcxABEg8KC0Z1bGxDb250cm9s", + "EAJCIQofY29tLnR3aW5lLnRhbmdvLnBtci5pbnRlZ3JhdGlvbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Integration.ExternalBridgeLoginIntent), }, null)); @@ -35,9 +35,9 @@ namespace Tango.PMR.Integration { } #region Enums public enum ExternalBridgeLoginIntent { - [pbr::OriginalName("Basic")] Basic = 0, - [pbr::OriginalName("Override")] Override = 1, - [pbr::OriginalName("Diagnostics")] Diagnostics = 2, + [pbr::OriginalName("ColorProfile")] ColorProfile = 0, + [pbr::OriginalName("Diagnostics")] Diagnostics = 1, + [pbr::OriginalName("FullControl")] FullControl = 2, } #endregion diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index fe7d8a249..e68e3c919 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -887,7 +887,10 @@ namespace Tango.Transport } else { - LogManager.Log("Could not send message " + message.Message.GetType().Name + ". Adapter is disconnected.", LogCategory.Warning); + if (message.Direction == TransportMessageDirection.Request) + { + message.SetException(LogManager.Log(new InvalidOperationException("Could not send message " + message.Message.GetType().Name + ". Adapter is disconnected."))); + } } if (message.Direction == TransportMessageDirection.Response) -- cgit v1.3.1