aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-01-03 14:41:43 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-01-03 14:41:43 +0200
commit456a9889b0fe98894088bf981c8edaaa9de429e6 (patch)
tree16826379bc7c5b83940736a9e0c37c8ca1d31a7a /Software/Visual_Studio
parente2cab8494c99c43a363e3d1c20dcf2b6381aef51 (diff)
downloadTango-456a9889b0fe98894088bf981c8edaaa9de429e6.tar.gz
Tango-456a9889b0fe98894088bf981c8edaaa9de429e6.zip
Some bug fixes.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs20
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Segment.cs10
2 files changed, 17 insertions, 13 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 e8325b8ea..777b1f24d 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
@@ -657,8 +657,15 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
private bool CanStartJob()
{
- return
- Job != null && Job.Validate(_db) && !Job.Segments.SelectMany(x => x.BrushStops).Where(x => !x.IsTransparent && !x.IsWhite).ToList().Exists(x => x.IsOutOfGamut || x.IsLiquidVolumesOutOfRange);
+ try
+ {
+ return Job != null && Job.Validate(_db) && !Job.Segments.SelectMany(x => x.BrushStops).Where(x => !x.IsTransparent && !x.IsWhite).ToList().Exists(x => x.IsOutOfGamut || (x.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume && x.IsLiquidVolumesOutOfRange));
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine(ex);
+ return false;
+ }
}
#endregion
@@ -843,6 +850,8 @@ namespace Tango.PPC.Jobs.ViewModels
{
BrushStop stop = sender as BrushStop;
stop.Segment.BrushStops.Where(x => x != stop).ToList().ForEach(x => x.ColorSpace = stop.ColorSpace);
+
+ DyeCommand.RaiseCanExecuteChanged();
}
/// <summary>
@@ -958,10 +967,7 @@ namespace Tango.PPC.Jobs.ViewModels
}
else if (brushStop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume)
{
- if (vm.SelectedSuggestion != suggestions.GetCenterSuggestion())
- {
- vm.SelectedSuggestion.ApplyOnBrushStop(brushStop);
- }
+ vm.SelectedSuggestion.ApplyOnBrushStop(brushStop);
}
brushStop.Corrected = true;
@@ -1325,7 +1331,7 @@ namespace Tango.PPC.Jobs.ViewModels
if (Job != null && Job.Rml.Cct != null && IsVisible)
{
- var brushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => (x.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB || x.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB) && !x.Corrected && !x.OutOfGamutChecked).ToList();
+ var brushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.ColorSpace != null).Where(x => (x.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB || x.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB) && !x.Corrected && !x.OutOfGamutChecked).ToList();
foreach (var stop in brushStops)
{
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
index bcdfcccc4..bc437d244 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs
@@ -276,13 +276,11 @@ namespace Tango.BL.Entities
{
BrushStop stop = new BrushStop();
- if (Job.ColorSpace != null)
- {
- stop.ColorSpace = Job.ColorSpace;
- }
- else
+ var lastStop = BrushStops.OrderBy(x => x.StopIndex).LastOrDefault();
+
+ if (lastStop != null && lastStop.ColorSpace != null)
{
- stop.ColorSpaceGuid = Job.ColorSpaceGuid;
+ stop.ColorSpace = lastStop.ColorSpace;
}
if (BrushStops.Count > 0)