diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs')
4 files changed, 66 insertions, 1 deletions
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 @@ <DockPanel> <Grid DockPanel.Dock="Bottom"> <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">DECLINE</touch:TouchButton> + + <Grid HorizontalAlignment="Center"> + <touch:TouchRingProgress Width="50" Height="50" Maximum="{Binding MaxSeconds}" Value="{Binding SecondsRemaining}" /> + <TextBlock Text="{Binding SecondsRemaining}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> + </Grid> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">APPROVE</touch:TouchButton> </Grid> <StackPanel DockPanel.Dock="Top"> 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>() { ColorSpaces.RGB }; vm.SelectedColorSpace = vm.SupportedColorSpaces.First(); + } + if (twnFile != null) + { vm.SupportedJobTypes = new List<JobTypes>() { 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) 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 @@ <touch:TouchLoadingPanel IsLoading="{Binding IsBusy}"> <DockPanel Margin="10"> <Border DockPanel.Dock="Bottom" Height="100"> - <touch:TouchButton Command="{Binding OKCommand}" HorizontalAlignment="Right" VerticalAlignment="Center" Content="OK" Height="50" Width="150" Style="{StaticResource TangoHollowButton}" Margin="0 0 20 0" /> + <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> <Border Style="{StaticResource TangoTouchBorder}" Padding="20 20 20 100" Margin="0 10 0 0"> |
