Process data display : many changes, TODO: Meter data and the end of test.

This commit is contained in:
Milan Hanajik
2016-02-10 19:24:10 +01:00
parent 3775913a33
commit 2c1e4e7d26
18 changed files with 254 additions and 223 deletions
@@ -63,13 +63,13 @@ namespace TBF.BenchControl.TestMethods.Adjustment
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -106,6 +106,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -120,6 +121,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -134,6 +136,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -221,7 +224,6 @@ namespace TBF.BenchControl.TestMethods.Adjustment
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
@@ -233,6 +235,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
@@ -297,8 +300,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume); /// Calculate master flowmeter coefficient
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
@@ -34,15 +34,15 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse]
LtrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse]
///
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -82,6 +82,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
}
@@ -95,6 +96,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -114,6 +116,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -149,6 +152,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -206,7 +210,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
State.Create("CombinedMeters : Measuring the start mass")
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.EnterState();
do
{
@@ -216,8 +220,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
}
while (!e.Contains(Event.BalanceDone));
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -266,7 +269,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
@@ -289,6 +291,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
// }
//}
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
@@ -322,7 +325,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
//------------------------------------------------
State.Create("CombinedMeters : Measuring the end mass")
.AddOperation(checkUiOp)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.EnterState();
do
@@ -333,7 +336,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
//------------------------------------------------
@@ -389,15 +391,15 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1001.03f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -50,13 +50,13 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
while (!e.Contains(Event.PreviousStopped));
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -327,6 +327,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
bool goBackToInitFlow = ((rvPulse > 0) && (relativeQave < 0)) ||
((rvPulse < 0) && (relativeQave > 0));
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
int flowSetTime0 = StateMachine.Time;
@@ -341,6 +342,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) goto stopTest;
@@ -364,6 +366,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) goto stopTest;
@@ -381,7 +384,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
State.Create(Strings.Measure_the_mass)
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.EnterState();
do
{
@@ -391,8 +394,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
while (!e.Contains(Event.BalanceDone));
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -442,7 +444,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
@@ -464,6 +465,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
// }
//}
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
@@ -476,7 +478,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
//------------------------------------------------
State.Create(Strings.Measure_the_mass)
.AddOperation(checkUiOp)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.EnterState();
do
{
@@ -486,7 +488,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
//------------------------------------------------
@@ -567,15 +568,15 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -83,6 +83,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -97,6 +98,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -116,6 +118,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -152,6 +155,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -166,6 +170,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -254,7 +259,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -267,8 +272,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
while (!e.Contains(Event.BalanceDone));
TestStartTime = DateTime.Now;
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -331,8 +335,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
@@ -343,6 +346,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (cBrd.EtPulses(0) < totalPulses);
@@ -398,7 +402,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -410,7 +414,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
@@ -426,8 +429,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
while (!e.Contains(Event.PreviousStopped));
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Balance.Corrections);
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average);
double volumeCTV = 1.00103f * 1000.0f * (massEnd - massStart) / densityOut;
@@ -513,15 +516,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -83,6 +83,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -97,6 +98,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -116,6 +118,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -152,6 +155,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -166,6 +170,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -254,7 +259,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -266,8 +271,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
}
while (!e.Contains(Event.BalanceDone));
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -330,7 +334,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
@@ -353,6 +356,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
// }
//}
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (cBrd.EtPulses(0) < totalPulses);
@@ -408,7 +412,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -420,7 +424,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
@@ -436,8 +439,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
while (!e.Contains(Event.PreviousStopped));
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Balance.Corrections);
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average); /// [kg/m3]
double volumeCTV = 1.00103f * 1000.0f * (massEnd - massStart) / densityOut;
@@ -523,15 +526,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -83,6 +83,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -97,6 +98,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -116,6 +118,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -152,6 +155,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -166,6 +170,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -254,7 +259,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -266,8 +271,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -330,8 +334,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
@@ -342,6 +345,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (cBrd.EtPulses(0) < totalPulses);
@@ -397,7 +401,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -409,7 +413,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
@@ -425,8 +428,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
while (!e.Contains(Event.PreviousStopped));
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
double massStart = Formulas.CorrectedValue(StartMass.Val, outPath.Balance.Corrections);
double massEnd = Formulas.CorrectedValue(EndMass.Val, outPath.Balance.Corrections);
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average); /// [kg/m3]
double volumeCTV = 1001.03 * (massEnd - massStart) / densityOut;
@@ -512,15 +515,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -79,6 +79,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -93,6 +94,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -173,8 +175,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
@@ -185,6 +186,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
@@ -251,8 +253,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume); /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -80,6 +80,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -94,6 +95,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -113,6 +115,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -148,6 +151,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -212,7 +216,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperations(measureOperations)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -226,9 +230,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
LogProcessHeader(processDataLogger, "Measurement");
StartMassRaw = startMass.Val;
log.WarnFormat("Start mass = {0}kg", startMass);
Mass.Val = startMass.Val;
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -308,8 +311,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
//------------------------------------------------
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
@@ -320,6 +322,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (true);
@@ -364,7 +367,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
.AddOperation(readRegistersOp)
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -376,9 +379,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", endMass);
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
log.WarnFormat("End mass = {0}kg", EndMass);
TestEndTime = DateTime.Now;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
@@ -433,15 +435,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
@@ -145,8 +145,6 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
{
e = StateMachine.WaitRunDevsRunOps();
CurrentMassRaw = Mass.Val;
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -34,13 +34,13 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
@@ -80,6 +80,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -94,6 +95,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
@@ -113,6 +115,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
@@ -146,6 +149,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
do
{
e = StateMachine.WaitRunDevsRunOps();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
@@ -177,7 +181,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -189,8 +193,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
}
while (!e.Contains(Event.BalanceDone));
StartMassRaw = startMass.Val;
Mass.Val = startMass.Val;
Mass.Val = StartMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -227,7 +230,6 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
}
UpdateAllStatistics();
CurrentMassRaw = Mass.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
@@ -239,6 +241,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
}
log.Debug(logstr);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
/// Measurement loop - end
@@ -279,7 +282,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -291,7 +294,6 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
}
while (!e.Contains(Event.BalanceDone));
///
EndMassRaw = endMass.Val;
TestEndTime = DateTime.Now;
//------------------------------------------------
@@ -347,21 +349,21 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = startMass.Val;
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEndRaw = endMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
/// Update flowmeter constant with the measured one
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
{
LtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = Convert.ToSingle(tstRslt.ConstMaster);
CalibratedLtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = Convert.ToSingle(tstRslt.ConstMaster);
log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Idx1 - 1, tstRslt.ConstMaster);
}