aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-04 17:46:26 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-04 17:46:26 +0200
commit95cabc98a8cd6baebc697c179be9fb68913ac483 (patch)
treeb9f839821e3f8087b968fef5c34660b122ec6d1f /Software/Visual_Studio
parent5513ba4c2db05de40d9adfac645d7e77c35c71f7 (diff)
downloadTango-95cabc98a8cd6baebc697c179be9fb68913ac483.tar.gz
Tango-95cabc98a8cd6baebc697c179be9fb68913ac483.zip
Fixed issue with LeastParameterTables index.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs14
3 files changed, 41 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
index 70073ad62..ef6fc816b 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
@@ -209,6 +209,34 @@ namespace Tango.MachineStudio.RML.ViewModels
.WithMediaProperties()
.BuildAsync();
+ if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0)
+ {
+ if (!_notification.ShowQuestion("Could not find any process group for the selected RML. Would you like to create one?"))
+ {
+ _notification.ShowError("Cannot load an RML with no process group.");
+ IsFree = true;
+ return;
+ }
+ else
+ {
+ ProcessParametersTablesGroup group = new ProcessParametersTablesGroup();
+ group.Name = "Active Group";
+ group.Active = true;
+ group.ProcessParametersTables.Add(new ProcessParametersTable()
+ {
+ Name = "Process Table 1",
+ });
+
+ group.Rml = ActiveRML;
+
+ _active_context.ProcessParametersTablesGroups.Add(group);
+ _active_context.ProcessParametersTables.Add(group.ProcessParametersTables[0]);
+ await _active_context.SaveChangesAsync();
+ LoadActiveRML(ActiveRML.Guid);
+ return;
+ }
+ }
+
ActiveProcessParametersGroup = ActiveRML.ProcessParametersTablesGroups.ToList().FirstOrDefault();
ActiveProcessParametersTableView = CollectionViewSource.GetDefaultView(ActiveProcessParametersGroup.ProcessParametersTables);
ActiveProcessParametersTableView.SortDescriptions.Add(new SortDescription(nameof(ProcessParametersTable.TableIndex), ListSortDirection.Ascending));
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index 5a41fad9c..d61c0fb6a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("2.0.9.1608")]
+[assembly: AssemblyVersion("2.0.10.1608")]
diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs
index 1542cfed9..327880b63 100644
--- a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs
+++ b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs
@@ -166,9 +166,19 @@ namespace Tango.BL.ColorConversion
{
var standard_stops = stops.Where(x => x.BrushColorSpace == Enumerations.ColorSpaces.RGB || x.BrushColorSpace == Enumerations.ColorSpaces.LAB || x.BrushColorSpace == Enumerations.ColorSpaces.CMYK || x.BrushColorSpace == Enumerations.ColorSpaces.Volume);
var color_catalog_stops = stops.Where(x => x.BrushColorSpace != Enumerations.ColorSpaces.RGB && x.BrushColorSpace != Enumerations.ColorSpaces.LAB && x.BrushColorSpace != Enumerations.ColorSpaces.CMYK && x.BrushColorSpace != Enumerations.ColorSpaces.Volume);
- var min_standard = standard_stops.Select(x => GetSuggestions(x)).Select(x => x.SingleCoordinates).Min(x => x.ProcessParametersTableIndex);
- var min_catalog = color_catalog_stops.Where(x => x.ColorCatalog != null).Min(x => x.ColorCatalog.ProcessParametersTableIndex);
+ var min_standard = 0;
+ var min_catalog = 0;
+
+ if (standard_stops.Count() > 0)
+ {
+ min_standard = standard_stops.Select(x => GetSuggestions(x)).Select(x => x.SingleCoordinates).Min(x => x.ProcessParametersTableIndex);
+ }
+
+ if (color_catalog_stops.Count() > 0)
+ {
+ min_catalog = color_catalog_stops.Where(x => x.ColorCatalog != null).Min(x => x.ColorCatalog.ProcessParametersTableIndex);
+ }
if (standard_stops.Count() == 0)
{