From 73327143a2ac187695bed0ecded52c4d675165c4 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 18 Mar 2019 15:01:20 +0200 Subject: Fixed issue with brush stop duplication on developer module. --- .../Converters/LiquidVolumesToLubricantLiquidVolume.cs | 11 +++++++++-- .../Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 1 + .../Modules/Tango.MachineStudio.Developer/Views/JobView.xaml | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs index e59141e7f..5939bfd53 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/LiquidVolumesToLubricantLiquidVolume.cs @@ -14,8 +14,15 @@ namespace Tango.MachineStudio.Developer.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - IEnumerable liquid_volumes = value as IEnumerable; - return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32()); + if (value != null) + { + IEnumerable liquid_volumes = value as IEnumerable; + return liquid_volumes.SingleOrDefault(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.Lubricant.ToInt32()); + } + else + { + return null; + } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 41f57794a..02431fd98 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -2179,6 +2179,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { var cloned = stop.Clone(); cloned.StopIndex = SelectedSegment.BrushStops.Max(x => x.StopIndex) + 1; + cloned.SetLiquidVolumes(ActiveJob.Machine.Configuration, SelectedRML, SelectedProcessParametersTable); SelectedSegment.BrushStops.Add(cloned); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 9504d5769..c4c831011 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -962,11 +962,11 @@ - + - + -- cgit v1.3.1