IScaleOrTank.ScaleNr eliminated.
This commit is contained in:
@@ -12,11 +12,6 @@ namespace TBF.Rig.GenericDevices
|
||||
/// </summary>
|
||||
public interface IScaleOrTank : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Balance number: 0-based index required for communication with the Elde component
|
||||
/// </summary>
|
||||
int ScaleNr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Balance water tank capacity in kg or ltr
|
||||
/// </summary>
|
||||
|
||||
+6
-18
@@ -232,7 +232,6 @@ namespace TBF.Rig
|
||||
|
||||
/// Find all balances (to initialize tank capacities in the control board)
|
||||
/// Find the control board
|
||||
IList<IScaleOrTank> tanks = new List<IScaleOrTank>();
|
||||
UInt128 valvesToInvert = 0;
|
||||
foreach (var cmpnt in components)
|
||||
{
|
||||
@@ -284,26 +283,12 @@ namespace TBF.Rig
|
||||
if (cmpnt is ITestMethod && cmpnt.ClassName == "TestMethods.OuterLoop.Start") LoopStartNames.Add(cmpnt.Name);
|
||||
if (cmpnt is ITestMethod && cmpnt.ClassName == "TestMethods.OuterLoop.End") LoopEndNames.Add(cmpnt.Name);
|
||||
|
||||
if (cmpnt is IScaleOrTank)
|
||||
{
|
||||
IScaleOrTank tank = cmpnt as IScaleOrTank;
|
||||
tanks.Add(tank);
|
||||
|
||||
if ((tank.ScaleNr == 0) && (Tank1 == null)) Tank1 = tank;
|
||||
else if ((tank.ScaleNr == 1) && (Tank2 == null)) Tank2 = tank;
|
||||
else if ((tank.ScaleNr == 2) && (Tank3 == null)) Tank3 = tank;
|
||||
}
|
||||
|
||||
BuiltIn.Valve.Valve plainValve = (cmpnt as BuiltIn.Valve.Valve);
|
||||
if ((plainValve != null) && plainValve.Inverted) valvesToInvert |= plainValve.Mask;
|
||||
|
||||
cmpnt.StartChangeHandler(); /// Start handling parameter change events
|
||||
}
|
||||
|
||||
/// Create an array with tank capacities
|
||||
double[] tankCapacities = new double[tanks.Count];
|
||||
for (int i = 0; i < tankCapacities.Length; i++) tankCapacities[i] = tanks[i].Capacity;
|
||||
|
||||
/// Pre-initialize the control board (= buffer the arguments ctrlBrdComponent, tankCapacities)
|
||||
if (ControlBoard == null)
|
||||
{
|
||||
@@ -366,20 +351,23 @@ namespace TBF.Rig
|
||||
{
|
||||
IScaleOrTank tank = cmpnt as IScaleOrTank;
|
||||
|
||||
if ((tank.ScaleNr == 0) && (DrainValve1 == null))
|
||||
if (Tank1 == null)
|
||||
{
|
||||
Tank1 = tank;
|
||||
DrainValve1 = tank.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale1={0} Draining valve1={1}",
|
||||
tank.Name, (DrainValve1 != null) ? DrainValve1.Name : "---");
|
||||
}
|
||||
else if ((tank.ScaleNr == 1) && (DrainValve2 == null))
|
||||
else if (Tank2 == null)
|
||||
{
|
||||
Tank2 = tank;
|
||||
DrainValve2 = tank.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale2={0} Draining valve2={1}",
|
||||
tank.Name, (DrainValve2 != null) ? DrainValve2.Name : "---");
|
||||
}
|
||||
else if ((tank.ScaleNr == 2) && (DrainValve3 == null))
|
||||
else if (Tank3 == null)
|
||||
{
|
||||
Tank3 = tank;
|
||||
DrainValve3 = tank.DrainValve;
|
||||
log.WarnFormat("InitializeBoardEtc() ... Scale3={0} Draining valve3={1}",
|
||||
tank.Name, (DrainValve3 != null) ? DrainValve3.Name : "---");
|
||||
|
||||
Reference in New Issue
Block a user