aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml239
1 files changed, 239 insertions, 0 deletions
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
new file mode 100644
index 000000000..4667959b8
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml
@@ -0,0 +1,239 @@
+<UserControl x:Class="Tango.MachineStudio.Statistics.Views.JobRunsView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:localConverters="clr-namespace:Tango.MachineStudio.Statistics.Converters"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
+ xmlns:local="clr-namespace:Tango.MachineStudio.Statistics.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="450" d:DesignWidth="1200">
+ <UserControl.Resources>
+ <sharedConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
+ <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
+ <sharedConverters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter"/>
+ <localConverters:DateIsInListToBooleanConverter x:Key="DateIsInListToBooleanConverter"/>
+ <localConverters:StringToBoolYesNoNullConverter x:Key="StringToBoolYesNoNullConverter"/>
+
+ <ResourceDictionary x:Key="SelectAllTextBoxResource">
+ <Style TargetType="TextBox">
+ <EventSetter Event="GotFocus" Handler="TextBox_GotFocus"></EventSetter>
+ <EventSetter Event="MouseDown" Handler="TextBox_PreviewMouseUp"></EventSetter>
+ </Style>
+ </ResourceDictionary>
+
+ <Style x:Key="CustomCalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}" BasedOn="{StaticResource MaterialDesignCalendarDayButton}">
+ <Style.Triggers>
+ <DataTrigger Value="True">
+ <DataTrigger.Binding>
+ <MultiBinding Converter="{StaticResource DateIsInListToBooleanConverter}">
+ <Binding />
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Dates" />
+ <Binding RelativeSource="{RelativeSource AncestorType=DatePicker}" Path="IsDropDownOpen" ></Binding>
+ </MultiBinding>
+ </DataTrigger.Binding>
+ <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="HighlightDatePickerStyle" TargetType="{x:Type Calendar}" BasedOn="{StaticResource {x:Type Calendar}}">
+ <Setter Property="CalendarDayButtonStyle" Value="{StaticResource CustomCalendarDayButtonStyle}" />
+ </Style>
+
+ <ObjectDataProvider x:Key="JobSource" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="enumerations:JobSource"/>
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
+
+ <ObjectDataProvider x:Key="JobRunStatus" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="enumerations:JobRunStatus"/>
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
+
+ </UserControl.Resources>
+
+ <Grid IsEnabled="{Binding IsFree}">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="3*"/>
+ <ColumnDefinition Width="1*"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="100"/>
+ <RowDefinition Height="*"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <materialDesign:Card Grid.Row="0" Background="{StaticResource WhiteBackgroundBrush}" Foreground="{StaticResource JobFieldForeground}" Width="Auto" Margin="10 10 0 0" >
+
+ <DockPanel>
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
+ <StackPanel Margin="30 5 0 20" Orientation="Vertical" >
+ <TextBlock DockPanel.Dock="Top" Text="Machine:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <ToggleButton Width="200" Margin="0 10 0 0" x:Name="selectMachineButton" HorizontalAlignment="Left" FontSize="16" VerticalAlignment="Center">
+ <ToggleButton.Template>
+ <ControlTemplate>
+ <Grid>
+ <Border CornerRadius="3" BorderBrush="{StaticResource borderBrush}" BorderThickness="1" TextElement.Foreground="Black" >
+ <DockPanel>
+ <Button Width="18" Padding="0" Height="16" DockPanel.Dock="Right" BorderBrush="{x:Null}" HorizontalAlignment="Left" Click="Button_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}">
+ <Run Text=" Select Machines"></Run>
+ <Run>(</Run><Run Text="{Binding SelectedMachines.SynchedSource.Count,Mode=OneWay}"></Run><Run>)</Run>
+ </TextBlock>
+ </DockPanel>
+ </Border>
+ <Popup StaysOpen="False" IsOpen="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked }" >
+ <Border Padding="5" Background="{DynamicResource ComboBox.Floating.Background}" BorderBrush="{StaticResource AutoCompleteTextBox.Popup.BorderBrush}">
+ <ScrollViewer MaxHeight="600" Background="{DynamicResource ComboBox.Floating.Background}">
+ <ItemsControl ItemsSource="{Binding SelectedMachines}" Foreground="{StaticResource MainWindow.Foreground}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <DockPanel Margin="2">
+ <CheckBox VerticalAlignment="Center" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data.SerialNumber}"></TextBlock>
+ </DockPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </ControlTemplate>
+ </ToggleButton.Template>
+ </ToggleButton>
+
+ </StackPanel>
+ <Border Margin="30 10 0 20" Padding="5" BorderBrush="#38696969" BorderThickness="1" >
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="Calendar" Width="24" Height="24" VerticalAlignment="Bottom" Margin="0 0 0 5" />
+ <DatePicker x:Name="datePicker" DisplayDateStart="{Binding MinDate}" DisplayDateEnd="{Binding MaxDate}" CalendarStyle="{StaticResource HighlightDatePickerStyle}" SelectedDate="{Binding SelectedDate}" materialDesign:HintAssist.Hint="Pick Date" Margin="10 0 0 5" Width="100" VerticalAlignment="Bottom" FontSize="16">
+ </DatePicker>
+ </StackPanel>
+ </Border>
+ <StackPanel Margin="30 5 20 20" Orientation="Vertical">
+ <TextBlock Text="Job Name:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <TextBox Text="{Binding JobName}" VerticalAlignment="Center" FontSize="16" Margin="0 5 0 0" Width="100"></TextBox>
+ </StackPanel>
+ <StackPanel Margin="30 5 20 0" Orientation="Vertical">
+ <TextBlock Text="Source:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <ComboBox Width="100" FontSize="14" Margin="0 5 0 0" ItemsSource="{Binding Source={StaticResource JobSource}}" SelectedItem="{Binding JobRunSource, UpdateSourceTrigger=PropertyChanged}">
+ <ComboBox.ItemContainerStyle>
+ <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
+ <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter>
+ </Style>
+ </ComboBox.ItemContainerStyle>
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </StackPanel>
+ <StackPanel Margin="30 5 20 0" Orientation="Vertical">
+ <TextBlock Text="Gradient:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <ComboBox Width="100" FontSize="14" Margin="0 5 0 0" SelectedItem="{Binding IsGradient, Converter={StaticResource StringToBoolYesNoNullConverter}, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}">
+ <ComboBox.ItemContainerStyle>
+ <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
+ <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter>
+ </Style>
+ </ComboBox.ItemContainerStyle>
+ <ComboBoxItem Content="Yes" />
+ <ComboBoxItem Content="No" />
+ <ComboBoxItem Content="Null" />
+ </ComboBox>
+ </StackPanel>
+ <StackPanel Margin="30 5 20 0" Orientation="Vertical">
+ <TextBlock Text="Length:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <mahapps:NumericUpDown Width="100" Margin="0 8.5 0 0" x:Name="numLength" FontSize="21" HideUpDownButtons="True" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Minimum="0" Maximum="5000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="{StaticResource DimGrayBrush}" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Length,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
+ <mahapps:NumericUpDown.Resources>
+ <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </StackPanel>
+ <StackPanel Margin="30 5 20 0" Orientation="Vertical">
+ <TextBlock Text="Status:" VerticalAlignment="Center" FontSize="10"></TextBlock>
+ <ComboBox Width="100" FontSize="14" Margin="0 5 0 0" ItemsSource="{Binding Source={StaticResource JobRunStatus}}" SelectedItem="{Binding JobRunStatus, UpdateSourceTrigger=PropertyChanged}">
+ <ComboBox.ItemContainerStyle>
+ <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
+ <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter>
+ </Style>
+ </ComboBox.ItemContainerStyle>
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </StackPanel>
+
+ </StackPanel>
+ <Button HorizontalAlignment="Right" Command="{Binding LoadJobRunsCommand}" DockPanel.Dock="Right" Margin="10">GO</Button>
+ </DockPanel>
+ </materialDesign:Card>
+
+ <DataGrid Grid.Row="1" Margin="20 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" RowHeight="40" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1"
+ Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserReorderColumns="True"
+ CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding JobRuns}"
+ SelectedItem="{Binding SelectedJobRun}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" FontSize="11">
+ <DataGrid.CellStyle>
+ <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+ <Style.Triggers>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" />
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </DataGrid.CellStyle>
+ <DataGrid.RowStyle>
+ <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
+ <Style.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" />
+ <Setter Property="Cursor" Value="Hand"></Setter>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ <Trigger Property="IsFocused" Value="True">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </DataGrid.RowStyle>
+
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="START DATE" Binding="{Binding JobRun.StartDate, Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" />
+ <DataGridTextColumn Header="LENGTH" Binding="{Binding JobRun.JobLength}" Width="Auto" />
+ <DataGridTextColumn Header="STATUS" Binding="{Binding JobRun.JobRunStatus, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto"/>
+ <DataGridTextColumn Header="DESIGNATION" Binding="{Binding JobRun.Designation, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto"/>
+ <DataGridTextColumn Header="SOURCE" Binding="{Binding JobRun.Source, Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto" />
+ </DataGrid.Columns>
+ </DataGrid>
+ <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>
+ </StackPanel>
+ </Border>
+ <Border Grid.Row="2" Grid.ColumnSpan="2" Margin="20, 10, 20, 20" BorderBrush="{StaticResource borderBrush}" Background="{StaticResource TransparentBackgroundBrush}" BorderThickness="1">
+ <StackPanel Background="{StaticResource TransparentBackgroundBrush}" >
+ <TextBlock>TOTALS:</TextBlock>
+ <TextBlock>Cyan:</TextBlock>
+ </StackPanel>
+ </Border>
+ </Grid>
+</UserControl>