aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-06-05 16:57:10 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-06-05 16:57:10 +0300
commitaa47e2874ee506b6f0d9b9f70f780fb4fe5d8c73 (patch)
treec5ee17f5e74343d87f95f68635851845342bc22f
parent44c2abcbc60357ed282cae20c8476de2b50cbe25 (diff)
downloadTango-aa47e2874ee506b6f0d9b9f70f780fb4fe5d8c73.tar.gz
Tango-aa47e2874ee506b6f0d9b9f70f780fb4fe5d8c73.zip
Implemented Coats Catalog !
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/Graphics/Mobile/coats-sylko-logo.pngbin0 -> 8189 bytes
-rw-r--r--Software/Graphics/Mobile/coats-sylko-logo@2x.pngbin0 -> 25037 bytes
-rw-r--r--Software/Graphics/Mobile/coats-sylko-logo@3x.pngbin0 -> 47114 bytes
-rw-r--r--Software/Graphics/Mobile/coats.pngbin0 -> 971 bytes
-rw-r--r--Software/Graphics/Mobile/coats@2x.pngbin0 -> 1873 bytes
-rw-r--r--Software/Graphics/Mobile/coats@3x.pngbin0 -> 2781 bytes
-rw-r--r--Software/Graphics/Mobile/thread.pngbin0 -> 5682 bytes
-rw-r--r--Software/Graphics/Mobile/thread@2x.pngbin0 -> 27389 bytes
-rw-r--r--Software/Graphics/Mobile/thread@3x.pngbin0 -> 53152 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml27
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml.cs95
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats-sylko-logo.pngbin0 -> 8189 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats.pngbin0 -> 971 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/thread.pngbin0 -> 5682 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModuleSettings.cs6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj26
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs12
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/CoatsCatalogViewVM.cs139
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs52
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml57
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml26
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml145
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml.cs112
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs44
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj9
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.BL/Catalogs/CatalogGroup.cs2
-rw-r--r--Software/Visual_Studio/Tango.BL/Catalogs/CatalogLoader.cs5
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs1
-rw-r--r--Software/Visual_Studio/Tango.sln43
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CatalogImporter/Program.cs2
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/App.config24
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Program.cs127
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Properties/AssemblyInfo.cs36
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Tango.CoatsCatalogImporter.csproj82
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/coats.xlsxbin0 -> 85154 bytes
-rw-r--r--Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/packages.config4
41 files changed, 1058 insertions, 49 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index f4cf8629e..3af16e07e 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index 33d3cb5a5..f3e61b08d 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/Graphics/Mobile/coats-sylko-logo.png b/Software/Graphics/Mobile/coats-sylko-logo.png
new file mode 100644
index 000000000..5fc4c13d1
--- /dev/null
+++ b/Software/Graphics/Mobile/coats-sylko-logo.png
Binary files differ
diff --git a/Software/Graphics/Mobile/coats-sylko-logo@2x.png b/Software/Graphics/Mobile/coats-sylko-logo@2x.png
new file mode 100644
index 000000000..a0e8cf3fe
--- /dev/null
+++ b/Software/Graphics/Mobile/coats-sylko-logo@2x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/coats-sylko-logo@3x.png b/Software/Graphics/Mobile/coats-sylko-logo@3x.png
new file mode 100644
index 000000000..5df4f6c41
--- /dev/null
+++ b/Software/Graphics/Mobile/coats-sylko-logo@3x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/coats.png b/Software/Graphics/Mobile/coats.png
new file mode 100644
index 000000000..1b2d01f51
--- /dev/null
+++ b/Software/Graphics/Mobile/coats.png
Binary files differ
diff --git a/Software/Graphics/Mobile/coats@2x.png b/Software/Graphics/Mobile/coats@2x.png
new file mode 100644
index 000000000..f62dc1a16
--- /dev/null
+++ b/Software/Graphics/Mobile/coats@2x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/coats@3x.png b/Software/Graphics/Mobile/coats@3x.png
new file mode 100644
index 000000000..de510add9
--- /dev/null
+++ b/Software/Graphics/Mobile/coats@3x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/thread.png b/Software/Graphics/Mobile/thread.png
new file mode 100644
index 000000000..443897335
--- /dev/null
+++ b/Software/Graphics/Mobile/thread.png
Binary files differ
diff --git a/Software/Graphics/Mobile/thread@2x.png b/Software/Graphics/Mobile/thread@2x.png
new file mode 100644
index 000000000..07b15efbd
--- /dev/null
+++ b/Software/Graphics/Mobile/thread@2x.png
Binary files differ
diff --git a/Software/Graphics/Mobile/thread@3x.png b/Software/Graphics/Mobile/thread@3x.png
new file mode 100644
index 000000000..ed4334cfa
--- /dev/null
+++ b/Software/Graphics/Mobile/thread@3x.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml
new file mode 100644
index 000000000..51388a93f
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml
@@ -0,0 +1,27 @@
+<UserControl x:Class="Tango.PPC.Jobs.Controls.CoatsCatalogViewer"
+ 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:controls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:local="clr-namespace:Tango.PPC.Jobs.Controls"
+ mc:Ignorable="d"
+ d:DesignHeight="500" d:DesignWidth="300">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="80"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <touch:TouchNavigationLinks FontSize="{StaticResource TangoTitleFontSize}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Filter,Mode=TwoWay}">
+ <sys:String>CATALOG</sys:String>
+ <sys:String>RECENT</sys:String>
+ </touch:TouchNavigationLinks>
+ </Grid>
+
+ <controls:CoatsCatalogControl x:Name="catalogControl" Grid.Row="1" DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:CoatsCatalogViewer},Path=Catalog}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=local:CoatsCatalogViewer},Path=SelectedItem,Mode=TwoWay}" />
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml.cs
new file mode 100644
index 000000000..d69066e4e
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/CoatsCatalogViewer.xaml.cs
@@ -0,0 +1,95 @@
+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;
+using Tango.BL.Catalogs;
+
+namespace Tango.PPC.Jobs.Controls
+{
+ /// <summary>
+ /// Interaction logic for CoatsCatalogViewer.xaml
+ /// </summary>
+ public partial class CoatsCatalogViewer : UserControl
+ {
+ private Catalog _originalCatalog;
+
+ /// <summary>
+ /// Gets or sets the recent catalog items as a catalog.
+ /// </summary>
+ public Catalog Recent
+ {
+ get { return (Catalog)GetValue(RecentProperty); }
+ set { SetValue(RecentProperty, value); }
+ }
+ public static readonly DependencyProperty RecentProperty =
+ DependencyProperty.Register("Recent", typeof(Catalog), typeof(CoatsCatalogViewer), new PropertyMetadata(null));
+
+ /// <summary>
+ /// Gets or sets the catalog.
+ /// </summary>
+ public Catalog Catalog
+ {
+ get { return (Catalog)GetValue(CatalogProperty); }
+ set { SetValue(CatalogProperty, value); }
+ }
+ public static readonly DependencyProperty CatalogProperty =
+ DependencyProperty.Register("Catalog", typeof(Catalog), typeof(CoatsCatalogViewer), new PropertyMetadata(null));
+
+ /// <summary>
+ /// Gets or sets the selected catalog item.
+ /// </summary>
+ public CatalogItem SelectedItem
+ {
+ get { return (CatalogItem)GetValue(SelectedItemProperty); }
+ set { SetValue(SelectedItemProperty, value); }
+ }
+ public static readonly DependencyProperty SelectedItemProperty =
+ DependencyProperty.Register("SelectedItem", typeof(CatalogItem), typeof(CoatsCatalogViewer), new PropertyMetadata(null));
+
+ /// <summary>
+ /// Gets or sets the current catalog filter.
+ /// </summary>
+ public String Filter
+ {
+ get { return (String)GetValue(FilterProperty); }
+ set { SetValue(FilterProperty, value); }
+ }
+ public static readonly DependencyProperty FilterProperty =
+ DependencyProperty.Register("Filter", typeof(String), typeof(CoatsCatalogViewer), new PropertyMetadata(null, (d, e) => (d as CoatsCatalogViewer).OnFilterChanged()));
+
+ /// <summary>
+ /// Called when the filter has been changed
+ /// </summary>
+ private void OnFilterChanged()
+ {
+ if (Filter == "CATALOG" && _originalCatalog != null)
+ {
+ Catalog = _originalCatalog;
+ }
+ else if (Filter == "RECENT")
+ {
+ _originalCatalog = Catalog;
+ Catalog = Recent;
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="CoatsCatalogViewer"/> class.
+ /// </summary>
+ public CoatsCatalogViewer()
+ {
+ InitializeComponent();
+ Filter = "CATALOG";
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats-sylko-logo.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats-sylko-logo.png
new file mode 100644
index 000000000..5fc4c13d1
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats-sylko-logo.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats.png
new file mode 100644
index 000000000..1b2d01f51
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/coats.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/thread.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/thread.png
new file mode 100644
index 000000000..443897335
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Coats/thread.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModuleSettings.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModuleSettings.cs
index 259f6031b..15b859168 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModuleSettings.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModuleSettings.cs
@@ -20,6 +20,11 @@ namespace Tango.PPC.Jobs
public List<String> RecentTwineCatalogColors { get; set; }
/// <summary>
+ /// Gets or sets the recent coats catalog colors.
+ /// </summary>
+ public List<String> RecentCoatsCatalogColors { get; set; }
+
+ /// <summary>
/// Gets or sets the last job color space.
/// </summary>
public ColorSpaces? LastJobColorSpace { get; set; }
@@ -35,6 +40,7 @@ namespace Tango.PPC.Jobs
public JobsModuleSettings()
{
RecentTwineCatalogColors = new List<string>();
+ RecentCoatsCatalogColors = new List<string>();
}
}
}
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 55983118d..4adb1bfb6 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 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Controls\CoatsCatalogViewer.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Controls\RunningJobViewer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -144,6 +148,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Views\CoatsCatalogView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\TwineCatalogView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -159,6 +167,9 @@
</Compile>
<Compile Include="AppButtons\StartPrintingButton.cs" />
<Compile Include="AppButtons\StopPrintingButton.cs" />
+ <Compile Include="Controls\CoatsCatalogViewer.xaml.cs">
+ <DependentUpon>CoatsCatalogViewer.xaml</DependentUpon>
+ </Compile>
<Compile Include="Controls\RunningJobViewer.xaml.cs">
<DependentUpon>RunningJobViewer.xaml</DependentUpon>
</Compile>
@@ -240,6 +251,7 @@
<Compile Include="ViewModels\JobsViewVM.cs" />
<Compile Include="ViewModels\JobViewVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
+ <Compile Include="ViewModels\CoatsCatalogViewVM.cs" />
<Compile Include="ViewModels\TwineCatalogViewVM.cs" />
<Compile Include="Views\JobProgressView.xaml.cs">
<DependentUpon>JobProgressView.xaml</DependentUpon>
@@ -256,6 +268,9 @@
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\CoatsCatalogView.xaml.cs">
+ <DependentUpon>CoatsCatalogView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\TwineCatalogView.xaml.cs">
<DependentUpon>TwineCatalogView.xaml</DependentUpon>
</Compile>
@@ -448,10 +463,19 @@
<ItemGroup>
<Resource Include="Images\emb-file.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Coats\coats.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Coats\coats-sylko-logo.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Coats\thread.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs
index 1b91d2ee8..c419bb8e2 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs
@@ -20,6 +20,7 @@ namespace Tango.PPC.Jobs
TangoIOC.Default.Register<JobSummeryViewVM>();
TangoIOC.Default.Register<JobViewVM>();
TangoIOC.Default.Register<TwineCatalogViewVM>();
+ TangoIOC.Default.Register<CoatsCatalogViewVM>();
TangoIOC.Default.Register<JobProgressViewVM>();
}
@@ -79,6 +80,17 @@ namespace Tango.PPC.Jobs
}
/// <summary>
+ /// Gets the coats catalog view VM.
+ /// </summary>
+ public static CoatsCatalogViewVM CoatsCatalogViewVM
+ {
+ get
+ {
+ return TangoIOC.Default.GetInstance<CoatsCatalogViewVM>();
+ }
+ }
+
+ /// <summary>
/// Gets the job progress view VM.
/// </summary>
public static JobProgressViewVM JobProgressViewVM
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/CoatsCatalogViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/CoatsCatalogViewVM.cs
new file mode 100644
index 000000000..23945e84b
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/CoatsCatalogViewVM.cs
@@ -0,0 +1,139 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL;
+using Tango.BL.Catalogs;
+using Tango.BL.Entities;
+using Tango.Core.Commands;
+using Tango.PPC.Common;
+using Tango.PPC.Common.Navigation;
+using Tango.PPC.Jobs.NavigationObjects;
+using Tango.Settings;
+
+namespace Tango.PPC.Jobs.ViewModels
+{
+ /// <summary>
+ /// Represents the coats catalog view model.
+ /// </summary>
+ /// <seealso cref="PPCViewModel" />
+ /// <seealso cref="INavigationResultProvider{CatalogItem, TwineCatalogNavigationObject}" />
+ public class CoatsCatalogViewVM : PPCViewModel, INavigationResultProvider<CatalogItem, TwineCatalogNavigationObject>
+ {
+ private bool _confirmed;
+ private ObservablesContext _db;
+
+ private Catalog _catalog;
+ /// <summary>
+ /// Gets or sets the catalog.
+ /// </summary>
+ public Catalog Catalog
+ {
+ get { return _catalog; }
+ set { _catalog = value; RaisePropertyChangedAuto(); }
+ }
+
+ private Catalog _recent;
+ /// <summary>
+ /// Gets or sets the recent catalog items as a complete catalog.
+ /// </summary>
+ public Catalog Recent
+ {
+ get { return _recent; }
+ set { _recent = value; RaisePropertyChangedAuto(); }
+ }
+
+ private CatalogItem _selectedItem;
+ /// <summary>
+ /// Gets or sets the selected item.
+ /// </summary>
+ public CatalogItem SelectedItem
+ {
+ get { return _selectedItem; }
+ set
+ {
+ _selectedItem = value; RaisePropertyChangedAuto();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the OK command.
+ /// </summary>
+ public RelayCommand OKCommand { get; set; }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TwineCatalogViewVM"/> class.
+ /// </summary>
+ public CoatsCatalogViewVM()
+ {
+ OKCommand = new RelayCommand(Confirm);
+ }
+
+ /// <summary>
+ /// Called when the application has been started.
+ /// </summary>
+ public override void OnApplicationStarted()
+ {
+ _db = ObservablesContext.CreateDefault();
+ }
+
+ /// <summary>
+ /// Called when the navigation system has navigated to this VM view.
+ /// </summary>
+ public override void OnNavigatedTo()
+ {
+ base.OnNavigatedTo();
+ _confirmed = false;
+ }
+
+ /// <summary>
+ /// Confirms this instance.
+ /// </summary>
+ private void Confirm()
+ {
+ SettingsManager.Default.GetOrCreate<JobsModuleSettings>().RecentCoatsCatalogColors.Add(SelectedItem.Entity.Name);
+ SettingsManager.Default.Save();
+
+ _confirmed = true;
+ NavigationManager.NavigateBack();
+ }
+
+ /// <summary>
+ /// Called when the navigation system requests a result when it is navigating away from this instance.
+ /// </summary>
+ /// <returns></returns>
+ public CatalogItem GetNavigationResult()
+ {
+ if (_confirmed)
+ {
+ return SelectedItem;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Called when the navigation object has been received
+ /// </summary>
+ /// <param name="brushStop">The brush stop.</param>
+ public async virtual void OnNavigationObjectReceived(TwineCatalogNavigationObject obj)
+ {
+ IsFree = false;
+ Catalog = await CatalogLoader.LoadCatalog(BL.Enumerations.ColorSpaces.Coats, obj.RML, _db);
+ Recent = CatalogLoader.GetRecent(Catalog, SettingsManager.Default.GetOrCreate<JobsModuleSettings>().RecentCoatsCatalogColors);
+ IsFree = true;
+
+ if (obj.BrushStop.ColorCatalog != null)
+ {
+ SelectedItem = Catalog.Groups.SelectMany(x => x.Items).SingleOrDefault(x => x.Entity.Guid == obj.BrushStop.ColorCatalog.Guid);
+ }
+ else
+ {
+ SelectedItem = null;
+ }
+ }
+ }
+}
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 d1c5a8536..f0950af09 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
@@ -200,6 +200,21 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
public IAutoCompleteProvider TwineCatalogAutoCompleteProvider { get; set; }
+ /// <summary>
+ /// Gets or sets the coats catalog automatic complete provider.
+ /// </summary>
+ public IAutoCompleteProvider CoatsCatalogAutoCompleteProvider { get; set; }
+
+ private List<ColorCatalog> _coatsCatalogItems;
+ /// <summary>
+ /// Gets or sets the coats catalog items.
+ /// </summary>
+ public List<ColorCatalog> CoatsCatalogItems
+ {
+ get { return _coatsCatalogItems; }
+ set { _coatsCatalogItems = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
#region Commands
@@ -255,6 +270,11 @@ namespace Tango.PPC.Jobs.ViewModels
public RelayCommand<BrushStop> OpenTwineCatalogCommand { get; set; }
/// <summary>
+ /// Gets or sets the open coats catalog command.
+ /// </summary>
+ public RelayCommand<BrushStop> OpenCoatsCatalogCommand { get; set; }
+
+ /// <summary>
/// Gets or sets the increase decrease samples to dye command.
/// </summary>
public RelayCommand<String> IncreaseDecreaseSamplesToDyeCommand { get; set; }
@@ -338,6 +358,7 @@ namespace Tango.PPC.Jobs.ViewModels
FineTuneItems = new ObservableCollection<FineTuneItem>();
ApprovalFineTuneItems = new ObservableCollection<FineTuneItem>();
TwineCatalogItems = new List<ColorCatalog>();
+ CoatsCatalogItems = new List<ColorCatalog>();
CustomersAutoCompleteProvider = new AutoCompleteProvider<Customer>((customer, filter) =>
{
@@ -350,6 +371,11 @@ namespace Tango.PPC.Jobs.ViewModels
return !String.IsNullOrWhiteSpace(filter) && color.RmlGuid == Job.Rml.Guid && color.Name.ToLower().StartsWith(filter.ToLower());
});
+ CoatsCatalogAutoCompleteProvider = new AutoCompleteProvider<ColorCatalog>((color, filter) =>
+ {
+ return !String.IsNullOrWhiteSpace(filter) && color.RmlGuid == Job.Rml.Guid && color.Name.ToLower().StartsWith(filter.ToLower());
+ });
+
//Initialize Commands
AddSolidSegmentCommand = new RelayCommand(() => AddSolidSegment());
AddBrushStopCommand = new RelayCommand<Segment>(AddBrushStop);
@@ -393,6 +419,7 @@ namespace Tango.PPC.Jobs.ViewModels
RepeatFineTuningCommand = new RelayCommand(RepeatFineTuning);
ApproveFineTuningCommand = new RelayCommand(ApproveFineTuning);
OpenTwineCatalogCommand = new RelayCommand<BrushStop>(OpenTwineCatalog);
+ OpenCoatsCatalogCommand = new RelayCommand<BrushStop>(OpenCoatsCatalog);
ExportEmbroideryCommand = new RelayCommand(ExportEmbroidery);
}
@@ -448,6 +475,7 @@ namespace Tango.PPC.Jobs.ViewModels
LogManager.Log("Loading Customers...");
Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync();
TwineCatalogItems = await _db.ColorCatalogs.Where(x => x.RmlGuid == Job.Rml.Guid && x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Twine).OrderBy(x => x.Name).ToListAsync();
+ CoatsCatalogItems = await _db.ColorCatalogs.Where(x => x.RmlGuid == Job.Rml.Guid && x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Coats).OrderBy(x => x.Name).ToListAsync();
foreach (var segment in Job.Segments)
{
@@ -610,13 +638,21 @@ namespace Tango.PPC.Jobs.ViewModels
protected virtual async void OnRmlChanged(object sender, Rml rml)
{
TwineCatalogItems = await _db.ColorCatalogs.Where(x => x.RmlGuid == rml.Guid && x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Twine).OrderBy(x => x.Name).ToListAsync();
+ CoatsCatalogItems = await _db.ColorCatalogs.Where(x => x.RmlGuid == rml.Guid && x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Coats).OrderBy(x => x.Name).ToListAsync();
- //Replace all brush stops color catalogs.
+ //Replace all brush stops twine color catalogs.
foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.ColorCatalog != null && x.BrushColorSpace == BL.Enumerations.ColorSpaces.Twine).ToList())
{
var replacement = TwineCatalogItems.SingleOrDefault(x => x.Name == stop.ColorCatalog.Name);
stop.ColorCatalog = replacement;
}
+
+ //Replace all brush stops coats color catalogs.
+ foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.ColorCatalog != null && x.BrushColorSpace == BL.Enumerations.ColorSpaces.Coats).ToList())
+ {
+ var replacement = CoatsCatalogItems.SingleOrDefault(x => x.Name == stop.ColorCatalog.Name);
+ stop.ColorCatalog = replacement;
+ }
}
#endregion
@@ -888,6 +924,20 @@ namespace Tango.PPC.Jobs.ViewModels
}
}
+ private async void OpenCoatsCatalog(BrushStop stop)
+ {
+ var catalogItem = await NavigationManager.NavigateForResult<JobsModule, CoatsCatalogView, CatalogItem, TwineCatalogNavigationObject>(new TwineCatalogNavigationObject()
+ {
+ BrushStop = stop,
+ RML = Job.Rml,
+ }, true);
+
+ if (catalogItem != null)
+ {
+ stop.ColorCatalog = CoatsCatalogItems.SingleOrDefault(x => x.Name == catalogItem.Entity.Name);
+ }
+ }
+
private void ArrangeBrushStopsIndices(Segment segment)
{
for (int i = 0; i < segment.BrushStops.Count; i++)
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml
new file mode 100644
index 000000000..434048ce6
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml
@@ -0,0 +1,57 @@
+<UserControl x:Class="Tango.PPC.Jobs.Views.CoatsCatalogView"
+ 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:vm="clr-namespace:Tango.PPC.Jobs.ViewModels"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:controls="clr-namespace:Tango.PPC.Jobs.Controls"
+ xmlns:global="clr-namespace:Tango.PPC.Jobs"
+ xmlns:local="clr-namespace:Tango.PPC.Jobs.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="1280" d:DesignWidth="800" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:CoatsCatalogViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.CoatsCatalogViewVM}">
+ <Grid>
+ <Grid Background="{StaticResource TangoMidBackgroundBrush}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
+
+ <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
+ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Coats Catalog</TextBlock>
+ </Border>
+
+ <Grid Grid.Row="1">
+ <touch:TouchLoadingPanel IsLoading="{Binding IsBusy}">
+ <DockPanel Margin="10">
+ <Border DockPanel.Dock="Bottom" Height="100">
+ <touch:TouchButton Command="{Binding OKCommand}" FontSize="{StaticResource TangoButtonFontSize}" HorizontalAlignment="Right" VerticalAlignment="Center" Content="SELECT" Height="60" Width="200" Style="{StaticResource TangoHollowButton}" Margin="0 0 20 0" />
+ </Border>
+
+ <DockPanel Margin="0 10 0 0">
+ <Grid DockPanel.Dock="Top" Height="76">
+ <Grid.Background>
+ <LinearGradientBrush>
+ <GradientStop Color="#ed2880" Offset="0" />
+ <GradientStop Color="#e74f68" Offset="1" />
+ </LinearGradientBrush>
+ </Grid.Background>
+ <DockPanel>
+ <Image DockPanel.Dock="Left" Source="../Images/Coats/coats-sylko-logo.png" Stretch="None" />
+ <Image DockPanel.Dock="Right" Source="../Images/Coats/thread.png" Stretch="None" />
+ <StackPanel Margin="40 0 0 0" HorizontalAlignment="Left" Orientation="Horizontal">
+ <Image Source="../Images/Coats/coats.png" Stretch="None" />
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="White" FontWeight="SemiBold" FontSize="20">Shade Card</TextBlock>
+ </StackPanel>
+ </DockPanel>
+ </Grid>
+ <Border Style="{StaticResource TangoTouchBorder}" Padding="20 20 20 100">
+ <controls:CoatsCatalogViewer Catalog="{Binding Catalog}" Recent="{Binding Recent}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" />
+ </Border>
+ </DockPanel>
+ </DockPanel>
+ </touch:TouchLoadingPanel>
+ </Grid>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.xaml.cs
new file mode 100644
index 000000000..c644b32b4
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/CoatsCatalogView.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.Views
+{
+ /// <summary>
+ /// Interaction logic for TwineCatalogColorCorrectionView.xaml
+ /// </summary>
+ public partial class CoatsCatalogView : UserControl
+ {
+ public CoatsCatalogView()
+ {
+ InitializeComponent();
+ }
+ }
+}
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 da46f31ff..957fead70 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
@@ -106,6 +106,26 @@
</DockPanel>
</DataTemplate>
+ <DataTemplate x:Key="COATS_Template" DataType="{x:Type entities:BrushStop}">
+ <DockPanel>
+ <touch:TouchIconButton Margin="0 0 -50 -10" CornerRadius="50" Width="50" Height="50" Padding="13" RippleBrush="{StaticResource TangoRippleDarkBrush}" DockPanel.Dock="Right" Icon="Palette" Foreground="{StaticResource TangoPrimaryAccentBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.OpenCoatsCatalogCommand}" CommandParameter="{Binding}"></touch:TouchIconButton>
+ <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding ElementName=view,Path=DataContext.CoatsCatalogItems}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding ElementName=view,Path=DataContext.CoatsCatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalog,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}">
+ <touch:TouchAutoComplete.ItemTemplate>
+ <DataTemplate>
+ <DockPanel Margin="2">
+ <Rectangle Width="24" Height="24">
+ <Rectangle.Fill>
+ <SolidColorBrush Color="{Binding Color,Mode=OneWay}"></SolidColorBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+ <TextBlock Margin="5 0 0 0" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock>
+ </DockPanel>
+ </DataTemplate>
+ </touch:TouchAutoComplete.ItemTemplate>
+ </touch:TouchAutoComplete>
+ </DockPanel>
+ </DataTemplate>
+
<DataTemplate x:Key="BrushStop_Template" DataType="{x:Type entities:BrushStop}">
<Grid Margin="50 20 140 20" RenderOptions.EdgeMode="Aliased">
<StackPanel>
@@ -144,6 +164,9 @@
<DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine">
<Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" />
</DataTrigger>
+ <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Coats">
+ <Setter Property="ContentTemplate" Value="{StaticResource COATS_Template}" />
+ </DataTrigger>
<DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume">
<Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" />
</DataTrigger>
@@ -286,6 +309,9 @@
<DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine">
<Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" />
</DataTrigger>
+ <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Coats">
+ <Setter Property="ContentTemplate" Value="{StaticResource COATS_Template}" />
+ </DataTrigger>
<DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume">
<Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" />
</DataTrigger>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml
index 505ccc312..21361e74f 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml
@@ -16,6 +16,7 @@
<views:JobSummeryView />
<views:JobView />
<views:TwineCatalogView />
+ <views:CoatsCatalogView />
<views:JobProgressView />
</controls:NavigationControl>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml
new file mode 100644
index 000000000..b9218a483
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml
@@ -0,0 +1,145 @@
+<UserControl x:Class="Tango.PPC.Common.Controls.CoatsCatalogControl"
+ 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:local="clr-namespace:Tango.PPC.Common.Controls"
+ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:catalog="clr-namespace:Tango.BL.Catalogs;assembly=Tango.BL"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=catalog:Catalog, IsDesignTimeCreatable=False}">
+ <Grid>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+
+ <touch:LightTouchScrollViewer x:Name="scrollViewer" ScrollBarVisibility="Collapsed">
+ <!--<Border Background="White">-->
+ <local:TwineCatalogRenderer x:Name="renderer" Groups="{Binding Groups}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}"></local:TwineCatalogRenderer>
+ <!--</Border>-->
+ </touch:LightTouchScrollViewer>
+
+ <!--<touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list" x:FieldModifier="public" DisableRipple="True" ScrollBarVisibility="Collapsed" SelectionMode="None">
+ <touch:TouchListBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Margin="0 0 10 0">
+ <TextBlock HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
+ <touch:TouchStaticListBox ItemsSource="{Binding Items,IsAsync=True}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}" Margin="0 20 0 40">
+ <touch:TouchStaticListBox.ItemsPanel>
+ <ItemsPanelTemplate>
+ <WrapPanel Orientation="Horizontal" />
+ </ItemsPanelTemplate>
+ </touch:TouchStaticListBox.ItemsPanel>
+ <touch:TouchStaticListBox.ItemContainerStyle>
+ <Style TargetType="{x:Type touch:TouchStaticListBoxItem}">
+ <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
+ <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="20" Opacity="0" />
+ </Setter.Value>
+ </Setter>-->
+ <!--
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True">
+ <DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.5" Duration="00:00:00" />
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.5" Duration="00:00:00" />
+ -->
+ <!--<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:00" />
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:00" />
+ -->
+ <!--<DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />-->
+ <!--
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.ExitActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchStaticListBox.ItemContainerStyle>
+ <touch:TouchStaticListBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Margin="10" Width="70">
+ <Ellipse Width="60" Height="60" Fill="{Binding Brush}" />
+ -->
+ <!--<controls:FastTextBlock Margin="0 5 0 0" HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}"></controls:FastTextBlock>-->
+ <!--
+ </StackPanel>
+ </DataTemplate>
+ </touch:TouchStaticListBox.ItemTemplate>
+ </touch:TouchStaticListBox>
+ </StackPanel>
+ </DataTemplate>
+ </touch:TouchListBox.ItemTemplate>
+ </touch:TouchListBox>-->
+
+ <Grid Grid.Column="1">
+ <!--<Rectangle Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Left" />-->
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition/>
+ </Grid.ColumnDefinitions>
+
+ <Border Width="25" CornerRadius="10">
+ <Border.Clip>
+ <RectangleGeometry RadiusX="10" RadiusY="10">
+ <RectangleGeometry.Rect>
+ <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
+ <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualWidth" />
+ <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualHeight" />
+ </MultiBinding>
+ </RectangleGeometry.Rect>
+ </RectangleGeometry>
+ </Border.Clip>
+ <ItemsControl ItemsSource="{Binding Groups}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Columns="1" />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Rectangle>
+ <Rectangle.Fill>
+ <SolidColorBrush Color="{Binding Color}" />
+ </Rectangle.Fill>
+ </Rectangle>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </Border>
+
+ <Grid Grid.Column="1">
+ <touch:TouchSlider x:Name="slider" ValueChanged="TouchSlider_ValueChanged" IsSnapToTickEnabled="True" Minimum="0" Maximum="{Binding Groups.Count,Converter={StaticResource MathOperatorConverter},ConverterParameter='-1'}" Orientation="Vertical" Width="40" Height="Auto" IsSelectionRangeEnabled="False">
+ <touch:TouchSlider.ThumbTemplate>
+ <ControlTemplate>
+ <touch:TouchIcon Foreground="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchSlider},Path=Foreground}" Width="40" Height="40" Icon="Water" Angle="-90" />
+ </ControlTemplate>
+ </touch:TouchSlider.ThumbTemplate>
+ </touch:TouchSlider>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml.cs
new file mode 100644
index 000000000..f4b764ad0
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/CoatsCatalogControl.xaml.cs
@@ -0,0 +1,112 @@
+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;
+using Tango.BL.Catalogs;
+
+namespace Tango.PPC.Common.Controls
+{
+ /// <summary>
+ /// Interaction logic for CoatsCatalogControl.xaml
+ /// </summary>
+ public partial class CoatsCatalogControl : UserControl
+ {
+ private Catalog _catalog;
+ private bool _preventChange;
+ private double _lastScrollPosition = 0;
+
+ /// <summary>
+ /// Gets or sets the selected catalog item.
+ /// </summary>
+ public CatalogItem SelectedItem
+ {
+ get { return (CatalogItem)GetValue(SelectedItemProperty); }
+ set { SetValue(SelectedItemProperty, value); }
+ }
+ public static readonly DependencyProperty SelectedItemProperty =
+ DependencyProperty.Register("SelectedItem", typeof(CatalogItem), typeof(CoatsCatalogControl), new PropertyMetadata(null));
+
+ public CoatsCatalogControl()
+ {
+ InitializeComponent();
+
+ //list.ApplyTemplate();
+ //list.Loaded += TwineCatalogControl_Loaded;
+ DataContextChanged += (x, y) =>
+ {
+ _catalog = DataContext as Catalog;
+
+ if (scrollViewer != null && _catalog != null)
+ {
+ scrollViewer.ScrollToTop();
+ _preventChange = true;
+ slider.Value = _catalog.Groups.Count;
+ _preventChange = false;
+ }
+ };
+
+ scrollViewer.Scrolling += ScrollViewer_Scrolling;
+ }
+
+ /// <summary>
+ /// Handles the Scrolling event of the ScrollViewer control.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="Touch.Controls.DoubleValueChangedEventArgs"/> instance containing the event data.</param>
+ private void ScrollViewer_Scrolling(object sender, Touch.Controls.DoubleValueChangedEventArgs e)
+ {
+ if (!_preventChange)
+ {
+ if (e.Value > _lastScrollPosition + 60 || e.Value < _lastScrollPosition - 60)
+ {
+ var group = renderer.GetVisibleGroup();
+
+ if (group != null)
+ {
+ _preventChange = true;
+ slider.Value = slider.Maximum - _catalog.Groups.IndexOf(group);
+ _preventChange = false;
+ }
+
+ _lastScrollPosition = e.Value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Handles the ValueChanged event of the TouchSlider control.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="RoutedPropertyChangedEventArgs{System.Double}"/> instance containing the event data.</param>
+ private void TouchSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+ {
+ if (_catalog == null || _catalog.Groups.Count == 0) return;
+
+ if (!_preventChange)
+ {
+ if (_catalog != null)
+ {
+ _preventChange = true;
+ var group = _catalog.Groups.ElementAt(_catalog.Groups.Count - 1 - (int)e.NewValue);
+ scrollViewer.ScrollToPosition(renderer.GetGroupPosition(group));
+ _preventChange = false;
+ }
+ }
+
+ if (_catalog != null && _catalog.Groups.Count > _catalog.Groups.Count - 1 - (int)e.NewValue && _catalog.Groups.Count - 1 - (int)e.NewValue > -1)
+ {
+ slider.Foreground = new SolidColorBrush(_catalog.Groups.ElementAt(_catalog.Groups.Count - 1 - (int)e.NewValue).Color);
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
index af5888f3f..5985fbd49 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
@@ -25,7 +25,6 @@ namespace Tango.PPC.Common.Controls
public partial class TwineCatalogControl : UserControl
{
private Catalog _catalog;
- private bool _loaded;
private bool _preventChange;
private double _lastScrollPosition = 0;
@@ -38,7 +37,7 @@ namespace Tango.PPC.Common.Controls
set { SetValue(SelectedItemProperty, value); }
}
public static readonly DependencyProperty SelectedItemProperty =
- DependencyProperty.Register("SelectedItem", typeof(CatalogItem), typeof(TwineCatalogControl), new PropertyMetadata(null,(d,e) => (d as TwineCatalogControl).OnSelectedItemChanged()));
+ DependencyProperty.Register("SelectedItem", typeof(CatalogItem), typeof(TwineCatalogControl), new PropertyMetadata(null));
/// <summary>
/// Initializes a new instance of the <see cref="TwineCatalogControl"/> class.
@@ -91,24 +90,6 @@ namespace Tango.PPC.Common.Controls
}
/// <summary>
- /// Handles the Loaded event of the TwineCatalogControl control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
- private void TwineCatalogControl_Loaded(object sender, RoutedEventArgs e)
- {
- if (!_loaded)
- {
- //list.ScrollViewer.Scrolling += ScrollViewer_Scrolling;
-
- _preventChange = true;
- slider.Value = slider.Maximum;
- _preventChange = false;
- _loaded = true;
- }
- }
-
- /// <summary>
/// Handles the ValueChanged event of the TouchSlider control.
/// </summary>
/// <param name="sender">The source of the event.</param>
@@ -133,28 +114,5 @@ namespace Tango.PPC.Common.Controls
slider.Foreground = new SolidColorBrush(_catalog.Groups.ElementAt(_catalog.Groups.Count - 1 - (int)e.NewValue).Color);
}
}
-
- /// <summary>
- /// Called when the selected item has been changed
- /// </summary>
- private void OnSelectedItemChanged()
- {
- //if (!_preventChange)
- //{
- // _preventChange = true;
- // var item = SelectedItem;
- // SelectedItem = null;
- // SelectedItem = item;
- // _preventChange = false;
- //}
- }
-
- /// <summary>
- /// Gets the touch ListBox.
- /// </summary>
- public TouchListBox TouchListBox
- {
- get { return null; }
- }
}
}
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 c5faaa28b..a84faf68d 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
@@ -128,6 +128,9 @@
<Compile Include="Connectivity\WiFiNetwork.cs" />
<Compile Include="Connectivity\IConnectivityProvider.cs" />
<Compile Include="Controls\AsyncAdornerControl.cs" />
+ <Compile Include="Controls\CoatsCatalogControl.xaml.cs">
+ <DependentUpon>CoatsCatalogControl.xaml</DependentUpon>
+ </Compile>
<Compile Include="Controls\TwineCatalogControl.xaml.cs">
<DependentUpon>TwineCatalogControl.xaml</DependentUpon>
</Compile>
@@ -211,6 +214,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Controls\CoatsCatalogControl.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Controls\MultiPieChart.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -373,7 +380,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.BL/Catalogs/CatalogGroup.cs b/Software/Visual_Studio/Tango.BL/Catalogs/CatalogGroup.cs
index a18520694..ee7ac743b 100644
--- a/Software/Visual_Studio/Tango.BL/Catalogs/CatalogGroup.cs
+++ b/Software/Visual_Studio/Tango.BL/Catalogs/CatalogGroup.cs
@@ -9,6 +9,8 @@ namespace Tango.BL.Catalogs
{
public class CatalogGroup
{
+ public int Index { get; set; }
+
public String Name { get; set; }
public List<CatalogItem> Items { get; set; }
diff --git a/Software/Visual_Studio/Tango.BL/Catalogs/CatalogLoader.cs b/Software/Visual_Studio/Tango.BL/Catalogs/CatalogLoader.cs
index 3784ee065..fac2be366 100644
--- a/Software/Visual_Studio/Tango.BL/Catalogs/CatalogLoader.cs
+++ b/Software/Visual_Studio/Tango.BL/Catalogs/CatalogLoader.cs
@@ -22,11 +22,14 @@ namespace Tango.BL.Catalogs
if (all_items.Count > 0)
{
- all_items = all_items.DistinctBy(x => x.Name).ToList();
+ all_items = all_items.DistinctBy(x => x.Name).OrderBy(x => x.ColorCode).ToList();
+
+ int index = 1;
foreach (var item in all_items.GroupBy(x => x.ColorGroup))
{
CatalogGroup group = new CatalogGroup();
+ group.Index = index++;
group.Name = item.First().ColorGroup;
foreach (var i in item)
diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
index f04ac51dc..5f9760dca 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
@@ -508,6 +508,7 @@ namespace Tango.BL.Entities
rgb = lab.To<Rgb>();
cmyk = lab.To<Cmyk>();
break;
+ case ColorSpaces.Coats:
case ColorSpaces.Twine:
cmyk = rgb_twine.To<Cmyk>();
lab = rgb_twine.To<Lab>();
diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln
index 00a5d95c4..1c9e5889d 100644
--- a/Software/Visual_Studio/Tango.sln
+++ b/Software/Visual_Studio/Tango.sln
@@ -293,6 +293,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealTimeGraphX.WPF", "SideC
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealTimeGraphX.WPF.Demo", "SideChains\RealTimeGraphX-master\RealTimeGraphX.WPF.Demo\RealTimeGraphX.WPF.Demo.csproj", "{B822CBD9-1113-4668-85C9-22AA9C24CE60}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.CoatsCatalogImporter", "Utilities\Tango.CoatsCatalogImporter\Tango.CoatsCatalogImporter.csproj", "{0C596287-D63B-4BB7-A3D7-B682DD9EC60B}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AppVeyor|Any CPU = AppVeyor|Any CPU
@@ -5201,6 +5203,46 @@ Global
{B822CBD9-1113-4668-85C9-22AA9C24CE60}.Release|x64.Build.0 = Release|Any CPU
{B822CBD9-1113-4668-85C9-22AA9C24CE60}.Release|x86.ActiveCfg = Release|Any CPU
{B822CBD9-1113-4668-85C9-22AA9C24CE60}.Release|x86.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|Any CPU.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|Any CPU.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|ARM.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|ARM.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|ARM64.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|ARM64.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|x64.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|x64.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|x86.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.AppVeyor|x86.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|ARM.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|x64.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Debug|x86.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|ARM.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|x64.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.DefaultBuild|x86.Build.0 = Debug|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|ARM.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|ARM.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|ARM64.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|x64.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|x64.Build.0 = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|x86.ActiveCfg = Release|Any CPU
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -5294,6 +5336,7 @@ Global
{F13A489C-80EE-4CD0-BDD4-92D959215646} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958}
{6B9774F7-960D-438E-AD81-C6B9BE328D50} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958}
{B822CBD9-1113-4668-85C9-22AA9C24CE60} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958}
+ {0C596287-D63B-4BB7-A3D7-B682DD9EC60B} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6}
diff --git a/Software/Visual_Studio/Utilities/Tango.CatalogImporter/Program.cs b/Software/Visual_Studio/Utilities/Tango.CatalogImporter/Program.cs
index cf9b4a518..884be8421 100644
--- a/Software/Visual_Studio/Utilities/Tango.CatalogImporter/Program.cs
+++ b/Software/Visual_Studio/Utilities/Tango.CatalogImporter/Program.cs
@@ -63,7 +63,7 @@ namespace Tango.CatalogImporter
{
bool inserting = false;
- var catalogItem = db.ColorCatalogs.SingleOrDefault(x => x.RmlGuid == rml.Guid && x.ColorCode == item.Code);
+ var catalogItem = db.ColorCatalogs.SingleOrDefault(x => x.RmlGuid == rml.Guid && x.ColorCode == item.Code && x.ColorSpaceGuid == twine_color_space_guid);
if (catalogItem == null)
{
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/App.config b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/App.config
new file mode 100644
index 000000000..4ef5218a0
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/App.config
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <configSections>
+ <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+ <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+ </configSections>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+ </startup>
+ <entityFramework>
+ <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
+ <providers>
+ <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+ </providers>
+ </entityFramework>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.0.5.0" newVersion="5.0.5.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Program.cs b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Program.cs
new file mode 100644
index 000000000..031bf39e6
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Program.cs
@@ -0,0 +1,127 @@
+using ColorMine.ColorSpaces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL;
+using Tango.BL.Entities;
+using Tango.BL.Enumerations;
+using Tango.Core.Helpers;
+using Tango.Documents;
+
+namespace Tango.CoatsCatalogImporter
+{
+ class Program
+ {
+ private class CatalogItem
+ {
+ public String ShadeName { get; set; }
+ public int SerialNumber { get; set; }
+ public String Strip { get; set; }
+ public String ShadeCode { get; set; }
+ public String Color { get; set; }
+ public float L { get; set; }
+ public float A { get; set; }
+ public float B { get; set; }
+ public int OutOfGamut { get; set; }
+ public String Nothing { get; set; }
+ public float DeltaE { get; set; }
+ public String Flurecent { get; set; }
+ public float Cyan { get; set; }
+ public float Magenta { get; set; }
+ public float Yellow { get; set; }
+ public float Black { get; set; }
+ public int GamutRegion { get; set; }
+ }
+
+ static void Main(string[] args)
+ {
+ ExcelReader reader = new ExcelReader(AssemblyHelper.GetCurrentAssemblyFolder() + "\\coats.xlsx");
+ var items = reader.GetDataByIndex<CatalogItem>("Volume 200%", 3);
+ reader.Dispose();
+
+ Console.Write("Please enter the target RML name (press enter to target all): ");
+ String rml_name = Console.ReadLine();
+
+ if (!String.IsNullOrWhiteSpace(rml_name))
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault(new Core.DataSource()
+ {
+ Address = "localhost\\SQLPPC",
+ Catalog = "Tango",
+ Type = Core.DataSourceType.SQLServer,
+ IntegratedSecurity = true,
+ }))
+ {
+ var rml = db.Rmls.Single(x => x.Name == rml_name);
+ var coats_color_space_guid = db.ColorSpaces.Single(x => (ColorSpaces)x.Code == ColorSpaces.Coats).Guid;
+
+ foreach (var strip in items.GroupBy(x => x.Strip))
+ {
+ foreach (var item in strip)
+ {
+ bool inserting = false;
+
+ var catalogItem = db.ColorCatalogs.SingleOrDefault(x => x.RmlGuid == rml.Guid && x.ColorCode == item.SerialNumber && x.ColorSpaceGuid == coats_color_space_guid);
+
+ if (catalogItem == null)
+ {
+ inserting = true;
+ catalogItem = new ColorCatalog();
+ }
+
+ catalogItem.ColorCode = item.SerialNumber;
+
+ Lab lab = new Lab(item.L, item.A, item.B);
+ Rgb rgb = lab.To<Rgb>();
+
+ catalogItem.L = lab.L;
+ catalogItem.A = lab.A;
+ catalogItem.B = lab.B;
+
+ catalogItem.Red = (int)rgb.R;
+ catalogItem.Green = (int)rgb.G;
+ catalogItem.Blue = (int)rgb.B;
+
+ catalogItem.Cyan = item.Cyan;
+ catalogItem.Magenta = item.Magenta;
+ catalogItem.Yellow = item.Yellow;
+ catalogItem.Black = item.Black;
+
+ catalogItem.L = item.L;
+ catalogItem.A = item.A;
+ catalogItem.B = item.B;
+
+ catalogItem.ProcessParametersTableIndex = item.GamutRegion;
+ catalogItem.ColorSpaceGuid = coats_color_space_guid;
+ catalogItem.RmlGuid = rml.Guid;
+
+ catalogItem.ColorGroup = "Strip " + item.Strip;
+ catalogItem.Name = item.ShadeCode;
+
+ if (inserting)
+ {
+ db.ColorCatalogs.Add(catalogItem);
+ Console.WriteLine($"Added catalog item {catalogItem.Name}...");
+ }
+ else
+ {
+ Console.WriteLine($"Updated catalog item {catalogItem.Name}...");
+ }
+ }
+ }
+
+ db.SaveChanges();
+
+ Console.WriteLine("Done");
+ Console.ReadLine();
+ }
+ }
+ else
+ {
+ throw new NotImplementedException();
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..6fb7439df
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tango.CoatsCatalogImporter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Tango.CoatsCatalogImporter")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0c596287-d63b-4bb7-a3d7-b682dd9ec60b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Tango.CoatsCatalogImporter.csproj b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Tango.CoatsCatalogImporter.csproj
new file mode 100644
index 000000000..229608ca0
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/Tango.CoatsCatalogImporter.csproj
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{0C596287-D63B-4BB7-A3D7-B682DD9EC60B}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>Tango.CoatsCatalogImporter</RootNamespace>
+ <AssemblyName>Tango.CoatsCatalogImporter</AssemblyName>
+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <Deterministic>true</Deterministic>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ <Content Include="coats.xlsx">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\SideChains\ColorMine\ColorMine.csproj">
+ <Project>{37e4ceab-b54b-451f-b535-04cf7da9c459}</Project>
+ <Name>ColorMine</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.BL\Tango.BL.csproj">
+ <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
+ <Name>Tango.BL</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj">
+ <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
+ <Name>Tango.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.Documents\Tango.Documents.csproj">
+ <Project>{ca87a608-7b17-4c98-88f2-42abee10f4c1}</Project>
+ <Name>Tango.Documents</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/coats.xlsx b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/coats.xlsx
new file mode 100644
index 000000000..b425fac4e
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/coats.xlsx
Binary files differ
diff --git a/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/packages.config b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/packages.config
new file mode 100644
index 000000000..b3daf0d6c
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.CoatsCatalogImporter/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="EntityFramework" version="6.2.0" targetFramework="net461" />
+</packages> \ No newline at end of file