From 24a77fd5e03c81c6b0e901da02bce4bdccd4c71c Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Jul 2018 14:32:56 +0300 Subject: Fixed a bug with logging module display timeline.. --- .../MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt | 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/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index c1f1cc77d..3c8a1e91c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Wed 07/18/2018 13:18:32.22 +Thu 07/19/2018 14:26:11.83 -- cgit v1.3.1 From c4feba445987d33c7bfcc304a3be368e8458d408 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Jul 2018 14:48:11 +0300 Subject: Some log improvements in TransporterBase. Added dynamic display/hide debug logs on logging module. --- .../ViewModels/ApplicationLogsViewVM.cs | 29 +++++++++++----------- .../Views/ApplicationLogsView.xaml | 10 +++++--- .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- .../Tango.Transport/TransporterBase.cs | 4 ++- 4 files changed, 25 insertions(+), 20 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs index c56ca5541..b0bc613bd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs @@ -57,6 +57,16 @@ namespace Tango.MachineStudio.Logging.ViewModels } } + private bool _displayDebug; + /// + /// Gets or sets a value indicating whether display debug logs. + /// + public bool DisplayDebug + { + get { return _displayDebug; } + set { _displayDebug = value; RaisePropertyChangedAuto(); } + } + private LogItemBase _selectedLog; public LogItemBase SelectedLog { @@ -169,21 +179,12 @@ namespace Tango.MachineStudio.Logging.ViewModels private void LogManager_NewLog(object sender, LogItemBase log) { + if (log.Category == LogCategory.Debug && !DisplayDebug) return; + if (!RealTimePaused) { InvokeUI(() => { - if (_is_debug) - { - if (_realTimeLogs.Count > 1000) - { - for (int i = 998; i < _realTimeLogs.Count; i++) - { - _realTimeLogs.RemoveAt(i); - } - } - } - _realTimeLogs.Insert(0, log); }); } @@ -225,10 +226,10 @@ namespace Tango.MachineStudio.Logging.ViewModels if (SelectedLog != null && !_dialog_shown) { _dialog_shown = true; - _notification.ShowModalDialog(new LogDetailsViewVM(SelectedLog), (x) => + _notification.ShowModalDialog(new LogDetailsViewVM(SelectedLog), (x) => { - - }, () => + + }, () => { _dialog_shown = false; }); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml index 310f4fd87..eeb7204d1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml @@ -100,10 +100,12 @@ - - - - + Process Debug Logs + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 3c8a1e91c..625616f0e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Thu 07/19/2018 14:26:11.83 +Thu 07/19/2018 14:46:09.13 diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index dbeae5b41..6b566ab58 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -641,6 +641,8 @@ namespace Tango.Transport LogManager.Log("Parsing message container...", LogCategory.Debug); MessageContainer container = Encoder.DecodeContainer(data); + LogManager.Log("Message was identified as " + container.Type + ".", LogCategory.Debug); + if (container.Token.Length != MESSAGE_TOKEN_LENGTH) { LogManager.Log("Invalid message token length received: " + container.Token, LogCategory.Error); @@ -683,7 +685,7 @@ namespace Tango.Transport } else { - LogManager.Log("Pending request was identified as 'continuous response' " + container.Type + ". keeping pending request.", LogCategory.Debug); + LogManager.Log("Pending request was identified as 'continuous response'. keeping pending request.", LogCategory.Debug); try { -- cgit v1.3.1 From 3cb25038b7742c7599a0e1059a7ca280fae57e9a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Jul 2018 15:34:54 +0300 Subject: Machine Studio v1.0.0.18 --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- .../ViewModels/ConnectedMachineViewVM.cs | 10 ++++ .../ViewModels/MainViewVM.cs | 19 ++++++++ .../Views/ConnectedMachineView.xaml | 1 + .../Tango.Emulations/Emulators/MachineEmulator.cs | 8 ++++ .../Operation/IMachineOperator.cs | 7 +++ .../Tango.Integration/Operation/MachineOperator.cs | 52 +++++++++++++++++++++ Software/Visual_Studio/Versioning/Core.cs | 4 +- Software/Visual_Studio/Versioning/MachineStudio.cs | 4 +- 11 files changed, 102 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 968448467..e19de79a7 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 f2683eab3..83b27aee3 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 625616f0e..43f0c081d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Thu 07/19/2018 14:46:09.13 +Thu 07/19/2018 15:24:26.26 diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs index 76e138e0e..8034ceb69 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs @@ -18,6 +18,7 @@ namespace Tango.MachineStudio.UI.ViewModels Cancel, Disconnect, UploadHardwareConfig, + Reset, } private IStudioApplicationManager _applicationManager; @@ -33,11 +34,20 @@ namespace Tango.MachineStudio.UI.ViewModels public RelayCommand UploadHardwareConfigurationCommand { get; set; } + public RelayCommand ResetCommand { get; set; } + public ConnectedMachineViewVM(IStudioApplicationManager application) { ApplicationManager = application; DisconnectCommand = new RelayCommand(Disconnect); UploadHardwareConfigurationCommand = new RelayCommand(UploadHardwareConfiguration); + ResetCommand = new RelayCommand(Reset); + } + + private void Reset() + { + Result = ConnectedMachineVMResult.Reset; + Accept(); } private void UploadHardwareConfiguration() 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 a7762a5e6..278926de9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -545,6 +545,25 @@ namespace Tango.MachineStudio.UI.ViewModels } } } + else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Reset) + { + if (NotificationProvider.ShowQuestion("This will reset the embedded device. Are you sure?")) + { + using (NotificationProvider.PushTaskItem("Uploading hardware configuration...")) + { + try + { + await ApplicationManager.ConnectedMachine.Reset(); + NotificationProvider.ShowInfo("Embedded device has been restarted."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resetting embedded device."); + NotificationProvider.ShowError("Error resetting embedded device." + Environment.NewLine + ex.Message); + } + } + } + } }); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index a4f253de3..39c42392d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -117,6 +117,7 @@ +