diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views')
3 files changed, 176 insertions, 26 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index ba7c80f5b..627e4d63e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -71,6 +71,8 @@ <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> <converters:IsNotConverter x:Key="IsNotConverter" /> <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" /> + <converters:MathOperatorConverter x:Key="MathOperatorConverter" /> + <localConverters:LiquidVolumesToLubricantLiquidVolume x:Key="LiquidVolumesToLubricantLiquidVolume" /> <ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> @@ -351,11 +353,6 @@ </Polygon> <Border Height="100" Padding="5" IsHitTestVisible="False"> <Grid> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontStyle="Italic"> - <Run>#</Run> - <Run>SEGMENT</Run> - <Run Text="{Binding SegmentIndex}"></Run> - </TextBlock> <Rectangle VerticalAlignment="Bottom" Height="8"> <Rectangle.Fill> <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> @@ -369,6 +366,21 @@ </Grid> </Border> + <Grid Margin="20 10 10 10" TextElement.FontSize="16" TextElement.FontStyle="Italic" > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + + <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> + <TextBlock FontWeight="SemiBold">#</TextBlock> + <TextBlock FontWeight="SemiBold" Margin="5 0 0 0" Text="{Binding SegmentIndex}"></TextBlock> + </StackPanel> + + + <TextBox Grid.Column="1" VerticalAlignment="Center" Width="200" HorizontalContentAlignment="Center" Style="{x:Null}" BorderThickness="0" Background="Transparent" Text="{Binding Name}"></TextBox> + </Grid> + </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -729,16 +741,28 @@ </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> + <Border> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Lubricant"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="60" Height="60"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> + </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> @@ -749,7 +773,9 @@ </StackPanel> </StackPanel> - <TextBlock VerticalAlignment="Center" Margin="40 0 0 0" FontSize="16" FontStyle="Italic" Foreground="Gray"> + <materialDesign:PackIcon Kind="ChevronDoubleLeft" Margin="40 2 0 0" VerticalAlignment="Center" Foreground="Gray" /> + + <TextBlock VerticalAlignment="Center" FontSize="16" Margin="5 0 0 0" FontStyle="Italic" Foreground="Gray"> <Run>Total:</Run> <Run Text="{Binding TotalLiquidVolume,Mode=OneWay,StringFormat=0}"></Run><Run>%</Run> <Run>(</Run> @@ -757,6 +783,29 @@ <Run FontSize="12">nl</Run> <Run>)</Run> </TextBlock> + + <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="#E6E6E6" BorderThickness="1 0 0 0"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="55" Height="55"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown Foreground="#515151" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> + </Border> </StackPanel> </Setter.Value> </Setter> @@ -1001,7 +1050,7 @@ <DataGridTemplateColumn Header="IDX"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> - <TextBlock Text="{Binding IdsPack.PackIndex}" VerticalAlignment="Center" HorizontalAlignment="Center" /> + <TextBlock Text="{Binding IdsPack.PackIndex,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}" VerticalAlignment="Center" HorizontalAlignment="Center" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> @@ -1419,8 +1468,8 @@ <Grid Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParameterDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}"> <ContentControl> <StackPanel> - <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="10"></TextBlock> - <mahapps:NumericUpDown FontSize="16" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> + <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </ContentControl> </Grid> @@ -1471,6 +1520,11 @@ </ListBox> <StackPanel Margin="10 20" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="#202020" Foreground="#202020" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center"> + RESET + </TextBlock> + </Button> <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon> @@ -1519,7 +1573,7 @@ <Button Background="Transparent" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0"> <Border Background="#F1F1F1" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#383838"> <Grid> - <TextBlock Foreground="#FF7272" Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> + <TextBlock Foreground="#FF7272" Text="PROCESS PARAMETERS" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock.LayoutTransform> <RotateTransform Angle="270"></RotateTransform> </TextBlock.LayoutTransform> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml index 11c60c1ef..fe04cead7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml @@ -14,15 +14,103 @@ <UserControl.Resources> <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" /> </UserControl.Resources> - - <Grid> - <Grid Margin="40"> + + <Grid Margin="40"> + <Grid.RowDefinitions> + <RowDefinition Height="900*" MinHeight="50" /> + <RowDefinition Height="5"/> + <RowDefinition Height="743*" MinHeight="170"/> + </Grid.RowDefinitions> + + <Grid> <DockPanel> - <StackPanel Margin="0 20 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> - <materialDesign:PackIcon Kind="Settings" Width="60" Height="60" /> - <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Job Status</TextBlock> + <StackPanel Margin="0 0 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> + <materialDesign:PackIcon Kind="Settings" Width="40" Height="40" /> + <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Status</TextBlock> </StackPanel> + <DataGrid x:Name="gridSegments" SelectionMode="Single" SelectionChanged="DataGrid_SelectionChanged" SelectionUnit="FullRow" RowHeight="40" GridLinesVisibility="None" ItemsSource="{Binding RunningJobStatus.Segments}" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding RunningJobStatus.CurrentSegment}" Background="Transparent" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" IsReadOnly="True" AutoGenerateColumns="False"> + <DataGrid.RowStyle> + <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Foreground" Value="White"></Setter> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> + <GradientStop Color="#FFFF7A7A"/> + <GradientStop Color="Transparent" Offset="1"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="BorderBrush" Value="White"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.RowStyle> + <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="White"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTextColumn Width="Auto" Header="#" Binding="{Binding SegmentIndex}" /> + <DataGridTemplateColumn Header="Status"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <materialDesign:PackIcon VerticalAlignment="Center" HorizontalAlignment="Center"> + <materialDesign:PackIcon.Style> + <Style TargetType="materialDesign:PackIcon"> + <Setter Property="Kind" Value="PauseCircle"></Setter> + <Setter Property="Foreground" Value="Gray"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Started}" Value="True"> + <Setter Property="Kind" Value="ClockFast"></Setter> + <Setter Property="Foreground" Value="White"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Completed}" Value="True"> + <Setter Property="Kind" Value="CheckCircle"></Setter> + <Setter Property="Foreground" Value="#29B31D"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </materialDesign:PackIcon.Style> + </materialDesign:PackIcon> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="80" Fill="{Binding SegmentBrush}" Stroke="Gray"></Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}" /> + <DataGridTextColumn Header="Length" Binding="{Binding Length,StringFormat={}{0:F2} m}" /> + <DataGridTextColumn Header="Progress" Binding="{Binding Progress,StringFormat={}{0:F2} m}" /> + <DataGridTextColumn Header="Estimated Duration" Binding="{Binding EstimatedDuration,StringFormat='hh\\:mm\\:ss'}" /> + <DataGridTextColumn Header="Remaining Time" Binding="{Binding RemainingTime,StringFormat='hh\\:mm\\:ss'}" /> + </DataGrid.Columns> + </DataGrid> + </DockPanel> + </Grid> + <GridSplitter Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Height="5" Background="Black" /> + <Grid Grid.Row="2" Margin="0 40 0 0"> + <DockPanel> + <StackPanel Margin="0 0 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> + <materialDesign:PackIcon Kind="Settings" Width="40" Height="40" /> + <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Events</TextBlock> + </StackPanel> <Grid DockPanel.Dock="Bottom" Height="40"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 0 0"> <Button Command="{Binding BackToJobCommand}" Style="{StaticResource MaterialDesignFlatButton}" FontSize="16"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs index 74ace554e..5579870f6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs @@ -24,5 +24,13 @@ namespace Tango.MachineStudio.Developer.Views { InitializeComponent(); } + + private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (gridSegments.SelectedItem != null) + { + gridSegments.ScrollIntoView(gridSegments.SelectedItem); + } + } } } |
