From 26cee052a5b20d7a5bdb597776c55dcd3da2da62 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 23 May 2019 16:44:30 +0300 Subject: Implemented new Twine color catalog ! --- .../PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml index a5ce50ad2..284666733 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml @@ -25,7 +25,7 @@ - + -- cgit v1.3.1 From 8ec5e9a3d252f65651cd2c1dd18888c7eb2ff151 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 23 May 2019 18:12:21 +0300 Subject: Added timeout for color profile received dialog. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../Dialogs/ColorProfileReceivedView.xaml | 6 +++ .../Dialogs/ColorProfileReceivedViewVM.cs | 55 +++++++++++++++++++++ .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 4 ++ 5 files changed, 65 insertions(+) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index c24341181..ef291bf44 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 597683824..4d8c31d41 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedView.xaml index 83c90f5ed..bc6534596 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedView.xaml @@ -11,6 +11,12 @@ DECLINE + + + + + + APPROVE diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedViewVM.cs index 31e664825..1386acb93 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/ColorProfileReceivedViewVM.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; +using System.Windows.Threading; using Tango.Core.Commands; using Tango.SharedUI; @@ -11,6 +12,60 @@ namespace Tango.PPC.Jobs.Dialogs { public class ColorProfileReceivedViewVM : DialogViewVM { + private DispatcherTimer _timer; + public Color Color { get; set; } + + private int _maxSeconds; + public int MaxSeconds + { + get { return _maxSeconds; } + set { _maxSeconds = value; RaisePropertyChangedAuto(); } + } + + private int _secondsRemaining; + public int SecondsRemaining + { + get { return _secondsRemaining; } + set { _secondsRemaining = value; RaisePropertyChangedAuto(); } + } + + public ColorProfileReceivedViewVM() + { + MaxSeconds = 10; + SecondsRemaining = 10; + + _timer = new DispatcherTimer(); + _timer.Interval = TimeSpan.FromMilliseconds(800); + _timer.Tick += _timer_Tick; + } + + public override void OnShow() + { + base.OnShow(); + _timer.Start(); + } + + protected override void Accept() + { + _timer.Stop(); + base.Accept(); + } + + protected override void Cancel() + { + _timer.Stop(); + base.Cancel(); + } + + private void _timer_Tick(object sender, EventArgs e) + { + SecondsRemaining--; + + if (SecondsRemaining == 0) + { + Cancel(); + } + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index 08d135e21..c89db820d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -417,7 +417,10 @@ namespace Tango.PPC.Jobs.ViewModels { vm.SupportedColorSpaces = new List() { ColorSpaces.RGB }; vm.SelectedColorSpace = vm.SupportedColorSpaces.First(); + } + if (twnFile != null) + { vm.SupportedJobTypes = new List() { JobTypes.Embroidery }; vm.SelectedJobType = vm.SupportedJobTypes.First(); } @@ -468,6 +471,7 @@ namespace Tango.PPC.Jobs.ViewModels else { job.AddSolidSegment(colorProfile.Value, machine.DefaultSegmentLength > 0 ? machine.DefaultSegmentLength : 100); + job.Name = $"SnapMatch {colorProfile.Value.R}, {colorProfile.Value.G}, {colorProfile.Value.B}"; } if (twnFile != null) -- cgit v1.3.1