From 29ac4ab17bdc882f0f85666cb82320ca8075ba95 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 11 Feb 2020 16:09:12 +0200 Subject: Implemented TechBoard "New Project" properly. Changed MS => PPC default intent to Diagnostics. Implemented producer/consumer queue for NavigationControl. Fixed issue with empty points pushed to RealTimerGraphX. Implemented ExternalBridgeService pinging to keep connection. Fixed issue with Firmware upgrade DFU upload failure, now fails all transport components. --- .../ViewModels/MachineTechViewVM.cs | 220 ++++++++++++--------- 1 file changed, 131 insertions(+), 89 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index ac54a714a..36f7940ed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -499,7 +499,11 @@ namespace Tango.MachineStudio.Technician.ViewModels if (prop != null) { var points = GetDataArray(techMonitor, prop.GetValue(data.Monitors)); - sr.PushData(points, delta_base, delta); + + if (points.Count > 0) + { + sr.PushData(points, delta_base, delta); + } } } @@ -512,15 +516,20 @@ namespace Tango.MachineStudio.Technician.ViewModels if (prop != null) { var points = GetDataMatrix(techMonitor, prop.GetValue(data.Monitors)); - mr.PushData(points, delta_base, delta); + if (points.Count > 0) + { + mr.PushData(points, delta_base, delta); + } } } lock (_elementsLock) { var elements = Tabs.SelectMany(x => x.Elements).ToList(); + var selectedTabElements = SelectedTab.Elements.ToList(); - foreach (var item in elements.Select(x => x.HostedElement as TechItem)) + //Can be updated only when visible + foreach (var item in selectedTabElements.Select(x => x.HostedElement as TechItem)) { if (item.GetType() == typeof(MonitorItem)) { @@ -550,7 +559,79 @@ namespace Tango.MachineStudio.Technician.ViewModels } } } - else if (item.GetType() == typeof(SingleGraphItem)) + else if (item.GetType() == typeof(DigitalOutItem)) + { + DigitalOutItem digitalOutItem = item as DigitalOutItem; + + var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalOutItem.TechIo.Code); + + if (digitalPin != null) + { + digitalOutItem.EffectiveValue = digitalPin.Value; + } + } + else if (item.GetType() == typeof(DigitalInItem)) + { + DigitalInItem digitalInItem = item as DigitalInItem; + + var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalInItem.TechIo.Code); + + if (digitalPin != null) + { + digitalInItem.Value = digitalPin.Value; + } + } + else if (item.GetType() == typeof(HeaterItem)) + { + HeaterItem heaterItem = item as HeaterItem; + + var heaterState = data.HeatersStates.SingleOrDefault(x => x.HeaterType == (HeaterType)heaterItem.TechHeater.Code); + + if (heaterState != null) + { + heaterItem.HeaterState = heaterState; + } + } + else if (item.GetType() == typeof(ValveItem)) + { + ValveItem valveItem = item as ValveItem; + + var valveState = data.ValvesStates.SingleOrDefault(x => x.ValveType == (ValveType)valveItem.TechValve.Code); + + if (valveState != null) + { + valveItem.EffectiveState = valveState.State; + } + } + else if (item.GetType() == typeof(BlowerItem)) + { + BlowerItem blowerItem = item as BlowerItem; + + if (data.Monitors.BlowerVoltage.Count > 0) + { + blowerItem.EffectiveActive = data.Monitors.BlowerVoltage.Last() > 0; + } + } + else if (item.GetType() == typeof(ControllerItem)) + { + ControllerItem controllerItem = item as ControllerItem; + + if (DateTime.Now > controllerItem.LastUpdateTime.AddMilliseconds(controllerItem.UpdateInterval)) + { + var componentState = data.ComponentsStates.SingleOrDefault(x => (int)x.Component == controllerItem.TechController.Code); + + if (componentState != null) + { + controllerItem.EffectiveValue = componentState.Value; + } + } + } + } + + //Must be updated all the time. + foreach (var item in elements.Select(x => x.HostedElement as TechItem)) + { + if (item.GetType() == typeof(SingleGraphItem)) { SingleGraphItem graphItem = item as SingleGraphItem; @@ -564,20 +645,23 @@ namespace Tango.MachineStudio.Technician.ViewModels { var points = GetDataArray(graphItem.TechMonitor, prop.GetValue(data.Monitors)); - List times = new List(); - var dPoints = points.Select(x => new DoubleDataPoint(x)).ToList(); - - for (int i = 0; i < points.Count; i++) + if (points.Count > 0) { - times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points.Count) * i))); - } + List times = new List(); + var dPoints = points.Select(x => new DoubleDataPoint(x)).ToList(); - controller.PushData(times, dPoints); + for (int i = 0; i < points.Count; i++) + { + times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points.Count) * i))); + } - var _graph_recording = _single_graphs_recordings.SingleOrDefault(x => x.Tag == graphItem); - if (_graph_recording != null) - { - _graph_recording.PushData(points, delta_base, delta); + controller.PushData(times, dPoints); + + var _graph_recording = _single_graphs_recordings.SingleOrDefault(x => x.Tag == graphItem); + if (_graph_recording != null) + { + _graph_recording.PushData(points, delta_base, delta); + } } } } @@ -640,73 +724,6 @@ namespace Tango.MachineStudio.Technician.ViewModels } } } - else if (item.GetType() == typeof(DigitalOutItem)) - { - DigitalOutItem digitalOutItem = item as DigitalOutItem; - - var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalOutItem.TechIo.Code); - - if (digitalPin != null) - { - digitalOutItem.EffectiveValue = digitalPin.Value; - } - } - else if (item.GetType() == typeof(DigitalInItem)) - { - DigitalInItem digitalInItem = item as DigitalInItem; - - var digitalPin = data.DigitalInterfaceStates.SingleOrDefault(x => x.InterfaceIO == (InterfaceIOs)digitalInItem.TechIo.Code); - - if (digitalPin != null) - { - digitalInItem.Value = digitalPin.Value; - } - } - else if (item.GetType() == typeof(HeaterItem)) - { - HeaterItem heaterItem = item as HeaterItem; - - var heaterState = data.HeatersStates.SingleOrDefault(x => x.HeaterType == (HeaterType)heaterItem.TechHeater.Code); - - if (heaterState != null) - { - heaterItem.HeaterState = heaterState; - } - } - else if (item.GetType() == typeof(ValveItem)) - { - ValveItem valveItem = item as ValveItem; - - var valveState = data.ValvesStates.SingleOrDefault(x => x.ValveType == (ValveType)valveItem.TechValve.Code); - - if (valveState != null) - { - valveItem.EffectiveState = valveState.State; - } - } - else if (item.GetType() == typeof(BlowerItem)) - { - BlowerItem blowerItem = item as BlowerItem; - - if (data.Monitors.BlowerVoltage.Count > 0) - { - blowerItem.EffectiveActive = data.Monitors.BlowerVoltage.Last() > 0; - } - } - else if (item.GetType() == typeof(ControllerItem)) - { - ControllerItem controllerItem = item as ControllerItem; - - if (DateTime.Now > controllerItem.LastUpdateTime.AddMilliseconds(controllerItem.UpdateInterval)) - { - var componentState = data.ComponentsStates.SingleOrDefault(x => (int)x.Component == controllerItem.TechController.Code); - - if (componentState != null) - { - controllerItem.EffectiveValue = componentState.Value; - } - } - } } } } @@ -2117,16 +2134,41 @@ namespace Tango.MachineStudio.Technician.ViewModels { var to_remove = Tabs.ToList(); - if (AddNewTab()) + var name = _notification.ShowTextInput("Enter project name", "Project Name", "untitled"); + + if (String.IsNullOrWhiteSpace(name)) { - _singleControllers.Clear(); - _multiControllers.Clear(); + return; + } - foreach (var tab in to_remove) - { - Tabs.Remove(tab); - } + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Select Technician Project Location"; + dlg.Filter = "Technician Project File|*.tpf"; + dlg.DefaultExt = ".tpf"; + dlg.FileName = name; + + if (!dlg.ShowDialog().Value) + { + return; + } + + _singleControllers.Clear(); + _multiControllers.Clear(); + _multi_graph_recordings.Clear(); + _multi_monitors_recordings.Clear(); + _single_graphs_recordings.Clear(); + _single_monitors_recordings.Clear(); + + foreach (var tab in to_remove) + { + Tabs.Remove(tab); } + + AddNewTab(name); + + _lastTechProjectFile = dlg.FileName; + File.AppendAllText(_lastTechProjectFile, ""); + SaveProject(); } /// -- cgit v1.3.1 From f4b1d1fce72c7b478d9603db8dfd66e471c9f467 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 11 Feb 2020 21:14:24 +0200 Subject: Implemented DisableRendering on RealTimeGraphX. Implemented partial rendering on tech board. --- .../ViewModels/MachineTechViewVM.cs | 77 ++++++++++++++++++++++ .../RealTimeGraphX/GraphController.cs | 8 ++- .../RealTimeGraphX/IGraphController.cs | 5 ++ 3 files changed, 89 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 36f7940ed..90ca3c017 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -116,6 +116,8 @@ namespace Tango.MachineStudio.Technician.ViewModels { _selectedTab.IsSelected = true; } + + EnableRenderingForSelectedTabGraphs(); } } @@ -732,6 +734,81 @@ namespace Tango.MachineStudio.Technician.ViewModels #region Private Methods + private void EnableRenderingForSelectedTabGraphs() + { + if (SelectedTab != null) + { + lock (_elementsLock) + { + var elements = Tabs.SelectMany(x => x.Elements).ToList(); + + foreach (var element in elements) + { + if (SelectedTab.Elements.Contains(element)) + { + var item = element.HostedElement as TechItem; + + if (item != null) + { + if (item.GetType() == typeof(SingleGraphItem)) + { + SingleGraphItem graphItem = item as SingleGraphItem; + + TechGraphController controller = null; + + if (_singleControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = false; + } + } + else if (item.GetType() == typeof(MultiGraphItem)) + { + MultiGraphItem graphItem = item as MultiGraphItem; + + TechGraphController controller = null; + + if (_multiControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = false; + } + } + } + } + else + { + var item = element.HostedElement as TechItem; + + if (item != null) + { + if (item.GetType() == typeof(SingleGraphItem)) + { + SingleGraphItem graphItem = item as SingleGraphItem; + + TechGraphController controller = null; + + if (_singleControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = true; + } + } + else if (item.GetType() == typeof(MultiGraphItem)) + { + MultiGraphItem graphItem = item as MultiGraphItem; + + TechGraphController controller = null; + + if (_multiControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = true; + } + } + } + } + } + } + } + } + /// /// Gets the last data point from a protobuf repeated field. /// diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs index f5fed3fe4..328f0736e 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/GraphController.cs @@ -78,6 +78,11 @@ namespace RealTimeGraphX /// public bool IsPaused { get; set; } + /// + /// Gets or sets a value indicating whether to disable the rendering of data. + /// + public bool DisableRendering { get; set; } + /// /// Gets the data series collection. /// @@ -201,6 +206,7 @@ namespace RealTimeGraphX _render_thread = new Thread(RenderThreadMethod); _render_thread.IsBackground = true; + _render_thread.Priority = ThreadPriority.Highest; _render_thread.Start(); } @@ -215,7 +221,7 @@ namespace RealTimeGraphX { while (true) { - if (!IsPaused) + if (!IsPaused && !DisableRendering) { try { diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/IGraphController.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/IGraphController.cs index 0dbc49ccb..4e36641e7 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/IGraphController.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX/IGraphController.cs @@ -38,6 +38,11 @@ namespace RealTimeGraphX /// bool IsPaused { get; set; } + /// + /// Gets or sets a value indicating whether to disable the rendering of data. + /// + bool DisableRendering { get; set; } + /// /// Gets the current effective x-axis minimum. /// -- cgit v1.3.1 From ffd8bbdb55ef8e99379dfb4aae2a48eca72f70ff Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 12 Feb 2020 12:23:22 +0200 Subject: Removed all application information event logging from MS. --- .../Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 10 ---------- .../ViewModels/MachineTechViewVM.cs | 10 ---------- .../MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | 10 ---------- .../Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs | 2 -- .../Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 11 ----------- 5 files changed, 43 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index a641c87b6..efbcaf5ad 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1448,8 +1448,6 @@ namespace Tango.MachineStudio.Developer.ViewModels IsJobRunning = true; ShowJobStatus = true; - _eventLogger.Log(String.Format("Job '{0}' started...", ActiveJob.Name)); - JobHandler.StatusChanged += (x, status) => { if (IsJobRunning) @@ -1469,25 +1467,21 @@ namespace Tango.MachineStudio.Developer.ViewModels if (!segment.IsInterSegment) { _speech.SpeakInfo(String.Format("Segment {0} Started.", segment.SegmentIndex)); - _eventLogger.Log(String.Format("Segment {0} Started.", segment.SegmentIndex) + Environment.NewLine + segment.ToJsonString()); } else { _speech.SpeakInfo(String.Format("Inter Segment Started.")); - _eventLogger.Log("Inter Segment Started."); } }; JobHandler.UnitCompleted += (x, unit) => { _speech.SpeakInfo(String.Format("{0} Units Completed.", unit + 1)); - _eventLogger.Log(String.Format("{0} Units Completed.", unit + 1)); }; JobHandler.Failed += (x, ex) => { LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); - _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); SetJobFailed(); InvokeUI(() => @@ -1501,13 +1495,11 @@ namespace Tango.MachineStudio.Developer.ViewModels { _speech.SpeakInfo("Finalizing job..."); LogManager.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); - _eventLogger.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); }; JobHandler.Completed += (x, e) => { LogManager.Log(String.Format("Job {0} has completed.", RunningJob.Name)); - _eventLogger.Log(String.Format("Job {0} has completed.", RunningJob.Name)); SetJobCompleted(); StopRecordingIfInProgress(); }; @@ -1521,7 +1513,6 @@ namespace Tango.MachineStudio.Developer.ViewModels } LogManager.Log(String.Format("Job {0} has been canceled.", RunningJob.Name)); - _eventLogger.Log(String.Format("Job {0} has been canceled.", RunningJob.Name)); StopRecordingIfInProgress(); //Finally Canceled.. }; @@ -1539,7 +1530,6 @@ namespace Tango.MachineStudio.Developer.ViewModels catch (Exception ex) { LogManager.Log(ex); - _eventLogger.Log(ex, "An error occurred while starting the job."); _notification.ShowError("An error occurred while starting the job. " + Environment.NewLine + ex.Message); SetJobFailed(); StopRecordingIfInProgress(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 90ca3c017..4205e5246 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -1365,7 +1365,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, String.Format("Error executing technician set valve state command on '{0}'.", item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician set valve state command on '{0}'.", item.TechName)); } }; } @@ -1386,7 +1385,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, $"Error executing SetBlowerState command for blower {item.HardwareBlower.HardwareBlowerType.Name}."); - _eventLogger.Log(ex, $"Error executing SetBlowerState command for blower {item.HardwareBlower.HardwareBlowerType.Name}."); } }; } @@ -1407,7 +1405,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, $"Error executing SetHeaterState command for heater {item.TechHeater.Name}."); - _eventLogger.Log(ex, $"Error executing SetHeaterState command for heater {item.TechHeater.Name}."); } }; } @@ -1504,7 +1501,6 @@ namespace Tango.MachineStudio.Technician.ViewModels item.HomingProgress = 0; item.HomingMaximumProgress = 0; LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); } }; } @@ -1602,7 +1598,6 @@ namespace Tango.MachineStudio.Technician.ViewModels item.HomingProgress = 0; item.HomingMaximumProgress = 0; LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); } }; } @@ -1756,7 +1751,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, String.Format(String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName))); - _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); } }; } @@ -1840,7 +1834,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician command '{0}' on item '{1}'.", action, item.TechName)); } }; } @@ -1861,7 +1854,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, String.Format("Error executing technician set digital out command on '{0}'.", item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician set digital out command on '{0}'.", item.TechName)); } }; } @@ -1886,7 +1878,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { LogManager.Log(ex, String.Format("Error executing technician set value component command on '{0}'.", item.TechName)); - _eventLogger.Log(ex, String.Format("Error executing technician set value component command on '{0}'.", item.TechName)); } }; } @@ -1912,7 +1903,6 @@ namespace Tango.MachineStudio.Technician.ViewModels catch (Exception ex) { String msg = "Error uploading process parameters:" + Environment.NewLine + parameters.ToJsonString(); - _eventLogger.Log(ex, msg); LogManager.Log(ex, msg); _notification.ShowError("Could not upload process parameters." + Environment.NewLine + ex.Message); } 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 e51247337..cb17a5a83 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -154,16 +154,6 @@ namespace Tango.MachineStudio.UI return; } - try - { - var eventLogger = TangoIOC.Default.GetInstance(); - if (eventLogger != null) - { - eventLogger.Log(e.Exception, "Application Crashed!"); - } - } - catch { } - Application.Current.Dispatcher.Invoke(() => { WorkItem bug = null; 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 c00caf72a..97ff894df 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -273,8 +273,6 @@ namespace Tango.MachineStudio.UI.ViewModels _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null; _settings.Save(); - _eventLogger.Log("User logged in."); - EnableSlotSelection = false; IsLogging = false; 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 2a00386dc..4d37321dd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -410,13 +410,11 @@ 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 @@ -497,7 +495,6 @@ namespace Tango.MachineStudio.UI.ViewModels 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(); @@ -510,11 +507,6 @@ namespace Tango.MachineStudio.UI.ViewModels { 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); } @@ -615,7 +607,6 @@ namespace Tango.MachineStudio.UI.ViewModels machine.SessionClosed -= Machine_SessionClosed; machine.SessionClosed += Machine_SessionClosed; PostMessage(new MachineConnectionChangedMessage() { Machine = machine }); - _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", machine.SerialNumber)); //if (x.UploadHardwareConfiguration) //{ @@ -626,13 +617,11 @@ namespace Tango.MachineStudio.UI.ViewModels catch (ResponseErrorException ex) { LogManager.Log(ex); - _eventLogger.Log(ex, "Error connecting to machine " + machine.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 " + machine.SerialNumber); _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message); } -- cgit v1.3.1