diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
| commit | ca293b80c52a54c73251fbf3cd50741fb5653ae9 (patch) | |
| tree | f1168fa167a26bf8455e601291b8a19945a70187 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 9ff8293b603f72c5faa8d238b3005524c31cc5a8 (diff) | |
| download | Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.tar.gz Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.zip | |
Lots Of Work !
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
4 files changed, 17 insertions, 7 deletions
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 76c7b3e58..1334a349d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -28,6 +28,9 @@ namespace Tango.MachineStudio.UI protected override void OnStartup(StartupEventArgs e) { + LogManager.RegisterLogger(new VSOutputLogger()); + LogManager.RegisterLogger(new FileLogger()); + LogManager.Log("Application Started..."); base.OnStartup(e); @@ -44,9 +47,6 @@ namespace Tango.MachineStudio.UI LogManager.Categories.AddRange(SettingsManager.Default.MachineStudio.LoggingCategories); - LogManager.RegisterLogger(new VSOutputLogger()); - LogManager.RegisterLogger(new FileLogger()); - exceptionTrapper = new WpfGlobalExceptionTrapper(); exceptionTrapper.Initialize(this); exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs index 121d429ec..07834393b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -80,8 +80,12 @@ namespace Tango.MachineStudio.UI.Modules if (!_loaded) { //Preloaded + + LogManager.Log(String.Format("Loading module '{0}'...", nameof(StubsModule))); AllModules.Add(new StubsModule()); + LogManager.Log(String.Format("Loading module '{0}'...", nameof(DBModule))); AllModules.Add(new DBModule()); + LogManager.Log(String.Format("Loading module '{0}'...", nameof(MachineDesignerModule))); AllModules.Add(new MachineDesignerModule()); //Preloaded @@ -103,6 +107,7 @@ namespace Tango.MachineStudio.UI.Modules { try { + LogManager.Log(String.Format("Loading module '{0}'...", moduleType.Name)); var module = Activator.CreateInstance(moduleType) as IStudioModule; AllModules.Add(module); } @@ -117,7 +122,7 @@ namespace Tango.MachineStudio.UI.Modules catch { } } - _loaded = true; + _loaded = true; } UserModules.Clear(); 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 f78cc15be..8e451cdce 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -425,7 +425,7 @@ namespace Tango.MachineStudio.UI.ViewModels { LogManager.Log(ex); _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber); - _notificationProvider.ShowError(ex.Message); + _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); } InvalidateRelayCommands(); @@ -455,7 +455,7 @@ namespace Tango.MachineStudio.UI.ViewModels { LogManager.Log(ex); _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber); - _notificationProvider.ShowError(ex.Message); + _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); } InvalidateRelayCommands(); @@ -472,7 +472,7 @@ namespace Tango.MachineStudio.UI.ViewModels } else { - _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>((x) => + _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>((x) => { DisconnectFromMachine(); }); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs index e0ae60b87..442d11cdd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs @@ -25,6 +25,7 @@ using Tango.MachineStudio.Common; using System.Threading; using Tango.Core.Helpers; using Tango.SharedUI.Helpers; +using Tango.Logging; namespace Tango.MachineStudio.UI.Views { @@ -54,6 +55,8 @@ namespace Tango.MachineStudio.UI.Views Task.Factory.StartNew(() => { + LogManager.Default.Log("Loading modules views..."); + var item = ServiceLocator.Current.GetInstance<INotificationProvider>().PushTaskItem("Loading Modules..."); var modules = _loader.UserModules.ToList(); @@ -67,6 +70,8 @@ namespace Tango.MachineStudio.UI.Views foreach (var module in modules) { + LogManager.Default.Log("Loading module view '" + module.Name + "'..."); + ThreadsHelper.InvokeUI(() => { Grid grid = new Grid(); |
