From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../Tango.MachineStudio.UI/App.config | 4 - .../Tango.MachineStudio.UI/App.xaml.cs | 72 ++---- .../DefaultAuthenticationProvider.cs | 26 +-- .../Console/ConsoleWindow.xaml | 4 +- .../Images/active_directory.png | Bin 15300 -> 0 bytes .../Images/external-bridge-emulator.png | Bin 6412 -> 3554 bytes .../Images/external-bridge-signalr.png | Bin 5399 -> 0 bytes .../Images/external-bridge-tcp.png | Bin 5653 -> 3618 bytes .../Images/external-bridge-usb.png | Bin 5669 -> 3623 bytes .../Tango.MachineStudio.UI/Images/login.png | Bin 6401 -> 0 bytes .../Tango.MachineStudio.UI/Images/login_white.png | Bin 3308 -> 0 bytes .../Images/machinestudio_login.png | Bin 21788 -> 0 bytes .../Tango.MachineStudio.UI/MainWindow.xaml | 2 +- .../Tango.MachineStudio.UI/MainWindow.xaml.cs | 2 - .../Notifications/DialogWindow.xaml | 2 +- .../Notifications/MessageBoxWindow.xaml | 4 +- .../Notifications/TextInputBoxWindow.xaml | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../DefaultStudioApplicationManager.cs | 35 +-- .../TFS/TeamFoundationServiceExtendedClient.cs | 75 ++---- .../TFS/TeamMembersProvider.cs | 3 +- .../Tango.MachineStudio.UI.csproj | 77 ++----- .../Tango.MachineStudio.UI/ViewModelLocator.cs | 19 +- .../ViewModels/ConnectedMachineViewVM.cs | 6 +- .../ViewModels/ConnectionLostViewVM.cs | 64 ------ .../ViewModels/FirmwareUpgradeViewVM.cs | 6 - .../ViewModels/LoginViewVM.cs | 170 +------------- .../ViewModels/MachineConnectionViewVM.cs | 14 -- .../ViewModels/MachineLoginViewVM.cs | 7 +- .../ViewModels/MainViewVM.cs | 251 ++++++++------------- .../ViewModels/UpdateViewVM.cs | 3 +- .../Tango.MachineStudio.UI/Views/AboutView.xaml | 6 +- .../Views/ConnectedMachineView.xaml | 58 ----- .../Views/ConnectionLostView.xaml | 11 +- .../Views/FirmwareUpgradeView.xaml | 2 +- .../Tango.MachineStudio.UI/Views/LoadingView.xaml | 2 +- .../Tango.MachineStudio.UI/Views/LoginView.xaml | 120 +++------- .../Views/MachineConnectionView.xaml | 28 +-- .../Views/MachineLoginView.xaml | 25 +- .../Views/MachineSerialView.xaml | 2 +- .../Tango.MachineStudio.UI/Views/MainView.xaml | 158 ++++--------- .../Views/ReportIssueView.xaml | 2 +- .../Tango.MachineStudio.UI/Views/ShutdownView.xaml | 2 +- .../Windows/ExceptionWindow.xaml | 2 +- .../Windows/ModuleWindow.xaml | 14 +- .../Windows/ModuleWindow.xaml.cs | 9 - .../Tango.MachineStudio.UI/machine_new_small.ico | Bin 132825 -> 0 bytes 47 files changed, 292 insertions(+), 999 deletions(-) delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-signalr.png delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login_white.png delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png delete mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/machine_new_small.ico (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index d70e2180b..59f92d6b9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -152,10 +152,6 @@ - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index 7eab5066a..8309500b7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -23,37 +23,21 @@ using Tango.MachineStudio.UI.Views; using Tango.MachineStudio.Common; using Tango.Core; using Tango.BL; -using Tango.Integration.Operation; -using System.Net; -using System.Globalization; -using System.Windows.Markup; namespace Tango.MachineStudio.UI { /// /// Interaction logic for App.xaml /// - public partial class App : Application + public partial class App : Application { private WpfGlobalExceptionTrapper exceptionTrapper; private LogManager LogManager = LogManager.Default; - public static String[] StartupArgs { get; set; } = Environment.GetCommandLineArgs().Skip(1).ToArray(); + public static String[] StartupArgs { get; set; } protected override void OnStartup(StartupEventArgs e) { - //Set culture info. - var enUSCulture = new CultureInfo("en-US"); - - Thread.CurrentThread.CurrentCulture = enUSCulture; - Thread.CurrentThread.CurrentUICulture = enUSCulture; - CultureInfo.DefaultThreadCurrentCulture = enUSCulture; - CultureInfo.DefaultThreadCurrentUICulture = enUSCulture; - - FrameworkElement.LanguageProperty.OverrideMetadata( - typeof(FrameworkElement), - new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); - StartupArgs = e.Args; #if DEBUG @@ -77,14 +61,7 @@ namespace Tango.MachineStudio.UI #if DEBUG LogManager.RegisterLogger(new VSOutputLogger()); #endif - LogManager.RegisterLogger(new FileLogger() { EnableAutoLogRemoval = true, EnableMaxFileSizeLimit = true }); - - var operatorLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.SingleOrDefault(x => x is FileLogger) as FileLogger; - if (operatorLogger != null) - { - operatorLogger.EnableAutoLogRemoval = true; - operatorLogger.EnableMaxFileSizeLimit = true; - } + LogManager.RegisterLogger(new FileLogger()); LogManager.Log("Application Started..."); @@ -95,30 +72,24 @@ namespace Tango.MachineStudio.UI base.OnStartup(e); - exceptionTrapper = new WpfGlobalExceptionTrapper(); - exceptionTrapper.Initialize(this); - exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; - - ApplyEFCacheSettings(); + LogManager.Categories.Clear(); - WebRequest.DefaultWebProxy = null; - GetLastApplicationCrashFromWindows(); - } - - private async void GetLastApplicationCrashFromWindows() - { - var logItem = await exceptionTrapper.GetLastApplicationCrashEventLog(); - if (logItem != null) + if (settings.LoggingCategories.Count == 0) { - LogManager.Log(logItem); + settings.LoggingCategories.Add(LogCategory.Critical); + settings.LoggingCategories.Add(LogCategory.Error); + settings.LoggingCategories.Add(LogCategory.Info); + settings.LoggingCategories.Add(LogCategory.Warning); } - } - private void ApplyEFCacheSettings() - { - var settings = SettingsManager.Default.GetOrCreate(); + LogManager.Categories.AddRange(settings.LoggingCategories); + + exceptionTrapper = new WpfGlobalExceptionTrapper(); + exceptionTrapper.Initialize(this); + exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; + //Apply Caching if (settings.CachingMode != ObservablesContextInMemoryCachingMode.None) { LogManager.Log("EF Caching is enabled."); @@ -137,7 +108,9 @@ namespace Tango.MachineStudio.UI { LogManager.Log("EF Caching is disabled"); } + } + #region Global Exception Trapping @@ -159,12 +132,15 @@ namespace Tango.MachineStudio.UI } catch { } - if (e.Exception.ToString().Contains("A Task's exception(s) were not observed")) + try { - e.TryRecover = true; - LogManager.Log("Task not observed exception. Ignoring..."); - return; + var eventLogger = TangoIOC.Default.GetInstance(); + if (eventLogger != null) + { + eventLogger.Log(e.Exception, "Application Crashed!"); + } } + catch { } Application.Current.Dispatcher.Invoke(() => { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index 26938b203..3cc5e8b49 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -90,16 +90,13 @@ namespace Tango.MachineStudio.UI.Authentication /// The password. /// /// Login failed for user " + email - public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false, Action logAction = null) + public AuthenticationLoginResult Login(string email, string password, bool bypassVersionCheck = false) { _refreshTokenTimer.Stop(); var settings = SettingsManager.Default.GetOrCreate(); - if (!App.StartupArgs.Contains("-webDebug")) - { - _client.Environment = settings.DeploymentSlot; - } + _client.Environment = settings.DeploymentSlot; var appVersion = AssemblyHelper.GetCurrentAssemblyVersion().ToString(); @@ -112,15 +109,12 @@ namespace Tango.MachineStudio.UI.Authentication try { - logAction?.Invoke("Logging in to machine service..."); - response = _client.Login(new LoginRequest() { Email = email, Password = password, Version = appVersion, - Method = method, }).Result; } @@ -147,20 +141,9 @@ namespace Tango.MachineStudio.UI.Authentication }; } - if (response.PasswordChangeRequired) - { - return new AuthenticationLoginResult() - { - Response = response - }; - } - try { - ObservablesStaticCollections.Instance.Initialize((x) => - { - logAction.Invoke(x); - }); + ObservablesStaticCollections.Instance.Initialize(); } catch (Exception ex) { @@ -169,7 +152,6 @@ namespace Tango.MachineStudio.UI.Authentication using (ObservablesContext db = ObservablesContext.CreateDefault()) { - logAction.Invoke("Loading user permissions..."); User user = new UserBuilder(db).Set(x => x.Email.ToLower() == email.ToLower()).WithRolesAndPermissions().WithOrganization().Build(); if (user == null) @@ -181,8 +163,6 @@ namespace Tango.MachineStudio.UI.Authentication _refreshTokenTimer.Start(); - logAction.Invoke("Starting application..."); - return new AuthenticationLoginResult() { User = user, diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml index cc2c1fd46..0408319ea 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml @@ -156,12 +156,12 @@ - + HighlightTypes="{Binding HighlightTypes}"/> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png deleted file mode 100644 index 4cced33e0..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-emulator.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-emulator.png index 254fc819a..cb159d4a6 100644 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-emulator.png and b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-emulator.png differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-signalr.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-signalr.png deleted file mode 100644 index bda45ffd2..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-signalr.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-tcp.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-tcp.png index 04e47f539..192cbcaa7 100644 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-tcp.png and b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-tcp.png differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-usb.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-usb.png index 07814e7de..414bbab04 100644 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-usb.png and b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/external-bridge-usb.png differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png deleted file mode 100644 index 9f7d0b9ba..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login_white.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login_white.png deleted file mode 100644 index 10a054147..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login_white.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png deleted file mode 100644 index 98f1b286a..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index 054d7b9d8..a76749b05 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -8,7 +8,7 @@ xmlns:views="clr-namespace:Tango.MachineStudio.UI.Views" xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - Title="Tango" Height="800" Width="1280" Foreground="{StaticResource MainWindow.Foreground}" FontFamily="{StaticResource flexo}" + Title="Tango" Height="800" Width="1280" Foreground="{StaticResource MainWindow.Foreground}" BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}" WindowTitleBrush="{StaticResource MainWindow.WindowTitleColorBrush}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 2e201b6af..915deb484 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -1,10 +1,8 @@ using MahApps.Metro.Controls; using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Text; -using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; 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 939adf5d5..41405f7fb 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" ShowInTaskbar="False" FontFamily="{StaticResource flexo}" > + 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 c26fae591..988e3c21f 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" ShowInTaskbar="False" FontFamily="{StaticResource flexo}" > + Title="Machine Studio" MinHeight="220" MaxHeight="600" SizeToContent="Height" Width="570" Opacity="0" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> @@ -31,7 +31,7 @@ - + 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 fc777ac7f..a43fafb46 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" ShowInTaskbar="False" FontFamily="{StaticResource flexo}" Foreground="{StaticResource Dialog.Foreground}" > + 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/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index 4f9bee934..9d843369e 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.2.6.0")] +[assembly: AssemblyVersion("4.0.31.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 feed9e193..0235f8cca 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -42,18 +42,12 @@ namespace Tango.MachineStudio.UI.StudioApplication private INotificationProvider _notification; private List _openedWindows; private List _notified_view_models; - private bool _isDialogShown; /// /// Occurs when the application is ready. /// public event EventHandler ApplicationReady; - /// - /// Occurs when the connected machine session has been lost and an automatic reconnection with the last machine is required. - /// - public event EventHandler ReconnectionRequired; - /// /// Initializes a new instance of the class. /// @@ -138,28 +132,15 @@ namespace Tango.MachineStudio.UI.StudioApplication { String failed_reason = (sender as IMachineOperator).FailedStateException.Message; - if (!_isDialogShown) + ConnectionLostViewVM vm = new ConnectionLostViewVM() { - _isDialogShown = true; + Exception = failed_reason + }; - ConnectionLostViewVM vm = new ConnectionLostViewVM() - { - Exception = failed_reason, - AutoReconnect = true, - }; - - InvokeUI(() => - { - _notification.ShowModalDialog(vm, (x) => - { - _isDialogShown = false; - ReconnectionRequired?.Invoke(this, new EventArgs()); - }, () => - { - _isDialogShown = false; - }); - }); - } + InvokeUI(() => + { + _notification.ShowModalDialog(vm, (x) => { }, () => { }); + }); } } } @@ -291,7 +272,7 @@ namespace Tango.MachineStudio.UI.StudioApplication var eventLogger = TangoIOC.Default.GetInstance(); if (eventLogger != null) { - //eventLogger.Log(EventTypes.APPLICATION_TERMINATED, "Application Terminated!"); + eventLogger.Log(EventTypes.APPLICATION_TERMINATED, "Application Terminated!"); eventLogger.FlushAll(); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs index b716ed1fb..31b330c3f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -15,10 +15,8 @@ using Tango.Core.Helpers; using Tango.Core.IO; using Tango.Integration.Operation; using Tango.Logging; -using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.StudioApplication; -using Tango.Settings; using Tango.SharedUI.Helpers; using Tango.TFS; @@ -161,7 +159,6 @@ namespace Tango.MachineStudio.UI.TFS item.Severity = Severity.Medium; item.State = State.New; item.Type = WorkItemType.Bug; - item.Environment = SettingsManager.Default.GetOrCreate().DeploymentSlot.ToDescription(); foreach (var window in Application.Current.Windows.OfType().Where(x => !String.IsNullOrWhiteSpace(x.Title))) { @@ -188,22 +185,6 @@ namespace Tango.MachineStudio.UI.TFS return item; } - private string[] GetLogFiles(FileLogger logger) - { - string[] fileEntries = new string[1]; - fileEntries[0] = logger.LogFile; - string fileName = Path.GetFileNameWithoutExtension(logger.LogFile); - int indexPos = fileName.IndexOf(FileLogger.FILE_SET_EXTENSION); - if (indexPos > 0) - { - string extension = Path.GetExtension(logger.LogFile); - fileName = fileName.Substring(0, indexPos); - fileEntries = Directory.GetFiles(logger.Folder, $"{fileName}*{extension}").Where(x => Path.GetFileName(x).StartsWith(logger.Tag)).OrderBy(x => x.Length).ThenBy(x => x).ToArray(); - } - - return fileEntries; - } - public void FinalizeBug(WorkItem item) { IAuthenticationProvider auth = TangoIOC.Default.GetInstance(); @@ -211,55 +192,31 @@ namespace Tango.MachineStudio.UI.TFS FileLogger appFileLogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; FileLogger embeddedFileLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; - + if (appFileLogger != null) { - string[] logFiles = GetLogFiles(appFileLogger); - foreach( string file in logFiles) - { - var appLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, appLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Application Log File", - FilePath = appLogFile.Path, - Name = Path.GetFileName(file), - }); - } - } + var appLogFile = _tempFolder.CreateImaginaryFile(); + File.Copy(appFileLogger.LogFile, appLogFile.Path); - if (embeddedFileLogger != null && File.Exists(embeddedFileLogger.LogFile)) - { - string[] logFiles = GetLogFiles(embeddedFileLogger); - foreach (string file in logFiles) + item.Attachments.Add(new Attachment() { - var embeddedLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, embeddedLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Embedded Log File", - FilePath = embeddedLogFile.Path, - Name = Path.GetFileName(file), - }); - } + Description = "Application Log File", + FilePath = appLogFile.Path, + Name = Path.GetFileName(appFileLogger.LogFile), + }); } - //Add session log file.. - if (MachineOperator.EnableSessionLogFile) + if (embeddedFileLogger != null && File.Exists(embeddedFileLogger.LogFile)) { - var file = MachineOperator.SessionLogger.LogFile; + var embeddedLogFile = _tempFolder.CreateImaginaryFile(); + File.Copy(embeddedFileLogger.LogFile, embeddedLogFile.Path); - if (file != null && File.Exists(file)) + item.Attachments.Add(new Attachment() { - var sessionLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, sessionLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Session Log File", - FilePath = sessionLogFile.Path, - Name = Path.GetFileName(file), - }); - } + Description = "Embedded Log File", + FilePath = embeddedLogFile.Path, + Name = Path.GetFileName(embeddedFileLogger.LogFile), + }); } SystemInformationModel sysModel = new SystemInformationModel(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs index 464599452..0691ca6bd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs @@ -13,8 +13,7 @@ namespace Tango.MachineStudio.UI.TFS { public IEnumerable GetSuggestions(string filter) { - var members = TangoIOC.Default.GetInstance().Project.Members; - return members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); + return TangoIOC.Default.GetInstance().Project.Members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index cd4eb4dd3..3379ef4ae 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -36,7 +36,7 @@ 4 - machine_new_small.ico + machine.ico @@ -343,6 +343,14 @@ Settings.settings True + + Tango.ColorLib_v1.dll + PreserveNewest + + + Tango.ColorLib_v2.dll + PreserveNewest + TCC\benchmarks_rgb_lab.csv Always @@ -351,12 +359,6 @@ TCC\template.bmp Always - - - - - - @@ -418,10 +420,6 @@ {63561e19-ff5a-414b-a5ef-e30711543e1d} Tango.Emulations - - {99081c0e-065c-4d68-bf60-f82330cca02d} - Tango.Git - {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration @@ -446,10 +444,6 @@ {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI - - {e1e66ed9-597d-45fa-8048-de90a6930484} - Tango.SQLExaminer - {998f8471-dc1b-41b6-9d96-354e1b4e7a32} Tango.TFS @@ -466,18 +460,22 @@ {f69da3a8-f823-461e-87cf-a9275abc0b15} Tango.MachineStudio.Dispensers - - {447ecb9f-f730-47d6-8df8-d232bf4a0315} - Tango.MachineStudio.ActionLogs - {7d0fce3c-9a37-439c-9f9f-b26cfd6a8a33} Tango.MachineStudio.Catalogs + + {4d183aca-552b-4135-ae81-7c5a8e5fc3b1} + Tango.MachineStudio.ColorLab + {fc337a7f-1214-41d8-9992-78092a3b961e} Tango.MachineStudio.DataCapture + + {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} + Tango.MachineStudio.DB + {ce4a0d11-08a2-4cd6-9908-d6c62e80d805} Tango.MachineStudio.Developer @@ -498,10 +496,6 @@ {d0186ac0-0fcf-4d3b-9619-54812b6e524b} Tango.MachineStudio.RML - - {18a27902-9881-4556-8163-f6df2236a14d} - Tango.MachineStudio.Sites - {8a65ad6a-a9b4-48c0-9301-4b7434b712f8} Tango.MachineStudio.Statistics @@ -526,37 +520,6 @@ {cb0b0aa2-bb24-4bca-a720-45e397684e12} Tango.MachineStudio.Common - - - - {E9528353-7D41-4AA8-BBAC-D65B7FE3A0D6} - Tango.ColorLib_v4 - false - Content - PreserveNewest - - - {A3A8ADA0-C150-4E30-A60D-11F291FDBF7A} - Tango.ColorLib_v3 - false - Content - PreserveNewest - - - {1A3FC7FB-403C-4B3D-B705-28FCE11317DD} - Tango.ColorLib_v2 - false - Content - PreserveNewest - - - {CF4C66B0-CD13-4D31-8133-339A01E7E6F2} - Tango.ColorLib_v1 - false - Content - PreserveNewest - - @@ -683,9 +646,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(TargetDir)" if $(ConfigurationName) == Release del *.xml -if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\" -if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\" -if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)lib\" +if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\" @@ -696,7 +657,7 @@ if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)lib\" - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index e0338a319..3fffd69fd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -1,7 +1,5 @@ using System; -using System.Linq; using System.Windows; -using Tango.BL.ActionLogs; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.Logging; @@ -71,19 +69,9 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); - TangoIOC.Default.Unregister(); - - if (App.StartupArgs.Contains("-webDebug")) - { - TangoIOC.Default.Register(new MachineStudioWebClient("http://localhost:1111", null)); - } - else - { - TangoIOC.Default.Register(new MachineStudioWebClient()); - } - + TangoIOC.Default.Register(new MachineStudioWebClient()); TangoIOC.Default.Register(new DefaultDispatcherProvider(Application.Current.Dispatcher)); TangoIOC.Default.Register(); TangoIOC.Default.Register(); @@ -95,9 +83,8 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); - TangoIOC.Default.Register(new DefaultActionLogManager() { IsAsync = true }); - TangoIOC.Default.Register(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "pyulwgs7m3v7pizz3oxusypdkdfw43txggo5mjwu2ouyv2qwprhq")); - + TangoIOC.Default.Register(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa")); + TangoIOC.Default.Register(); TangoIOC.Default.Register(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs index 30b2c83fd..16f6938a0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs @@ -95,11 +95,11 @@ namespace Tango.MachineStudio.UI.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { - var jobRuns = await db.JobRuns.Where(x => x.MachineGuid == ApplicationManager.Machine.Guid).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); + var jobs = await db.Jobs.Include(x => x.JobRuns).Where(x => x.MachineGuid == ApplicationManager.Machine.Guid).ToListAsync(); - TotalMachineWorkTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); + TotalMachineWorkTime = TimeSpan.FromHours(jobs.SelectMany(x => x.JobRuns).Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToString(@"hh\:mm\:ss"); - int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); + int meters = (int)jobs.SelectMany(x => x.JobRuns).Select(x => x.EndPosition).Sum(); TotalMachineMeters = $"{meters.ToString("N0")} meters"; } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs index e96f0ab62..f1f4f69c0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs @@ -3,76 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Timers; -using System.Windows.Threading; using Tango.SharedUI; namespace Tango.MachineStudio.UI.ViewModels { public class ConnectionLostViewVM : DialogViewVM { - private Timer _reconnectTimer; - public String Exception { get; set; } - - private int _reconnectinSeconds; - public int ReconnectinSeconds - { - get { return _reconnectinSeconds; } - set { _reconnectinSeconds = value; RaisePropertyChangedAuto(); } - } - - private bool _autoReconnect; - public bool AutoReconnect - { - get { return _autoReconnect; } - set { _autoReconnect = value; RaisePropertyChangedAuto(); } - } - - - public ConnectionLostViewVM() : base() - { - ReconnectinSeconds = 10; - _reconnectTimer = new Timer(); - _reconnectTimer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds; - _reconnectTimer.Elapsed += _reconnectTimer_Elapsed; - } - - private void _reconnectTimer_Elapsed(object sender, ElapsedEventArgs e) - { - ReconnectinSeconds--; - - if (ReconnectinSeconds == -1) - { - _reconnectTimer.Stop(); - - InvokeUI(() => - { - Accept(); - }); - } - } - - public override void OnShow() - { - base.OnShow(); - - if (AutoReconnect) - { - _reconnectTimer.Start(); - } - } - - protected override void Accept() - { - _reconnectTimer.Stop(); - base.Accept(); - } - - protected override void Cancel() - { - base.Cancel(); - _reconnectTimer.Stop(); - } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs index 7d2d8b401..e45c29f73 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs @@ -202,17 +202,11 @@ namespace Tango.MachineStudio.UI.ViewModels { IsFree = true; CanClose = true; - _stream?.Dispose(); UpgradeError = ex.FlattenMessage(); CurrentPage = 3; } } - protected override bool CanOK() - { - return base.CanOK() && CanClose; - } - private async void AbortUpgrade() { CanClose = true; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index f4645ecf2..cf34764d9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -22,9 +22,6 @@ using Tango.MachineStudio.UI.Messages; using Tango.Settings; using Tango.SharedUI; using Tango.Web; -using SimpleValidator.Extensions; -using Tango.BL.Entities; -using System.Data.Entity; namespace Tango.MachineStudio.UI.ViewModels { @@ -41,7 +38,6 @@ namespace Tango.MachineStudio.UI.ViewModels private Rfc2898Cryptographer cryptographer; private MachineStudioSettings _settings; private MachineStudioWebClient _machineStudioWebClient; - private TaskCompletionSource _updatePasswordCompletionSource; private String _email; /// @@ -86,14 +82,6 @@ namespace Tango.MachineStudio.UI.ViewModels set { _isLogging = value; RaisePropertyChangedAuto(); } } - private bool _showLogginDetails; - public bool ShowLoggingDetails - { - get { return _showLogginDetails; } - set { _showLogginDetails = value; RaisePropertyChangedAuto(); } - } - - private bool _rememberMe; /// /// Gets or sets a value indicating whether to remember the last user email and password. @@ -114,58 +102,12 @@ namespace Tango.MachineStudio.UI.ViewModels set { _enableSlotSelection = value; RaisePropertyChangedAuto(); } } - private bool _isActiveDirectory; - public bool IsActiveDirectory - { - get { return _isActiveDirectory; } - set { _isActiveDirectory = value; RaisePropertyChangedAuto(); if (value) IsStandardUser = false; } - } - - private bool _isStandardUser; - public bool IsStandardUser - { - get { return _isStandardUser; } - set { _isStandardUser = value; RaisePropertyChangedAuto(); if (value) IsActiveDirectory = false; } - } - - private String _progressLog; - public String ProgressLog - { - get { return _progressLog; } - set { _progressLog = value; RaisePropertyChangedAuto(); } - } - - private bool _isChangingPassword; - public bool IsChangingPassword - { - get { return _isChangingPassword; } - set { _isChangingPassword = value; RaisePropertyChangedAuto(); } - } - - private String _newPassword1; - public String NewPassword1 - { - get { return _newPassword1; } - set { _newPassword1 = value; RaisePropertyChangedAuto(); } - } - - private String _newPassword2; - public String NewPassword2 - { - get { return _newPassword2; } - set { _newPassword2 = value; RaisePropertyChangedAuto(); } - } /// /// Gets or sets the login command. /// public RelayCommand LoginCommand { get; set; } - /// - /// Gets or sets the update password command. - /// - public RelayCommand UpdatePasswordCommand { get; set; } - /// /// Initializes a new instance of the class. /// @@ -175,7 +117,6 @@ namespace Tango.MachineStudio.UI.ViewModels public LoginViewVM(MachineStudioWebClient machineStudioWebClient, IAuthenticationProvider authenticationProvider, INavigationManager navigationManager, INotificationProvider notificationProvider, IEventLogger eventLogger) { EnableSlotSelection = true; - ShowLoggingDetails = true; _machineStudioWebClient = machineStudioWebClient; _settings = SettingsManager.Default.GetOrCreate(); @@ -185,22 +126,12 @@ namespace Tango.MachineStudio.UI.ViewModels _authenticationProvider = authenticationProvider; _eventLogger = eventLogger; LoginCommand = new RelayCommand(Login, () => !IsLogging); - UpdatePasswordCommand = new RelayCommand(UpdatePassword, () => IsChangingPassword); cryptographer = new Rfc2898Cryptographer(); Email = _settings.LastLoginEmail; DeploymentSlot = _settings.DeploymentSlot; RememberMe = _settings.RememberMe; - if (_settings.LastLoginMethod == LoginMethod.ActiveDirectory) - { - IsActiveDirectory = true; - } - else - { - IsStandardUser = true; - } - try { Password = cryptographer.Decrypt(_settings.LastLoginPassword); @@ -221,22 +152,13 @@ namespace Tango.MachineStudio.UI.ViewModels try { IsLogging = true; - ShowLoggingDetails = false; - NewPassword1 = String.Empty; - NewPassword2 = String.Empty; - InvalidateRelayCommands(); - LoginMethod loginMethod = IsActiveDirectory ? LoginMethod.ActiveDirectory : LoginMethod.StandardUser; - await Task.Factory.StartNew(() => { _settings.DeploymentSlot = DeploymentSlot; - LoginResponse result = _authenticationProvider.Login(Email, Password, loginMethod, _settings.ByPassEnvironmentVersionCheck, (progress) => - { - ProgressLog = progress; - }).Response; + LoginResponse result = _authenticationProvider.Login(Email, Password, _settings.ByPassEnvironmentVersionCheck).Response; if (result.VersionChangeRequired && !_settings.ByPassEnvironmentVersionCheck) { @@ -255,113 +177,31 @@ namespace Tango.MachineStudio.UI.ViewModels return; } - if (result.PasswordChangeRequired) - { - StartUpdatePassword().Task.GetAwaiter().GetResult(); - Password = NewPassword1; - Login(); - return; - } - - //_eventLogger.Log(EventTypes.APPLICATION_STARTED, "Application Started!"); + _eventLogger.Log(EventTypes.APPLICATION_STARTED, "Application Started!"); _navigationManager.NavigateTo(NavigationView.MainView); _settings.LastLoginEmail = Email; _settings.RememberMe = RememberMe; - _settings.LastLoginMethod = loginMethod; _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null; _settings.Save(); - EnableSlotSelection = false; + _eventLogger.Log("User logged in."); - IsLogging = false; - ShowLoggingDetails = true; - IsChangingPassword = false; - InvalidateRelayCommands(); + EnableSlotSelection = false; }); } catch (Exception ex) { - IsLogging = false; - ShowLoggingDetails = true; - IsChangingPassword = false; - InvalidateRelayCommands(); LogManager.Log(ex, "Login Error."); _notificationProvider.ShowError($"An error occurred while trying to perform the log-in operation.\n{ex.FlattenMessage()}"); } - } - } - - private TaskCompletionSource StartUpdatePassword() - { - _updatePasswordCompletionSource = new TaskCompletionSource(); - - IsChangingPassword = true; - ShowLoggingDetails = false; - IsLogging = false; - InvalidateRelayCommands(); - - return _updatePasswordCompletionSource; - } - - private async void UpdatePassword() - { - await Task.Factory.StartNew(() => - { - try - { - if (!Validate()) - { - return; - } - - ProgressLog = "Updating your password..."; - IsChangingPassword = false; - IsLogging = true; - InvalidateRelayCommands(); - - using (var db = ObservablesContext.CreateDefault()) - { - var user = db.Users.SingleOrDefault(x => x.Email == Email); - user.PasswordChangeRequired = false; - user.Password = User.GetPasswordHash(NewPassword1); - db.SaveChanges(); - } - - _updatePasswordCompletionSource.SetResult(true); - } - catch (Exception ex) - { - IsLogging = false; - IsChangingPassword = false; - ShowLoggingDetails = true; - InvalidateRelayCommands(); - _updatePasswordCompletionSource.SetException(ex); - } finally { + IsLogging = false; InvalidateRelayCommands(); } - }); - } - - protected override void OnValidating() - { - if (IsChangingPassword) - { - if (!NewPassword1.IsBetweenLength(6, 8)) - { - InsertError(nameof(NewPassword1), "Password must be 6 to 8 characters long"); - } - - if (NewPassword1 != NewPassword2) - { - InsertError(nameof(NewPassword2), "Passwords do not match"); - } } - - base.OnValidating(); } } } 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 5e44bf43d..d1f3cc69e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; -using Tango.Core.DI; using Tango.Emulations.ExternalBridge; using Tango.Integration.ExternalBridge; using Tango.MachineStudio.Common; @@ -53,18 +52,7 @@ namespace Tango.MachineStudio.UI.ViewModels { if (_scanner == null) { - var settings = SettingsManager.Default.GetOrCreate(); _scanner = new ExternalBridgeScanner(); - _scanner.SignalRConfiguration.Enabled = settings.EnableExternalBridgeSignalR; - if (App.StartupArgs.Contains("-webDebug")) - { - _scanner.SignalRConfiguration.Address = "http://localhost:1111/"; //settings.DeploymentSlot.ToAddress(); - } - else - { - _scanner.SignalRConfiguration.Address = settings.DeploymentSlot.ToAddress(); - } - _scanner.SignalRConfiguration.Hub = settings.ExternalBridgeSignalRHub; } EnableDiagnostics = true; @@ -120,8 +108,6 @@ namespace Tango.MachineStudio.UI.ViewModels catch (Exception ex) { LogManager.Log(ex, "Error starting external bridge scanner."); - Cancel(); - TangoIOC.Default.GetInstance().ShowError($"There is a problem with machine scanning.\n{ex.FlattenMessage()}"); } } 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 81d3f4243..7584617ed 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs @@ -26,11 +26,6 @@ namespace Tango.MachineStudio.UI.ViewModels /// public ExternalBridgeLoginIntent Intent { get; set; } - /// - /// Gets or sets a value indicating whether to require safety level operations permission from the remote machine. - /// - public bool RequireSafetyOperations { get; set; } - /// /// Gets or sets the login command. /// @@ -46,7 +41,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// public MachineLoginViewVM() { - Intent = ExternalBridgeLoginIntent.Diagnostics; + 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 4f8c8a9b1..90fe25c8f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -58,9 +58,6 @@ namespace Tango.MachineStudio.UI.ViewModels private IEventLogger _eventLogger; private MachineStudioSettings _settings; private MachineStudioWebClient _machineStudioWebClient; - private IExternalBridgeClient _reconnectionMachine; - private MachineLoginViewVM _reconnectionMachineConfig; - private bool _lastUploadHardwareConfigLocal; /// /// Gets or sets the current loaded module. @@ -347,20 +344,6 @@ namespace Tango.MachineStudio.UI.ViewModels AboutCommand = new RelayCommand(ShowAboutDialog); ChangeAppThemeCommand = new RelayCommand(ChangeTheme); - - ApplicationManager.ReconnectionRequired += ApplicationManager_ReconnectionRequired; - } - - private async void ApplicationManager_ReconnectionRequired(object sender, EventArgs e) - { - if (_reconnectionMachine is IExternalBridgeSecureClient client) - { - ConnectToMachineSecure(client, _reconnectionMachineConfig); - } - else - { - await ConnectToMachineLocal(_reconnectionMachine, _reconnectionMachine.Machine, _lastUploadHardwareConfigLocal); - } } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable e) @@ -418,11 +401,13 @@ namespace Tango.MachineStudio.UI.ViewModels String serial = ApplicationManager.ConnectedMachine.SerialNumber; await ApplicationManager.ConnectedMachine.Disconnect(); ApplicationManager.SetConnectedMachine(null); + _eventLogger.Log("Disconnected from machine " + serial); PostMessage(new MachineConnectionChangedMessage() { Machine = null }); } catch (Exception ex) { + _eventLogger.Log(ex, "Error disconnecting from machine."); LogManager.Log(ex, "Could not disconnect from machine."); } finally @@ -470,23 +455,71 @@ namespace Tango.MachineStudio.UI.ViewModels x.SelectedMachine.EnableEventsNotification = x.EnableDiagnostics; x.SelectedMachine.UseKeepAlive = x.EnableKeepAlive; x.SelectedMachine.JobUnitsMethod = _settings.JobUnitsMethod; - x.SelectedMachine.JobRunsLogger.JobSource = BL.Enumerations.JobSource.Remote; if (x.SelectedMachine is ExternalBridgeTcpClient) { x.SelectedMachine.As().EnableApplicationLogs = x.EnableApplicationLogs; x.SelectedMachine.RequestTimeout = _settings.ExternalBridgeRequestTimeout; - x.SelectedMachine.ContinuousRequestTimeout = _settings.ExternalBridgeContinuousRequestTimeout; - } - - if (x.SelectedMachine.Adapter is TcpTransportAdapter) - { - (x.SelectedMachine.Adapter as TcpTransportAdapter).WriteMode = _settings.TcpTransportAdapterWriteMode; } if (x.SelectedMachine.RequiresAuthentication) { - ConnectToMachineSecure(x.SelectedMachine as IExternalBridgeSecureClient); + //Check machine exist on my database first + if (x.SelectedMachine.Machine == null) + { + _notificationProvider.ShowError($"The specified machine '{x.SelectedMachine.SerialNumber}' could not be found on the database. Aborting connection."); + return; + } + + _notificationProvider.ShowModalDialog(async (login) => + { + using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.ToString() + "...")) + { + try + { + await x.SelectedMachine.As().Connect(new PMR.Integration.ExternalBridgeLoginRequest() + { + AppID = "Machine Studio", + HostName = Environment.MachineName, + Password = login.Password, + UserGuid = AuthenticationProvider.CurrentUser.Guid, + Intent = login.Intent, + }); + + ApplicationManager.SetConnectedMachine(x.SelectedMachine); + (x.SelectedMachine as IExternalBridgeSecureClient).SessionClosed += (_, __) => + { + InvokeUI(() => + { + _notificationProvider.ShowError("The remote machine has closed the current session. Machine disconnected."); + ApplicationManager.SetConnectedMachine(null); + }); + }; + 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); + //} + + } + catch (ResponseErrorException ex) + { + LogManager.Log(ex); + _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber); + _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Container.ErrorMessage); + } + catch (Exception ex) + { + LogManager.Log(ex); + _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber); + _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); + } + + InvalidateRelayCommands(); + } + }); } else { @@ -494,15 +527,47 @@ namespace Tango.MachineStudio.UI.ViewModels { if (vm.SelectedMachine != null) { - await ConnectToMachineLocal(x.SelectedMachine, vm.SelectedMachine, x.UploadHardwareConfiguration); + using (NotificationProvider.PushTaskItem("Connecting to " + x.SelectedMachine.ToString() + "...")) + { + try + { + await x.SelectedMachine.Connect(); + x.SelectedMachine.SerialNumber = vm.SelectedMachine.SerialNumber; + ApplicationManager.SetConnectedMachine(x.SelectedMachine); + + PostMessage(new MachineConnectionChangedMessage() { Machine = x.SelectedMachine }); + _eventLogger.Log(String.Format("Successfully connected to machine {0} via USB", x.SelectedMachine.SerialNumber)); + _settings.LastVirtualMachineSerialNumber = vm.SelectedMachine.SerialNumber; + _settings.Save(); + + if (x.UploadHardwareConfiguration) + { + UploadHardwareConfiguration(false); + } + } + catch (Exception ex) + { + LogManager.Log(ex); + + if (x.SelectedMachine != null) + { + _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber); + } + + _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); + + } + + InvalidateRelayCommands(); + } } }); } - base.InvalidateRelayCommands(); + InvalidateRelayCommands(); } - base.InvalidateRelayCommands(); + InvalidateRelayCommands(); }); } else @@ -567,115 +632,6 @@ namespace Tango.MachineStudio.UI.ViewModels InvalidateRelayCommands(); } - private async Task ConnectToMachineLocal(IExternalBridgeClient client, Machine machine, bool uploadHardwareConfig) - { - using (NotificationProvider.PushTaskItem("Connecting to " + client.ToString() + "...")) - { - try - { - _reconnectionMachine = client; - - await client.Connect(); - client.SerialNumber = machine.SerialNumber; - ApplicationManager.SetConnectedMachine(client); - - PostMessage(new MachineConnectionChangedMessage() { Machine = client }); - _settings.LastVirtualMachineSerialNumber = machine.SerialNumber; - _settings.Save(); - - _lastUploadHardwareConfigLocal = uploadHardwareConfig; - - if (uploadHardwareConfig) - { - UploadHardwareConfiguration(false); - } - } - catch (Exception ex) - { - LogManager.Log(ex); - - _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); - - } - - InvalidateRelayCommands(); - } - } - - private async void ConnectToMachineSecure(IExternalBridgeSecureClient machine, MachineLoginViewVM config) - { - using (NotificationProvider.PushTaskItem("Connecting to machine " + machine.ToString() + "...")) - { - try - { - await machine.Connect(new PMR.Integration.ExternalBridgeLoginRequest() - { - AppID = "Machine Studio", - HostName = Environment.MachineName, - Password = config.Password, - UserGuid = AuthenticationProvider.CurrentUser.Guid, - Intent = config.Intent, - UserName = AuthenticationProvider.CurrentUser.Contact.FullName, - RequireSafetyLevelOperations = config.RequireSafetyOperations - }, new PMR.Integration.ConfigureProtocolRequest() - { - EnableCompression = true, - GenericProtocol = PMR.Integration.GenericMessageProtocol.Bson - }); - - _reconnectionMachine = machine; - _reconnectionMachineConfig = config; - - ApplicationManager.SetConnectedMachine(machine); - machine.SessionClosed -= Machine_SessionClosed; - machine.SessionClosed += Machine_SessionClosed; - PostMessage(new MachineConnectionChangedMessage() { Machine = machine }); - - //if (x.UploadHardwareConfiguration) - //{ - // UploadHardwareConfiguration(false); - //} - - } - catch (ResponseErrorException ex) - { - LogManager.Log(ex); - _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Container.ErrorMessage); - } - catch (Exception ex) - { - LogManager.Log(ex); - _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); - } - - InvalidateRelayCommands(); - } - } - - private void ConnectToMachineSecure(IExternalBridgeSecureClient machine) - { - //Check machine exist on my database first - if (machine.Machine == null) - { - _notificationProvider.ShowError($"The specified machine '{machine.SerialNumber}' could not be found on the database. Aborting connection."); - return; - } - - _notificationProvider.ShowModalDialog((login) => - { - ConnectToMachineSecure(machine, login); - }); - } - - private void Machine_SessionClosed(object sender, EventArgs e) - { - InvokeUI(() => - { - _notificationProvider.ShowError("The remote machine has closed the current session. Machine disconnected."); - ApplicationManager.SetConnectedMachine(null); - }); - } - private async void UploadHardwareConfiguration(bool showSuccessMessage = true) { try @@ -711,7 +667,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// Starts the specified module. /// /// The module. - internal async void StartModule(IStudioModule module) + internal void StartModule(IStudioModule module) { IsMenuOpened = false; @@ -736,9 +692,10 @@ namespace Tango.MachineStudio.UI.ViewModels m.IsLoaded = false; } + CurrentModule = module; + if (module != null) { - CurrentModule = module; CurrentModule.IsLoaded = true; IsModuleLoaded = true; @@ -749,10 +706,7 @@ namespace Tango.MachineStudio.UI.ViewModels { IsModuleLoaded = false; LogManager.Log(String.Format("Navigating to Home...")); - (MainView.Self as MainView).NavigationControl.NavigateTo("Home", () => - { - CurrentModule = module; - }); + (MainView.Self as MainView).NavigationControl.NavigateTo("Home"); } } @@ -760,7 +714,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// Opens the module in a new window. /// /// The module. - private async void OpenModuleInWindow(IStudioModule module, Rect? bounds = null, WindowState? state = null, bool setHomeModule = true) + private void OpenModuleInWindow(IStudioModule module, Rect? bounds = null, WindowState? state = null) { if (module == null) return; @@ -768,12 +722,7 @@ namespace Tango.MachineStudio.UI.ViewModels { module.InNewWindow = true; - if (setHomeModule) - { - StartModule(null); - } - - await Task.Delay(1000); + StartModule(null); LogManager.Log(String.Format("Starting module '{0}' in new window...", module.Name)); @@ -969,7 +918,7 @@ namespace Tango.MachineStudio.UI.ViewModels if (module != null && !module.InNewWindow) { - OpenModuleInWindow(module, item.Bounds, item.State, false); + OpenModuleInWindow(module, item.Bounds, item.State); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs index 160041b5f..2ee8574b1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -179,7 +179,6 @@ namespace Tango.MachineStudio.UI.ViewModels _updateInfo = new CheckForUpdatesResponse(); _updateInfo.BlobAddress = response.BlobAddress; _updateInfo.Version = response.Version; - _updateInfo.CdnAddress = response.CdnAddress; LatestVersion = _updateInfo.Version; StartUpdate(); @@ -271,7 +270,7 @@ namespace Tango.MachineStudio.UI.ViewModels { logManager.Log("Creating temporary file " + tempFile); - using (AutoFileDownloader downloader = new AutoFileDownloader(_updateInfo.BlobAddress, _updateInfo.CdnAddress, tempFile.Path)) + using (StorageBlobDownloader downloader = new StorageBlobDownloader(_updateInfo.BlobAddress, tempFile.Path)) { downloader.Progress += (x, e) => { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml index 22c1a5c00..f7e90d4f5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml @@ -9,7 +9,6 @@ xmlns:pmrPrinting="clr-namespace:Tango.PMR.Printing;assembly=Tango.PMR" xmlns:operation="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration" xmlns:bl="clr-namespace:Tango.BL;assembly=Tango.BL" - xmlns:adapters="clr-namespace:Tango.Transport.Adapters;assembly=Tango.Transport" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="700" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:AboutViewVM, IsDesignTimeCreatable=False}" DataContext="{Binding AboutViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -29,7 +28,7 @@ - + @@ -76,9 +75,6 @@ Job Units Duplication Method: - External Bridge TCP Write Mode: - - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index 600104095..e69ac516e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -19,8 +19,6 @@ - - @@ -34,10 +32,6 @@ - - - - @@ -71,54 +65,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -144,10 +90,6 @@ - - - - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml index ba5624592..b2fa2b3e3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml @@ -7,7 +7,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - Width="559" Height="350" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> + Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -18,7 +18,7 @@ - + @@ -50,12 +50,7 @@ - - Reconnecting in - - seconds... - - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml index 5cf23e79e..233f8e4cb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml @@ -87,7 +87,7 @@ Upgrading Machine Firmware - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml index 14fcc3a37..df1c1b831 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml @@ -16,7 +16,7 @@ - + Machine Studio diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml index 9a3b3405e..ec6091988 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml @@ -42,102 +42,38 @@ - + Machine Studio + - - - - - - - - - - + - - + + + Login to your account + + + + + + + + + + + + + + Environment selection requires restarting the application + Remember me + - - - - - - Login to your account - - - - - - - - - - - - - - - - - - Environment selection requires restarting the application - Remember me - - - - - - - - - - - - Password change required - - - - - - - - - - - - - + + + Logging you in... + + + 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 78557a42e..69ce4c855 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -10,7 +10,7 @@ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="400" Width="700" Height="500" Background="{StaticResource Dialog.Background}" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> + d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="{StaticResource Dialog.Background}" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -27,7 +27,7 @@ - + @@ -55,28 +55,10 @@ - - - - - - - S/N: - - - Address: - - - Organization: - - - - - - + S/N: @@ -94,7 +76,7 @@ - + Port: @@ -109,7 +91,7 @@ - + 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 e4cdfe199..7d0b2e25c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml @@ -17,26 +17,19 @@ - - - - Require Safety Level Operations - - - - - - - + + + + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml index 2393ab6e7..eea90c7b9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml @@ -23,7 +23,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index ea6e93412..d427be9e5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -47,27 +47,51 @@ - - - - - + + - - + + + + + + + + , + + + + + + + + + + + + + + + ... + + + - + + + + + + + + + Home + + MODULES @@ -75,7 +99,7 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -372,9 +307,6 @@ - - - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml index aac712f59..ef9667b6d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml @@ -12,7 +12,7 @@ xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS" xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="530" Height="660" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> + mc:Ignorable="d" Width="530" Height="720" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml index 6bda3fe2d..cc1060b2a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml @@ -10,7 +10,7 @@ - + Machine Studio diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml index 01f08491a..25fe4af5d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ExceptionWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Windows" mc:Ignorable="d" - WindowStyle="None" ResizeMode="NoResize" Topmost="True" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Width="800" Height="600" Background="Transparent" d:DataContext="{d:DesignInstance Type=local:ExceptionWindow, IsDesignTimeCreatable=False}" FontFamily="{StaticResource flexo}" Foreground="{StaticResource Dialog.Foreground}"> + WindowStyle="None" ResizeMode="NoResize" Topmost="True" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Width="800" Height="600" Background="Transparent" d:DataContext="{d:DesignInstance Type=local:ExceptionWindow, IsDesignTimeCreatable=False}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml index 5db0277cc..47b36070a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml @@ -10,7 +10,7 @@ xmlns:views="clr-namespace:Tango.MachineStudio.UI.Views" xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - Title="Machine Studio" Height="800" Width="1280" WindowStartupLocation="CenterOwner" WindowState="Maximized" Foreground="#494949" BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" FontFamily="{StaticResource flexo}"> + Title="{Binding RelativeSource={RelativeSource Self},Path=ModuleContext.Module.Name}" Height="800" Width="1280" WindowStartupLocation="CenterOwner" WindowState="Maximized" Foreground="#494949" BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}"> @@ -29,16 +29,8 @@ - - - - - - - - - - + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml.cs index cfea78964..7ca062645 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml.cs @@ -12,8 +12,6 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; -using Tango.Core.DI; -using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.UI.ViewModels; namespace Tango.MachineStudio.UI.Windows @@ -34,13 +32,6 @@ namespace Tango.MachineStudio.UI.Windows public ModuleWindow() { InitializeComponent(); - - ContentRendered += ModuleWindow_ContentRendered; - } - - private void ModuleWindow_ContentRendered(object sender, EventArgs e) - { - Title = "MACHINE STUDIO " + TangoIOC.Default.GetInstance().Version.ToString(3); } public ModuleWindow(MainViewVM mainViewVM, ModuleWindowVM moduleVM, FrameworkElement view) : this() diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/machine_new_small.ico b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/machine_new_small.ico deleted file mode 100644 index dd159c221..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/machine_new_small.ico and /dev/null differ -- cgit v1.3.1