aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-01 09:09:55 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-01 09:09:55 +0300
commitbe014619f075a3ff76e03487014212234955f322 (patch)
tree8e4e387dfeb5e4f51cc60461f47812451dac950a /Software/Visual_Studio/PPC
parent1303ac651e1990447612e139d02d5844c05fb31c (diff)
downloadTango-be014619f075a3ff76e03487014212234955f322.tar.gz
Tango-be014619f075a3ff76e03487014212234955f322.zip
Working on PPC color conversion UI.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml91
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs40
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs34
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj1
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml1
6 files changed, 166 insertions, 6 deletions
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 404ef7560..ccbcc8394 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
@@ -4,14 +4,95 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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: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="555" d:DesignWidth="560" MinWidth="560" MinHeight="555" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}">
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" MinWidth="560" Height="555" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}">
<Grid>
- <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">This is a dialog</TextBlock>
+ <Grid Margin="20">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="40"/>
+ <RowDefinition Height="100"/>
+ <RowDefinition Height="1*"/>
+ <RowDefinition Height="101"/>
+ </Grid.RowDefinitions>
- <touch:TouchButton VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="200" Height="50" Command="{Binding OKCommand}">
- OK
- </touch:TouchButton>
+ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoErrorBrush}">Color is out of gamut</TextBlock>
+
+ <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center">
+ <Image Source="../Images/JobView/error.png" Stretch="None" />
+ <Ellipse Width="60" Height="60" Margin="20 0 0 0" Fill="{Binding InvalidBrushStop.Brush}" />
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Margin="20 0 0 0">
+ <Run Text="{Binding InvalidBrushStop.Red}"></Run><Run>,</Run>
+ <Run Text="{Binding InvalidBrushStop.Green}"></Run><Run>,</Run>
+ <Run Text="{Binding InvalidBrushStop.Blue}"></Run>
+ </TextBlock>
+ </StackPanel>
+
+ <DockPanel Grid.Row="2" Margin="0 0 0 0">
+ <TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please select an alternative</TextBlock>
+
+ <!--<Grid>-->
+ <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoBasicListBox}" ItemsSource="{Binding Results}" Margin="0 20 0 0">
+ <touch:TouchListBox.ItemContainerStyle>
+ <Style TargetType="touch:TouchListBoxItem">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Margin" Value="0 10"></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>
+ <!--</Grid>-->
+ </DockPanel>
+ </Grid>
</Grid>
</UserControl>
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 a146d2348..9ad80e025 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
@@ -3,12 +3,52 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.BL.Entities;
+using Tango.PPC.Jobs.Models;
using Tango.SharedUI;
namespace Tango.PPC.Jobs.Dialogs
{
public class BasicColorCorrectionViewVM : DialogViewVM
{
+ public BrushStop InvalidBrushStop { get; set; }
+ public List<ColorConversionResult> Results { get; set; }
+
+ public BasicColorCorrectionViewVM()
+ {
+ Results = new List<ColorConversionResult>();
+
+ Results.Add(new ColorConversionResult()
+ {
+ Coordinates = new PMR.ColorLab.OutputCoordinates()
+ {
+ Red = 255,
+ Green = 0,
+ Blue = 0
+ },
+ });
+
+ Results.Add(new ColorConversionResult()
+ {
+ Coordinates = new PMR.ColorLab.OutputCoordinates()
+ {
+ Red = 0,
+ Green = 255,
+ Blue = 0
+ },
+ });
+
+ Results.Add(new ColorConversionResult()
+ {
+ Coordinates = new PMR.ColorLab.OutputCoordinates()
+ {
+ Red = 0,
+ Green = 0,
+ Blue = 255
+ },
+ });
+
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs
new file mode 100644
index 000000000..32d4733f7
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+using Tango.Core;
+using Tango.PMR.ColorLab;
+
+namespace Tango.PPC.Jobs.Models
+{
+ public class ColorConversionResult : ExtendedObject
+ {
+ public Color Color
+ {
+ get
+ {
+ return Color.FromRgb((byte)Coordinates.Red, (byte)Coordinates.Green, (byte)Coordinates.Blue);
+ }
+ }
+
+ public SolidColorBrush Brush
+ {
+ get { return new SolidColorBrush(Color); }
+ }
+
+ private OutputCoordinates _coordinates;
+ public OutputCoordinates Coordinates
+ {
+ get { return _coordinates; }
+ set { _coordinates = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Color)); RaisePropertyChanged(nameof(Brush)); }
+ }
+ }
+}
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 82f890876..940c438d2 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
@@ -114,6 +114,7 @@
<Compile Include="Messages\JobRemovedMessage.cs" />
<Compile Include="Messages\JobSavedMessage.cs" />
<Compile Include="Messages\JobSelectedMessage.cs" />
+ <Compile Include="Models\ColorConversionResult.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
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 b7f4eea9a..85aab2129 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
@@ -313,7 +313,10 @@ namespace Tango.PPC.Jobs.ViewModels
/// <param name="brushStop">The brush stop.</param>
private async void InvokeColorAdjustmentForBrushStop(BrushStop brushStop)
{
- var vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>();
+ var vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>(new BasicColorCorrectionViewVM()
+ {
+ InvalidBrushStop = brushStop,
+ });
var b = vm;
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
index c8041863b..e28234573 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
@@ -13,6 +13,7 @@
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" />
+ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchListBox.xaml" />
<!--PPC-->
<ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Colors.xaml"/>