Fixed a bug in emptying valves initialization on StateMachine startup
This commit is contained in:
@@ -282,20 +282,17 @@ namespace TBF.BenchControl
|
||||
// Automatic detection of empty tank valves
|
||||
foreach (var opath in outputPaths)
|
||||
{
|
||||
if ((Balance1 != null) && (opath.Balance == Balance1.Cfg.Name))
|
||||
if ((EmptyTankValve1 == null) && (Balance1 != null) && (opath.Balance == Balance1.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve1 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
break;
|
||||
}
|
||||
if ((Balance2 != null) && (opath.Balance == Balance2.Cfg.Name))
|
||||
if ((EmptyTankValve2 == null) && (Balance2 != null) && (opath.Balance == Balance2.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve2 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
break;
|
||||
}
|
||||
if ((Balance3 != null) && (opath.Balance == Balance3.Cfg.Name))
|
||||
if ((EmptyTankValve3 == null) && (Balance3 != null) && (opath.Balance == Balance3.Cfg.Name))
|
||||
{
|
||||
EmptyTankValve3 = TbfComponents.FindComponent(opath.EmptyTankValve) as IValve;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user