diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs | 12 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/LiquidVolume.cs | 22 |
2 files changed, 13 insertions, 21 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index 41ebbee7c..a8d94ff8c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs @@ -506,11 +506,15 @@ namespace Tango.BL.Entities { LiquidVolumes = new ObservableCollection<LiquidVolume>(); - foreach (var idsPack in configuration.GetSupportedIdsPacks(rml)) + + lock (LiquidVolumes) { - var liquidVolume = new LiquidVolume(configuration, idsPack, rml, processParametersTable, this); - liquidVolume.VolumeChanged += LiquidVolume_VolumeChanged; - LiquidVolumes.Add(liquidVolume); + foreach (var idsPack in configuration.GetSupportedIdsPacks(rml)) + { + var liquidVolume = new LiquidVolume(configuration, idsPack, rml, processParametersTable, this); + liquidVolume.VolumeChanged += LiquidVolume_VolumeChanged; + LiquidVolumes.Add(liquidVolume); + } } foreach (var volume in LiquidVolumes.ToList()) diff --git a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs index 014ca040a..5b4cec488 100644 --- a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs @@ -14,7 +14,6 @@ namespace Tango.BL public class LiquidVolume : ExtendedObject { public event Action VolumeChanged; - private static object _lock = new object(); private BrushStop _brushStop; [JsonIgnore] @@ -83,25 +82,14 @@ namespace Tango.BL public void Invalidate() { - lock (_lock) + if (BrushStop.LiquidVolumes != null) { - try - { - if (BrushStop.LiquidVolumes != null) - { - InvalidateSolo(); + InvalidateSolo(); - foreach (var liquidVolume in BrushStop.LiquidVolumes.ToList().Where(x => x != this)) - { - liquidVolume.InvalidateSolo(); - } - } - } - catch (Exception ex) + foreach (var liquidVolume in BrushStop.LiquidVolumes.ToList().Where(x => x != this)) { - - throw; - } + liquidVolume.InvalidateSolo(); + } } } |
