aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-09 15:40:36 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-09 15:40:36 +0200
commit87f3462d4b9498df5f6deeca70ab8340e386574c (patch)
treebf58df12413a3d6a324c604eeaf8b6b85de78899 /Software/Visual_Studio/Tango.BL
parent889e372e720f096f3142cb6a5200361883a2c7be (diff)
downloadTango-87f3462d4b9498df5f6deeca70ab8340e386574c.tar.gz
Tango-87f3462d4b9498df5f6deeca70ab8340e386574c.zip
Fixed some bugs.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs12
-rw-r--r--Software/Visual_Studio/Tango.BL/LiquidVolume.cs22
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();
+ }
}
}