From 856a23723afcc9d48c0f019dc33a259ac6c279ed Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 12 Jul 2018 14:03:47 +0300 Subject: Implemented continuous request timeouts. Implemented continuous request abort exception. Added log object for real time logs. Some work on PPC & Machine Studio. --- .../Converters/LogItemToMessageConverter.cs | 39 ++++++++++++++++++++++ .../Tango.MachineStudio.Logging.csproj | 1 + .../ViewModels/ApplicationLogsViewVM.cs | 4 +++ .../ViewModels/EmbeddedLogsViewVM.cs | 4 +++ .../Views/ApplicationLogDetailsView.xaml | 4 ++- .../Views/ApplicationLogsView.xaml | 7 ++++ .../Views/EmbeddedLogsView.xaml | 7 ++++ 7 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs new file mode 100644 index 000000000..7136b22ea --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Logging; +using Tango.PMR.Common; + +namespace Tango.MachineStudio.Logging.Converters +{ + public class LogItemToMessageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + LogItemBase log = value as LogItemBase; + + if (log != null) + { + String str = log.Message; + + if (log.LogObject != null) + { + str += Environment.NewLine + Environment.NewLine + log.LogObject.ToJsonString("Data"); + } + + return str; + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj index 706243ee1..2ce0446aa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj @@ -74,6 +74,7 @@ + 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 eb172069e..2bb96c1e5 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 @@ -94,6 +94,8 @@ namespace Tango.MachineStudio.Logging.ViewModels public RelayCommand ToggleRealTimePaused { get; set; } + public RelayCommand ClearRealTimeLogsCommand { get; set; } + public ApplicationLogsViewVM(LoggingNavigationManager navigation, INotificationProvider notification) { _notification = notification; @@ -122,6 +124,8 @@ namespace Tango.MachineStudio.Logging.ViewModels LogManager.NewLog += LogManager_NewLog; ToggleRealTimePaused = new RelayCommand(() => RealTimePaused = !RealTimePaused); + + ClearRealTimeLogsCommand = new RelayCommand(() => { _realTimeLogs.Clear(); }); } private void LogManager_NewLog(object sender, LogItemBase log) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs index 8cf4edcb3..ba18cbdb1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs @@ -96,6 +96,8 @@ namespace Tango.MachineStudio.Logging.ViewModels public RelayCommand ToggleRealTimePaused { get; set; } + public RelayCommand ClearRealTimeLogsCommand { get; set; } + public EmbeddedLogsViewVM(LoggingNavigationManager navigation, IStudioApplicationManager application, INotificationProvider notification) { _notification = notification; @@ -124,6 +126,8 @@ namespace Tango.MachineStudio.Logging.ViewModels MachineOperator.EmbeddedLogManager.NewLog += EmbeddedLogManager_NewLog; ToggleRealTimePaused = new RelayCommand(() => RealTimePaused = !RealTimePaused); + + ClearRealTimeLogsCommand = new RelayCommand(() => { _realTimeLogs.Clear(); }); } private void EmbeddedLogManager_NewLog(object sender, LogItemBase log) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml index 8c934545a..c7ebcaf02 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml @@ -6,6 +6,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.Logging.Converters" xmlns:vm="clr-namespace:Tango.MachineStudio.Logging.ViewModels" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views" @@ -14,6 +15,7 @@ + @@ -71,7 +73,7 @@ - + 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 9115b6a7c..3ca10f370 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 @@ -92,6 +92,13 @@ + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml index 3b54c1d35..d70149bbb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml @@ -92,6 +92,13 @@ + + -- cgit v1.3.1 From 8adbe1c2004903c3e60e9347c4b0ee8d09cd2457 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 12 Jul 2018 14:47:26 +0300 Subject: Temp --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes .../Converters/JobProgressToPositionConverter.cs | 7 +++---- .../Views/JobView.xaml | 1 - .../Views/MainView.xaml | 4 ++-- .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- Software/Visual_Studio/Versioning/Core.cs | 4 ++-- Software/Visual_Studio/Versioning/MachineStudio.cs | 4 ++-- 8 files changed, 10 insertions(+), 12 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index c63ad1861..4b4f9a441 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 f36fd173c..39cd69c13 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs index f6d2c4f42..4212c6908 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs @@ -15,14 +15,13 @@ namespace Tango.MachineStudio.Developer.Converters { try { - Job job = values[0] as Job; - - if (job != null) + if (values.Length == 3) { + double length = System.Convert.ToDouble(values[0]); double progress = System.Convert.ToDouble(values[1]); double parentElementWidth = System.Convert.ToDouble(values[2]); - return (progress / job.Length) * parentElementWidth; + return (progress / length) * parentElementWidth; } else { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 585a0cb6b..fde7ff275 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -59,7 +59,6 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 14c4cd78a..3e76ccbd0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -213,8 +213,8 @@ - - + + 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 a64fd8b3d..66ca876c6 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/12/2018 13:56:47.00 +Thu 07/12/2018 14:40:14.74 diff --git a/Software/Visual_Studio/Versioning/Core.cs b/Software/Visual_Studio/Versioning/Core.cs index 20faee219..0c8bdf3f5 100644 --- a/Software/Visual_Studio/Versioning/Core.cs +++ b/Software/Visual_Studio/Versioning/Core.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.5")] -[assembly: AssemblyFileVersion("1.0.0.5")] +[assembly: AssemblyVersion("1.0.0.6")] +[assembly: AssemblyFileVersion("1.0.0.6")] diff --git a/Software/Visual_Studio/Versioning/MachineStudio.cs b/Software/Visual_Studio/Versioning/MachineStudio.cs index 6046b1b47..df70e81bb 100644 --- a/Software/Visual_Studio/Versioning/MachineStudio.cs +++ b/Software/Visual_Studio/Versioning/MachineStudio.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.11")] -[assembly: AssemblyFileVersion("1.0.0.11")] +[assembly: AssemblyVersion("1.0.0.12")] +[assembly: AssemblyFileVersion("1.0.0.12")] -- cgit v1.3.1