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
@@ -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++)