From cf81fa5d4c4927858f312cfa520f2acd58a2e2e3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 2 Feb 2020 14:02:00 +0200 Subject: GUI changes according to review item. Related Work Items: #2402 --- Software/Visual_Studio/Tango.Logging/LogFile.cs | 21 ++ .../Analyzers/FlowAnalyser.cs | 69 ++-- .../Tango.DispenserAnalyzer.UI.csproj | 4 +- .../Utilities/Tango.LogViewer.UI/App.config | 8 + .../ApplicationLogViewerParser.cs | 21 +- .../Tango.LogViewer.UI/LogViewerManager.cs | 108 ++++-- .../Utilities/Tango.LogViewer.UI/MainWindow.xaml | 417 ++++++++++----------- .../Tango.LogViewer.UI/Tango.LogViewer.UI.csproj | 17 +- .../Tango.LogViewer.UI/ViewModels/MainViewVM.cs | 114 +++--- .../Utilities/Tango.LogViewer.UI/packages.config | 3 +- 10 files changed, 420 insertions(+), 362 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.Logging/LogFile.cs b/Software/Visual_Studio/Tango.Logging/LogFile.cs index 24a8a11f2..c86ec1792 100644 --- a/Software/Visual_Studio/Tango.Logging/LogFile.cs +++ b/Software/Visual_Studio/Tango.Logging/LogFile.cs @@ -8,14 +8,35 @@ namespace Tango.Logging { public class LogFile { + /// + /// Gets or sets the date time started Log file. + /// public DateTime DateTime { get; set; } + /// + /// Gets or sets the full path of file. + /// public String File { get; set; } + /// + /// Gets or sets the name of the file. + /// + public String FileName { get; set; } + + /// + /// Gets or sets a value indicating whether set of files + /// public bool PartOfSet { get; set; } + + /// + /// Gets or sets the start index of the set. + /// public int SetStartIndex { get; set; } + /// + /// Gets or sets the set count of set. + /// public int SetCount { get; set; } } } diff --git a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs index 504d79aeb..ee4fad4d4 100644 --- a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs +++ b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Analyzers/FlowAnalyser.cs @@ -33,7 +33,7 @@ namespace Tango.DispenserAnalyzer.UI.Analyzers if (index % 2 == 1)//testing Flow-error { - List filteredValues = rangeTestValues.Skip(4800).ToList(); + List filteredValues = rangeTestValues.Skip(5000).ToList(); // Move Average data List tasks = new List(); int calc_count = (int)filteredValues.Count() / 4; @@ -54,23 +54,23 @@ namespace Tango.DispenserAnalyzer.UI.Analyzers Task.WaitAll(tasks.ToArray()); //calculate difference Max Min values for each 250 values - var rangeItems = rangeTestValues.Select((x, i) => new { x, i }).GroupBy(p => (p.i / 250)).Select(x => x.Select(v => v.x).ToList()); + var rangeItems = filteredValues.Select((x, i) => new { x, i }).GroupBy(p => (p.i / 250)).Select(x => x.Select(v => v.x).ToList()); var differenceMaxMin = rangeItems.Select(x => x.Max(t => t.Pressure) - x.Min(t => t.Pressure)).ToList(); FlowAnalyzerResult result = new FlowAnalyzerResult(); - result.AverageValue = rangeTestValues.Average(t => t.Pressure); - result.MinValue = rangeTestValues.Min(t => t.Pressure); - result.MaxValue = rangeTestValues.Max(t => t.Pressure); - result.TotalValue = result.AverageValue == 0 ? 0 : (result.MaxValue - result.MinValue) * 100 / result.AverageValue; + result.AverageValue = filteredValues.Average(t => t.Pressure); + //result.MinValue = rangeTestValues.Min(t => t.Pressure); + //result.MaxValue = rangeTestValues.Max(t => t.Pressure); + //result.TotalValue = result.AverageValue == 0 ? 0 : (result.MaxValue - result.MinValue) * 100 / result.AverageValue; //local test - List filterTestValues = rangeTestValues.Skip(10000).Take(1000).ToList(); - result.FilterAverageValue = filterTestValues.Average(t => t.Pressure); - result.FilterMinValue = filterTestValues.Min(t => t.Pressure); - result.FilterMaxValue = filterTestValues.Max(t => t.Pressure); - result.FilterTotalValue = result.FilterAverageValue == 0 ? 0 : (result.FilterMaxValue - result.FilterMinValue) * 100 / result.FilterAverageValue; + //List filterTestValues = rangeTestValues.Skip(10000).Take(1000).ToList(); + //result.FilterAverageValue = filterTestValues.Average(t => t.Pressure); + //result.FilterMinValue = filterTestValues.Min(t => t.Pressure); + //result.FilterMaxValue = filterTestValues.Max(t => t.Pressure); + //result.FilterTotalValue = result.FilterAverageValue == 0 ? 0 : (result.FilterMaxValue - result.FilterMinValue) * 100 / result.FilterAverageValue; - result.Result = (result.FilterTotalValue <= 1.5 && result.TotalValue <= 3) ? AnalyzerResultValue.Passed : AnalyzerResultValue.Failed; + //result.Result = (result.FilterTotalValue <= 1.5 && result.TotalValue <= 3) ? AnalyzerResultValue.Passed : AnalyzerResultValue.Failed; result.SetLocalErrors(differenceMaxMin); results.Add(result); @@ -95,54 +95,55 @@ namespace Tango.DispenserAnalyzer.UI.Analyzers [Description("Average Value")] public double AverageValue { get; set; } - [Description("Max Value")] - public double MaxValue { get; set; } + //[Description("Max Value")] + //public double MaxValue { get; set; } - [Description("Min Value")] - public double MinValue { get; set; } + //[Description("Min Value")] + //public double MinValue { get; set; } - [Description("Total Value Peak to peak")] - public double TotalValue { get; set; } + //[Description("Total Value Peak to peak")] + //public double TotalValue { get; set; } - [Description("Local Average Value")] - public double FilterAverageValue { get; set; } + //[Description("Local Average Value")] + //public double FilterAverageValue { get; set; } - [Description("Local Max Value")] - public double FilterMaxValue { get; set; } + //[Description("Local Max Value")] + //public double FilterMaxValue { get; set; } - [Description("Local Min Value")] - public double FilterMinValue { get; set; } + //[Description("Local Min Value")] + //public double FilterMinValue { get; set; } - [Description("Local Total Value Peak to peak")] - public double FilterTotalValue { get; set; } + //[Description("Local Total Value Peak to peak")] + //public double FilterTotalValue { get; set; } [Description("Errors under 15")] public string LocalErrorsUnder15 { get; set; } - [Description("Errors under 20")] + [Description("Errors greater than or equal to 15 and less than 20")] public string LocalErrorsUnder20 { get; set; } - [Description("Errors under 25")] + [Description("Errors greater than or equal to 20 and less than 25")] public string LocalErrorsUnder25 { get; set; } - [Description("Errors under 30")] + [Description("Errors greater than or equal to 25 and less than 30")] public string LocalErrorsUnder30 { get; set; } public FlowAnalyzerResult() { - AverageValue = MaxValue = MinValue = TotalValue = FilterAverageValue = FilterMaxValue = FilterMinValue = FilterTotalValue = 0.0; + // AverageValue = MaxValue = MinValue = TotalValue = FilterAverageValue = FilterMaxValue = FilterMinValue = FilterTotalValue = 0.0; + AverageValue = 0.0; Result = AnalyzerResultValue.Undetermined; } public void SetLocalErrors(List differenceMaxMin) { - int count = differenceMaxMin.Where(x => x <= 15).Count(); + int count = differenceMaxMin.Where(x => x < 15).Count(); LocalErrorsUnder15 = (count > 10 ? "multiple" : count.ToString()); - count = differenceMaxMin.Where(x => x <= 20 && x > 15).Count(); + count = differenceMaxMin.Where(x => x < 20 && x >= 15).Count(); LocalErrorsUnder20 = (count > 10 ? "multiple" : count.ToString()); - count = differenceMaxMin.Where(x => x <= 25 && x > 20).Count(); + count = differenceMaxMin.Where(x => x < 25 && x >= 20).Count(); LocalErrorsUnder25 = (count > 10 ? "multiple" : count.ToString()); - count = differenceMaxMin.Where(x => x <= 30 && x > 25).Count(); + count = differenceMaxMin.Where(x => x< 30 && x >= 25).Count(); LocalErrorsUnder30 = (count > 10 ? "multiple" : count.ToString()); } } diff --git a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Tango.DispenserAnalyzer.UI.csproj b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Tango.DispenserAnalyzer.UI.csproj index 74ed4a4a5..9c37b8d10 100644 --- a/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Tango.DispenserAnalyzer.UI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/Tango.DispenserAnalyzer.UI.csproj @@ -20,7 +20,7 @@ true full false - bin\Debug\ + ..\..\Build\DispenserAnalyzer\Debug\ DEBUG;TRACE prompt 4 @@ -29,7 +29,7 @@ AnyCPU pdbonly true - bin\Release\ + ..\..\Build\DispenserAnalyzer\Release\ TRACE prompt 4 diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/App.config b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/App.config index f9370449f..bafe24888 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/App.config +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/App.config @@ -49,6 +49,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerFileParser/ApplicationLogViewerParser.cs b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerFileParser/ApplicationLogViewerParser.cs index 93d856b2e..1a43a7eff 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerFileParser/ApplicationLogViewerParser.cs +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerFileParser/ApplicationLogViewerParser.cs @@ -21,28 +21,33 @@ namespace Tango.LogViewer.UI.LogViewerFileParser String text = File.ReadAllText(file); var logs = Regex.Split(text, @"(\[\d{2}:\d{2}:\d{2}.\d{2}\])"); + String logText = String.Empty; + for (int i = 1; i < logs.Length; i += 2) { try { DateTime date = DateTime.ParseExact(logs[i].Replace("[", "").Replace("]", ""), "HH:mm:ss.ff", CultureInfo.InvariantCulture); - String rest = logs[i + 1]; - var entries = Regex.Split(rest, @"\[(.*?)\]"); + logText = logs[i + 1]; + var matches = Regex.Matches(logText, @"(?<=\[)(.*?)(?=\])"); MessageLogItem item = new MessageLogItem(); item.TimeStamp = new DateTime(datetime.Year, datetime.Month, datetime.Day, date.Hour, date.Minute, date.Second, date.Millisecond); - item.Category = (LogCategory)Enum.Parse(typeof(LogCategory), entries[1]); - item.CallerFile = entries[3]; - item.CallerMethodName = entries[5]; - item.CallerLineNumber = int.Parse(entries[7]); - item.Message = new String(entries[8].Skip(2).ToArray()); + item.Category = (LogCategory)Enum.Parse(typeof(LogCategory), matches[0].ToString()); + item.CallerFile = matches[1].ToString(); + item.CallerMethodName = matches[2].ToString(); + item.CallerLineNumber = int.Parse(matches[3].ToString()); + + int messageStartIndex = matches[3].Index + matches[3].Length + 2; + + item.Message = logText.Substring(messageStartIndex, logText.Length - messageStartIndex); logItems.Add(item); } catch (Exception ex) { - //LogManager.Default.Log(ex, "Could not parse log line: " + logs[i]); + LogManager.Default.Log(ex, "Could not parse log line: " + logText); } } } diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerManager.cs b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerManager.cs index 6c5a68d1a..e7be4797f 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerManager.cs +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/LogViewerManager.cs @@ -6,36 +6,43 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Logging; +using Tango.LogViewer.UI.LogViewerFileParser; namespace Tango.LogViewer.UI { public class LogViewerManager { - public static List LogFiles { get; set; } + private ILogViewerParser _parser; - static LogViewerManager() + public LogFile LogFile { get; set; } + + public string FileName { get; set; } + + public bool IsEmbeddedLog { get; set; } + + public int CountOfSet { get; set; } + + public LogViewerManager() { - LogFiles = new List(); + LogFile = null; ; } /// - /// Static member to create list of LogFiles by given path. + /// Create LogFile by given path. /// /// The file. - public static void InitLogFile(String file) + public void InitLogFile(String file) { - LogFiles.Clear(); - LogFiles = GetLogFiles(file); + LogFile = GetLogFile(file); } /// /// Gets set of log files by path. /// - public static List GetLogFiles(string filePath) + public LogFile GetLogFile(string filePath) { - List logFiles = new List(); if (!File.Exists(filePath)) - return logFiles; + return null; var directoryName = Path.GetDirectoryName(filePath); var logfileName = Path.GetFileNameWithoutExtension(filePath); @@ -51,33 +58,72 @@ namespace Tango.LogViewer.UI logfileName = logfileName.Substring(0, indexPos); } - HashSet dateStrings = new HashSet(); - foreach (var file in Directory.GetFiles(directoryName, "*.log").Where(x => (Path.GetFileName(x).StartsWith(logfileName)))) + try { - try + String dateString = System.IO.Path.GetFileNameWithoutExtension(filePath).Replace($"{fileName}-", ""); + indexPos = dateString.IndexOf(FileLogger.FILE_SET_EXTENSION); + int indexOfFile = 0; + CountOfSet = 0; + if (indexPos > 0) { - String dateString = System.IO.Path.GetFileNameWithoutExtension(file).Replace($"{fileName}-", ""); - indexPos = dateString.IndexOf(FileLogger.FILE_SET_EXTENSION); - int indexOfFile = 0; - if (indexPos > 0) - { - string fileNameIndex = dateString.Substring(indexPos + FileLogger.FILE_SET_EXTENSION.Length); - int.TryParse(fileNameIndex, out indexOfFile); - dateString = dateString.Substring(0, indexPos); - } - if (!dateStrings.Contains(dateString)) - { - dateStrings.Add(dateString); - DateTime date = DateTime.ParseExact(dateString, "dd-MM-yyyy_HH-mm-ss", CultureInfo.InvariantCulture); - logFiles.Add(new LogFile() { DateTime = date, File = file, PartOfSet = indexOfFile > 0, }); - } + string fileNameIndex = dateString.Substring(indexPos + FileLogger.FILE_SET_EXTENSION.Length); + string[] fileEntries = Directory.GetFiles(directoryName, $"{logfileName}*{Path.GetExtension(filePath)}").Where(x => Path.GetFileName(x).StartsWith(logfileName)).OrderBy(x => x).ToArray(); + CountOfSet = fileEntries.Length; + int.TryParse(fileNameIndex, out indexOfFile); + dateString = dateString.Substring(0, indexPos); } - catch (Exception ex) - { + DateTime date = DateTime.ParseExact(dateString, "dd-MM-yyyy_HH-mm-ss", CultureInfo.InvariantCulture); + return (new LogFile() { DateTime = date, File = filePath, FileName= logfileName, PartOfSet = indexOfFile > 0, SetStartIndex = indexOfFile, SetCount = CountOfSet }); + } + catch (Exception ex) + { + + } + + return null; + } + + /// + /// Parses the this LogFile. + /// + public List Parse() + { + IsEmbeddedLog = false; + FileName = ""; + List logItems = new List(); + if (LogFile == null) + return logItems; + + FileName = LogFile.FileName; + + IsEmbeddedLog = FileName.StartsWith("Embedded"); + if (IsEmbeddedLog) + { + _parser = new EmbeddedLogViewerParser(); + } + else + { + _parser = new ApplicationLogViewerParser(); + } + if (LogFile.PartOfSet) + { + string extension = Path.GetExtension(LogFile.File); + var directoryName = Path.GetDirectoryName(LogFile.File); + + string[] fileEntries = Directory.GetFiles(directoryName, $"{FileName}*{extension}").Where(x => Path.GetFileName(x).StartsWith(FileName)).OrderBy(x => x).ToArray(); + + foreach (var file in fileEntries) + { + _parser.Parse(file, LogFile.DateTime, ref logItems); } } - return logFiles; + else + { + _parser.Parse(LogFile.File, LogFile.DateTime, ref logItems); + } + + return logItems; } } } diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/MainWindow.xaml index d1492c513..a46f404fb 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/MainWindow.xaml @@ -14,6 +14,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,17 +184,22 @@ + Start Time: - + + + End Time: - + + + - + @@ -52,7 +210,7 @@ - + @@ -61,9 +219,10 @@ - - + + + @@ -77,112 +236,18 @@ - Log - Message - - - - - - - - + Log + + Message + + + + + + - - - - - - - - - - - + @@ -201,106 +266,15 @@ - - - - - - - - + + + + + + - - - - - - - - - - - + @@ -320,10 +294,23 @@ - - + + + + + + - + @@ -342,8 +329,8 @@ - - + + diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/Tango.LogViewer.UI.csproj b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/Tango.LogViewer.UI.csproj index 76be4e85e..66f8549a5 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/Tango.LogViewer.UI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/Tango.LogViewer.UI.csproj @@ -20,7 +20,7 @@ true full false - ..\..\Build\Utilities\Debug\ + ..\..\Build\LogViewer\Debug\ DEBUG;TRACE prompt 4 @@ -29,17 +29,20 @@ AnyCPU pdbonly true - ..\..\Build\Utilities\Release\ + ..\..\Build\LogViewer\Release\ TRACE prompt 4 + + ..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll + ..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll - - ..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll + + ..\..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll ..\..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll @@ -53,7 +56,7 @@ - ..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll + ..\..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll @@ -119,10 +122,6 @@ - - {116DFDB0-7681-46FE-8BAD-FE8AE09BB076} - Tango.MachineStudio.UI - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/ViewModels/MainViewVM.cs index cb4a8d49e..11d62a8ab 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/ViewModels/MainViewVM.cs @@ -14,12 +14,14 @@ using System.Windows.Data; using System.Diagnostics; using System.IO; using Tango.LogViewer.UI.LogViewerFileParser; +using System.Globalization; namespace Tango.LogViewer.UI.ViewModels { public class MainViewVM: ViewModel { - private ILogViewerParser _parser; + + private LogViewerManager _logViewerManager; #region Properties public SelectedObjectCollection SelectedLogCategories { get; set; } @@ -133,12 +135,29 @@ namespace Tango.LogViewer.UI.ViewModels public bool IsEmbeddedLog { get { return _isEmbeddedLog; } - set { _isEmbeddedLog = value; - RaisePropertyChangedAuto(); - } + set { _isEmbeddedLog = value; RaisePropertyChangedAuto(); } } - + private bool _isSet; + /// + /// Gets or sets a value indicating whether set of files. + /// + public bool IsSet + { + get { return _isSet; } + set { _isSet = value; RaisePropertyChangedAuto(); } + } + + private bool _loading; + + public bool Loading + { + get { return _loading; } + set { _loading = value; RaisePropertyChangedAuto(); } + } + + public CultureInfo Culture { get; set; } + #endregion public RelayCommand OpeFileLogCommand { get; set; } @@ -146,6 +165,8 @@ namespace Tango.LogViewer.UI.ViewModels #region Constructors public MainViewVM() { + Culture = new CultureInfo("he-IL"); + SelectedLogCategories = new SelectedObjectCollection(new ObservableCollection() { LogCategory.Info, @@ -161,8 +182,11 @@ namespace Tango.LogViewer.UI.ViewModels LogCategory.Critical, LogCategory.Debug, }); + _logViewerManager = new LogViewerManager(); + IsSet = false; IsEmbeddedLog = false; - ClearFilters(); + Loading = false; + Clear(); OpeFileLogCommand = new RelayCommand(OpenLogFile); SelectedLogCategories.SynchedSource.CollectionChanged += (_, __) => { @@ -175,15 +199,22 @@ namespace Tango.LogViewer.UI.ViewModels /// /// Clears the all filters. Set filter properties to init state. /// - private void ClearFilters() + private void Clear() { - FileName = "FileName"; + FileName = ""; StartSelectedTime = TimeSpan.Zero; EndSelectedTime = TimeSpan.Zero; Filter = ""; SelectedLog = null; SelectedLogCategories.SynchedSource= SelectedLogCategories.Source; CountOfSet = 0; + IsSet = false; + if (Logs != null) + { + Logs.Clear(); + RaisePropertyChanged("Logs"); + } + } /// @@ -210,67 +241,26 @@ namespace Tango.LogViewer.UI.ViewModels /// public async void LoadLogFile(String fileName) { - ClearFilters(); - LogViewerManager.InitLogFile(fileName); + Clear(); + Loading = true; + _logViewerManager.InitLogFile(fileName); List logs = new List(); await Task.Factory.StartNew(() => - { - foreach (var logFile in LogViewerManager.LogFiles) - { - logs.AddRange(Parse(logFile)); - } - }); + { + logs.AddRange(_logViewerManager.Parse()); + }); + + CountOfSet = _logViewerManager.CountOfSet; + IsSet = CountOfSet > 0 ? true : false; + IsEmbeddedLog = _logViewerManager.IsEmbeddedLog; + FileName = _logViewerManager.FileName; Logs = new ObservableCollection(logs); LogsViewSource = CollectionViewSource.GetDefaultView(Logs); ApplyLogsFilter(); + Loading = false; } - /// - /// Parses the specified log file. - /// - public List Parse(LogFile logFile) - { - List logItems = new List(); - List logFiles = new List(); - string fileName = Path.GetFileNameWithoutExtension(logFile.File); - FileName = fileName; - IsEmbeddedLog = fileName.StartsWith("Embedded"); - if (IsEmbeddedLog) - { - _parser = new EmbeddedLogViewerParser(); - } - else - { - _parser = new ApplicationLogViewerParser(); - } - - if (logFile.PartOfSet) - { - string extension = Path.GetExtension(logFile.File); - var directoryName = Path.GetDirectoryName(logFile.File); - int indexPos = fileName.IndexOf(FileLogger.FILE_SET_EXTENSION); - if (indexPos > 0) - { - fileName = fileName.Substring(0, indexPos); - FileName = fileName; - } - string folder = logFile.File; - string[] fileEntries = Directory.GetFiles(directoryName, $"{fileName}*{extension}").Where(x => Path.GetFileName(x).StartsWith(fileName)).OrderBy(x => x).ToArray(); - CountOfSet = fileEntries.Length; - foreach (var file in fileEntries) - { - _parser.Parse(file, logFile.DateTime, ref logItems); - } - } - else - { - CountOfSet = 1; - _parser.Parse(logFile.File, logFile.DateTime, ref logItems); - } - - return logItems; - } - + #endregion #region Filtering diff --git a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/packages.config b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/packages.config index 224f74b3a..0ac4ca4b4 100644 --- a/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/packages.config +++ b/Software/Visual_Studio/Utilities/Tango.LogViewer.UI/packages.config @@ -1,7 +1,8 @@  + - + \ No newline at end of file -- cgit v1.3.1