diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-03-17 17:13:19 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-03-17 17:13:19 +0200 |
| commit | e22c6c134455f7b2423215f7d7c6a0e707c65c7c (patch) | |
| tree | 4e07f516a679965defe7b7178b579d8b3e33c7dd /Software/Visual_Studio/FSE | |
| parent | cb872d2cbcc20fe456b4e2ca8633c803bd104de7 (diff) | |
| parent | ad89c52f42dd38dcdc332d2e1059b49858e0b9dd (diff) | |
| download | Tango-e22c6c134455f7b2423215f7d7c6a0e707c65c7c.tar.gz Tango-e22c6c134455f7b2423215f7d7c6a0e707c65c7c.zip | |
Merged Buzzer Branch To Software !!!
Diffstat (limited to 'Software/Visual_Studio/FSE')
3 files changed, 52 insertions, 37 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/ViewModels/LayoutViewVM.cs index 19d5598e0..52025b63f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/ViewModels/LayoutViewVM.cs @@ -265,6 +265,8 @@ namespace Tango.FSE.LogViewer.UI.ViewModels private bool FilterLogs(object obj) { + bool includeLog = false; + LogItemBase log = obj as LogItemBase; if (String.IsNullOrWhiteSpace(Filter)) return true; @@ -274,28 +276,33 @@ namespace Tango.FSE.LogViewer.UI.ViewModels if (keywords.Any(x => log.Category.ToString().ToLower() == x.ToLower())) { - return true; + includeLog = true; } } else { if (log.Category.ToString().ToLower() == Filter.ToLower()) { - return true; + includeLog = true; } } if (log.TimeStamp.ToString("HH:mm:ss").Contains(Filter)) { - return true; + includeLog = true; + } + + if (log.ClassName.ToLower() == Filter.ToLower()) + { + includeLog = true; } if (log.Message.ToLower().Contains(Filter.ToLower())) { - return true; + includeLog = true; } - return false; + return includeLog; } private void OnApplicationReady(List<string> args) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LayoutView.xaml index b86b40878..3df2bff4c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LayoutView.xaml @@ -73,7 +73,7 @@ </TextBlock> </DockPanel> </Grid.ToolTip> - <TextBox Padding="5 0 30 0" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged,Delay=300}" Width="{Binding ElementName=borderMessage,Path=ActualWidth}" Style="{StaticResource FSE_Rounded_Corners_TextBox}"></TextBox> + <TextBox Padding="5 0 30 0" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged,Delay=300}" Width="{Binding ElementName=borderMessage,Path=ActualWidth}" Style="{StaticResource FSE_Rounded_Corners_TextBox}" ToolTip="Filter by message or Timestamp like 12:30, 12:30:33, 12:00-12:30, or Service name."></TextBox> <material:PackIcon Kind="Search" HorizontalAlignment="Right" Width="25" Height="25" Opacity="0.5" VerticalAlignment="Center" Margin="0 0 5 0" /> </Grid> </Grid> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/LogViewerPaneVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/LogViewerPaneVM.cs index 1ceda060f..502d07d65 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/LogViewerPaneVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/LogViewerPaneVM.cs @@ -175,9 +175,9 @@ namespace Tango.FSE.UI.Panes ApplicationLogsView = CollectionViewSource.GetDefaultView(ApplicationLogs); FirmwareLogsView = CollectionViewSource.GetDefaultView(FirmwareLogs); - FSELogsView.Filter = FilterFSELogs; - ApplicationLogsView.Filter = FilterApplicationLogs; - FirmwareLogsView.Filter = FilterFirmwareLogs; + FSELogsView.Filter = (log) => FilterLogsFunc(log as LogItemBase, FSELogsFilter); + ApplicationLogsView.Filter = (log) => FilterLogsFunc(log as LogItemBase, ApplicationLogsFilter); + FirmwareLogsView.Filter = (log) => FilterLogsFunc(log as LogItemBase, FirmwareLogsFilter); SelectedFSELogsCategories = new SelectedObjectCollection<LogCategory>(new ObservableCollection<LogCategory>() { @@ -284,39 +284,47 @@ namespace Tango.FSE.UI.Panes await NotificationProvider.ShowDialog(new FirmwareLogItemViewVM() { LogItem = logItem }); } - private bool FilterFSELogs(object obj) + private bool FilterLogsFunc(LogItemBase log, String filter) { - var log = obj as LogItemBase; - if (log != null) { - return SelectedFSELogsCategories.SynchedSource.Contains(log.Category) && (String.IsNullOrWhiteSpace(FSELogsFilter) || log.Message.ToStringOrEmpty().ToLower().Contains(FSELogsFilter.ToStringOrEmpty().ToLower())); - } - else - { - return false; - } - } + bool includeLog = false; - private bool FilterApplicationLogs(object obj) - { - var log = obj as LogItemBase; - if (log != null) - { - return SelectedApplicationLogsCategories.SynchedSource.Contains(log.Category) && (String.IsNullOrWhiteSpace(ApplicationLogsFilter) || log.Message.ToStringOrEmpty().ToLower().Contains(ApplicationLogsFilter.ToStringOrEmpty().ToLower())); - } - else - { - return false; - } - } + if (String.IsNullOrWhiteSpace(filter)) return true; - private bool FilterFirmwareLogs(object obj) - { - var log = obj as EmbeddedLogItem; - if (log != null) - { - return SelectedFirmwareLogsCategories.SynchedSource.Contains(log.Category) && (String.IsNullOrWhiteSpace(FirmwareLogsFilter) || log.Message.ToStringOrEmpty().ToLower().Contains(FirmwareLogsFilter.ToStringOrEmpty().ToLower())); + if (filter.Contains("|")) + { + List<String> keywords = filter.Split('|').ToList(); + + if (keywords.Any(x => log.Category.ToString().ToLower() == x.ToLower())) + { + includeLog = true; + } + } + else + { + if (log.Category.ToString().ToLower() == filter.ToLower()) + { + includeLog = true; + } + } + + if (log.TimeStamp.ToString("HH:mm:ss").Contains(filter)) + { + includeLog = true; + } + + if (log.ClassName.ToLower() == filter.ToLower()) + { + includeLog = true; + } + + if (log.Message.ToLower().Contains(filter.ToLower())) + { + includeLog = true; + } + + return includeLog; } else { |
