From b4f206f1cf88e6d23949e4484cacf024c0ecfcec Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 1 Jul 2018 16:34:42 +0300 Subject: Implemented hive on PPC. --- .../Dialogs/AdvancedColorCorrectionView.xaml | 116 +++++++++++---------- .../Dialogs/AdvancedColorCorrectionViewVM.cs | 56 ++++++++++ .../Dialogs/BasicColorCorrectionView.xaml | 2 +- .../Dialogs/BasicColorCorrectionViewVM.cs | 12 +-- .../Tango.PPC.Jobs/Models/ColorConversionResult.cs | 38 ------- .../Models/ColorConversionSuggestion.cs | 45 ++++++++ .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 6 +- 7 files changed, 173 insertions(+), 102 deletions(-) delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs (limited to 'Software/Visual_Studio/PPC/Modules') 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}"> @@ -37,63 +38,66 @@ Please select the best alternative - - - + + + + , + + + + + + - - - - - - - - - - - , - , - - - - - - + + 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(); + + 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 @@ - + 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 Suggestions { get; set; } + public List 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(); + Suggestions = new List(); - 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/ColorConversionResult.cs deleted file mode 100644 index deeb363dc..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs +++ /dev/null @@ -1,38 +0,0 @@ -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)); } - } - - public int Column { get; set; } - - public int Row { get; set; } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs new file mode 100644 index 000000000..8d88070d7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionSuggestion.cs @@ -0,0 +1,45 @@ +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 ColorConversionSuggestion : 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)); } + } + + 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 @@ - + Code @@ -177,6 +177,10 @@ {b112d89a-a106-41ae-a0c1-4abc84c477f5} Tango.DragAndDrop + + {942134ac-6ea2-4500-8f22-0f739b70a05f} + Tango.Hive + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging -- cgit v1.3.1 From 9abee60d7f07068c5f07c3e44f7aa1e8049d97ef Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 1 Jul 2018 17:47:36 +0300 Subject: Working on PPC. --- Software/Graphics/Mobile/twine-catalog.png | Bin 0 -> 1408 bytes Software/Graphics/Mobile/twine-catalog@2x.png | Bin 0 -> 2764 bytes Software/Graphics/Mobile/twine-catalog@3x.png | Bin 0 -> 4063 bytes .../Controls/TwineCatalogControl.xaml | 12 +++++++++ .../Controls/TwineCatalogControl.xaml.cs | 28 +++++++++++++++++++++ .../Dialogs/AdvancedColorCorrectionView.xaml | 7 ++++-- .../Dialogs/BasicColorCorrectionView.xaml | 2 +- .../Images/JobView/twine-catalog.png | Bin 0 -> 1408 bytes .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 10 ++++++++ 9 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 Software/Graphics/Mobile/twine-catalog.png create mode 100644 Software/Graphics/Mobile/twine-catalog@2x.png create mode 100644 Software/Graphics/Mobile/twine-catalog@3x.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/twine-catalog.png (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Graphics/Mobile/twine-catalog.png b/Software/Graphics/Mobile/twine-catalog.png new file mode 100644 index 000000000..35d9b69cd Binary files /dev/null and b/Software/Graphics/Mobile/twine-catalog.png differ diff --git a/Software/Graphics/Mobile/twine-catalog@2x.png b/Software/Graphics/Mobile/twine-catalog@2x.png new file mode 100644 index 000000000..4d98c27b8 Binary files /dev/null and b/Software/Graphics/Mobile/twine-catalog@2x.png differ diff --git a/Software/Graphics/Mobile/twine-catalog@3x.png b/Software/Graphics/Mobile/twine-catalog@3x.png new file mode 100644 index 000000000..46c234069 Binary files /dev/null and b/Software/Graphics/Mobile/twine-catalog@3x.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml new file mode 100644 index 000000000..51917b594 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.xaml.cs new file mode 100644 index 000000000..b1a109a75 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogControl.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 +{ + /// + /// Interaction logic for TwineCatalogControl.xaml + /// + public partial class TwineCatalogControl : UserControl + { + public TwineCatalogControl() + { + InitializeComponent(); + } + } +} 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 d33b2220a..f707397a4 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 @@ -20,7 +20,7 @@ - Color is out of gamut + Color is out of range @@ -102,7 +102,10 @@ - Twine Catalog + + + Twine Catalog + 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 6df139cd8..32759d292 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 @@ -19,7 +19,7 @@ - Color is out of gamut + Color is out of range diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/twine-catalog.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/twine-catalog.png new file mode 100644 index 000000000..35d9b69cd Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/twine-catalog.png differ 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 1212be08d..7e8dc94b3 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 @@ -72,6 +72,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -108,6 +112,9 @@ JobSummeryViewer.xaml + + TwineCatalogControl.xaml + @@ -258,5 +265,8 @@ + + + \ No newline at end of file -- cgit v1.3.1