aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-05-29 15:11:43 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-05-29 15:11:43 +0300
commit378789e4c4bc694736965cb8c620883bf91b8f08 (patch)
tree941148572faa6d297593bf4686e6fca8521f67aa /Software/Visual_Studio/PPC
parentf7424796d093009adc95df6cbb2d54d6bce57592 (diff)
downloadTango-378789e4c4bc694736965cb8c620883bf91b8f08.tar.gz
Tango-378789e4c4bc694736965cb8c620883bf91b8f08.zip
Added Flexo font.
Improved Jobs list. Added job status.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Themes/Generic.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml61
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs38
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml2
9 files changed, 109 insertions, 36 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml
new file mode 100644
index 000000000..935e2b199
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml
@@ -0,0 +1,10 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:local="clr-namespace:Tango.PanelPC.Common.Resources">
+
+ <FontFamily x:Key="Flexo">Flexo</FontFamily>
+ <sys:Double x:Key="NavigationLinks-Font-Size">12.524999999999999</sys:Double>
+ <sys:Double x:Key="Button-Font-Size">15.899999999999999</sys:Double>
+
+</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index 3a3090c6a..9ca7a86b4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -7,7 +7,7 @@
<ProjectGuid>{0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>Tango.PanelPC.Common</RootNamespace>
- <AssemblyName>Tango.PanelPC.Common</AssemblyName>
+ <AssemblyName>Tango.PPC.Common</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -76,6 +76,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Resources\Fonts.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -165,11 +169,11 @@
<ItemGroup>
<Content Include="..\..\..\DB\Tango.mdf">
<Link>DB\Tango.mdf</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\..\..\DB\Tango_log.ldf">
<Link>DB\Tango_log.ldf</Link>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
@@ -184,5 +188,8 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <Folder Include="Fonts\" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Themes/Generic.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Themes/Generic.xaml
index af7652bf7..6e11a6617 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Themes/Generic.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Themes/Generic.xaml
@@ -2,17 +2,9 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Tango.PPC.Common">
- <Style TargetType="{x:Type local:CustomControl1}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:CustomControl1}">
- <Border Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Fonts.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+
</ResourceDictionary>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
index ddfb18c60..5cded95b4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
@@ -9,6 +9,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Fonts.xaml"/>
+ <ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Fonts.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" />
<!--Styles-->
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
index f716a6e88..ba5099fb5 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Tango.PPC.UI"
xmlns:views="clr-namespace:Tango.PPC.UI.Views"
mc:Ignorable="d"
- Title="MainWindow" Height="1000" Width="625" WindowStyle="None" ResizeMode="NoResize">
+ Title="MainWindow" Height="1000" Width="625" WindowStyle="None" ResizeMode="NoResize" FontFamily="{StaticResource Flexo}">
<Grid>
<Viewbox Stretch="Fill">
<Grid Height="1280" Width="800">
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 6a60b6701..964f34ace 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -7,7 +7,7 @@
<ProjectGuid>{654BEDA3-16FB-44FF-ADE7-B52E50B02E63}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Tango.PanelPC.UI</RootNamespace>
- <AssemblyName>Tango.PanelPC.UI</AssemblyName>
+ <AssemblyName>Tango.PPC.UI</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
index 8062280de..c460e3b1e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
@@ -6,7 +6,7 @@
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
xmlns:keyboard="clr-namespace:Tango.SharedUI.Keyboard;assembly=Tango.SharedUI"
- xmlns:converters="clr-namespace:Tango.PPC.Common.Converters;assembly=Tango.PanelPC.Common"
+ xmlns:converters="clr-namespace:Tango.PPC.Common.Converters;assembly=Tango.PPC.Common"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
@@ -18,6 +18,7 @@
<UserControl.Resources>
<converters:SegmentsToPieConverter x:Key="SegmentsToPieConverter" />
<sharedConverters:DateTimeUTCToShortDateConverter x:Key="DateTimeUTCToShortDateConverter" />
+ <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
</UserControl.Resources>
<Grid Background="{StaticResource TangoMidBackgroundBrush}">
@@ -39,14 +40,14 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20" FontSize="18" FontWeight="SemiBold">
+ <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20" FontSize="{StaticResource NavigationLinks-Font-Size}">
<sys:String>READY TO DYE</sys:String>
<sys:String>NOT READY</sys:String>
<sys:String>ALL</sys:String>
</touch:TouchNavigationLinks>
<Grid Grid.Row="1">
- <touch:TouchDataGrid ItemsSource="{Binding Jobs}" Margin="10" EnableDropShadow="True" ShadowColor="#ECECEC" AutoGenerateColumns="False" RowHeight="68" ColumnHeaderHeight="67">
+ <touch:TouchDataGrid x:Name="dataGridJobs" ItemsSource="{Binding Jobs}" Margin="10" EnableDropShadow="True" ShadowColor="#ECECEC" AutoGenerateColumns="False" RowHeight="68" ColumnHeaderHeight="67">
<touch:TouchDataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
@@ -58,34 +59,58 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTextColumn Header="Status" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Name" Width="295" Binding="{Binding Name}"></DataGridTextColumn>
- <DataGridTextColumn Header="Length (m)" Binding="{Binding Length,StringFormat=0.0}"></DataGridTextColumn>
- <DataGridTemplateColumn Header="Colors" SortMemberPath="Segments.Count">
+ <DataGridTextColumn Width="90" Header="Status" Binding="{Binding JobStatus,Converter={StaticResource EnumToDescriptionConverter}}"></DataGridTextColumn>
+ <DataGridTextColumn Width="256" Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
+ <DataGridTextColumn Width="110" Header="Length (m)" Binding="{Binding Length,StringFormat=0.0}"></DataGridTextColumn>
+ <DataGridTemplateColumn Header="Colors" SortMemberPath="Segments.Count" Width="80">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
- <ContentControl Content="{Binding Segments,Converter={StaticResource SegmentsToPieConverter}}" Width="23" Height="23"></ContentControl>
+ <ContentControl Content="{Binding Segments,Converter={StaticResource SegmentsToPieConverter}}" Width="23" Height="23" HorizontalAlignment="Left"></ContentControl>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTextColumn Header="Updated" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></DataGridTextColumn>
- <DataGridTextColumn Binding="{Binding JobIndex}" Width="70" SortMemberPath="JobIndex">
- <DataGridTextColumn.HeaderStyle>
+ <DataGridTextColumn Width="95" Header="Updated" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></DataGridTextColumn>
+ <DataGridTemplateColumn x:Name="userSortColumn" SortMemberPath="JobIndex" SortDirection="Ascending" Width="78" CanUserSort="False">
+ <DataGridTemplateColumn.HeaderStyle>
<Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
<Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter>
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
<Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
+ <EventSetter Event="PreviewMouseUp" Handler="OnJobIndexColumnClick"></EventSetter>
</Style>
- </DataGridTextColumn.HeaderStyle>
- <DataGridTextColumn.Header>
- <Grid>
- <Grid IsHitTestVisible="False">
+ </DataGridTemplateColumn.HeaderStyle>
+ <DataGridTemplateColumn.Header>
+ <Border CornerRadius="0 5 5 0" x:Name="userSortColumnBorder">
+ <Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter>
+ </Style>
+ </Border.Style>
+ <Grid>
<Rectangle HorizontalAlignment="Left" StrokeThickness="2" Stroke="{StaticResource TangoColumnDividerBrush}" />
<Image Source="/Images/arrows.png" Width="28" />
</Grid>
- </Grid>
- </DataGridTextColumn.Header>
- </DataGridTextColumn>
+ </Border>
+ </DataGridTemplateColumn.Header>
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <StackPanel Width="30">
+ <StackPanel.Style>
+ <Style TargetType="StackPanel">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Source={x:Reference userSortColumn},Path=SortDirection}" Value="Ascending">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <Rectangle StrokeThickness="2" Stroke="{StaticResource TangoDarkForegroundBrush}" />
+ <Rectangle StrokeThickness="2" Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="0 5 0 0" />
+ </StackPanel>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
</touch:TouchDataGrid.Columns>
</touch:TouchDataGrid>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs
index 3ccb48c01..5ec459f5e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -23,6 +24,43 @@ namespace Tango.PPC.UI.Views
public JobsView()
{
InitializeComponent();
+
+ dataGridJobs.Sorting += DataGridJobs_Sorting;
+ }
+
+ private void DataGridJobs_Sorting(object sender, DataGridSortingEventArgs e)
+ {
+ if (e.Column != userSortColumn)
+ {
+ userSortColumnBorder.Background = Application.Current.Resources["TangoMidAccentBrush"] as Brush;
+ }
+ }
+
+ private void OnJobIndexColumnClick(object sender, MouseButtonEventArgs e)
+ {
+ SortDataGrid(dataGridJobs, dataGridJobs.Columns.Count - 1, ListSortDirection.Ascending);
+ userSortColumnBorder.Background = Application.Current.Resources["TangoLowAccentBrush"] as Brush;
+ }
+
+ private static void SortDataGrid(DataGrid dataGrid, int columnIndex = 0, ListSortDirection sortDirection = ListSortDirection.Ascending)
+ {
+ var column = dataGrid.Columns[columnIndex];
+
+ // Clear current sort descriptions
+ dataGrid.Items.SortDescriptions.Clear();
+
+ // Add the new sort description
+ dataGrid.Items.SortDescriptions.Add(new SortDescription(column.SortMemberPath, sortDirection));
+
+ // Apply sort
+ foreach (var col in dataGrid.Columns)
+ {
+ col.SortDirection = null;
+ }
+ column.SortDirection = sortDirection;
+
+ // Refresh items to display sort
+ dataGrid.Items.Refresh();
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index 2a6d1b52b..41c221df5 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -96,7 +96,7 @@
</Border>
<Grid>
<StackPanel HorizontalAlignment="Right" Margin="30 0" Orientation="Horizontal">
- <touch:TouchButton Height="54" FontSize="20" Padding="0" Width="184" CornerRadius="30" BlurRadius="20">
+ <touch:TouchButton Height="54" FontSize="{StaticResource Button-Font-Size}" Padding="0" Width="184" CornerRadius="30" BlurRadius="20">
DYE
</touch:TouchButton>
</StackPanel>