SequenceBase.LogProcessDataHeader() added.

This commit is contained in:
Milan Hanajik 2017-05-10 13:32:49 +02:00
parent 847a4d74d6
commit 6cace280c9
8 changed files with 78 additions and 23 deletions

View File

@ -201,4 +201,7 @@
<data name="Water_Meter" xml:space="preserve">
<value>Vodoměr</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
</root>

View File

@ -73,12 +73,22 @@ namespace TBF.BenchControl.Sequences
///
/// 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);
if (sectionName != null) logger.Info(sectionName);
@ -108,7 +118,7 @@ namespace TBF.BenchControl.Sequences
outPath.RegulValve.Position.ToString("F1"));
}
public void LogProcessHeaderHeatMeters(ILog logger, string sectionName)
public void LogProcessDataHeaderHeatMeters(ILog logger, string sectionName)
{
logger.Info(Environment.NewLine);
if (sectionName != null) logger.Info(sectionName);

View File

@ -72,7 +72,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
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 });
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);
//------------------------------------------------
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))
.AddOperation(checkUiOp)
.AddOperations(measureOperations)
@ -430,6 +436,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
@ -615,6 +625,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
while (!e.Contains(Event.TimerExpired));
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
@ -743,17 +756,18 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
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.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
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; /// [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.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.FlowMin = (float)((tstRslt.VolumeMaster != 0) ? (RefFlowStat.Min * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : RefFlowStat.Min);

View File

@ -458,10 +458,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "Start mass");
else
LogProcessHeaderHeatMeters(processDataLogger, "Start mass");
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))
.AddOperation(checkUiOp)
@ -490,14 +490,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "Measurement");
else
LogProcessHeaderHeatMeters(processDataLogger, "Measurement");
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement");
//------------------------------------------------
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));
if (heatMetersPath == null)
LogProcessHeader(processDataLogger, "End mass");
else
LogProcessHeaderHeatMeters(processDataLogger, "End mass");
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass");
State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name))
.AddOperation(checkUiOp)

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>
/// Looks up a localized string similar to Bench.
/// </summary>

View File

@ -1281,4 +1281,7 @@
<data name="Show" xml:space="preserve">
<value>Zobrazit</value>
</data>
</root>
<data name="Batch_nr" xml:space="preserve">
<value>Číslo dávky</value>
</data>
</root>

View File

@ -1422,4 +1422,7 @@
<data name="Temperature" xml:space="preserve">
<value>Temperatur</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Stapel Nr.</value>
</data>
</root>

View File

@ -1759,4 +1759,10 @@
<data name="Manual_control_disabled" xml:space="preserve">
<value>Manual control disabled</value>
</data>
<data name="Batch" xml:space="preserve">
<value>Batch</value>
</data>
<data name="Batch_nr" xml:space="preserve">
<value>Batch nr.</value>
</data>
</root>