diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-26 15:00:43 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-26 15:00:43 +0300 |
| commit | 2c11fdf484f1fed9015c7f0c13ea222e5d96f7e6 (patch) | |
| tree | ab4d04ae38752da82066e3dc6aed90d6daa7406c | |
| parent | 3c76016cff1a5e5d9c2ad270a954056e77ea9ce8 (diff) | |
| download | Tango-2c11fdf484f1fed9015c7f0c13ea222e5d96f7e6.tar.gz Tango-2c11fdf484f1fed9015c7f0c13ea222e5d96f7e6.zip | |
Implemented job view inter segment length.
| -rw-r--r-- | Software/Graphics/Mobile/settings.png | bin | 0 -> 857 bytes | |||
| -rw-r--r-- | Software/Graphics/Mobile/settings@2x.png | bin | 0 -> 1725 bytes | |||
| -rw-r--r-- | Software/Graphics/Mobile/settings@3x.png | bin | 0 -> 2511 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml | 92 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs | 28 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/settings.png | bin | 0 -> 857 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 10 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 109 |
9 files changed, 162 insertions, 79 deletions
diff --git a/Software/Graphics/Mobile/settings.png b/Software/Graphics/Mobile/settings.png Binary files differnew file mode 100644 index 000000000..d7b224819 --- /dev/null +++ b/Software/Graphics/Mobile/settings.png diff --git a/Software/Graphics/Mobile/settings@2x.png b/Software/Graphics/Mobile/settings@2x.png Binary files differnew file mode 100644 index 000000000..3e87a17a6 --- /dev/null +++ b/Software/Graphics/Mobile/settings@2x.png diff --git a/Software/Graphics/Mobile/settings@3x.png b/Software/Graphics/Mobile/settings@3x.png Binary files differnew file mode 100644 index 000000000..0b5fbab64 --- /dev/null +++ b/Software/Graphics/Mobile/settings@3x.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml new file mode 100644 index 000000000..1769dd49d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml @@ -0,0 +1,92 @@ +<UserControl x:Class="Tango.PPC.Jobs.Controls.JobSummeryViewer" + 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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:local="clr-namespace:Tango.PPC.Jobs.Controls" + mc:Ignorable="d" + d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=entities:Job, IsDesignTimeCreatable=False}"> + + <Grid> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="1*" /> + </Grid.RowDefinitions> + + <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="Length"></Binding> + </MultiBinding> + </Grid.Width> + + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSize}"> + <Run Text="{Binding Length,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run> + </TextBlock> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Border Grid.Row="1" x:Name="brush_border" ClipToBounds="False" CornerRadius="10" Margin="0 5 0 0"> + <Border.Clip> + <RectangleGeometry RadiusX="10" RadiusY="10"> + <RectangleGeometry.Rect> + <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}"> + <Binding ElementName="brush_border" Path="ActualWidth" /> + <Binding ElementName="brush_border" Path="ActualHeight" /> + </MultiBinding> + </RectangleGeometry.Rect> + </RectangleGeometry> + </Border.Clip> + <Grid> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="Length"></Binding> + </MultiBinding> + </Grid.Width> + <Rectangle> + <Rectangle.Fill> + <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> + </MultiBinding> + </Rectangle.Fill> + </Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="10" RadiusY="10" /> + </Grid> + </Border> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs new file mode 100644 index 000000000..0b3ad620e --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Jobs.Controls +{ + /// <summary> + /// Interaction logic for JobSummeryViewer.xaml + /// </summary> + public partial class JobSummeryViewer : UserControl + { + public JobSummeryViewer() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/settings.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/settings.png Binary files differnew file mode 100644 index 000000000..d7b224819 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/settings.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index ee26a0148..e83e1e29b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -68,6 +68,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\JobSummeryViewer.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\JobsView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -89,6 +93,9 @@ <Compile Include="..\..\..\Versioning\PPC.cs"> <Link>PPC.cs</Link> </Compile> + <Compile Include="Controls\JobSummeryViewer.xaml.cs"> + <DependentUpon>JobSummeryViewer.xaml</DependentUpon> + </Compile> <Compile Include="Converters\JobCollectionToCategoryCountConverter.cs" /> <Compile Include="Converters\JobToPieImageConverter.cs" /> <Compile Include="JobsModule.cs" /> @@ -215,5 +222,8 @@ <ItemGroup> <Resource Include="Images\JobView\job-summary.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\settings.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index a9ac604e6..fdd389ad3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -102,7 +102,7 @@ namespace Tango.PPC.Jobs.ViewModels CustomersAutoCompleteProvider = new AutoCompleteProvider<Customer>((customer, filter) => { - return customer.Name.ToLower().StartsWith(filter.ToLower()); + return customer.Name.ToLower().StartsWith(filter != null ? filter.ToLower() : String.Empty); }); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index c42435f94..45722ae1c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -11,6 +11,7 @@ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:localControls="clr-namespace:Tango.PPC.Jobs.Controls" xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" mc:Ignorable="d" d:DesignHeight="2000" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobViewVM}"> @@ -346,10 +347,19 @@ </touch:TouchButton> </StackPanel> - <StackPanel Style="{StaticResource Level2Container}"> - <StackPanel Margin="0 10 0 0"> - <touch:TouchCheckBox HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> - </StackPanel> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <DockPanel LastChildFill="False"> + <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}"> + <Run Text="Length (m):"></Run> + </TextBlock> + + <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> + + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" /> + </StackPanel> + </DockPanel> </StackPanel> <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" /> @@ -379,78 +389,16 @@ </StackPanel> <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding Job.EffectiveSegments}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> - - <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSize}"> - <Run Text="{Binding Length,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run> - </TextBlock> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + <Grid> + <localControls:JobSummeryViewer DataContext="{Binding Job}" /> + </Grid> - <Border x:Name="brush_border" ClipToBounds="False" CornerRadius="10" Height="17" Margin="0 5 0 0"> - <Border.Clip> - <RectangleGeometry RadiusX="10" RadiusY="10"> - <RectangleGeometry.Rect> - <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}"> - <Binding ElementName="brush_border" Path="ActualWidth" /> - <Binding ElementName="brush_border" Path="ActualHeight" /> - </MultiBinding> - </RectangleGeometry.Rect> - </RectangleGeometry> - </Border.Clip> - <Grid> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding Job.EffectiveSegments}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> - <Rectangle> - <Rectangle.Fill> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Job.Length"></Binding> - </MultiBinding> - </Rectangle.Fill> - </Rectangle> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="10" RadiusY="10" /> - </Grid> - </Border> + <Grid Margin="0 30 0 0"> + <TextBlock> + <Run Text="Job length (m):"></Run> + <Run Text="{Binding Job.Length,Mode=OneWay}"></Run> + </TextBlock> + </Grid> </StackPanel> </StackPanel> </Border> @@ -491,9 +439,14 @@ <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" /> <Border Padding="20 20"> <Grid> - <touch:TouchButton Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding DyeCommand}"> - DYE - </touch:TouchButton> + <DockPanel> + <touch:TouchButton DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding DyeCommand}"> + DYE + </touch:TouchButton> + + <!--Add this in case you want to display job summery on bottom panel--> + <!--<localControls:JobSummeryViewer DataContext="{Binding Job}" Height="35" Margin="0 -20 30 0" />--> + </DockPanel> </Grid> </Border> </Grid> |
