diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-24 14:35:03 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-24 14:35:03 +0300 |
| commit | a8efe6694164ff1808be8f5e19501a7396608755 (patch) | |
| tree | e2f10dd92ea6c2ee3687ca8dcc20d35a998393c5 /Software/Visual_Studio/PPC/Modules | |
| parent | d7a0d5e8d6804f5f739c223c123b4b2780af4e11 (diff) | |
| download | Tango-a8efe6694164ff1808be8f5e19501a7396608755.tar.gz Tango-a8efe6694164ff1808be8f5e19501a7396608755.zip | |
PPC. Jobs List - added Thread column, changed Length with spools for Eureka.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
4 files changed, 78 insertions, 8 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs new file mode 100644 index 000000000..60f94b8aa --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.PPC.Jobs.Converters +{ + public class LengthWithSpoolsConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + double length = System.Convert.ToDouble(values[0]); + bool isEureka = System.Convert.ToBoolean(values[1]); + double spools = System.Convert.ToDouble(values[2]); + + if (isEureka) + return length * spools; + else return length; + } + catch + { + return 0d; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj index c0e24ac8c..3aefa29a1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj @@ -240,6 +240,7 @@ <Compile Include="Converters\JobToPieImageConverter.cs" /> <Compile Include="Converters\JobTypeToImageConverter.cs" /> <Compile Include="Converters\LengthToWeightConverter.cs" /> + <Compile Include="Converters\LengthWithSpoolsConverter.cs" /> <Compile Include="Converters\MarginOffsetSliderConverter .cs" /> <Compile Include="Converters\RoundDoubleConverter.cs" /> <Compile Include="Converters\TimeSpanToHoursConverter.cs" /> @@ -753,7 +754,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs index 0e4ec8fa4..df3ae4596 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs @@ -371,7 +371,7 @@ namespace Tango.PPC.Jobs.ViewModels _colorSpaces = _db.ColorSpaces.ToList(); - var jobs = new JobsCollectionBuilder(_db).Set(x => x.MachineGuid == MachineProvider.Machine.Guid).WithSegments().WithBrushStops().WithCustomer().WithColorSpace().WithSegmentsGroups().Build(); + var jobs = new JobsCollectionBuilder(_db).Set(x => x.MachineGuid == MachineProvider.Machine.Guid).WithSegments().WithBrushStops().WithCustomer().WithColorSpace().WithSegmentsGroups().WithRmls().Build(); InvokeUI(() => { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml index d143268c7..0a5124078 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml @@ -29,6 +29,7 @@ </ResourceDictionary.MergedDictionaries> <converters:JobToPieImageConverter x:Key="JobToPieImageConverter" /> + <converters:LengthWithSpoolsConverter x:Key="LengthWithSpoolsConverter"/> <sharedConverters:DateTimeUTCToShortDateConverter x:Key="DateTimeUTCToShortDateConverter" /> <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> <sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> @@ -256,17 +257,33 @@ </touch:LightTouchDataGridColumn.Header> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock Margin="20 0 0 0" IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='40'}"></TextBlock> + <TextBlock Margin="20 0 0 0" IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='30'}"></TextBlock> + </DataTemplate> + </touch:LightTouchDataGridColumn.CellTemplate> + </touch:LightTouchDataGridColumn> + <touch:LightTouchDataGridColumn Width="160" Header="Thread" SortMember="ThreadName" HorizontalContentAlignment="Left"> + <touch:LightTouchDataGridColumn.CellTemplate> + <DataTemplate> + <TextBlock IsHitTestVisible="False" Text="{Binding ThreadName,Converter={StaticResource StringEllipsisConverter},ConverterParameter='28'}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> - <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="Length"> + <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="LengthIncludingNumberOfUnits"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0}"></TextBlock> + <TextBlock IsHitTestVisible="False"> + <TextBlock.Text> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay"> + <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/> + <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/> + <Binding Path="Spools" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> + <touch:LightTouchDataGridColumn Header="Colors" SortMember="Segments.Count" Width="85"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> @@ -363,14 +380,29 @@ <touch:LightTouchDataGridColumn Width="1*" Header="Name" SortMember="Name" HorizontalContentAlignment="Left"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='40'}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock> + <TextBlock IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='30'}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock> + </DataTemplate> + </touch:LightTouchDataGridColumn.CellTemplate> + </touch:LightTouchDataGridColumn> + <touch:LightTouchDataGridColumn Width="160" Header="Thread" SortMember="ThreadName" HorizontalContentAlignment="Left"> + <touch:LightTouchDataGridColumn.CellTemplate> + <DataTemplate> + <TextBlock IsHitTestVisible="False" Text="{Binding ThreadName,Converter={StaticResource StringEllipsisConverter},ConverterParameter='28'}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> - <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="Length"> + <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="LengthIncludingNumberOfUnits"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0}"></TextBlock> + <TextBlock IsHitTestVisible="False" > + <TextBlock.Text> + <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0'> + <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/> + <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/> + <Binding Path="Spools" Mode="OneWay"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> |
