aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-10 19:15:50 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-10 19:15:50 +0300
commit3cfc4ee06b801e581107f24e691451cd291b6a70 (patch)
tree1d13c5f9c1e701900fe1f161b38b5a7ea49c1959 /Software/Visual_Studio
parented3a77f6c890c6e232bb154418e2fdfb08c83dcf (diff)
downloadTango-3cfc4ee06b801e581107f24e691451cd291b6a70.tar.gz
Tango-3cfc4ee06b801e581107f24e691451cd291b6a70.zip
Reduced several unhandled exceptions written to logs from GlobalExceptionTrapper.
Reset RemoteJob on FSE connection. Ensure auto reconnection time does not execute when the dialog has been already closed.. Not sure if that is the problem.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs2
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostViewVM.cs11
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs7
-rw-r--r--Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs7
4 files changed, 15 insertions, 12 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
index 8e0208c0f..60c6f0e6f 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs
@@ -106,7 +106,7 @@ namespace Tango.FSE.UI
try
{
- LogManager.Log(e.Exception, "Application Crashed!");
+ LogManager.Log(e.Exception, LogCategory.Critical, "Application Crashed!");
LogManager.Log("Trying to recover from application crash...");
try
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostViewVM.cs
index dc08c87d1..b21c3788e 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostViewVM.cs
@@ -91,11 +91,14 @@ namespace Tango.FSE.UI.Dialogs
private void _timer_Tick(object sender, EventArgs e)
{
- RemainingSeconds--;
-
- if (RemainingSeconds == 0)
+ if (IsVisible)
{
- Accept();
+ RemainingSeconds--;
+
+ if (RemainingSeconds == 0)
+ {
+ Accept();
+ }
}
}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs
index cb99ef6ca..b0a563ebd 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/RemoteJob/RemoteJobTile.cs
@@ -58,6 +58,7 @@ namespace Tango.FSE.UI.Tiles.RemoteJob
private void InitDemoJob()
{
+ IsRunning = false;
Job = new Job();
Job.NumberOfUnits = 1;
Job.Name = "N/A";
@@ -88,6 +89,12 @@ namespace Tango.FSE.UI.Tiles.RemoteJob
RemoteJobProvider.RemoteJobStarted += RemoteJobProvider_RemoteJobStarted;
RemoteJobProvider.RemoteJobStopped += RemoteJobProvider_RemoteJobStopped;
+ MachineProvider.MachineConnected += MachineProvider_MachineConnected;
+ }
+
+ private void MachineProvider_MachineConnected(object sender, Common.Connection.MachineConnectedEventArgs e)
+ {
+ InitDemoJob();
}
private void RemoteJobProvider_RemoteJobStopped(object sender, Common.RemoteJob.RemoteJobStoppedEventArgs e)
diff --git a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
index b5acb4b88..7580eea31 100644
--- a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
+++ b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs
@@ -90,18 +90,11 @@ namespace Tango.Logging
}
_lastGlobalExceptionTime = DateTime.Now;
- LogManager.Default.Log("Application Crashed", LogCategory.Critical);
- LogManager.Default.Log(exception, LogCategory.Critical);
ApplicationCrashedEventArgs e = new ApplicationCrashedEventArgs(exception);
ApplicationCrashed?.Invoke(this, e);
- if (e.TryRecover)
- {
- LogManager.Default.Log("Trying application recovery. Ignoring exception...");
- }
-
return e.TryRecover;
}
}