aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-07-23 11:37:09 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-07-23 11:37:09 +0300
commit8a84d33ab8d8a44b1036bb8c5707858d7a25b123 (patch)
tree26658a7d67adade1389a4d71ded4d9a56c0e7e04 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging
parent81dd84b2749ee06fa592ac64075c0d8195972aa5 (diff)
parent87444d2a16e63e9b992c25a9e9fbaf3bb5b91025 (diff)
downloadTango-8a84d33ab8d8a44b1036bb8c5707858d7a25b123.tar.gz
Tango-8a84d33ab8d8a44b1036bb8c5707858d7a25b123.zip
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Navigation/LoggingNavigationView.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs65
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EventsViewVM.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/TimelineEventGroup.cs7
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml39
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml.cs11
13 files changed, 152 insertions, 33 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Navigation/LoggingNavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Navigation/LoggingNavigationView.cs
index e8a14cc3d..bd8b63773 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Navigation/LoggingNavigationView.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Navigation/LoggingNavigationView.cs
@@ -10,7 +10,7 @@ namespace Tango.MachineStudio.Logging.Navigation
{
HomeView,
EventsView,
- TimelineView,
+ TimelineWrapperView,
ApplicationLogsView,
EmbeddedLogsView,
}
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 2b12b1670..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
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Data;
using Tango.Core.Commands;
using Tango.Logging;
using Tango.MachineStudio.Common.Notifications;
@@ -19,6 +21,8 @@ namespace Tango.MachineStudio.Logging.ViewModels
private ApplicationLogFileParser _parser;
private List<LogFile> _logFiles;
private INotificationProvider _notification;
+ private bool _dialog_shown;
+ private bool _is_debug;
private ControlledObservableCollection<LogItemBase> _realTimeLogs;
private List<LogItemBase> _pausedLogs;
@@ -30,6 +34,39 @@ namespace Tango.MachineStudio.Logging.ViewModels
set { _logs = value; RaisePropertyChangedAuto(); }
}
+ private ICollectionView _logsViewSource;
+ public ICollectionView LogsViewSource
+ {
+ get { return _logsViewSource; }
+ set { _logsViewSource = value; RaisePropertyChangedAuto(); }
+ }
+
+ private String _filter;
+ public String Filter
+ {
+ get { return _filter; }
+ set
+ {
+ _filter = value;
+ RaisePropertyChangedAuto();
+
+ if (RealTimePaused)
+ {
+ LogsViewSource.Refresh();
+ }
+ }
+ }
+
+ 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
{
@@ -84,9 +121,19 @@ namespace Tango.MachineStudio.Logging.ViewModels
if (!_realTimePaused)
{
+ LogsViewSource.Filter = null;
_realTimeLogs.InsertRange(0, _pausedLogs);
_pausedLogs.Clear();
}
+ else
+ {
+ LogsViewSource.Filter = (x) =>
+ {
+ if (String.IsNullOrWhiteSpace(Filter)) return true;
+ LogItemBase log = x as LogItemBase;
+ return log.Message.ToLower().Contains(Filter.ToLower());
+ };
+ }
}
}
@@ -126,10 +173,14 @@ namespace Tango.MachineStudio.Logging.ViewModels
ToggleRealTimePaused = new RelayCommand(() => RealTimePaused = !RealTimePaused);
ClearRealTimeLogsCommand = new RelayCommand(() => { _realTimeLogs.Clear(); });
+
+ _is_debug = LogManager.Categories.Contains(LogCategory.Debug);
}
private void LogManager_NewLog(object sender, LogItemBase log)
{
+ if (log.Category == LogCategory.Debug && !DisplayDebug) return;
+
if (!RealTimePaused)
{
InvokeUI(() =>
@@ -166,14 +217,22 @@ namespace Tango.MachineStudio.Logging.ViewModels
Logs = new ControlledObservableCollection<LogItemBase>(logs);
}
+
+ LogsViewSource = CollectionViewSource.GetDefaultView(Logs);
}
private void OnSelectedLogChanged()
{
- if (SelectedLog != null)
+ if (SelectedLog != null && !_dialog_shown)
{
- _notification.ShowModalDialog<LogDetailsViewVM, ApplicationLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) => { }, () => { });
- SelectedLog = null;
+ _dialog_shown = true;
+ _notification.ShowModalDialog<LogDetailsViewVM, ApplicationLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) =>
+ {
+
+ }, () =>
+ {
+ _dialog_shown = false;
+ });
}
}
}
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 1895dd230..3f6775b75 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
@@ -21,6 +21,7 @@ namespace Tango.MachineStudio.Logging.ViewModels
private EmbeddedLogFileParser _parser;
private List<LogFile> _logFiles;
private INotificationProvider _notification;
+ private bool _dialog_shown;
private ControlledObservableCollection<LogItemBase> _realTimeLogs;
private List<LogItemBase> _pausedLogs;
@@ -172,10 +173,16 @@ namespace Tango.MachineStudio.Logging.ViewModels
private void OnSelectedLogChanged()
{
- if (SelectedLog != null)
+ if (SelectedLog != null && !_dialog_shown)
{
- _notification.ShowModalDialog<LogDetailsViewVM, EmbeddedLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) => { }, () => { });
- SelectedLog = null;
+ _dialog_shown = true;
+ _notification.ShowModalDialog<LogDetailsViewVM, EmbeddedLogDetailsView>(new LogDetailsViewVM(SelectedLog), (x) =>
+ {
+
+ }, () =>
+ {
+ _dialog_shown = false;
+ });
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EventsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EventsViewVM.cs
index 98fcf12db..50caced63 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EventsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EventsViewVM.cs
@@ -25,6 +25,7 @@ namespace Tango.MachineStudio.Logging.ViewModels
private ObservableCollection<MachinesEvent> _realTimeEvents;
private Machine _connectedMachine;
private LoggingNavigationManager _navigation;
+ private bool _dialog_shown;
private Machine _selectedMachine;
public Machine SelectedMachine
@@ -178,10 +179,16 @@ namespace Tango.MachineStudio.Logging.ViewModels
private void OnSelectedEventChanged()
{
- if (SelectedEvent != null && SelectedEvent.Type != BL.Enumerations.EventTypes.ApplicationStarted)
+ if (SelectedEvent != null && SelectedEvent.Type != BL.Enumerations.EventTypes.ApplicationStarted && !_dialog_shown)
{
- _notification.ShowModalDialog<EventDetailsViewVM, EventDetailsView>(new EventDetailsViewVM(SelectedEvent), (x) => { }, () => { });
- SelectedEvent = null;
+ _dialog_shown = true;
+ _notification.ShowModalDialog<EventDetailsViewVM, EventDetailsView>(new EventDetailsViewVM(SelectedEvent), (x) =>
+ {
+
+ }, () =>
+ {
+ _dialog_shown = false;
+ });
}
}
@@ -192,7 +199,7 @@ namespace Tango.MachineStudio.Logging.ViewModels
TimelineViewVM.Initialize(events.ToList());
- _navigation.NavigateTo(LoggingNavigationView.TimelineView);
+ _navigation.NavigateTo(LoggingNavigationView.TimelineWrapperView);
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/TimelineEventGroup.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/TimelineEventGroup.cs
index 978348fd2..6a86f38e6 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/TimelineEventGroup.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/TimelineEventGroup.cs
@@ -13,6 +13,13 @@ namespace Tango.MachineStudio.Logging.ViewModels
{
public String Name { get; set; }
+ private double _height;
+ public double Height
+ {
+ get { return _height; }
+ set { _height = value; RaisePropertyChangedAuto(); }
+ }
+
public ObservableCollection<MachinesEvent> Events { get; set; }
public TimelineEventGroup()
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 3ca10f370..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
@@ -99,6 +99,13 @@
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">CLEAR</TextBlock>
</StackPanel>
</Button>
+
+ <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>
@@ -113,7 +120,7 @@
<Grid>
<Grid>
<Grid>
- <DataGrid Background="Transparent" AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
+ <DataGrid x:Name="grid" Background="Transparent" RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="LowQuality" MaxWidth="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth}" AutoGenerateColumns="False" SelectionMode="Single" SelectedCellsChanged="grid_SelectedCellsChanged" ItemsSource="{Binding LogsViewSource}" SelectedItem="{Binding SelectedLog}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Style.Triggers>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml.cs
index 6cdf6ea53..234fdfeab 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml.cs
@@ -24,5 +24,15 @@ namespace Tango.MachineStudio.Logging.Views
{
InitializeComponent();
}
+
+ private void DataGrid_Selected(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void grid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
+ {
+ grid.SelectedIndex = -1;
+ }
}
}
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 ba6330f77..4573c8451 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
@@ -113,7 +113,7 @@
<Grid>
<Grid>
<Grid>
- <DataGrid Background="Transparent" AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
+ <DataGrid x:Name="grid" SelectedCellsChanged="grid_SelectedCellsChanged" Background="Transparent" AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding Logs}" SelectedItem="{Binding SelectedLog}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Style.Triggers>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml.cs
index a728650cd..bc897cc82 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml.cs
@@ -24,5 +24,10 @@ namespace Tango.MachineStudio.Logging.Views
{
InitializeComponent();
}
+
+ private void grid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
+ {
+ grid.SelectedIndex = -1;
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml
index 9fe9e084e..196b6f930 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml
@@ -121,7 +121,7 @@
<Grid>
<Grid>
<Grid>
- <DataGrid Background="Transparent" AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding Events}" SelectedItem="{Binding SelectedEvent}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
+ <DataGrid x:Name="grid" SelectedCellsChanged="grid_SelectedCellsChanged" Background="Transparent" AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding Events}" SelectedItem="{Binding SelectedEvent}" RowHeight="40" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="True" IsReadOnly="True">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Style.Triggers>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml.cs
index b17eea54c..83710f1c9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml.cs
@@ -24,5 +24,10 @@ namespace Tango.MachineStudio.Logging.Views
{
InitializeComponent();
}
+
+ private void grid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
+ {
+ grid.SelectedIndex = -1;
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
index 1046fa4e8..664f2489c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml
@@ -68,23 +68,24 @@
</Grid>
- <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Grid.Column="0" Grid.Row="1" Margin="0 0 0 0" Background="#FCFCFC" Height="{Binding ElementName=scrollViewer,Path=ViewportHeight}" VerticalAlignment="Top">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="1" />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate DataType="{x:Type vm:TimelineEventGroup}">
- <Border BorderThickness="1 0.5 1 0.5" BorderBrush="{StaticResource AccentColorBrush}" Margin="2 0 0 0" Padding="5">
+ <ScrollViewer x:Name="scroll_channels" Grid.Column="0" Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
+ <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Margin="0 0 0 0" Background="#FCFCFC" VerticalAlignment="Top">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate DataType="{x:Type vm:TimelineEventGroup}">
+ <Border BorderThickness="1 0.5 1 0.5" BorderBrush="{StaticResource AccentColorBrush}" Margin="2 0 0 0" Padding="5" Height="{Binding Height,Mode=OneWay}">
+ <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" TextWrapping="Wrap" TextAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource AccentColorBrush}"></TextBlock>
+ </Border>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </ScrollViewer>
- <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" TextWrapping="Wrap" TextAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource AccentColorBrush}"></TextBlock>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- <localControls:TimelineScrollViewer x:Name="scrollViewer" Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
+ <localControls:TimelineScrollViewer x:Name="scrollViewer" Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" ScrollChanged="scrollViewer_ScrollChanged">
<Grid HorizontalAlignment="Left">
<ItemsControl ItemsSource="{Binding TimelineEventGroups}" HorizontalAlignment="Left" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=localControls:TimelineScrollViewer},Path=ActualWidth}">
<ItemsControl.Width>
@@ -101,15 +102,15 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:TimelineEventGroup}">
<Border BorderThickness="0 0 0 1" BorderBrush="#98DEFF" Margin="0 0 0 0">
- <ItemsControl ItemsSource="{Binding Events}">
+ <ItemsControl ItemsSource="{Binding Events}" SizeChanged="ItemsControl_SizeChanged">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
- <UniformGrid IsItemsHost="True" Columns="1"></UniformGrid>
+ <StackPanel IsItemsHost="True"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type entities:MachinesEvent}">
- <Canvas Margin="0 5 0 5" MinHeight="20">
+ <Canvas Margin="0 0 0 0" MinHeight="20">
<Grid Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualHeight}">
<Canvas.Left>
<MultiBinding Converter="{StaticResource MachineEventToXConverter}">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml.cs
index e1c09e49f..8004ef154 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml.cs
@@ -40,5 +40,16 @@ namespace Tango.MachineStudio.Logging.Views
_vm.TimelineScaleFactor -= 0.5;
}
}
+
+ private void ItemsControl_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ TimelineEventGroup group = (sender as FrameworkElement).DataContext as TimelineEventGroup;
+ group.Height = e.NewSize.Height;
+ }
+
+ private void scrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
+ {
+ scroll_channels.ScrollToVerticalOffset(e.VerticalOffset);
+ }
}
}