aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
index cadbc6275..e37686a33 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
@@ -614,6 +614,7 @@ namespace Tango.PPC.Jobs.ViewModels
}
segmentModel.ArrangeBrushStopsPosition();
+ segmentModel.UpdateMiddleColorBrush();
return segmentModel;
}
@@ -701,6 +702,7 @@ namespace Tango.PPC.Jobs.ViewModels
Job.EnableInterSegment = vm.WhiteGap > 0;
JobModel.InterSegmentLength = vm.WhiteGap;
JobModel.EnableInterSegment = vm.WhiteGap > 0;
+ JobModel.JobChanged = true;
Job.SpoolType = vm.SelectedSpoolType;
JobModel.SpoolType = vm.SelectedSpoolType;//update length!!!!
@@ -830,6 +832,7 @@ namespace Tango.PPC.Jobs.ViewModels
LogManager.Log("Adding new segment...");
UndoRedoManager.Instance.InsertAndExecuteCommand(new AddNewSegmentCommand(JobModel, segment, Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 10));
+ JobModel.JobChanged = true;
ArrangeSegmentsIndixes();
}
catch (Exception ex)
@@ -852,6 +855,7 @@ namespace Tango.PPC.Jobs.ViewModels
if (vm.DialogResult)
{
group.Repeats = vm.Repeats;
+ JobModel.JobChanged = true;
}
}
@@ -867,6 +871,7 @@ namespace Tango.PPC.Jobs.ViewModels
if (await NotificationProvider.ShowQuestion("Are you sure you want to remove the selected segment?"))
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new RemoveSegmentCommand(JobModel, segment));
+ JobModel.JobChanged = true;
ArrangeSegmentsIndixes();
DyeCommand.RaiseCanExecuteChanged();
@@ -895,6 +900,7 @@ namespace Tango.PPC.Jobs.ViewModels
UndoRedoManager.Instance.InsertAndExecuteCommand(new DeleteSegmentsGroupCommand(JobModel, segmentsGroup));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
DyeCommand.RaiseCanExecuteChanged();
}
@@ -917,6 +923,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new DuplicateSegmentCommand(JobModel, segment));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
DyeCommand.RaiseCanExecuteChanged();
}
@@ -990,6 +997,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new EditBrushStopColorCommand(segment, brushStop, vm.SelectedBrushStop));
DyeCommand.RaiseCanExecuteChanged();
+ JobModel.JobChanged = true;
}
}
@@ -1013,8 +1021,8 @@ namespace Tango.PPC.Jobs.ViewModels
}
}
UndoRedoManager.Instance.InsertAndExecuteCommand(new AddBrushStopCommand(JobModel, segment, newBrushStop));
-
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
#endregion
@@ -1206,6 +1214,7 @@ namespace Tango.PPC.Jobs.ViewModels
UndoRedoManager.Instance.InsertAndExecuteCommand(new ReverseCommand(JobModel));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
private async void DeleteSegments()
@@ -1227,6 +1236,7 @@ namespace Tango.PPC.Jobs.ViewModels
UndoRedoManager.Instance.InsertAndExecuteCommand(new RemoveSegmentsCommand(JobModel));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
DyeCommand.RaiseCanExecuteChanged();
}
}
@@ -1248,24 +1258,28 @@ namespace Tango.PPC.Jobs.ViewModels
return;
UndoRedoManager.Instance.InsertAndExecuteCommand(new RepeatCommand(JobModel));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
private void UngroupSegments(SegmentsGroupModel segmentsGroup)
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new UnGroupSegmentsCommand(JobModel, segmentsGroup));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
private void Paste()
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new PasteSegmentsCommand(JobModel));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
private void Copy()
{
UndoRedoManager.Instance.InsertAndExecuteCommand(new CopySegmentCommand(JobModel));
ArrangeSegmentsIndixes();
+ JobModel.JobChanged = true;
}
private void Undo()
@@ -1423,6 +1437,11 @@ namespace Tango.PPC.Jobs.ViewModels
}
Job.LastUpdated = DateTime.UtcNow;
Job.IsSynchronized = false;
+ if(Job.JobStatus == JobStatuses.Completed && JobModel.JobChanged == true)
+ {
+ Job.JobStatus = BL.Enumerations.JobStatuses.Draft;
+ JobModel.JobChanged = false;
+ }
//Job.JobStatus = BL.Enumerations.JobStatuses.Draft;
//_current_job_string = Job.ToJobFileWhenLoaded().ToString();
RaiseMessage(new JobSavedMessage() { Job = Job });