From 64b768178dc9e64293a52c1b6d2631709af9502a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Feb 2019 13:38:47 +0200 Subject: Removed all refresh tokens use :/ --- .../MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') 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 bceaaf956..f313e9073 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.0.7.0")] +[assembly: AssemblyVersion("4.0.9.0")] [assembly: ComVisible(false)] \ No newline at end of file -- cgit v1.3.1 From 2248c386c45aa0b1f2d077907424b6fdbcc0d53c Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Feb 2019 20:26:44 +0200 Subject: Machine Studio v4.0.9 PPC v1.0.3 --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Machine Studio Installer.aip | 104 +++++++++- .../Build/Shortcuts/Machine Emulator.lnk | Bin 1445 -> 1471 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1532 -> 1532 bytes .../Build/Shortcuts/Proto Compiler GUI.lnk | Bin 1444 -> 1464 bytes .../ViewModels/FirmwareUpgradeViewVM.cs | 32 ++- .../Views/FirmwareUpgradeView.xaml | 3 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 2 +- .../Tango.Transport/TransportMessageBase.cs | 5 + .../Tango.Transport/TransporterBase.cs | 216 ++++++++++++--------- 11 files changed, 256 insertions(+), 106 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 19a7f9e56..a64750021 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 71bdb175e..762885218 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index c55783488..2937817c5 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -66,9 +66,17 @@ + + + + + + + + @@ -98,13 +106,13 @@ + - @@ -114,7 +122,9 @@ + + @@ -123,6 +133,7 @@ + @@ -130,8 +141,11 @@ + + + @@ -143,13 +157,18 @@ + + + + + @@ -176,6 +195,7 @@ + @@ -192,15 +212,23 @@ + + + + + + + + @@ -208,19 +236,25 @@ + + + + + + @@ -273,19 +307,26 @@ + + + + - + + + + - + @@ -313,7 +354,7 @@ - + @@ -328,12 +369,21 @@ + + + + + + + + + @@ -380,6 +430,7 @@ + @@ -388,6 +439,7 @@ + @@ -412,7 +464,9 @@ + + @@ -421,6 +475,7 @@ + @@ -430,8 +485,11 @@ + + + @@ -443,13 +501,18 @@ + + + + + @@ -484,6 +547,7 @@ + @@ -500,16 +564,24 @@ + + + + + + + + @@ -517,10 +589,12 @@ + + @@ -529,10 +603,14 @@ + + + + @@ -667,18 +745,32 @@ + + + + + + + + + + + + + + @@ -772,8 +864,6 @@ - - @@ -834,8 +924,8 @@ - + diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk index 82d25f5cb..fb11f4b31 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index d8c2c376b..053449ca5 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk index 2d58f55bf..21aad3ff2 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk and b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk differ 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 e54c28e17..e45c29f73 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/FirmwareUpgradeViewVM.cs @@ -61,6 +61,7 @@ namespace Tango.MachineStudio.UI.ViewModels if (_dfu) { UploadTFP = false; + DFUAndTFP = false; } } } @@ -76,10 +77,29 @@ namespace Tango.MachineStudio.UI.ViewModels if (_uploadTFP) { DFU = false; + DFUAndTFP = false; } } } + private bool _dfuAndTFP; + + public bool DFUAndTFP + { + get { return _dfuAndTFP; } + set + { + _dfuAndTFP = value; RaisePropertyChangedAuto(); + + if (_dfuAndTFP) + { + DFU = false; + UploadTFP = false; + } + } + } + + public RelayCommand SelectCommand { get; set; } public RelayCommand UpgradeCommand { get; set; } @@ -131,13 +151,17 @@ namespace Tango.MachineStudio.UI.ViewModels { IsFree = false; - if (UploadTFP) + if (DFU) { - _operator.FirmwareUpgradeMode = FirmwareUpgradeModes.DFU | FirmwareUpgradeModes.TFP_PACKAGE; + _operator.FirmwareUpgradeMode = FirmwareUpgradeModes.DFU; } - else + else if (UploadTFP) { - _operator.FirmwareUpgradeMode = FirmwareUpgradeModes.DFU; + _operator.FirmwareUpgradeMode = FirmwareUpgradeModes.TFP_PACKAGE; + } + else if (DFUAndTFP) + { + _operator.FirmwareUpgradeMode = FirmwareUpgradeModes.DFU | FirmwareUpgradeModes.TFP_PACKAGE; } _stream = new FileStream(SelectedFile, FileMode.Open); 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 9acd0386a..976c3866a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml @@ -66,7 +66,8 @@ DFU - DFU & Package + TFP Package + DFU & Package diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 020456bf1..f1d9487ff 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -46,7 +46,7 @@ namespace Tango.Emulations.Emulators public bool Canceled { get; set; } } - private const int MAX_CHUNK_LENGTH = 1024 * 10; + private const int MAX_CHUNK_LENGTH = 4000; private StartDiagnosticsRequest _diagnosticsRequest; private bool _cancelJob; private List _motorJoggingRequestTypes; diff --git a/Software/Visual_Studio/Tango.Transport/TransportMessageBase.cs b/Software/Visual_Studio/Tango.Transport/TransportMessageBase.cs index 8ef9aee5f..4e80dc2e6 100644 --- a/Software/Visual_Studio/Tango.Transport/TransportMessageBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransportMessageBase.cs @@ -32,6 +32,11 @@ namespace Tango.Transport /// public Func Serialize { get; set; } + /// + /// Gets or sets the activate timeout callback. + /// + public Action ActivateTimeout { get; set; } + /// /// Gets or sets the message. /// diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 03188b71f..fe7d8a249 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -329,20 +329,24 @@ namespace Tango.Transport TaskCompletionSource source = new TaskCompletionSource(); TransportMessage message = new TransportMessage(container.Token, request, TransportMessageDirection.Request, () => container.ToByteArray(), source); - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - - if (!source.Task.IsCompleted) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request task exception...", LogCategory.Debug); - source.SetException(ex); - } - }, timeout != null ? timeout.Value : RequestTimeout); + if (!source.Task.IsCompleted) + { + TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request task exception...", LogCategory.Debug); + source.SetException(ex); + } + + }, timeout != null ? timeout.Value : RequestTimeout); + }; + + EnqueueMessageOut(message); return source.Task; } @@ -399,20 +403,25 @@ namespace Tango.Transport TaskCompletionSource source = new TaskCompletionSource(); TransportMessage message = new TransportMessage(container.Token, container, TransportMessageDirection.Request, () => container.ToByteArray(), source); - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - - if (!source.Task.IsCompleted) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + container.Type + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request task exception...", LogCategory.Debug); - source.SetException(ex); - } - }, timeout != null ? timeout.Value : RequestTimeout); + if (!source.Task.IsCompleted) + { + TimeoutException ex = new TimeoutException("Request message: " + container.Type + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request task exception...", LogCategory.Debug); + source.SetException(ex); + } + + }, timeout != null ? timeout.Value : RequestTimeout); + + }; + + EnqueueMessageOut(message); return source.Task; } @@ -489,20 +498,26 @@ namespace Tango.Transport IsContinuous = true, ContinuesResponseSubject = subject, }; - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - if (!message.AtLeastOneResponseReceived) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request exception...", LogCategory.Debug); - message.SetException(ex); - } - }, timeout != null ? timeout.Value : RequestTimeout); + if (!message.AtLeastOneResponseReceived) + { + TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request exception...", LogCategory.Debug); + message.SetException(ex); + } + + }, timeout != null ? timeout.Value : RequestTimeout); + + }; + + EnqueueMessageOut(message); return subject.AsObservable(); } @@ -524,20 +539,24 @@ namespace Tango.Transport TaskCompletionSource> source = new TaskCompletionSource>(); TransportMessage> message = new TransportMessage>(request.Container.Token, request, TransportMessageDirection.Request, () => Encoder.Encode(request), source); - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - - if (!source.Task.IsCompleted) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + typeof(Request).Name + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request task exception...", LogCategory.Debug); - source.SetException(ex); - } - }, timeout != null ? timeout.Value : RequestTimeout); + if (!source.Task.IsCompleted) + { + TimeoutException ex = new TimeoutException("Request message: " + typeof(Request).Name + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request task exception...", LogCategory.Debug); + source.SetException(ex); + } + + }, timeout != null ? timeout.Value : RequestTimeout); + }; + + EnqueueMessageOut(message); return source.Task; } @@ -569,44 +588,48 @@ namespace Tango.Transport IsContinuous = true, ContinuesResponseSubject = subject, }; - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - - if (!message.AtLeastOneResponseReceived) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + typeof(Request).Name + " had timed out after " + (firstTimeout != null ? firstTimeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request exception...", LogCategory.Debug); - message.SetException(ex); - } - if (continousTimeout != null) - { - Task.Factory.StartNew(async () => + if (!message.AtLeastOneResponseReceived) + { + TimeoutException ex = new TimeoutException("Request message: " + typeof(Request).Name + " had timed out after " + (firstTimeout != null ? firstTimeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request exception...", LogCategory.Debug); + message.SetException(ex); + } + + if (continousTimeout != null) { - while (!message.Completed) + Task.Factory.StartNew(async () => { - await Task.Delay(continousTimeout.Value).ContinueWith((y) => + while (!message.Completed) { - if (!message.Completed) + await Task.Delay(continousTimeout.Value).ContinueWith((y) => { - if (DateTime.Now - message.LastResponseTime > continousTimeout.Value) + if (!message.Completed) { - TimeoutException ex = new TimeoutException("Continuous request message: " + typeof(Request).Name + " had failed to provide a response for a period of " + (continousTimeout.Value.TotalSeconds) + " seconds and has timed out."); - LogManager.Log(ex); - LogManager.Log("Setting request exception...", LogCategory.Debug); - message.SetException(ex); - return; + if (DateTime.Now - message.LastResponseTime > continousTimeout.Value) + { + TimeoutException ex = new TimeoutException("Continuous request message: " + typeof(Request).Name + " had failed to provide a response for a period of " + (continousTimeout.Value.TotalSeconds) + " seconds and has timed out."); + LogManager.Log(ex); + LogManager.Log("Setting request exception...", LogCategory.Debug); + message.SetException(ex); + return; + } } - } - }); - } - }); - } + }); + } + }); + } + + }, firstTimeout != null ? firstTimeout.Value : RequestTimeout); + }; - }, firstTimeout != null ? firstTimeout.Value : RequestTimeout); + EnqueueMessageOut(message); return subject.AsObservable(); } @@ -635,44 +658,48 @@ namespace Tango.Transport IsContinuous = true, ContinuesResponseSubject = subject, }; - EnqueueMessageOut(message); - TimeoutTask.StartNew(() => + message.ActivateTimeout = () => { - - if (!message.AtLeastOneResponseReceived) + TimeoutTask.StartNew(() => { - TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); - LogManager.Log(ex); - LogManager.Log("Setting request exception...", LogCategory.Debug); - message.SetException(ex); - } - if (continuousTimeout != null) - { - Task.Factory.StartNew(async () => + if (!message.AtLeastOneResponseReceived) { - while (!message.Completed) + TimeoutException ex = new TimeoutException("Request message: " + requestName + " had timed out after " + (timeout != null ? timeout.Value.TotalSeconds : RequestTimeout.TotalSeconds) + " seconds."); + LogManager.Log(ex); + LogManager.Log("Setting request exception...", LogCategory.Debug); + message.SetException(ex); + } + + if (continuousTimeout != null) + { + Task.Factory.StartNew(async () => { - await Task.Delay(continuousTimeout.Value).ContinueWith((y) => + while (!message.Completed) { - if (!message.Completed) + await Task.Delay(continuousTimeout.Value).ContinueWith((y) => { - if (DateTime.Now - message.LastResponseTime > continuousTimeout.Value) + if (!message.Completed) { - TimeoutException ex = new TimeoutException("Continuous request message: " + requestName + " had failed to provide a response for a period of " + (continuousTimeout.Value.TotalSeconds) + " seconds and has timed out."); - LogManager.Log(ex); - LogManager.Log("Setting request exception...", LogCategory.Debug); - message.SetException(ex); - return; + if (DateTime.Now - message.LastResponseTime > continuousTimeout.Value) + { + TimeoutException ex = new TimeoutException("Continuous request message: " + requestName + " had failed to provide a response for a period of " + (continuousTimeout.Value.TotalSeconds) + " seconds and has timed out."); + LogManager.Log(ex); + LogManager.Log("Setting request exception...", LogCategory.Debug); + message.SetException(ex); + return; + } } - } - }); - } - }); - } + }); + } + }); + } - }, timeout != null ? timeout.Value : RequestTimeout); + }, timeout != null ? timeout.Value : RequestTimeout); + }; + + EnqueueMessageOut(message); return subject.AsObservable(); } @@ -853,6 +880,9 @@ namespace Tango.Transport } Adapter.Write(message.Serialize()); + + message.ActivateTimeout?.Invoke(); + LogManager.Log("Message sent on adapter: " + Adapter.Address + "...", LogCategory.Debug, message.Message); } else -- cgit v1.3.1