ProcessData base class with 'public static' process data introduced.
This commit is contained in:
parent
15ac3608c4
commit
bb2087c002
9
TODO.txt
9
TODO.txt
@ -1,9 +1,10 @@
|
||||
iPerl:
|
||||
- default hodnoty 'publish' a 'evaluate' vzdy 'yes'
|
||||
- naimplementovat Spooler pre OracleDB
|
||||
- updatovat progress bary pre iPerl comm.
|
||||
- neukaldat process data pre UnknownPcbNr... vodomery
|
||||
|
||||
- 'publish' a 'evaluate' pre vsetky metody
|
||||
- menej logovania vah MettlerToledo
|
||||
- naukaldat process data pre UnknownPcbNr... vodomery
|
||||
- vyuzit sirku obrazovky na Activity, Progress bar, Drop down menu
|
||||
- prechadzat na double (results)
|
||||
|
||||
- log pre pevny start, podobne (zarazky) ako pre letmy
|
||||
- 'Q2 corrected from ...' Evaluate a Publish parametre
|
||||
|
||||
@ -467,7 +467,7 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
/// Update format for the water mass
|
||||
mass.Format = outPath.Balance.Format;
|
||||
Mass.Format = outPath.Balance.Format;
|
||||
startMass.Format = outPath.Balance.Format;
|
||||
endMass.Format = outPath.Balance.Format;
|
||||
|
||||
@ -522,7 +522,7 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
|
||||
/// Update format for the water mass
|
||||
mass.Format = outPath.Balance.Format;
|
||||
Mass.Format = outPath.Balance.Format;
|
||||
startMass.Format = outPath.Balance.Format;
|
||||
endMass.Format = outPath.Balance.Format;
|
||||
|
||||
|
||||
25
TestBenchFramework/BenchControl/Sequences/ProcessData.cs
Normal file
25
TestBenchFramework/BenchControl/Sequences/ProcessData.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
public class ProcessData
|
||||
{
|
||||
public static IBenchInfo BenchInfo;
|
||||
|
||||
public static FloatBox AmbientTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
|
||||
public static FloatBox AmbientPressure = new FloatBox() { Name = "Ambient Pressure", Format = "F1" };
|
||||
public static FloatBox AmbientHumidity = new FloatBox() { Name = "Ambient Humidity", Format = "F1" }; /// [%]
|
||||
|
||||
public static FloatBox TempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox PressureUp = new FloatBox() { Name = "Pressure In", Format = "F3", Factor = 0.01f };
|
||||
public static FloatBox PressureDown = new FloatBox() { Name = "Pressure Out", Format = "F3", Factor = 0.01f };
|
||||
|
||||
public static IntBox RefCount = new IntBox() { Name = "RefCount" };
|
||||
public static FloatBox RefFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
||||
public static FloatBox RefFlow = new FloatBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
||||
public static FloatBox Mass = new FloatBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,7 @@ namespace TBF.BenchControl.Sequences
|
||||
/// Sequence is a group of states that can be dynamically added to
|
||||
/// and removed from the state machine
|
||||
/// </summary>
|
||||
public class SequenceBase
|
||||
public class SequenceBase : ProcessData
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(SequenceBase));
|
||||
protected static readonly ILog processDataLogger = LogManager.GetLogger("ProcessData");
|
||||
@ -28,7 +28,6 @@ namespace TBF.BenchControl.Sequences
|
||||
///------------------------------------------------------------
|
||||
/// Global static variables set only once.
|
||||
///------------------------------------------------------------
|
||||
public static IBenchInfo BenchInfo;
|
||||
public static IList<IFlowMeter> FlowMeters; /// list of reference flowmeters
|
||||
public static IList<IRegulValve> RegulValves; /// list of regulation valves
|
||||
public static IList<IPumpFM> PumpsWithFM; /// list of FM controlled pumps
|
||||
@ -134,15 +133,6 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
#region Temperature_Pressure_Humidity
|
||||
|
||||
protected static FloatBox tempIn = new FloatBox() { Name = "Temperature In", Format = "F2" };
|
||||
protected static FloatBox tempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" };
|
||||
protected static FloatBox tempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" };
|
||||
protected static FloatBox pressIn = new FloatBox() { Name = "Pressure In", Format = "F3", Factor = 0.01f };
|
||||
protected static FloatBox pressOut = new FloatBox() { Name = "Pressure Out", Format = "F3", Factor = 0.01f };
|
||||
protected static FloatBox airTemperature = new FloatBox() { Name = "Ambient Temperature", Format = "F1" };
|
||||
protected static FloatBox airPressure = new FloatBox() { Name = "Ambient Pressure", Format = "F1" };
|
||||
protected static FloatBox airHumidity = new FloatBox() { Name = "Ambient Humidity", Format = "F1" };
|
||||
///
|
||||
protected float tempInSum;
|
||||
protected float tempOutSum;
|
||||
protected float tempDivSum;
|
||||
@ -170,14 +160,14 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
protected void AccumulateAveragedData()
|
||||
{
|
||||
tempInSum += tempIn.Val;
|
||||
tempOutSum += tempOut.Val;
|
||||
tempDivSum += tempDiv.Val;
|
||||
pressInSum += pressIn.Val;
|
||||
pressOutSum += pressOut.Val;
|
||||
ambientTempSum += airTemperature.Val;
|
||||
ambientPressSum += airPressure.Val;
|
||||
ambientHumiSum += airHumidity.Val;
|
||||
tempInSum += TempIn.Val;
|
||||
tempOutSum += TempOut.Val;
|
||||
tempDivSum += TempDiv.Val;
|
||||
pressInSum += PressureUp.Val;
|
||||
pressOutSum += PressureDown.Val;
|
||||
ambientTempSum += AmbientTemp.Val;
|
||||
ambientPressSum += AmbientPressure.Val;
|
||||
ambientHumiSum += AmbientHumidity.Val;
|
||||
///
|
||||
averagedDataCount++;
|
||||
}
|
||||
@ -216,10 +206,6 @@ namespace TBF.BenchControl.Sequences
|
||||
protected static FloatBox[] WMVolumes;
|
||||
protected static FloatBox[] WMErrors;
|
||||
|
||||
protected static IntBox refCount = new IntBox() { Name = "RefCount" };
|
||||
protected static FloatBox refFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
||||
protected static FloatBox refFlow = new FloatBox() { Name = "RefFlow", Format = "F2" };
|
||||
protected static FloatBox mass = new FloatBox() { Name = "Mass", Format = "F3" };
|
||||
protected static FloatBox startMass = new FloatBox() { Name = "Start Mass", Format = "F3" };
|
||||
protected static FloatBox endMass = new FloatBox() { Name = "End Mass", Format = "F3" };
|
||||
|
||||
@ -239,10 +225,10 @@ namespace TBF.BenchControl.Sequences
|
||||
WMErrors[i].Clear();
|
||||
}
|
||||
|
||||
refCount.Clear();
|
||||
refFreq.Clear();
|
||||
refFlow.Clear();
|
||||
mass.Clear();
|
||||
RefCount.Clear();
|
||||
RefFreq.Clear();
|
||||
RefFlow.Clear();
|
||||
Mass.Clear();
|
||||
startMass.Clear();
|
||||
endMass.Clear();
|
||||
}
|
||||
@ -268,20 +254,20 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15}",
|
||||
DateTime.Now.ToLongTimeString(),
|
||||
Utils.FloatToStr(refFlow.Val, 4),
|
||||
Utils.FloatToStr(RefFlow.Val, 4),
|
||||
StateMachine.ControlBoard.TTime.ToString("F3"),
|
||||
StateMachine.ControlBoard.EtPulses(0),
|
||||
Formulas.VolumeFromPulses(StateMachine.ControlBoard.EtPulses(0), 1.0f / ltrPerRefPulse).ToString("F3"),
|
||||
tempIn,
|
||||
tempOut,
|
||||
tempDiv,
|
||||
pressIn,
|
||||
pressOut,
|
||||
mass,
|
||||
TempIn,
|
||||
TempOut,
|
||||
TempDiv,
|
||||
PressureUp,
|
||||
PressureDown,
|
||||
Mass,
|
||||
"VolMM",
|
||||
airTemperature,
|
||||
airHumidity,
|
||||
airPressure,
|
||||
AmbientTemp,
|
||||
AmbientHumidity,
|
||||
AmbientPressure,
|
||||
outPath.RegulValve.Position.ToString("F1"));
|
||||
}
|
||||
|
||||
@ -313,7 +299,7 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------
|
||||
State.Create("SequenceBase : Emptying the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
@ -325,13 +311,13 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
}
|
||||
while (!Balance.IsEmpty(mass.Val));
|
||||
while (!Balance.IsEmpty(Mass.Val));
|
||||
|
||||
quit_emptying:
|
||||
//--------------------------------
|
||||
State.Create("SequenceBase : Closing the emptying valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, EmptyTankValve))
|
||||
.EnterState();
|
||||
@ -344,7 +330,7 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
State.Create("SequenceBase : Updating the weight")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(new Operations.TimerOp(5))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
@ -727,15 +713,15 @@ namespace TBF.BenchControl.Sequences
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(realTest ? outPath.Balance.ReadMassOp(ref mass) : null)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(realTest ? outPath.Balance.ReadMassOp(ref Mass) : null)
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity)
|
||||
: null)
|
||||
//.AddOperation(realTest ? (ticTac ? queryEnd1 : queryEnd2) : null)
|
||||
.AddOperation(realTest ? queryEnd1 : null)
|
||||
@ -769,33 +755,33 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
data.TestResult = tstRslt;
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
data.FlowMtrFreq = refFreq;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
data.FlowMtrFreq = RefFreq;
|
||||
|
||||
data.Flow = refFlow;
|
||||
data.Flow = RefFlow;
|
||||
data.Time = time;
|
||||
data.StartMass = startMass;
|
||||
data.Mass = mass;
|
||||
data.Mass = Mass;
|
||||
|
||||
data.Progress = progress;
|
||||
float estCurrentTime = TimeEstimateBeginRpts + ((float)(tstRslt.RepetitionNr - 1) + progress) * TimeEstimateOneTest;
|
||||
data.OveralProgress = estCurrentTime / TimeEstimateTotal;
|
||||
|
||||
data.Tin = tempIn;
|
||||
data.Tout = tempOut;
|
||||
data.Tdiv = tempDiv;
|
||||
data.Pin = pressIn;
|
||||
data.Pout = pressOut;
|
||||
data.Tin = TempIn;
|
||||
data.Tout = TempOut;
|
||||
data.Tdiv = TempDiv;
|
||||
data.Pin = PressureUp;
|
||||
data.Pout = PressureDown;
|
||||
|
||||
data.AmbientTemp = airTemperature;
|
||||
data.AmbientPressure = airPressure;
|
||||
data.AmbientHumidity = airHumidity;
|
||||
data.AmbientTemp = AmbientTemp;
|
||||
data.AmbientPressure = AmbientPressure;
|
||||
data.AmbientHumidity = AmbientHumidity;
|
||||
|
||||
if (testRunning)
|
||||
{
|
||||
/// Only when test is running
|
||||
data.RefPulses = cBrd.EtPulses(0);
|
||||
float refPulsesPerLtr = 1.0f / outPath.FlowMeter.LtrPerPulseCorrected(refFlow.Val); /// [pulse/ltr]
|
||||
float refPulsesPerLtr = 1.0f / outPath.FlowMeter.LtrPerPulseCorrected(RefFlow.Val); /// [pulse/ltr]
|
||||
data.Volume = new FloatBox() { Name = "Volume", Format = "F1", Val = Formulas.VolumeFromPulses(data.RefPulses, refPulsesPerLtr) };
|
||||
|
||||
int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
||||
|
||||
@ -132,7 +132,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
//--------------------------------
|
||||
State.Create("Adjustment : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -160,7 +160,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
|
||||
loop:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
@ -234,27 +234,27 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
|
||||
@ -62,7 +62,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
//--------------------------------
|
||||
State.Create("RoiDetection : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -82,7 +82,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.ROI_Detection_in_Progress);
|
||||
|
||||
@ -113,7 +113,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
///
|
||||
State.Create("CombinedMeters : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -123,7 +123,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -146,7 +146,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
//------------------------------------------------
|
||||
State.Create("CombinedMeters : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -170,7 +170,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
@ -182,14 +182,14 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
|
||||
State.Create("CombinedMeters : Waiting before 1st mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeFlow2Mass))
|
||||
@ -223,7 +223,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -275,27 +275,27 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -324,15 +324,15 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
test_completed:
|
||||
State.Create("CombinedMeters : Waiting before mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
|
||||
@ -86,7 +86,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//--------------------------------
|
||||
State.Create("CombinedWithDetection : Get the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -96,7 +96,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto switching_flow_detection; /// Enough room in the tank -> skip emptying
|
||||
@ -148,7 +148,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Set the initial flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600, (float)test.TolerRed)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600, (float)test.TolerRed)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -183,7 +183,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
float[] pulseFreqsForDetection = new float[DetectionBufferSize];
|
||||
|
||||
/// Current values
|
||||
flowsForDetection[0] = refFlow.Val;
|
||||
flowsForDetection[0] = RefFlow.Val;
|
||||
pulseFreqsForDetection[0] = 0.0f;
|
||||
int startTime = StateMachine.Time;
|
||||
int lastTime = StateMachine.Time;
|
||||
@ -339,7 +339,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Switching flow detected, going back")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -364,7 +364,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//State.Create("set_RV_position",
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, outPath.PidCoef, refFlow, 600)) /// timeout = 10 sec.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 sec.
|
||||
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
|
||||
.EnterState();
|
||||
do
|
||||
@ -401,7 +401,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -454,19 +454,19 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
///
|
||||
State.Create("FixedStartAdvanced : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -165,7 +165,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
//--------------------------------
|
||||
State.Create("FixedStartAdvanced : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -206,7 +206,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
|
||||
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
@ -255,13 +255,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
@ -277,7 +277,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -343,27 +343,27 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -397,14 +397,14 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
|
||||
State.Create("FixedStartAdvanced : Waiting before 2nd mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@ -423,13 +423,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartAdvanced : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
|
||||
@ -114,7 +114,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
///
|
||||
State.Create("FixedStartCombinedMeters : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -165,7 +165,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
//--------------------------------
|
||||
State.Create("FixedStartCombinedMeters : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -206,7 +206,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
|
||||
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
@ -255,13 +255,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartCombinedMeters : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
@ -277,7 +277,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -343,27 +343,27 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -408,14 +408,14 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
|
||||
State.Create("FixedStartCombinedMeters : Waiting before 2nd mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@ -434,13 +434,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartCombinedMeters : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
|
||||
@ -114,7 +114,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
///
|
||||
State.Create("FixedStartMassCollection : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -165,7 +165,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//--------------------------------
|
||||
State.Create("FixedStartMassCollection : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -206,7 +206,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
@ -255,13 +255,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartMassCollection : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
@ -277,7 +277,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -343,27 +343,27 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -397,14 +397,14 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
|
||||
State.Create("FixedStartMassCollection : Waiting before 2nd mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@ -423,13 +423,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//------------------------------------------------
|
||||
State.Create("FixedStartMassCollection : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
|
||||
@ -87,7 +87,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
//--------------------------------
|
||||
State.Create("FlyingStart : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -111,7 +111,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
@ -180,27 +180,27 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
|
||||
@ -113,7 +113,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
///
|
||||
State.Create("FlyingStartCollectionMethod : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -123,7 +123,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -146,7 +146,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -170,7 +170,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
@ -182,14 +182,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
|
||||
State.Create("FlyingStartCollectionMethod : Waiting before 1st mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeFlow2Mass))
|
||||
@ -210,13 +210,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
@ -235,20 +235,20 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
log.WarnFormat("Start mass = {0}kg", startMass);
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
@ -283,15 +283,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity)
|
||||
: null)
|
||||
.AddOperation(queryEnd1)
|
||||
.AddOperation(processDataLoggingOp)
|
||||
@ -318,27 +318,27 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -358,15 +358,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
test_completed:
|
||||
State.Create("FlyingStartCollectionMethod : Waiting before 2nd mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@ -386,14 +386,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
|
||||
@ -57,10 +57,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
State.Create("LeakTest : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -82,10 +82,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
|
||||
State.Create("LeakTest : Setting the water pressure")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(new Operations.TimerOp(5))
|
||||
.EnterState();
|
||||
do
|
||||
@ -100,17 +100,17 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}kPa, pressure_down = {3}kPa\r\n",
|
||||
StateMachine.Time - startTime,
|
||||
pumpPower.ToString("F0"),
|
||||
pressIn.Val.ToString("F1"),
|
||||
pressIn.Val.ToString("F1")));
|
||||
PressureUp.Val.ToString("F1"),
|
||||
PressureUp.Val.ToString("F1")));
|
||||
|
||||
float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f));
|
||||
|
||||
if (pressOut.Val < testParams.PressureLo)
|
||||
if (PressureDown.Val < testParams.PressureLo)
|
||||
{
|
||||
if (pumpPower == 100.0f) break; /// Already at max. pump power -> Quit loop
|
||||
pumpPower = Math.Min(pumpPower + step, 100.0f); /// Limit max. power to 100%
|
||||
}
|
||||
else if (pressOut.Val > testParams.PressureHi)
|
||||
else if (PressureDown.Val > testParams.PressureHi)
|
||||
{
|
||||
if (pumpPower == 0) break; /// Already at min. pump power -> Quit loop
|
||||
pumpPower = Math.Max(pumpPower - step, 0); /// Limit min. power to 0%
|
||||
@ -131,20 +131,20 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
//------------------------------------------------
|
||||
State.Create("LeakTest : Maximum water pressure set")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(new Operations.TimerOp(testParams.DurationPMax))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -169,19 +169,19 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
State.Create("LeakTest : Closing the valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(null, outPath.StartValve))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -195,19 +195,19 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
State.Create("LeakTest : Closing the valve")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
@ -227,10 +227,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
//------------------------------------------------
|
||||
State.Create("LeakTest : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(new Operations.TimerOp(testParams.DurationLeak))
|
||||
.EnterState();
|
||||
do
|
||||
@ -249,11 +249,11 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
}
|
||||
|
||||
@ -57,10 +57,10 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
State.Create("PMaxTest : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -82,10 +82,10 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
|
||||
State.Create("PMaxTest : Setting the water pressure")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(new Operations.TimerOp(5))
|
||||
.EnterState();
|
||||
do
|
||||
@ -100,22 +100,22 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}kPa, pressure_down = {3}kPa\r\n",
|
||||
StateMachine.Time - startTime,
|
||||
pumpPower.ToString("F0"),
|
||||
pressIn.Val.ToString("F1"),
|
||||
pressIn.Val.ToString("F1")));
|
||||
PressureUp.Val.ToString("F1"),
|
||||
PressureUp.Val.ToString("F1")));
|
||||
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
|
||||
float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f));
|
||||
|
||||
if (pressOut.Val < testParams.PressureLo)
|
||||
if (PressureDown.Val < testParams.PressureLo)
|
||||
{
|
||||
if (pumpPower == 100.0f) break; /// Already at max. pump power -> Quit loop
|
||||
pumpPower = Math.Min(pumpPower + step, 100.0f); /// Limit max. power to 100%
|
||||
}
|
||||
else if (pressOut.Val > testParams.PressureHi)
|
||||
else if (PressureDown.Val > testParams.PressureHi)
|
||||
{
|
||||
if (pumpPower == 0) break; /// Already at min. pump power -> Quit loop
|
||||
pumpPower = Math.Max(pumpPower - step, 0); /// Limit min. power to 0%
|
||||
@ -138,21 +138,21 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
||||
//------------------------------------------------
|
||||
State.Create("PMaxTest : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(new Operations.TimerOp(testParams.DurationPMax))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
///
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -121,7 +121,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
}
|
||||
while (!e.Contains(Event.BalanceDone));
|
||||
|
||||
float estimatedEndMass = mass.Val + test.Volume;
|
||||
float estimatedEndMass = Mass.Val + test.Volume;
|
||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||
@ -142,7 +142,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//--------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -166,20 +166,20 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
|
||||
flow_set:
|
||||
int time = StateMachine.Time;
|
||||
float currentFlow = refFlow.Val;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
@ -194,7 +194,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.MassStartRaw = startMass.Val;
|
||||
mass.Val = startMass.Val;
|
||||
Mass.Val = startMass.Val;
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||
@ -234,27 +234,27 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
if (firstTime)
|
||||
{
|
||||
firstTime = false; /// Do the following only once
|
||||
tstRslt.TempInStart = tempIn.Val;
|
||||
tstRslt.TempOutStart = tempOut.Val;
|
||||
tstRslt.TempDivStart = tempDiv.Val;
|
||||
tstRslt.PressInStart = pressIn.Val;
|
||||
tstRslt.PressOutStart = pressOut.Val;
|
||||
tstRslt.TempInStart = TempIn.Val;
|
||||
tstRslt.TempOutStart = TempOut.Val;
|
||||
tstRslt.TempDivStart = TempDiv.Val;
|
||||
tstRslt.PressInStart = PressureUp.Val;
|
||||
tstRslt.PressOutStart = PressureDown.Val;
|
||||
}
|
||||
|
||||
tstRslt.TempInEnd = tempIn.Val;
|
||||
tstRslt.TempOutEnd = tempOut.Val;
|
||||
tstRslt.TempDivEnd = tempDiv.Val;
|
||||
tstRslt.PressInEnd = pressIn.Val;
|
||||
tstRslt.PressOutEnd = pressOut.Val;
|
||||
tstRslt.MassEndRaw = mass.Val;
|
||||
tstRslt.TempInEnd = TempIn.Val;
|
||||
tstRslt.TempOutEnd = TempOut.Val;
|
||||
tstRslt.TempDivEnd = TempDiv.Val;
|
||||
tstRslt.PressInEnd = PressureUp.Val;
|
||||
tstRslt.PressOutEnd = PressureDown.Val;
|
||||
tstRslt.MassEndRaw = Mass.Val;
|
||||
|
||||
AccumulateAveragedData();
|
||||
|
||||
refFreq.Val = cBrd.ReferenceFreq;
|
||||
refFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = airTemperature.Val;
|
||||
tstRslt.AmbientPressAve = airPressure.Val;
|
||||
tstRslt.AmbientHumiAve = airHumidity.Val;
|
||||
RefFreq.Val = cBrd.ReferenceFreq;
|
||||
RefFlow.Val = cBrd.ReferenceFlow;
|
||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
||||
|
||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||
@ -273,15 +273,15 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
test_completed:
|
||||
State.Create("FlyingStartCollectionMethod : Waiting before mass measurement")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation(readRegistersOp)
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||
@ -299,13 +299,13 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Measuring the end mass")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
|
||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||
.AddOperation((StateMachine.Ambient != null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
|
||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.AddOperation(processDataLoggingOp)
|
||||
|
||||
@ -411,6 +411,7 @@
|
||||
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\ResultsPrinters\Zapiska\PrinterFactory.cs" />
|
||||
<Compile Include="BenchControl\Sequences\ProcessData.cs" />
|
||||
<Compile Include="BenchControl\TestMethods\Adjustment\WMErrorsForm12.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user