aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-19 14:48:11 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-19 14:48:11 +0300
commitc4feba445987d33c7bfcc304a3be368e8458d408 (patch)
tree0be608bb86ddd4a8369501f49b74de8178bacc65 /Software/Visual_Studio/MachineStudio/Modules
parent24a77fd5e03c81c6b0e901da02bce4bdccd4c71c (diff)
downloadTango-c4feba445987d33c7bfcc304a3be368e8458d408.tar.gz
Tango-c4feba445987d33c7bfcc304a3be368e8458d408.zip
Some log improvements in TransporterBase.
Added dynamic display/hide debug logs on logging module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs29
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml10
2 files changed, 21 insertions, 18 deletions
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;
+ /// <summary>
+ /// Gets or sets a value indicating whether display debug logs.
+ /// </summary>
+ 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<LogDetailsViewVM, ApplicationLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) =>
+ _notification.ShowModalDialog<LogDetailsViewVM, ApplicationLogDetailsView>(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 @@
</StackPanel>
</Button>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="30 0 0 0">
- <materialDesign:PackIcon Kind="Magnify" Width="24" Height="24" />
- <TextBox VerticalAlignment="Center" Margin="10 0 0 0" Width="200" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding RealTimePaused}" materialDesign:HintAssist.Hint="Filter" />
- </StackPanel>
+ <CheckBox VerticalAlignment="Center" Margin="20 0 0 0" IsChecked="{Binding DisplayDebug}" ToolTip="Hide/Display debug logs (applies only when debug logs are enabled in the settings file)">Process Debug Logs</CheckBox>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 30 0">
+ <materialDesign:PackIcon Kind="Magnify" Width="24" Height="24" />
+ <TextBox VerticalAlignment="Center" Margin="10 0 0 0" Width="300" Text="{Binding Filter,UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding RealTimePaused}" materialDesign:HintAssist.Hint="Filter" />
</StackPanel>
</Grid>
</Border>