diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-07-18 17:52:17 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-07-18 17:52:17 +0300 |
| commit | e0d570b8994b5d8ac3733075df9aa4d25e723131 (patch) | |
| tree | 261ebcd32f07ec43cf29030036c077258d8c03a7 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer | |
| parent | e0c19a620f338848b130ad6d2bd0ce8d5a52ca93 (diff) | |
| parent | df566bfe8b0f5ab0978dc3fa600052cd300fc577 (diff) | |
| download | Tango-e0d570b8994b5d8ac3733075df9aa4d25e723131.tar.gz Tango-e0d570b8994b5d8ac3733075df9aa4d25e723131.zip | |
merge build date
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
7 files changed, 441 insertions, 170 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs index 6157bf5fd..31208a4f4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs @@ -16,18 +16,17 @@ namespace Tango.MachineStudio.Developer.Converters { try { - if (values.Length == 4) + if (values.Length == 3) { - Job job = values[0] as Job; - - if (job != null && values[1] is double) + if (values[0] is double) { - double jobLength = System.Convert.ToDouble(values[1]); - double elementWidth = System.Convert.ToDouble(values[2]); - double segmentLength = System.Convert.ToDouble(values[3]); - double totalLength = job.Length; + double jobLength = System.Convert.ToDouble(values[0]); + double elementWidth = System.Convert.ToDouble(values[1]); + double segmentLength = System.Convert.ToDouble(values[2]); + + double result = (segmentLength / jobLength) * elementWidth; - return (segmentLength / totalLength) * elementWidth; + return double.IsInfinity(result) ? 0d : result; } else { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index ab74fcca8..749a09023 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -700,17 +700,21 @@ namespace Tango.MachineStudio.Developer.ViewModels _colorConversionThread.Start(); } + #endregion + + #region Color Conversion + private void ColorConversionThreadMethod() { while (true) { - if (IsVisible && ActiveJob != null) + if (IsVisible && ActiveJob != null && ActiveJob.Segments != null) { var stops = ActiveJob.Segments.SelectMany(x => x.BrushStops); foreach (var stop in stops) { - if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32()) + if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32() && !stop.IsLiquidVolumesOutOfRange) { try { @@ -721,6 +725,14 @@ namespace Tango.MachineStudio.Developer.ViewModels } catch { } } + else if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() && !stop.Corrected) + { + try + { + stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop); + } + catch { } + } } } @@ -743,6 +755,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { _color_changed_from_hive = true; SelectedBrushStop.Color = SelectedSuggestion.Color; + SelectedBrushStop.Corrected = true; + SelectedBrushStop.IsOutOfGamut = false; var coords = SelectedSuggestion.Coordinates; @@ -764,6 +778,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (!_color_changed_from_hive && _hiveOpened) { + SelectedBrushStop.Corrected = false; HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(TangoColorConverter.GetSuggestions(SelectedBrushStop)); } } @@ -1098,6 +1113,11 @@ namespace Tango.MachineStudio.Developer.ViewModels return; } + foreach (var stop in ActiveJob.Segments.SelectMany(x => x.BrushStops).Where(x => x.LiquidVolumes == null)) + { + stop.SetLiquidVolumes(SelectedMachine.Configuration, SelectedRML, SelectedProcessParametersTable); + } + JobEvents.Clear(); IsJobFailed = false; IsJobCanceled = false; @@ -1165,6 +1185,13 @@ namespace Tango.MachineStudio.Developer.ViewModels }); }; + _jobHandler.Finalizing += (_, __) => + { + _speech.SpeakInfo("Finalizing job..."); + LogManager.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); + _eventLogger.Log(String.Format("Finalizing job {0}.", RunningJob.Name)); + }; + _jobHandler.Completed += (x, e) => { LogManager.Log(String.Format("Job {0} has completed.", RunningJob.Name)); @@ -1308,9 +1335,13 @@ namespace Tango.MachineStudio.Developer.ViewModels ProcessParametersTablesGroup group = new ProcessParametersTablesGroup(); List<ProcessParametersTable> tables = new List<ProcessParametersTable>(); + + int index = 0; + foreach (var table in RmlProcessParametersTableGroup.ProcessParametersTables) { var newTable = table.CloneEntity(); + newTable.TableIndex = index++; newTable.ProcessParametersTablesGroup = group; tables.Add(newTable); } @@ -1364,10 +1395,13 @@ namespace Tango.MachineStudio.Developer.ViewModels _activeJobDbContext.Configuration.LazyLoadingEnabled = true; LogManager.Log("Initializing available color spaces, RMLs & Winding methods..."); + var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); + var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); Rmls = _activeJobDbContext.Rmls.ToObservableCollection(); WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); + LogManager.Log("Setting active job..."); _activeJob = _activeJobDbContext.Jobs.SingleOrDefault(x => x.Guid == SelectedMachineJob.Guid); 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 e350f966b..d6652b38d 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 @@ -32,6 +32,9 @@ d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Resources> + + <sys:Double x:Key="NumbersFontSize">21</sys:Double> + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> <Setter Property="Margin" Value="2" /> @@ -186,6 +189,28 @@ <Setter Property="Grid.Row" Value="0"></Setter> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="ToolTip"> + <Setter.Value> + <ToolTip Background="White"> + <ItemsControl ItemsSource="{Binding Coordinates.OutputLiquids}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <TextBlock TextAlignment="Center" Foreground="#202020" Margin="10 0"> + <Run Text="{Binding LiquidType}"></Run> + <LineBreak/> + <Run Text="{Binding Volume,StringFormat=0}"></Run> + </TextBlock> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ToolTip> + </Setter.Value> + </Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}"> @@ -446,7 +471,7 @@ </StackPanel> <DockPanel LastChildFill="True"> <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding ActiveJob.EnableInterSegment}"></ToggleButton> - <mahapps:NumericUpDown Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> </DockPanel> </StackPanel> </Border> @@ -469,7 +494,7 @@ <Image Source="../Images/repeat.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Units</TextBlock> </StackPanel> - <mahapps:NumericUpDown Width="70" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" Margin="0 5 0 0" HideUpDownButtons="True" Minimum="1" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.NumberOfUnits,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" Margin="0 5 0 0" HideUpDownButtons="True" Minimum="1" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.NumberOfUnits,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </Border> @@ -527,7 +552,7 @@ <Image Source="../Images/ruler.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock> </StackPanel> - <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </Border> @@ -709,7 +734,7 @@ <ContentControl.Foreground> <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> </ContentControl.Foreground> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <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> @@ -718,6 +743,11 @@ </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> + + <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FFAC3C" /> + <TextBlock Margin="5 0 0 0" Foreground="#FFAC3C">Liquid volumes exceeds the maximum range for color conversion!</TextBlock> + </StackPanel> </StackPanel> </Setter.Value> </Setter> @@ -725,32 +755,39 @@ <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> <Setter Property="Content"> <Setter.Value> - <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> + <StackPanel> + <StackPanel Orientation="Horizontal"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="60" Height="60" Margin="10 0 0 0"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> + <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> + <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="60" Height="60" Margin="10 0 0 0"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> - <ContentControl Style="{StaticResource colorPicker}"></ContentControl> + <ContentControl Style="{StaticResource colorPicker}"></ContentControl> + </StackPanel> + + <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> + <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut!</TextBlock> + </StackPanel> </StackPanel> </Setter.Value> </Setter> @@ -760,7 +797,7 @@ <Setter.Value> <StackPanel Orientation="Horizontal"> <ContentControl Style="{StaticResource numberBorder}" Foreground="Cyan" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -768,7 +805,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Magenta" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -776,7 +813,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Yellow" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -784,7 +821,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -801,7 +838,7 @@ <Setter.Value> <StackPanel Orientation="Horizontal"> <ContentControl Style="{StaticResource numberBorder}" Foreground="Gray" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -809,7 +846,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF8A8A" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -817,7 +854,7 @@ </ContentControl> <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> </mahapps:NumericUpDown.Resources> @@ -1140,7 +1177,6 @@ <Grid> <Grid.Width> <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob"></Binding> <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding> <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> <Binding Path="Length"></Binding> @@ -1187,6 +1223,8 @@ <TextBlock FontSize="12" Foreground="Black"> <Run Text="{Binding ActiveJob.Length,Mode=OneWay,StringFormat=N2}"></Run> <Run Foreground="Gray" FontSize="10" Text="m"></Run> + <Run>x</Run> + <Run Text="{Binding ActiveJob.NumberOfUnits}"></Run> </TextBlock> <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index 066dc870b..4593ef259 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -121,7 +121,7 @@ </Grid> <Grid Margin="0 20 0 0"> - <controls:MultiSelectDataGrid AutomationProperties.AutomationId="{x:Static automation:Developer.JobsDataGrid}" Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding JobsCollectionView}" SelectedItem="{Binding SelectedMachineJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}"> + <controls:MultiSelectDataGrid MouseDoubleClick="MultiSelectDataGrid_MouseDoubleClick" AutomationProperties.AutomationId="{x:Static automation:Developer.JobsDataGrid}" Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding JobsCollectionView}" SelectedItem="{Binding SelectedMachineJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml.cs index 52786a59f..d21342d01 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml.cs @@ -12,6 +12,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.BL.Entities; +using Tango.MachineStudio.Developer.ViewModels; namespace Tango.MachineStudio.Developer.Views { @@ -20,9 +22,29 @@ namespace Tango.MachineStudio.Developer.Views /// </summary> public partial class MachineJobSelectionView : UserControl { + private MainViewVM _vm; + public MachineJobSelectionView() { InitializeComponent(); + + this.Loaded += (_, __) => + { + _vm = DataContext as MainViewVM; + }; + } + + private void MultiSelectDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) + { + DataGrid row = sender as DataGrid; + + + + + if (row != null && row.SelectedItem is Job) + { + _vm.LoadJobCommand.Execute(null); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index fd3b2289d..a7348d869 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -5,8 +5,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:dispensing="clr-namespace:Tango.BL.Dispensing;assembly=Tango.BL" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:global="clr-namespace:Tango.MachineStudio.Developer" @@ -35,6 +37,9 @@ <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" /> <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" /> <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" /> + <converters:IsNotConverter x:Key="IsNotConverter" /> + <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> + <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> <SolidColorBrush x:Key="SideBarBackground" Color="White"> @@ -42,6 +47,12 @@ </SolidColorBrush> <Color x:Key="dummyColor">Transparent</Color> + + <ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> + <ObjectDataProvider.MethodParameters> + <x:Type TypeName="dispensing:DispenserStepDivisions"/> + </ObjectDataProvider.MethodParameters> + </ObjectDataProvider> </UserControl.Resources> @@ -82,153 +93,320 @@ </Style> </Grid.Style> <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20"> - <DockPanel> - <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> - <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> - <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> - <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> + <Grid> + <DockPanel> + <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> + <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> + <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> <Run Text="Running '"></Run> <Run Text="{Binding RunningJob.Name}"></Run> <Run Text="'..."></Run> - </TextBlock> - </StackPanel> - </Grid> - <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> - <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobStatus.RemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> + </TextBlock> + </StackPanel> + </Grid> + <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobStatus.RemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> - <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> - </StackPanel> - </Button> + <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> + </StackPanel> + </Button> + </StackPanel> </StackPanel> - </StackPanel> - <Grid> <Grid> - <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> - <Grid ClipToBounds="False" > + <Grid> + <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> + <Grid ClipToBounds="False" > - <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobSegments}" Margin="0 0 60 0"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid ClipToBounds="False"> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> + <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobStatus.CurrentUnitSegments}" Margin="0 0 60 0"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid ClipToBounds="False"> + <Grid.ToolTip> + <ToolTip Background="White" Padding="0" Visibility="{Binding IsInterSegment,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <Border BorderThickness="1" BorderBrush="#202020" CornerRadius="3" Padding="5"> + <StackPanel Background="White"> + <ItemsControl ItemsSource="{Binding BrushStops[0].LiquidVolumes}" VerticalAlignment="Center"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </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> + <TextBlock Foreground="#202020" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Volume,StringFormat=0.00}"></TextBlock> + </ContentControl> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <StackPanel Margin="0 0 0 0" ClipToBounds="False"> + <DataGrid Margin="0 10 0 0" SelectedIndex="-1" IsReadOnly="True" ItemsSource="{Binding BrushStops[0].LiquidVolumes}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" Background="Transparent" SelectionUnit="FullRow"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTemplateColumn Header="IDS PACK"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Grid x:Name="t0"> + <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -11 0 0"> + <Polygon.Fill> + <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" /> + </Polygon.Fill> + </Polygon> + <TextBlock FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock> + </Grid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="D/F"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding IdsPack.DispenserType.NlPerPulse,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="STEP"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}"> + <ComboBox.ItemContainerStyle> + <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> + <Setter Property="Background" Value="#ECECEC"></Setter> + </Style> + </ComboBox.ItemContainerStyle> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="MAX NL / CM"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="VOLUME"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding Volume,StringFormat='0.0'}"></Run> + <Run Text="%" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="FORMULA"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding IdsPack.IdsPackFormula.Name}"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="NL / CM"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="NL / SEC"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="PULSE / SEC"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Label VerticalAlignment="Center"> + <Label.Style> + <Style TargetType="Label"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock> + <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}"> + <Setter Property="Content" Value="Auto"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding DispenserStepDivision,Converter={StaticResource IsNotConverter},ConverterParameter={x:Static dispensing:DispenserStepDivisions.Auto}}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock> + <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </StackPanel> + </Border> + </ToolTip> + </Grid.ToolTip> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJobStatus.CurrentUnitTotalProgress"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="Length"></Binding> + </MultiBinding> + </Grid.Width> - <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> - <TextBlock Margin="0 0 0 0" FontSize="14" HorizontalAlignment="Right"> - <Run Text="{Binding Length,Mode=OneWay,StringFormat=N2}"></Run> - <Run FontSize="12" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> - <materialDesign:PackIcon.RenderTransform> - <RotateTransform Angle="180" /> - </materialDesign:PackIcon.RenderTransform> - </materialDesign:PackIcon> - </StackPanel> + <StackPanel Margin="0 0 0 0" ClipToBounds="False"> - <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center"> - <Rectangle.Fill> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - </MultiBinding> - </Rectangle.Fill> - </Rectangle> + <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> + <Canvas Height="19"> + <TextBlock Canvas.Top="0" Canvas.Left="-7" Margin="0 0 0 0" FontSize="10" HorizontalAlignment="Right"> + <Run Text="{Binding Length,Mode=OneWay,StringFormat=0}"></Run> + <Run FontSize="7" Text="m"></Run> + </TextBlock> + </Canvas> + <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> + <materialDesign:PackIcon.RenderTransform> + <RotateTransform Angle="180" /> + </materialDesign:PackIcon.RenderTransform> + </materialDesign:PackIcon> + </StackPanel> - <Canvas Height="30" HorizontalAlignment="Center" Width="80"> - <Label Padding="0" Margin="0"> - <Label.Style> - <Style TargetType="Label"> - <Setter Property="Content" Value="{x:Null}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Started}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Completed}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </Canvas> - </StackPanel> + <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center"> + <Rectangle.Fill> + <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> + </MultiBinding> + </Rectangle.Fill> + </Rectangle> + + <Canvas Height="30" HorizontalAlignment="Center" Width="80"> + <Label Padding="0" Margin="0"> + <Label.Style> + <Style TargetType="Label"> + <Setter Property="Content" Value="{x:Null}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Started}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Completed}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </Canvas> + </StackPanel> - <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25" ></Rectangle> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25" ></Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left"> - <TextBlock FontSize="14"> + <StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left"> + <TextBlock FontSize="14"> <Run Text="0"></Run> <Run FontSize="13" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20"> + </TextBlock> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20"> - </materialDesign:PackIcon> - </StackPanel> + </materialDesign:PackIcon> + </StackPanel> - <StackPanel Margin="0 -5 -70 0" HorizontalAlignment="Right"> - <TextBlock FontSize="14"> - <Run Text="{Binding RunningJob.Length,Mode=OneWay,StringFormat=N2}"></Run> + <StackPanel Margin="0 -5 -70 0" HorizontalAlignment="Right"> + <TextBlock FontSize="14"> + <Run Text="{Binding RunningJobStatus.CurrentUnitTotalProgress,Mode=OneWay,StringFormat=N2}"></Run> <Run FontSize="13" Text="m"></Run> <Run></Run> <Run Foreground="#FF6464">x</Run><Run Foreground="#FF6464" FontSize="16" FontWeight="SemiBold" Text="{Binding RunningJobStatus.RemainingUnits}"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> + </TextBlock> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> - </materialDesign:PackIcon> - </StackPanel> + </materialDesign:PackIcon> + </StackPanel> - <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 60 0"> + <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 60 0"> - </Border> + </Border> - <Canvas x:Name="jobProgressCanvas"> - <Grid Canvas.Top="0"> - <Canvas.Left> - <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}"> - <Binding Path="RunningJobStatus.CurrentUnitTotalProgress" /> - <Binding Path="RunningJobStatus.CurrentUnitProgress" /> - <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> - </MultiBinding> - </Canvas.Left> - <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> - <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></TextBlock> - </Grid> - </Canvas> - </Grid> - </Border> + <Canvas x:Name="jobProgressCanvas" Width="{Binding ElementName=runningJobBrushList,Path=ActualWidth}" HorizontalAlignment="Left"> + <Grid Canvas.Top="0"> + <Canvas.Left> + <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}"> + <Binding Path="RunningJobStatus.CurrentUnitTotalProgress" /> + <Binding Path="RunningJobStatus.CurrentUnitProgress" /> + <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> + </MultiBinding> + </Canvas.Left> + <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> + <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></TextBlock> + </Grid> + </Canvas> + </Grid> + </Border> + </Grid> </Grid> - </Grid> - </DockPanel> + </DockPanel> + + <TextBlock Visibility="{Binding RunningJobStatus.IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="-170 0 0 0" Background="#202020" FontSize="14" Height="30" Foreground="#FF6D6D">Finalizing...</TextBlock> + </Grid> </Border> <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar> 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 94570196f..dd2e541f5 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 @@ -97,7 +97,7 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <DataGridTextColumn Header="DATE TIME" Binding="{Binding DateTime,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss.fff'}" /> + <DataGridTextColumn SortDirection="Descending" Header="DATE TIME" Binding="{Binding DateTime,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss.fff'}" /> <DataGridTextColumn Header="GROUP" Binding="{Binding EventType.EventTypesGroup.Name}" /> <DataGridTextColumn Header="EVENT" Binding="{Binding EventType.Name}" /> <DataGridTemplateColumn Header="MESSAGE" Width="1*"> |
