aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs53
1 files changed, 52 insertions, 1 deletions
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 6b25d323f..82cfc3456 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
@@ -39,7 +39,6 @@ namespace Tango.PPC.Jobs.ViewModels
#region Properties
private Job _job;
-
/// <summary>
/// Gets or sets the selected job.
/// </summary>
@@ -172,6 +171,16 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
public RelayCommand<BrushStop> TwineCatalogFieldTapCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the increase decrease samples to dye command.
+ /// </summary>
+ public RelayCommand<String> IncreaseDecreaseSamplesToDyeCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the start sample dye command.
+ /// </summary>
+ public RelayCommand StartSampleDyeCommand { get; set; }
+
#endregion
#region Constructors
@@ -205,9 +214,22 @@ namespace Tango.PPC.Jobs.ViewModels
SaveJobCommand = new RelayCommand(SaveJob);
ReplaceBrushStopCommand = new RelayCommand<BrushStop>(InvokeColorAdjustmentForBrushStop);
TwineCatalogFieldTapCommand = new RelayCommand<BrushStop>(InvokeTwineCatalogForBrushStop);
+ IncreaseDecreaseSamplesToDyeCommand = new RelayCommand<string>((x) =>
+ {
+ if (x == "+")
+ {
+ Job.SampleUnitsOrMeters++;
+ }
+ else
+ {
+ Job.SampleUnitsOrMeters--;
+ }
+ });
_check_gamut_thread = new Thread(CheckGamutThreadMethod);
_check_gamut_thread.IsBackground = true;
+
+ StartSampleDyeCommand = new RelayCommand(StartSampleDye);
}
#endregion
@@ -390,6 +412,35 @@ namespace Tango.PPC.Jobs.ViewModels
#endregion
+ #region Sample Dye
+
+ /// <summary>
+ /// Starts a sample dye.
+ /// </summary>
+ private async void StartSampleDye()
+ {
+ Job sampleDyeJob = Job.Clone();
+ sampleDyeJob.Name += " sample";
+
+ if (Job.JobType == BL.Enumerations.JobTypes.Embroidery)
+ {
+ sampleDyeJob.NumberOfUnits = Job.SampleUnitsOrMeters;
+ }
+ else
+ {
+ sampleDyeJob.NumberOfUnits = 1;
+
+ foreach (var segment in sampleDyeJob.Segments)
+ {
+ segment.Length = Job.SampleUnitsOrMeters;
+ }
+ }
+
+ await NavigationManager.NavigateForResult<JobsModule, JobProgressView, Object, Job>(sampleDyeJob);
+ }
+
+ #endregion
+
#region Out Of Gamut Check Thread
private void CheckGamutThreadMethod()