diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-02-27 16:03:06 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-02-27 16:03:06 +0200 |
| commit | c9ba7c0b806818cdcbcd10fb03805a61608b4233 (patch) | |
| tree | 46c781852752ee4bb6aa453109970d1803c1fe14 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics | |
| parent | 228dca3384369f23d6dcad6a696cf491ab9d8840 (diff) | |
| download | Tango-c9ba7c0b806818cdcbcd10fb03805a61608b4233.tar.gz Tango-c9ba7c0b806818cdcbcd10fb03805a61608b4233.zip | |
Liquid quantities implementation in xaml.
Related Work Items: #2509
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics')
6 files changed, 181 insertions, 79 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/DateIsInListToBooleanConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/DateIsInListToBooleanConverter.cs deleted file mode 100644 index 74e0c61d8..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/DateIsInListToBooleanConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; - -namespace Tango.MachineStudio.Statistics.Converters -{ - public class DateIsInListToBooleanConverter : IMultiValueConverter - { - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - if (values.Length < 2 || !(values[0] is DateTime) || !(values[1] is IEnumerable<DateTime>)) - return false; - - var date = (DateTime)values[0]; - var dateList = (IEnumerable<DateTime>)values[1]; - - return dateList.ToList().Exists(x => x.ToLocalTime().ToShortDateString() == date.ToLocalTime().ToShortDateString()); - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/MidTankLevelToElementHeightConverter.cs new file mode 100644 index 000000000..e9f513cc3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/MidTankLevelToElementHeightConverter.cs @@ -0,0 +1,41 @@ +using System; +using System.Globalization; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Statistics.Converters +{ + public class MidTankLevelToElementHeightConverter : IMultiValueConverter + { + public const double MAX_QUANTITY = 130000000; + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double parentActualHeight; + Double.TryParse(values[0].ToString(), out parentActualHeight); + double quantity; + Double.TryParse(values[1].ToString(), out quantity); + + double midTankLevel = (double)Math.Min(quantity, MAX_QUANTITY); + double delta = ((midTankLevel / MAX_QUANTITY) * parentActualHeight); + if (midTankLevel < (MAX_QUANTITY/10))// if quantity < 10|% set 2 pixel + delta = 2.0; + var test = delta; + return test;// (parentActualHeight - (midTankLevel / MAX_QUANTITY) * parentActualHeight); + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/StringToFirstLetterConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/StringToFirstLetterConverter.cs new file mode 100644 index 000000000..a1c9561b9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/StringToFirstLetterConverter.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Statistics.Converters +{ + public class StringToFirstLetterConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && value.ToString().Length > 1) + { + return value.ToString().First().ToString(); + } + else + { + return value; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj index fa62578a1..603429f94 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Tango.MachineStudio.Statistics.csproj @@ -75,8 +75,9 @@ <ItemGroup> <Compile Include="Converters\CollectionConverter .cs" /> <Compile Include="Converters\LiquidTypeToColorConverter.cs" /> + <Compile Include="Converters\MidTankLevelToElementHeightConverter.cs" /> <Compile Include="Converters\StringToBoolYesNoNullConverter.cs" /> - <Compile Include="Converters\DateIsInListToBooleanConverter.cs" /> + <Compile Include="Converters\StringToFirstLetterConverter.cs" /> <Compile Include="Models\JobRunModel.cs" /> <Compile Include="Models\JobRunStatisticsModel.cs" /> <Compile Include="Models\LabeledSeriesCollection.cs" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs index cf74071c9..07e431751 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs @@ -25,11 +25,14 @@ namespace Tango.MachineStudio.Statistics.ViewModels private List<Machine> _allMachines; private List<User> _allUsers; private List<RmlModel> _rmlsModels; - private List<JobRun> _allJobRuns; + private List<Job> _allJobRuns; #region Properties private ObservableCollection<JobRunModel> _jobRuns; + /// <summary> + /// Gets or sets the job runs. Contains filtered data of JobRunModel. + /// </summary> public ObservableCollection<JobRunModel> JobRuns { get { return _jobRuns; } @@ -41,6 +44,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private JobRunModel _selectedJobRun = null; + /// <summary> + /// Gets or sets the JobRunModel. Binding to selected item of grid items. + /// </summary> public JobRunModel SelectedJobRun { get { return _selectedJobRun; } @@ -52,6 +58,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private SelectedObjectCollection<Machine> _selectedMachines; + /// <summary> + /// Gets or sets the selected machines. Contains all available machines and selected machines. Binding to ComboBox Machines. + /// </summary> public SelectedObjectCollection<Machine> SelectedMachines { get { return _selectedMachines; } @@ -63,6 +72,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private DateTime _startSelectedDate; + /// <summary> + /// Gets or sets the start selected date. + /// </summary> public DateTime StartSelectedDate { get { return _startSelectedDate; } @@ -70,6 +82,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private DateTime _endSelectedDate; + /// <summary> + /// Gets or sets the end selected date. + /// </summary> public DateTime EndSelectedDate { get { return _endSelectedDate; } @@ -77,6 +92,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } protected Double _lengthLowerValue; + /// <summary> + /// Gets or sets the length lower value of Range Slider + /// </summary> public Double LengthLowerValue { get { return _lengthLowerValue; } @@ -88,6 +106,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } protected Double _lengthUpperValue; + /// <summary> + /// Gets or sets the length upper value of Range Slider. + /// </summary> public Double LengthUpperValue { get { return _lengthUpperValue; } @@ -99,6 +120,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private SelectedObjectCollection<JobSource> _jobRunSelectedSources; + /// <summary> + /// Gets or sets the job run selected sources. Binding to ComboBox "Source". + /// </summary> public SelectedObjectCollection<JobSource> JobRunSelectedSources { get { return _jobRunSelectedSources; } @@ -106,6 +130,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private SelectedObjectCollection<JobRunStatus> _jobRunSelectedStatuses; + /// <summary> + /// Gets or sets the job run selected statuses. Binding to ComboBox "Status". + /// </summary> public SelectedObjectCollection<JobRunStatus> JobRunSelectedStatuses { get { return _jobRunSelectedStatuses; } @@ -113,6 +140,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } public SelectedObjectCollection<bool> _isGradientSelection; + /// <summary> + /// Gets or sets the is gradient selection. Binding to ComboBox "IsGradient". + /// </summary> public SelectedObjectCollection<bool> IsGradientSelection { get { return _isGradientSelection; } @@ -124,6 +154,9 @@ namespace Tango.MachineStudio.Statistics.ViewModels } private SelectedObjectCollection<RmlModel> _selectedThreads; + /// <summary> + /// Gets or sets the selected threads. Contains all available threads and selected threads. Binding to ComboBox "Thread". + /// </summary> public SelectedObjectCollection<RmlModel> SelectedThreads { get { return _selectedThreads; } @@ -137,21 +170,26 @@ namespace Tango.MachineStudio.Statistics.ViewModels /// <summary> /// Gets or sets the JobRuns providers. /// </summary> - public ISuggestionProvider JobRunsProvider { get; set; } + public ISuggestionProvider JobsProvider { get; set; } - private JobRun _jobRun; - public JobRun JobRun + private Job _selectedJob; + /// <summary> + /// Gets or sets the job. Used as Sele + /// </summary> + public Job SelectedJob { - get { return _jobRun; } - set { - _jobRun = value; - if (_jobRun != null) - { - SelectedJobName = _jobRun.JobName; - } - RaisePropertyChangedAuto(); } + get { return _selectedJob; } + set + { + _selectedJob = value; + SelectedJobName = _selectedJob != null ? _selectedJob.Name : ""; + RaisePropertyChangedAuto(); + } } + /// <summary> + /// Gets or sets the name of the selected job. Used in filter. + /// </summary> private string SelectedJobName { get; set; } @@ -209,12 +247,12 @@ namespace Tango.MachineStudio.Statistics.ViewModels }); IsGradientSelection.SelectionChanged -= (x, y) => RaisePropertyChanged(nameof(IsGradientSelection)); IsGradientSelection.SelectionChanged += (x, y) => RaisePropertyChanged(nameof(IsGradientSelection)); - JobRunsProvider = new SuggestionProvider((filter) => + JobsProvider = new SuggestionProvider((filter) => { try { SelectedJobName = filter; - return _allJobRuns.Where(x => x.JobName != null && x.JobName.ToString().StartsWith(filter, StringComparison.CurrentCultureIgnoreCase)).ToList(); + return _allJobRuns.Where(x => x.Name != null && x.Name.ToString().StartsWith(filter, StringComparison.CurrentCultureIgnoreCase)).ToList(); } catch { @@ -223,7 +261,10 @@ namespace Tango.MachineStudio.Statistics.ViewModels }); } - + + /// <summary> + /// Initializes this instance. Called form main view VM in OnApplicationReady + /// </summary> public async void Init() { using (_notification.PushTaskItem("Loading job runs...")) @@ -234,7 +275,7 @@ namespace Tango.MachineStudio.Statistics.ViewModels using (var db = ObservablesContext.CreateDefault()) { - _allJobRuns = await db.JobRuns.ToListAsync(); ; + _allJobRuns = await db.Jobs.ToListAsync(); ; _allMachines = await db.Machines.ToListAsync(); _allUsers = await db.Users.Include(x => x.Contact).ToListAsync(); _rmlsModels = await db.Rmls.Select(x=> new RmlModel(){ Name = x.Name, Guid = x.Guid}).ToListAsync(); @@ -253,7 +294,10 @@ namespace Tango.MachineStudio.Statistics.ViewModels } } } - + + /// <summary> + /// Loads the job runs by filters. + /// </summary> private async Task LoadJobRuns() { using (_notification.PushTaskItem("Loading job runs...")) @@ -273,6 +317,7 @@ namespace Tango.MachineStudio.Statistics.ViewModels .WithJobSource(JobRunSelectedSources.SynchedSource) .WithJobStatus(JobRunSelectedStatuses.SynchedSource) .WithGradient(IsGradientSelection.SynchedSource) + .WithRmls(SelectedThreads.SynchedSource.Select(x => x.Guid).ToList()) .Query(y => y.Where(x => (String.IsNullOrEmpty(SelectedJobName) || x.JobName.ToString().ToLower().StartsWith(SelectedJobName.ToLower())) && ( x.JobLength < LengthUpperValue && x.JobLength >= LengthLowerValue) )) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml index c89cd5819..c82fa3beb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml @@ -17,14 +17,13 @@ <sharedConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <sharedConverters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter"/> <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> - <sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> <sharedConverters:TimeSpanToTwoDigitsTimeConverter x:Key="TimeSpanToTwoDigitsTimeConverter" /> <sharedConverters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter"/> - <sharedConverters:ColorToIntegerConverter x:Key="ColorToIntegerConverter" /> - <localConverters:DateIsInListToBooleanConverter x:Key="DateIsInListToBooleanConverter"/> <localConverters:StringToBoolYesNoNullConverter x:Key="StringToBoolYesNoNullConverter"/> <localConverters:LiquidTypeToColorConverter x:Key="LiquidTypeToColorConverter"/> <localConverters:CollectionConverter x:Key="CollectionConverter"/> + <localConverters:StringToFirstLetterConverter x:Key="StringToFirstLetterConverter"/> + <localConverters:MidTankLevelToElementHeightConverter x:Key="MidTankLevelToElementHeightConverter"/> <ResourceDictionary x:Key="SelectAllTextBoxResource"> <Style TargetType="TextBox"> @@ -37,6 +36,35 @@ <Setter Property="TextWrapping" Value="Wrap"/> </Style> + <DataTemplate x:Key="LiquidQuantitiesTemplate"> + <DockPanel ToolTip="{Binding Quantity}"> + <Grid DockPanel.Dock="Top" Height="40" Margin="2 0 2 -5" > + <Border x:Name="LiquidTypeBorder" BorderThickness="1" BorderBrush="{StaticResource borderBrush}" CornerRadius="2" ClipToBounds="True" > + <Canvas Width="16" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0"> + <Border Height="39" Width="16" MinHeight="2" CornerRadius="0 0 2 2 " BorderThickness="0 0 0 3"> + <Border.Background> + <SolidColorBrush Color="{Binding LiquidType,Converter={StaticResource LiquidTypeToColorConverter}}" /> + </Border.Background> + <Border.Style> + <Style> + <Setter Property="Canvas.Top" > + <Setter.Value> + <MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}"> + <Binding RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type Border}, AncestorLevel=1}" Path="ActualHeight" /> + <Binding Path="Quantity" /> + </MultiBinding> + </Setter.Value> + </Setter> + </Style> + </Border.Style> + </Border> + </Canvas> + </Border> + </Grid> + <TextBlock DockPanel.Dock="Bottom" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" Text="{Binding LiquidType,Converter={StaticResource StringToFirstLetterConverter}}" Foreground="Gray"/> + </DockPanel> + </DataTemplate> + </UserControl.Resources> <Grid IsEnabled="{Binding IsFree}" > @@ -92,7 +120,7 @@ </TextBlock> </DockPanel> </Border> - <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" Width="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}" > + <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}" > <Border Background="{StaticResource Logging.Background}" BorderBrush="{StaticResource AutoCompleteTextBox.Popup.BorderBrush}" CornerRadius="3" BorderThickness="0.5" Padding="2"> <ScrollViewer MaxHeight="600" Background="{DynamicResource ComboBox.Floating.Background}"> <ItemsControl ItemsSource="{Binding SelectedMachines}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -100,7 +128,7 @@ <DataTemplate> <CheckBox VerticalAlignment="Center" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" > <CheckBox.Content> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data.SerialNumber}" ToolTip="{Binding Data.SerialNumber}"></TextBlock> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data.SerialNumber}" ToolTip="{Binding Data.SerialNumber}" FontFamily="{StaticResource FontName}"></TextBlock> </CheckBox.Content> </CheckBox> </DataTemplate> @@ -129,12 +157,11 @@ <StackPanel Margin="10 20 0 0" Orientation="Vertical" HorizontalAlignment="Center"> <!--<TextBlock Text="Job Name:" VerticalAlignment="Center" FontSize="11"></TextBlock>--> <!--<TextBox Text="{Binding JobName}" VerticalAlignment="Center" FontSize="11" Margin="0 5 0 0" Width="130"></TextBox>--> - <autoComplete:AutoCompleteTextBox Provider="{Binding JobRunsProvider}" Width="130" FontSize="11" LoadingContent="Loading..." SelectedItem="{Binding JobRun,Mode=TwoWay}" materialDesign:HintAssist.Hint="Job Name" DisplayMember="JobName" materialDesign:HintAssist.IsFloating="True"> + <autoComplete:AutoCompleteTextBox Provider="{Binding JobsProvider}" Width="130" FontSize="11" LoadingContent="Loading..." SelectedItem="{Binding SelectedJob,Mode=TwoWay}" materialDesign:HintAssist.Hint="Job Name" DisplayMember="Name" materialDesign:HintAssist.IsFloating="True"> <autoComplete:AutoCompleteTextBox.ItemTemplate> <DataTemplate> <StackPanel> - <TextBlock Text="{Binding JobName}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <!--<TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock>--> + <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> </StackPanel> </DataTemplate> </autoComplete:AutoCompleteTextBox.ItemTemplate> @@ -237,7 +264,7 @@ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" FontSize="11" Margin="5" Text="{Binding JobRunSelectedStatuses.SynchedSource, Converter={StaticResource CollectionConverter}}"/> </DockPanel> </Border> - <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" Width="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}"> + <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}"> <Border Padding="5" Background="{DynamicResource ComboBox.Floating.Background}" BorderBrush="{StaticResource AutoCompleteTextBox.Popup.BorderBrush}" > <ItemsControl ItemsSource="{Binding JobRunSelectedStatuses}" Foreground="{StaticResource MainWindow.Foreground}"> <ItemsControl.ItemTemplate> @@ -259,7 +286,7 @@ </StackPanel> <StackPanel Margin="40 10 0 0" Orientation="Vertical" HorizontalAlignment="Center"> <TextBlock Text="Threads:" VerticalAlignment="Center" FontSize="11"></TextBlock> - <ToggleButton Width="130" Margin="0 10 0 0" x:Name="selectThreadsButton" HorizontalAlignment="Left" FontSize="16" VerticalAlignment="Center"> + <ToggleButton Width="140" Margin="0 10 0 0" x:Name="selectThreadsButton" HorizontalAlignment="Left" FontSize="16" VerticalAlignment="Center"> <ToggleButton.Template> <ControlTemplate> <Grid> @@ -268,10 +295,10 @@ <Button x:Name="selectThreadButton" Width="18" Padding="0" Height="16" DockPanel.Dock="Right" BorderBrush="{x:Null}" HorizontalAlignment="Left" Click="SelectMachineButton_Click" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource MainWindow.Foreground}"> <materialDesign:PackIcon Width="16" Height="16" Kind="ChevronDown" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" HorizontalAlignment="Right"/> </Button> - <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" FontSize="11" Margin="5"> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" FontSize="11" Margin="5" > <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> - <Setter Property="Text" Value="{Binding SelectedThreads.SynchedSource.Count, StringFormat={}Selected Machines({0})}"> + <Setter Property="Text" Value="{Binding SelectedThreads.SynchedSource.Count, StringFormat={}Selected Threads({0})}"> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding SelectedThreads.SynchedSource.Count}" Value="0"> @@ -283,7 +310,7 @@ </TextBlock> </DockPanel> </Border> - <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" Width="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}" > + <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=Width}" > <Border Background="{DynamicResource ComboBox.Floating.Background}" BorderBrush="{StaticResource AutoCompleteTextBox.Popup.BorderBrush}" CornerRadius="3" BorderThickness="0.5" Padding="2"> <ScrollViewer MaxHeight="600" Background="{DynamicResource ComboBox.Floating.Background}"> <ItemsControl ItemsSource="{Binding SelectedThreads}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -291,7 +318,7 @@ <DataTemplate> <CheckBox VerticalAlignment="Center" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" > <CheckBox.Content> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data.Name}" ToolTip="{Binding Data.Name}"></TextBlock> + <TextBlock Margin="5 0 5 0" VerticalAlignment="Center" Text="{Binding Data.Name}" ToolTip="{Binding Data.Name}" FontFamily="{StaticResource FontName}" FontSize="16"></TextBlock> </CheckBox.Content> </CheckBox> </DataTemplate> @@ -312,7 +339,7 @@ </Border> </Grid> - <DataGrid Grid.Row="1" Margin="20 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" RowHeight="60" + <DataGrid Grid.Row="1" Margin="20 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" RowHeight="80" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserReorderColumns="True" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding JobRuns}" HorizontalScrollBarVisibility="Disabled" SelectedItem="{Binding SelectedJobRun}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" FontSize="11"> @@ -400,10 +427,10 @@ <DataGridTextColumn Header="Status" Binding="{Binding JobRun.JobRunStatus, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto"/> <DataGridTextColumn Header="End Time" Binding="{Binding JobRun.EndDate, Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" /> <DataGridTextColumn Header="End Position" Binding="{Binding JobRun.EndPosition, StringFormat={}{0:0.00}}" Width="Auto" /> - <DataGridTemplateColumn Header="Liquid Quantities" Width="1*"> + <DataGridTemplateColumn Header="Liquid Quantities" Width="1*" > <DataGridTemplateColumn.CellTemplate> <DataTemplate> - <ItemsControl ItemsSource="{Binding JobRun.LiquidQuantities,Mode=OneWay}" Margin="0 0 0 0" Height="60"> + <ItemsControl ItemsSource="{Binding JobRun.LiquidQuantities,Mode=OneWay}" Margin="0 0 0 0" Height="80" ItemTemplate="{StaticResource LiquidQuantitiesTemplate}"> <ItemsControl.ItemContainerStyle> <Style TargetType="ContentPresenter"> <Setter Property="Visibility" Value="Visible"></Setter> @@ -416,22 +443,9 @@ </ItemsControl.ItemContainerStyle> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <WrapPanel ></WrapPanel> + <UniformGrid Rows="1" IsItemsHost="True"></UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <StackPanel Orientation="Vertical" ToolTip="{Binding Quantity}"> - <!--<TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding LiquidType,Converter={StaticResource EnumToDescriptionConverter}}"/>--> - <Rectangle Height="30" Width="20" Margin="0 0 0 0"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding LiquidType,Converter={StaticResource LiquidTypeToColorConverter}}" /> - </Rectangle.Fill> - </Rectangle> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2" Text="{Binding LiquidType,Converter={StaticResource EnumToDescriptionConverter}}" Foreground="Gray"/> - </StackPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> </ItemsControl> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -441,7 +455,7 @@ <Border Grid.Row="1" Grid.Column="1" Margin="20, 0, 20, 10" BorderBrush="{StaticResource borderBrush}" Background="{StaticResource TransparentBackgroundBrush}" BorderThickness="1"> <StackPanel> - <TextBlock Margin="10" Text="{Binding SelectedJobRunsText}"></TextBlock> + <TextBlock Margin="10" Text="{Binding SelectedJobName}"></TextBlock> </StackPanel> </Border> <Border Grid.Row="2" Grid.ColumnSpan="2" Margin="20, 10, 20, 20" BorderBrush="{StaticResource borderBrush}" Background="{StaticResource TransparentBackgroundBrush}" BorderThickness="1"> |
