diff --git a/TBF/BenchControl/GenericDevices/ILevelMeter.cs b/TBF/BenchControl/GenericDevices/ILevelMeter.cs
index 1801bd6e1..305cfd157 100644
--- a/TBF/BenchControl/GenericDevices/ILevelMeter.cs
+++ b/TBF/BenchControl/GenericDevices/ILevelMeter.cs
@@ -30,5 +30,12 @@ namespace TBF.BenchControl.GenericDevices
/// Reference to a variable for the measured level in mm
/// ReadLevelOp instance reference casted to IOperaton
IOperation ReadLevelOp(ref DoubleBox level);
+
+ ///
+ /// Events: Busy, LevelDone, Error
+ ///
+ /// Reference to a variable for the measured level in mm
+ /// ReadLevelOp instance reference casted to IOperaton
+ IOperation ReadStableLevelOp(ref DoubleBox level, double sdev);
}
}
diff --git a/TBF/BenchControl/GenericDevices/ITankWithVolumeMsrmnt.cs b/TBF/BenchControl/GenericDevices/ITankWithVolumeMsrmnt.cs
deleted file mode 100644
index 7bea5aee7..000000000
--- a/TBF/BenchControl/GenericDevices/ITankWithVolumeMsrmnt.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-///
-/// Copyright (c) 2018 Sensus Slovensko a.s.
-///
-using TBF.Boxes;
-
-namespace TBF.BenchControl.GenericDevices
-{
- public interface ITankWithVolumeMsrmnt : IScaleOrTank
- {
- IOperation MeasureVolumeOp(ref DoubleBox volume);
- }
-}
diff --git a/TBF/BenchControl/GenericDevices/IVolumeMeter.cs b/TBF/BenchControl/GenericDevices/IVolumeMeter.cs
index e90a02e40..0e0015bec 100644
--- a/TBF/BenchControl/GenericDevices/IVolumeMeter.cs
+++ b/TBF/BenchControl/GenericDevices/IVolumeMeter.cs
@@ -24,11 +24,17 @@ namespace TBF.BenchControl.GenericDevices
IOperation ReadVolumeOp(ref DoubleBox volume);
///
- /// Events: volumeDone, Error
+ /// Events: VolumeDone, Error
///
/// Reference to a variable for the measured volume in l
- /// Event returned when measurement done
/// ReadPressureOp instance reference casted to IOperaton
- IOperation ReadVolumeOp(ref DoubleBox volume, Event volumeDone);
+ IOperation ReadStableVolumeOp(ref DoubleBox volume, double sdev);
+
+ ///
+ /// Events: VolumeDone, Error
+ ///
+ /// Reference to a variable for the measured volume in l
+ /// ReadPressureOp instance reference casted to IOperaton
+ IOperation ManualReadVolumeOp(ref DoubleBox volume);
}
}
diff --git a/TBF/BenchControl/Hart/Nivotrack/Nivotrack.cs b/TBF/BenchControl/Hart/Nivotrack/Nivotrack.cs
index 36413c0a0..daf8d738f 100644
--- a/TBF/BenchControl/Hart/Nivotrack/Nivotrack.cs
+++ b/TBF/BenchControl/Hart/Nivotrack/Nivotrack.cs
@@ -33,12 +33,14 @@ namespace TBF.BenchControl.Hart.Nivotrack
public double Level { get { return ReadLevel(); } }
DoubleBox levelBox;
+ double sdev;
enum CurrentOp
{
None,
ReadLevel,
- }
+ ReadStableLevel,
+ }
CurrentOp currentOp;
@@ -173,6 +175,16 @@ namespace TBF.BenchControl.Hart.Nivotrack
return this;
}
+ /// Reference to the operation
+ public IOperation ReadStableLevelOp(ref DoubleBox levelBox, double sdev)
+ {
+ if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
+ this.levelBox = levelBox;
+ this.sdev = sdev;
+ currentOp = CurrentOp.ReadStableLevel;
+ return this;
+ }
+
/// Start this operation
public void Start()
{
diff --git a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/LevelMeter.cs b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/LevelMeter.cs
index 50869e068..49ef3bfb6 100644
--- a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/LevelMeter.cs
+++ b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/LevelMeter.cs
@@ -84,11 +84,12 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public double ReadTemperature() { return temperature; } /// Returns temperature in °C
public IOperation ReadLevelOp(ref DoubleBox level) { return new ReadLevelOp(this, ref level); }
+ public IOperation ReadStableLevelOp(ref DoubleBox level, double sdev) { return new ReadStableLevelOp(this, ref level, sdev); }
+ public IOperation ManualReadLevelOp(ref DoubleBox level) { return null; }
public IOperation ReadVolumeOp(ref DoubleBox volume) { return new ReadVolumeOp(this, ref volume); }
+ public IOperation ReadStableVolumeOp(ref DoubleBox volume, double sdev) { return new ReadStableVolumeOp(this, ref volume, sdev); }
+ public IOperation ManualReadVolumeOp(ref DoubleBox volume) { return null; }
public IOperation ReadTempOp(ref DoubleBox temperature) { return new ReadTempOp(this, ref temperature); }
-
- public IOperation ReadLevelOp(ref DoubleBox level, Event eventDone) { return new ReadLevelOp(this, ref level, eventDone); }
- public IOperation ReadVolumeOp(ref DoubleBox volume, Event eventDone) { return new ReadVolumeOp(this, ref volume, eventDone); }
public IOperation ReadTempOp(ref DoubleBox temperature, Event eventDone) { return new ReadTempOp(this, ref temperature, eventDone); }
diff --git a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadLevelOp.cs b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadLevelOp.cs
index 0785400cf..a8307db1c 100644
--- a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadLevelOp.cs
+++ b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadLevelOp.cs
@@ -10,11 +10,10 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public class ReadLevelOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadLevelOp));
- public override string ToString() { return string.Format("ReadLevelOp(.,{0},.)", eventDone); }
+ public override string ToString() { return string.Format("ReadLevelOp(.,.)"); }
/// Set by the constructor
readonly LevelMeter levelMeter;
- readonly Event eventDone;
/// Measured value
DoubleBox level;
@@ -25,19 +24,14 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
/// Water level meter reference
/// Reference to the measured level variable, value is in mm
/// Event to be returned by Run() when completed OK
- public ReadLevelOp(LevelMeter levelMeter, ref DoubleBox level, Event eventDone)
+ public ReadLevelOp(LevelMeter levelMeter, ref DoubleBox level)
{
if (levelMeter == null) throw new ArgumentNullException("levelMeter");
this.levelMeter = levelMeter;
this.level = level;
- this.eventDone = eventDone;
log.Debug(this.ToString());
}
- public ReadLevelOp(LevelMeter levelMeter, ref DoubleBox level)
- : this(levelMeter, ref level, Event.LevelDone)
- {
- }
/// Start this operation
@@ -53,7 +47,7 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public Event Run()
{
level.Val = levelMeter.ReadLevel();
- return eventDone;
+ return Event.LevelDone;
}
/// Stop this operation
diff --git a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableLevelOp.cs b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableLevelOp.cs
new file mode 100644
index 000000000..d20c4e37b
--- /dev/null
+++ b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableLevelOp.cs
@@ -0,0 +1,58 @@
+///
+/// Copyright (c) 2018 Sensus Slovensko a.s.
+///
+using System;
+using log4net;
+using TBF.Boxes;
+
+namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
+{
+ public class ReadStableLevelOp : IOperation
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof(ReadLevelOp));
+ public override string ToString() { return string.Format("ReadLevelOp(.,.)"); }
+
+ /// Set by the constructor
+ readonly LevelMeter levelMeter;
+ readonly DoubleBox level;
+ readonly double sdev;
+
+ ///
+ /// Events: LevelDone or Error
+ ///
+ /// Water level meter reference
+ /// Reference to the measured level variable, value is in mm
+ /// Event to be returned by Run() when completed OK
+ public ReadStableLevelOp(LevelMeter levelMeter, ref DoubleBox level, double sdev)
+ {
+ if (levelMeter == null) throw new ArgumentNullException("levelMeter");
+ this.levelMeter = levelMeter;
+ this.level = level;
+ this.sdev = sdev;
+
+ log.Debug(this.ToString());
+ }
+
+
+ /// Start this operation
+ public void Start()
+ {
+ level.Val = levelMeter.ReadLevel();
+ }
+
+ /// Run this operation
+ ///
+ /// Event.LevelDone
+ ///
+ public Event Run()
+ {
+ level.Val = levelMeter.ReadLevel();
+ return Event.LevelDone;
+ }
+
+ /// Stop this operation
+ public void Stop()
+ {
+ }
+ }
+}
diff --git a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableVolumeOp.cs b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableVolumeOp.cs
new file mode 100644
index 000000000..30c0c4835
--- /dev/null
+++ b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadStableVolumeOp.cs
@@ -0,0 +1,58 @@
+///
+/// Copyright (c) 2018 Sensus Slovensko a.s.
+///
+using System;
+using log4net;
+using TBF.Boxes;
+
+namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
+{
+ public class ReadStableVolumeOp : IOperation
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof(ReadVolumeOp));
+ public override string ToString() { return string.Format("ReadVolumeOp(.,.)"); }
+
+ /// Set by the constructor
+ readonly LevelMeter levelMeter;
+ readonly DoubleBox volume;
+ readonly double sdev;
+
+ ///
+ /// Events: VolumeDone or Error
+ ///
+ /// Water volume meter reference
+ /// Reference to the measured volume variable, value is in l
+ /// Event to be returned by Run() when completed OK
+ public ReadStableVolumeOp(LevelMeter levelMeter, ref DoubleBox volume, double sdev)
+ {
+ if (levelMeter == null) throw new ArgumentNullException("levelMeter");
+ this.levelMeter = levelMeter;
+ this.volume = volume;
+ this.sdev = sdev;
+
+ log.Debug(this.ToString());
+ }
+
+
+ /// Start this operation
+ public void Start()
+ {
+ volume.Val = levelMeter.ReadVolume();
+ }
+
+ /// Run this operation
+ ///
+ /// Event.VolumeDone
+ ///
+ public Event Run()
+ {
+ volume.Val = levelMeter.ReadVolume();
+ return Event.VolumeDone;
+ }
+
+ /// Stop this operation
+ public void Stop()
+ {
+ }
+ }
+}
diff --git a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadVolumeOp.cs b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadVolumeOp.cs
index d27b82a09..616bddc8e 100644
--- a/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadVolumeOp.cs
+++ b/TBF/BenchControl/Modbus/UltrasoundLevelMeter/ReadVolumeOp.cs
@@ -10,11 +10,10 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public class ReadVolumeOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadVolumeOp));
- public override string ToString() { return string.Format("ReadVolumeOp(.,{0},.)", eventDone); }
+ public override string ToString() { return string.Format("ReadVolumeOp(.,.)"); }
/// Set by the constructor
readonly LevelMeter levelMeter;
- readonly Event eventDone;
/// Measured value
DoubleBox volume;
@@ -25,19 +24,14 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
/// Water volume meter reference
/// Reference to the measured volume variable, value is in l
/// Event to be returned by Run() when completed OK
- public ReadVolumeOp(LevelMeter levelMeter, ref DoubleBox volume, Event eventDone)
+ public ReadVolumeOp(LevelMeter levelMeter, ref DoubleBox volume)
{
if (levelMeter == null) throw new ArgumentNullException("levelMeter");
this.levelMeter = levelMeter;
this.volume = volume;
- this.eventDone = eventDone;
log.Debug(this.ToString());
}
- public ReadVolumeOp(LevelMeter levelMeter, ref DoubleBox volume)
- : this(levelMeter, ref volume, Event.VolumeDone)
- {
- }
/// Start this operation
@@ -53,7 +47,7 @@ namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
public Event Run()
{
volume.Val = levelMeter.ReadVolume();
- return eventDone;
+ return Event.VolumeDone;
}
/// Stop this operation
diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs
index 23daaf6bd..9edd5a0b7 100644
--- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs
+++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs
@@ -32,13 +32,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
{
IList e = new List(); /// Events from currently running operations
- ITankWithVolumeMsrmnt tank = outPath.Scale as ITankWithVolumeMsrmnt;
- if (tank == null)
+ if ((outPath.Scale == null) || !(outPath.Scale is IVolumeMeter))
{
Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
return e;
}
+ IVolumeMeter tank = outPath.Scale as IVolumeMeter;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
@@ -62,7 +62,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
}
}
- if (test.Volume >= tank.Capacity * Constants.TankFullFactor)
+ if (test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor)
{
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
e.Add(Event.UiCmdStop);
@@ -100,7 +100,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
///
if (test.DoDraining)
{
- switch (DrainTheTank(tank))
+ switch (DrainTheTank(outPath.Scale))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
@@ -565,7 +565,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
- .AddOperation(tank.MeasureVolumeOp(ref volumeBox))
+ .AddOperation(tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread))
.AddOperation(processDataLoggingOp)
.EnterState();
do
@@ -826,7 +826,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
- tank != null ? tank.Name : string.Empty,
+ outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
index b7ea3be14..3b6e0799e 100644
--- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
+++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
@@ -36,13 +36,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
IList e = new List(); /// Events from currently running operations
- ITankWithVolumeMsrmnt tank = outPath.Scale as ITankWithVolumeMsrmnt;
- if (tank == null)
- {
- Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
- e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
- return e;
- }
+ if ((outPath.Scale == null) || !(outPath.Scale is IVolumeMeter))
+ {
+ Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
+ e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
+ return e;
+ }
+ IVolumeMeter tank = outPath.Scale as IVolumeMeter;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
@@ -66,7 +66,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
}
}
- if (test.Volume > tank.Capacity * Constants.TankFullFactor)
+ if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)
{
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
e.Add(Event.UiCmdStop);
@@ -100,7 +100,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
///
if (test.DoDraining)
{
- switch (DrainTheTank(tank))
+ switch (DrainTheTank(outPath.Scale))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
@@ -450,7 +450,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
- .AddOperation(tank.MeasureVolumeOp(ref volumeBox))
+ .AddOperation(tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread))
.AddOperation(processDataLoggingOp)
.EnterState();
do
@@ -715,7 +715,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
- tank != null ? tank.Name : string.Empty,
+ outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
@@ -775,8 +775,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
///
/// Test method simulation
///
- ITankWithVolumeMsrmnt tank = outPath.Scale as ITankWithVolumeMsrmnt;
- if (tank == null)
+ if ((outPath.Scale == null) || !(outPath.Scale is IVolumeMeter))
{
Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
@@ -785,6 +784,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
retListSim1.Add(Event.ConfigurationError);
return retListSim1;
}
+ IVolumeMeter tank = outPath.Scale as IVolumeMeter;
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
@@ -792,7 +792,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
Event retVal = Event.Done;
DoubleBox volumeBox = new DoubleBox();
///
- IOperation msrVolOp = tank.MeasureVolumeOp(ref volumeBox);
+ IOperation msrVolOp = tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread);
State.Create(string.Format("{0}({1}) : Water level measurement", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(msrVolOp)
diff --git a/TBF/BenchControl/Various/ManualLevelMsrmnt/ManualLevelMsrmnt.cs b/TBF/BenchControl/Various/ManualLevelMsrmnt/ManualLevelMsrmnt.cs
index f135c03b7..b7c041a31 100644
--- a/TBF/BenchControl/Various/ManualLevelMsrmnt/ManualLevelMsrmnt.cs
+++ b/TBF/BenchControl/Various/ManualLevelMsrmnt/ManualLevelMsrmnt.cs
@@ -56,6 +56,24 @@ namespace TBF.BenchControl.Various.ManualLevelMsrmnt
return this;
}
+ /// Reference to the operation
+ public IOperation ReadStableLevelOp(ref DoubleBox levelBox, double sdev)
+ {
+ if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
+ this.levelBox = levelBox;
+ currentOp = CurrentOp.EnterLevel;
+ return this;
+ }
+
+ /// Reference to the operation
+ public IOperation ManualReadLevelOp(ref DoubleBox levelBox)
+ {
+ if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
+ this.levelBox = levelBox;
+ currentOp = CurrentOp.EnterLevel;
+ return this;
+ }
+
delegate void EntryFormDlgt(ManualLevelMsrmnt myRef);
///
@@ -70,7 +88,7 @@ namespace TBF.BenchControl.Various.ManualLevelMsrmnt
public void Start()
{
resultSaved = false;
- if (currentOp == CurrentOp.EnterLevel)
+ if (currentOp == CurrentOp.EnterLevel)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenWaterLevelForm), this);
}
diff --git a/TBF/BenchControl/Various/TankWithLevelMsrmnt/Tank.cs b/TBF/BenchControl/Various/TankWithLevelMsrmnt/Tank.cs
index 71aa1297c..c322ce023 100644
--- a/TBF/BenchControl/Various/TankWithLevelMsrmnt/Tank.cs
+++ b/TBF/BenchControl/Various/TankWithLevelMsrmnt/Tank.cs
@@ -13,7 +13,7 @@ using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
{
- public class Tank : TBF.BenchControl.MettlerToledo.TankDraining, IDevice, ITankWithVolumeMsrmnt, IOperation
+ public class Tank : TBF.BenchControl.MettlerToledo.TankDraining, IDevice, IScaleOrTank, IVolumeMeter, IOperation
{
///
/// Info: StartMassMeasurement() and "Balnce response = .., Mass = ..."
@@ -31,13 +31,17 @@ namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
public enum CurrentOp
{
None,
- MeasureVolume,
- }
+ ReadVolume,
+ ReadStableVolume,
+ ManualReadVolume,
+ }
CurrentOp currentOp;
DoubleBox volumeBox;
+ double sdev;
TBF.BenchControl.GenericDevices.ILevelMeter levelMeter;
- DoubleBox levelBox;
+ TBF.BenchControl.GenericDevices.ILevelMeter manualLevelMeter;
+ DoubleBox levelBox;
IOperation readLevelOp;
@@ -106,8 +110,9 @@ namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
drainValve2 = TbfComponents.FindComponent(tankCfg.DrainValve2) as IValve;
+ manualLevelMeter = new Various.ManualLevelMsrmnt.ManualLevelMsrmnt();
levelMeter = TbfComponents.FindComponent(tankCfg.LevelMeasurement) as ILevelMeter;
- if (levelMeter == null) levelMeter = new Various.ManualLevelMsrmnt.ManualLevelMsrmnt();
+ if (levelMeter == null) levelMeter = manualLevelMeter;
useCalibTable = LoadCalibrationTable(tankCfg.CalibrationTable);
}
@@ -303,15 +308,36 @@ namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
/// Reference to the operation
- public IOperation MeasureVolumeOp(ref DoubleBox volume)
+ public IOperation ReadVolumeOp(ref DoubleBox volume)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
this.volumeBox = volume;
readLevelOp = levelMeter.ReadLevelOp(ref levelBox);
- currentOp = CurrentOp.MeasureVolume;
+ currentOp = CurrentOp.ReadVolume;
return this;
}
+ /// Reference to the operation
+ public IOperation ReadStableVolumeOp(ref DoubleBox volume, double sdev)
+ {
+ if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
+ this.volumeBox = volume;
+ this.sdev = sdev;
+ readLevelOp = levelMeter.ReadStableLevelOp(ref levelBox, sdev);
+ currentOp = CurrentOp.ReadStableVolume;
+ return this;
+ }
+
+ /// Reference to the operation
+ public IOperation ManualReadVolumeOp(ref DoubleBox volume)
+ {
+ if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
+ this.volumeBox = volume;
+ readLevelOp = manualLevelMeter.ReadLevelOp(ref levelBox);
+ currentOp = CurrentOp.ManualReadVolume;
+ return this;
+ }
+
public void Start()
{
readLevelOp.Start();
diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj
index 9df2d6ed6..120aafd59 100644
--- a/TBF/TBF.csproj
+++ b/TBF/TBF.csproj
@@ -536,7 +536,6 @@
-
@@ -668,6 +667,8 @@
+
+