SequenceBase.LogProcessDataHeader() added.

This commit is contained in:
Milan Hanajik
2017-05-10 13:54:38 +02:00
parent 847a4d74d6
commit 6cace280c9
8 changed files with 78 additions and 23 deletions
+3
View File
@@ -201,4 +201,7 @@
<data name="Water_Meter" xml:space="preserve"> <data name="Water_Meter" xml:space="preserve">
<value>Vodoměr</value> <value>Vodoměr</value>
</data> </data>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
</root> </root>
@@ -73,12 +73,22 @@ namespace TBF.BenchControl.Sequences
/// ///
/// Process data logging /// Process data logging
/// ///
public void LogProcessHeader(ILog logger) public void LogProcessDataTestInfo(ILog logger, string procedureName, string testName)
{ {
LogProcessHeader(logger, null); logger.Info(Environment.NewLine);
logger.InfoFormat("{0}={1:dd.MM.yyyy HH:mm:ss} {2}={3} {4}={5} {6}={7}",
Strings.Date_and_time, TestStartTime,
Strings.Batch_nr, BatchRslts.Batch.BatchNr,
Strings.Procedure, procedureName,
Strings.Test, testName);
} }
public void LogProcessHeader(ILog logger, string sectionName) public void LogProcessDataHeader(ILog logger)
{
LogProcessDataHeader(logger, null);
}
public void LogProcessDataHeader(ILog logger, string sectionName)
{ {
logger.Info(Environment.NewLine); logger.Info(Environment.NewLine);
if (sectionName != null) logger.Info(sectionName); if (sectionName != null) logger.Info(sectionName);
@@ -108,7 +118,7 @@ namespace TBF.BenchControl.Sequences
outPath.RegulValve.Position.ToString("F1")); outPath.RegulValve.Position.ToString("F1"));
} }
public void LogProcessHeaderHeatMeters(ILog logger, string sectionName) public void LogProcessDataHeaderHeatMeters(ILog logger, string sectionName)
{ {
logger.Info(Environment.NewLine); logger.Info(Environment.NewLine);
if (sectionName != null) logger.Info(sectionName); if (sectionName != null) logger.Info(sectionName);
@@ -72,7 +72,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
/// Start the test, initialize test results /// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr); string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
TestStartTime = DateTime.Now;
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, 0, 0 }); TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
@@ -401,6 +400,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
//------------------------------------------------ //------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight); Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------ //------------------------------------------------
TestStartTime = DateTime.Now;
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name)) State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name))
.AddOperation(checkUiOp) .AddOperation(checkUiOp)
.AddOperations(measureOperations) .AddOperations(measureOperations)
@@ -430,6 +436,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
Mass.Val = StartMass.Val; Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------ //------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress); Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------ //------------------------------------------------
@@ -615,6 +625,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
while (!e.Contains(Event.TimerExpired)); while (!e.Contains(Event.TimerExpired));
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
//------------------------------------------------ //------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight); Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------ //------------------------------------------------
@@ -743,17 +756,18 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.StartTime = TestStartTime; tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime; tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime; tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time <--------------------------------------------------------------
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total) 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.MassStart = massStart;
tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd; tstRslt.MassEnd = massEnd;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h] 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.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter 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.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); tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min); tstRslt.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);
@@ -458,10 +458,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
Bridge.OnActivity(this, Strings.Measuring_the_weight); Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------ //------------------------------------------------
if (heatMetersPath == null) LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
LogProcessHeader(processDataLogger, "Start mass");
else if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
LogProcessHeaderHeatMeters(processDataLogger, "Start mass"); else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name)) State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name))
.AddOperation(checkUiOp) .AddOperation(checkUiOp)
@@ -490,14 +490,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
} }
while (!e.Contains(Event.BalanceDone)); while (!e.Contains(Event.BalanceDone));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "Measurement");
else
LogProcessHeaderHeatMeters(processDataLogger, "Measurement");
log.WarnFormat("Start mass = {0}kg", StartMass); log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val; Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------ //------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress); Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------ //------------------------------------------------
@@ -661,10 +660,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
} }
while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone)); while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "End mass"); if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
LogProcessHeaderHeatMeters(processDataLogger, "End mass");
State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name)) State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name))
.AddOperation(checkUiOp) .AddOperation(checkUiOp)
+18
View File
@@ -420,6 +420,24 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Batch.
/// </summary>
internal static string Batch {
get {
return ResourceManager.GetString("Batch", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Batch nr..
/// </summary>
internal static string Batch_nr {
get {
return ResourceManager.GetString("Batch_nr", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Bench. /// Looks up a localized string similar to Bench.
/// </summary> /// </summary>
+4 -1
View File
@@ -1281,4 +1281,7 @@
<data name="Show" xml:space="preserve"> <data name="Show" xml:space="preserve">
<value>Zobrazit</value> <value>Zobrazit</value>
</data> </data>
</root> <data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
</root>
@@ -1422,4 +1422,7 @@
<data name="Temperature" xml:space="preserve"> <data name="Temperature" xml:space="preserve">
<value>Temperatur</value> <value>Temperatur</value>
</data> </data>
<data name="Batch_nr" xml:space="preserve">
<value>Stapel Nr.</value>
</data>
</root> </root>
@@ -1759,4 +1759,10 @@
<data name="Manual_control_disabled" xml:space="preserve"> <data name="Manual_control_disabled" xml:space="preserve">
<value>Manual control disabled</value> <value>Manual control disabled</value>
</data> </data>
<data name="Batch" xml:space="preserve">
<value>Batch</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Batch nr.</value>
</data>
</root> </root>