diff options
| -rw-r--r-- | Software/DB/PPC/Tango.mdf | bin | 75497472 -> 75497472 bytes | |||
| -rw-r--r-- | Software/DB/PPC/Tango_log.ldf | bin | 20578304 -> 20578304 bytes | |||
| -rw-r--r-- | Software/DB/Tango.mdf | bin | 75497472 -> 75497472 bytes | |||
| -rw-r--r-- | Software/DB/Tango_log.ldf | bin | 15400960 -> 15400960 bytes | |||
| -rw-r--r-- | Software/Graphics/oemlogo.bmp | bin | 0 -> 43254 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk | bin | 1532 -> 1532 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs | 14 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 3 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs | 45 |
10 files changed, 54 insertions, 10 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf Binary files differindex f7f7abf41..fa31b0348 100644 --- a/Software/DB/PPC/Tango.mdf +++ b/Software/DB/PPC/Tango.mdf diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf Binary files differindex 062e93922..79864f917 100644 --- a/Software/DB/PPC/Tango_log.ldf +++ b/Software/DB/PPC/Tango_log.ldf diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 6b1058841..c378557df 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 9870bdd45..403ca0da6 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Graphics/oemlogo.bmp b/Software/Graphics/oemlogo.bmp Binary files differnew file mode 100644 index 000000000..d0e472a90 --- /dev/null +++ b/Software/Graphics/oemlogo.bmp diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk Binary files differindex 3cdd0db6d..b9c753f00 100644 --- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk +++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs index db312b78f..2234d09c1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs @@ -177,7 +177,7 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels using (_notification.PushTaskItem("Removing organization...")) { await SelectedOrganization.DeleteCascadeAsync(_organizationsContext); - LoadOrganizations(); + await LoadOrganizations(); } } } @@ -187,7 +187,7 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels using (_notification.PushTaskItem("Saving organization address and contact...")) { await ManagedOrganization.SaveAsync(_manageContext); - LoadOrganizations(); + await LoadOrganizations(); SelectedOrganization = Organizations.SingleOrDefault(x => x.Guid == ManagedOrganization.Guid); } } @@ -263,9 +263,9 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels } } - private void LoadOrganizations() + private Task LoadOrganizations() { - Task.Factory.StartNew(() => + return Task.Factory.StartNew(() => { _organizationsContext = ObservablesContext.CreateDefault(); @@ -320,6 +320,8 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels Email = email, }; + user.Address = new Address(); + user.UsersRoles.Add(new UsersRole() { User = user, @@ -336,14 +338,12 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels return; } - user.Address = new Address(); - ManagedOrganization.Users.Add(user); using (_notification.PushTaskItem("Adding new user...")) { await ManagedOrganization.SaveAsync(_manageContext); - LoadOrganizations(); + await LoadOrganizations(); SelectedOrganization = Organizations.SingleOrDefault(x => x.Guid == ManagedOrganization.Guid); } } 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 631804544..ae5dbc5fa 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("3.5.47.18238")] +[assembly: AssemblyVersion("3.5.48.18238")] [assembly: ComVisible(false)]
\ No newline at end of file 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 b3d896d53..bbd621e65 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -796,6 +796,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { + LogManager.Log(ex, "Error while trying to upload bug report."); _notificationProvider.ShowError("An error occurred while trying to create the issue." + Environment.NewLine + ex.Message); } } @@ -819,6 +820,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { + LogManager.Log(ex, $"Error while trying to approve resolved bug '{item.ID}'."); _notificationProvider.ShowError("An error occurred while trying to update the issue." + Environment.NewLine + ex.Message); } vm.IsAvailable = true; @@ -840,6 +842,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { + LogManager.Log(ex, $"Error while trying to decline resolved bug '{item.ID}'."); _notificationProvider.ShowError("An error occurred while trying to update the issue." + Environment.NewLine + ex.Message); } diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs index d914ac98a..2e014ebbb 100644 --- a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs +++ b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.IO.Ports; using System.Linq; using System.Text; @@ -59,7 +60,10 @@ namespace Tango.Transport.Adapters { ThrowIfDisposed(); - return Task.Factory.StartNew(() => + bool completed = false; + bool timeout = false; + + var connect_task = Task.Factory.StartNew(() => { try { @@ -79,18 +83,36 @@ namespace Tango.Transport.Adapters _serialPort.ReadBufferSize = MAX_BUFFER_SIZE; _serialPort.WriteBufferSize = MAX_BUFFER_SIZE; _serialPort.Open(); + + if (timeout) return; + _serialPort.DiscardInBuffer(); _serialPort.DiscardOutBuffer(); State = TransportComponentState.Connected; LogManager.Log("USB adapter connected."); + + completed = true; } } catch (Exception ex) { + completed = true; throw LogManager.Log(ex, "Could not open serial port on " + Address + "."); } }); + + var timeout_task = Task.Delay(TimeSpan.FromSeconds(5)).ContinueWith((x) => + { + if (!completed) + { + timeout = true; + throw LogManager.Log(new IOException("The serial port seems to be in a froze state. Reinitialize the port and try again.")); + } + + }); + + return Task.WhenAny(connect_task, timeout_task); } /// <summary> @@ -101,7 +123,10 @@ namespace Tango.Transport.Adapters { ThrowIfDisposed(); - return Task.Factory.StartNew(() => + bool completed = false; + bool timeout = false; + + var disconnect_task = Task.Factory.StartNew(() => { try { @@ -117,15 +142,31 @@ namespace Tango.Transport.Adapters _serialPort.DiscardOutBuffer(); _serialPort.DiscardInBuffer(); _serialPort.Close(); + + if (timeout) return; + State = TransportComponentState.Disconnected; LogManager.Log("USB adapter disconnected."); + completed = true; } } catch (Exception ex) { + completed = true; throw LogManager.Log(ex, "Could not close serial port on " + Address + "."); } }); + + var timeout_task = Task.Delay(TimeSpan.FromSeconds(5)).ContinueWith((x) => + { + if (!completed) + { + timeout = true; + throw LogManager.Log(new IOException("The serial port seems to be in a froze state. Reinitialize the port and try again.")); + } + }); + + return Task.WhenAny(disconnect_task, timeout_task); } /// <summary> |
