aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-01 16:34:42 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-01 16:34:42 +0300
commitb4f206f1cf88e6d23949e4484cacf024c0ecfcec (patch)
tree9b643daa14498465f369bca76385dc2e0a737516
parent72819bfd9ce2c0573045f25435035fc0288f87bb (diff)
downloadTango-b4f206f1cf88e6d23949e4484cacf024c0ecfcec.tar.gz
Tango-b4f206f1cf88e6d23949e4484cacf024c0ecfcec.zip
Implemented hive on PPC.
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin1572864 -> 1572864 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml116
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs56
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs12
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs (renamed from Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs)9
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj6
8 files changed, 136 insertions, 65 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index 995738447..ed4c7f49e 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 0f05a572a..21d4f4f44 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml
index 9267e07c3..d33b2220a 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml
@@ -5,10 +5,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs"
xmlns:models="clr-namespace:Tango.PPC.Jobs.Models"
+ xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive"
xmlns:pmr="clr-namespace:Tango.PMR.ColorLab;assembly=Tango.PMR"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
mc:Ignorable="d"
- Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="630" d:DesignWidth="560" MinWidth="560" Height="630" d:DataContext="{d:DesignInstance Type=local:AdvancedColorCorrectionViewVM, IsDesignTimeCreatable=False}">
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="630" d:DesignWidth="560" MinWidth="560" Height="700" d:DataContext="{d:DesignInstance Type=local:AdvancedColorCorrectionViewVM, IsDesignTimeCreatable=False}">
<Grid>
<Grid Margin="20">
<Grid.RowDefinitions>
@@ -37,63 +38,66 @@
<DockPanel Grid.Row="2" Margin="0 0 0 0">
<TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please select the best alternative</TextBlock>
- <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoNoRippleListBox}" ItemsSource="{Binding Suggestions}" Margin="0 20 0 0">
- <touch:TouchListBox.ItemContainerStyle>
- <Style TargetType="touch:TouchListBoxItem">
+ <hive:HexList Width="340" Height="460" Margin="0 20 0 0" RowCount="6" ColumnCount="5" ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}">
+ <hive:HexList.ItemContainerStyle>
+ <Style TargetType="ListBoxItem">
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
+ <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
- <Setter Property="Margin" Value="0 10"></Setter>
+ <Setter Property="Grid.Column" Value="{Binding Path=Column}"></Setter>
+ <Setter Property="Grid.Row" Value="{Binding Path=Row}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ListBoxItem">
+ <Grid Margin="10" RenderTransformOrigin="0.5,0.5">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <ScaleTransform ScaleX="1" ScaleY="1" />
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Effect">
+ <Setter.Value>
+ <DropShadowEffect Color="{StaticResource TangoDarkForegroundColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" />
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
+ <DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" />
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" />
+ <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>
+ <DataTrigger.ExitActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" />
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" />
+ <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.ExitActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+ <Ellipse Fill="{Binding Brush}"></Ellipse>
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding DisplayIndices,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <Run Text="{Binding Column}"></Run><Run>,</Run>
+ <Run Text="{Binding Row}"></Run>
+ </TextBlock>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
</Style>
- </touch:TouchListBox.ItemContainerStyle>
- <touch:TouchListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type models:ColorConversionResult}">
- <StackPanel Orientation="Horizontal">
- <Ellipse Width="60" Height="60" Margin="40 0 0 0" Fill="{Binding Brush}" RenderTransformOrigin="0.5,0.5">
- <Ellipse.Style>
- <Style TargetType="Ellipse">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <ScaleTransform ScaleX="1" ScaleY="1" />
- </Setter.Value>
- </Setter>
- <Setter Property="Effect">
- <Setter.Value>
- <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" />
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" />
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" />
- <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" />
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" />
- <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Ellipse.Style>
- </Ellipse>
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">
- <Run Text="{Binding Color.R}"></Run><Run>,</Run>
- <Run Text="{Binding Color.G}"></Run><Run>,</Run>
- <Run Text="{Binding Color.B}"></Run>
- </TextBlock>
- </StackPanel>
- </DataTemplate>
- </touch:TouchListBox.ItemTemplate>
- </touch:TouchListBox>
+ </hive:HexList.ItemContainerStyle>
+ </hive:HexList>
</DockPanel>
<DockPanel Grid.Row="3" Margin="40 10 20 0" LastChildFill="False">
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs
index d48c36c34..fe510622c 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs
@@ -3,12 +3,68 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.PMR.ColorLab;
+using Tango.PPC.Jobs.Models;
using Tango.SharedUI;
namespace Tango.PPC.Jobs.Dialogs
{
public class AdvancedColorCorrectionViewVM : BasicColorCorrectionViewVM
{
+ private static Random rnd = new Random();
+
+ private static OutputCoordinates GetRandomCoordinates()
+ {
+ OutputCoordinates coords = new OutputCoordinates();
+ coords.Red = rnd.Next(0, 255);
+ coords.Green = rnd.Next(0, 255);
+ coords.Blue = rnd.Next(0, 255);
+
+ return coords;
+ }
+
+ private static ColorConversionSuggestion CreateSuggestion(int row, int column)
+ {
+ ColorConversionSuggestion s = new ColorConversionSuggestion();
+ s.Row = row;
+ s.Column = column;
+ s.Coordinates = GetRandomCoordinates();
+
+ return s;
+ }
+
+ public AdvancedColorCorrectionViewVM()
+ {
+ //Create Hive.
+ Suggestions = new List<ColorConversionSuggestion>();
+
+ Suggestions.Add(CreateSuggestion(0, 1));
+ Suggestions.Add(CreateSuggestion(0, 2));
+ Suggestions.Add(CreateSuggestion(0, 3));
+
+ Suggestions.Add(CreateSuggestion(1, 0));
+ Suggestions.Add(CreateSuggestion(1, 1));
+ Suggestions.Add(CreateSuggestion(1, 2));
+ Suggestions.Add(CreateSuggestion(1, 3));
+ Suggestions.Add(CreateSuggestion(1, 4));
+
+ Suggestions.Add(CreateSuggestion(2, 0));
+ Suggestions.Add(CreateSuggestion(2, 1));
+ Suggestions.Add(CreateSuggestion(2, 2));
+ Suggestions.Add(CreateSuggestion(2, 3));
+ Suggestions.Add(CreateSuggestion(2, 4));
+
+ Suggestions.Add(CreateSuggestion(3, 0));
+ Suggestions.Add(CreateSuggestion(3, 1));
+ Suggestions.Add(CreateSuggestion(3, 2));
+ Suggestions.Add(CreateSuggestion(3, 3));
+ Suggestions.Add(CreateSuggestion(3, 4));
+
+ Suggestions.Add(CreateSuggestion(4, 2));
+
+ //Select Center Hex.
+ }
+
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml
index ffeea1b48..6df139cd8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml
@@ -45,7 +45,7 @@
</Style>
</touch:TouchListBox.ItemContainerStyle>
<touch:TouchListBox.ItemTemplate>
- <DataTemplate DataType="{x:Type models:ColorConversionResult}">
+ <DataTemplate DataType="{x:Type models:ColorConversionSuggestion}">
<StackPanel Orientation="Horizontal">
<Ellipse Width="60" Height="60" Margin="40 0 0 0" Fill="{Binding Brush}" RenderTransformOrigin="0.5,0.5">
<Ellipse.Style>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs
index ecc32cd00..0012ac71d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs
@@ -25,9 +25,9 @@ namespace Tango.PPC.Jobs.Dialogs
public BasicColorCorrectionResult Result { get; private set; }
- public List<ColorConversionResult> Suggestions { get; set; }
+ public List<ColorConversionSuggestion> Suggestions { get; set; }
- public ColorConversionResult SelectedSuggestion { get; set; }
+ public ColorConversionSuggestion SelectedSuggestion { get; set; }
public RelayCommand MoreOptionsCommand { get; set; }
@@ -39,9 +39,9 @@ namespace Tango.PPC.Jobs.Dialogs
Accept();
});
- Suggestions = new List<ColorConversionResult>();
+ Suggestions = new List<ColorConversionSuggestion>();
- Suggestions.Add(new ColorConversionResult()
+ Suggestions.Add(new ColorConversionSuggestion()
{
Coordinates = new PMR.ColorLab.OutputCoordinates()
{
@@ -51,7 +51,7 @@ namespace Tango.PPC.Jobs.Dialogs
},
});
- Suggestions.Add(new ColorConversionResult()
+ Suggestions.Add(new ColorConversionSuggestion()
{
Coordinates = new PMR.ColorLab.OutputCoordinates()
{
@@ -61,7 +61,7 @@ namespace Tango.PPC.Jobs.Dialogs
},
});
- Suggestions.Add(new ColorConversionResult()
+ Suggestions.Add(new ColorConversionSuggestion()
{
Coordinates = new PMR.ColorLab.OutputCoordinates()
{
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs
index deeb363dc..8d88070d7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs
@@ -9,7 +9,7 @@ using Tango.PMR.ColorLab;
namespace Tango.PPC.Jobs.Models
{
- public class ColorConversionResult : ExtendedObject
+ public class ColorConversionSuggestion : ExtendedObject
{
public Color Color
{
@@ -34,5 +34,12 @@ namespace Tango.PPC.Jobs.Models
public int Column { get; set; }
public int Row { get; set; }
+
+ public bool DisplayIndices { get; set; }
+
+ public ColorConversionSuggestion()
+ {
+ DisplayIndices = false;
+ }
}
}
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 d1999608d..1212be08d 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
@@ -122,7 +122,7 @@
<Compile Include="Messages\JobRemovedMessage.cs" />
<Compile Include="Messages\JobSavedMessage.cs" />
<Compile Include="Messages\JobSelectedMessage.cs" />
- <Compile Include="Models\ColorConversionResult.cs" />
+ <Compile Include="Models\ColorConversionSuggestion.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@@ -177,6 +177,10 @@
<Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project>
<Name>Tango.DragAndDrop</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Hive\Tango.Hive.csproj">
+ <Project>{942134ac-6ea2-4500-8f22-0f739b70a05f}</Project>
+ <Name>Tango.Hive</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj">
<Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
<Name>Tango.Logging</Name>