diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index cae9f52cc..8bc97593a 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -17,6 +17,7 @@ namespace TBF.BenchControl.Sequences public class SequenceBase { private static readonly ILog log = LogManager.GetLogger(typeof(SequenceBase)); + protected static readonly ILog processDataLogger = LogManager.GetLogger("ProcessData"); ///------------------------------------------------------------ /// Global static variables set only once. @@ -193,6 +194,7 @@ namespace TBF.BenchControl.Sequences #endregion + protected float ltrPerRefPulse; protected IOperation readRegisters1; protected IOperation readRegisters2; @@ -200,6 +202,7 @@ namespace TBF.BenchControl.Sequences protected IOperation queryEnd2; protected IOperation checkUiOp; + protected IOperation processDataLoggingOp; protected bool ticTac = false; protected int[] WMPulses = new int[Program.WMsCount]; @@ -239,6 +242,43 @@ namespace TBF.BenchControl.Sequences endMass.Clear(); } + + /// + /// Process data logging + /// + public void LogProcessHeader(ILog logger) + { + LogProcessHeader(logger, null); + } + + public void LogProcessHeader(ILog logger, string sectionName) + { + logger.Info(Environment.NewLine); + if (sectionName != null) logger.Info(sectionName); + logger.Info("Time Flow Test time Et.vol T.in Tou Tdi Pin Pou Mass VolMM Tam Ham. Pam Rv"); + logger.Info(Environment.NewLine); + } + + public void LogProcessData(ILog logger) + { + logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}", + DateTime.Now.ToShortTimeString(), + refFlow, + "Test time", + Formulas.VolumeFromPulses(refCount.Val, 1.0f / ltrPerRefPulse), + tempIn, + tempOut, + pressIn, + pressOut, + mass, + "VolMM", + airTemperature, + airHumidity, + airPressure, + "Rv"); + } + + /// /// Empties the tank: opens the emptying valve and measures the weight. /// @@ -522,6 +562,7 @@ namespace TBF.BenchControl.Sequences ticTac = !ticTac; State.Create("Read water meters") .AddOperation(checkUiOp) + .AddOperation(realTest ? processDataLoggingOp : null) .AddOperations(measureOperations) .AddOperation(ticTac ? readRegisters1 : readRegisters2) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn, Event.TempInDone)) diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs index fd6f49c6b..f94fe7565 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs @@ -14,6 +14,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters private static readonly ILog log = LogManager.GetLogger(typeof(CombinedMetersSeq)); private static readonly ILog allResults = LogManager.GetLogger("AllResults"); private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + private static readonly ILog processDataLog = LogManager.GetLogger("ProcessData"); /// /// Flying start mass collection method sequence for combined meter @@ -41,9 +42,11 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] /// - int repetitionNr = 1; /// First test: repetitionNr=1 + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + int repetitionNr = 1; /// First test: repetitionNr=1 //==================================== // Transition or SetRoute - Start diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 87109ae1b..a9bb6f1bd 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -13,6 +13,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection private static readonly ILog log = LogManager.GetLogger(typeof(CombinedWithDetectionSeq)); private static readonly ILog allResults = LogManager.GetLogger("AllResults"); private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + private static readonly ILog processDataLog = LogManager.GetLogger("ProcessData"); const int DetectionBufferSize = 9; const int DetectionKernelSize = 5; @@ -45,9 +46,11 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection /// uint refPulses = (uint)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] /// - /// Meters path is required for the following: + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + /// Meters path is required for the following: readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index b38d41149..11e7391ff 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -14,6 +14,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection private static readonly ILog log = LogManager.GetLogger(typeof(FixedStartMassCollectionSeq)); private static readonly ILog allResults = LogManager.GetLogger("AllResults"); private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + private static readonly ILog processDataLog = LogManager.GetLogger("ProcessData"); /// /// Flying start mass collection method sequence @@ -41,9 +42,11 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] - int repetitionNr = 1; /// First test: repetitionNr=1 + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + int repetitionNr = 1; /// First test: repetitionNr=1 //==================================== // Transition or SetRoute - Start diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 2e4f96622..0e83f9ed5 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -14,6 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartSeq)); private static readonly ILog allResults = LogManager.GetLogger("AllResults"); private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + private static readonly ILog processDataLog = LogManager.GetLogger("ProcessData"); /// /// Flying start mass collection method sequence @@ -41,9 +42,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStart /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] - int repetitionNr = 1; /// First test: repetitionNr=1 + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + int repetitionNr = 1; /// First test: repetitionNr=1 //==================================== // Transition or SetRoute - Start diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index 24af0bb8d..59d716b19 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -41,7 +41,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + /// + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); int repetitionNr = 1; /// First test: repetitionNr=1 @@ -151,11 +153,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp()); } + LogProcessHeader(processDataLogger, "Start mass"); + //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the start mass") .AddOperation(checkUiOp) + .AddOperation(processDataLoggingOp) .AddOperations(measureOperations) .AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5)) .EnterState(); @@ -167,6 +172,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod } while (!e.Contains(Event.BalanceDone)); + LogProcessHeader(processDataLogger, "Measurement"); + tstRslt.TimeStart = DateTime.Now; tstRslt.MassStartRaw = startMass.Val; mass.Val = startMass.Val; @@ -248,11 +255,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod test_completed: + LogProcessHeader(processDataLogger, "End mass"); + //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the end mass") .AddOperation(checkUiOp) + .AddOperation(processDataLoggingOp) .AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5)) .AddOperation(cBrd.UpdateTankWeightOp()) .EnterState(); diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index e794fcc07..14d7fd626 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -14,6 +14,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration private static readonly ILog log = LogManager.GetLogger(typeof(ReferenceFlowmeterCalibrationSeq)); private static readonly ILog allResults = LogManager.GetLogger("AllResults"); private static readonly ILog summaryResults = LogManager.GetLogger("SummaryResults"); + private static readonly ILog processDataLog = LogManager.GetLogger("ProcessData"); /// /// Flying start mass collection method sequence @@ -41,9 +42,11 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] - float ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] + ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] - int repetitionNr = 1; /// First test: repetitionNr=1 + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + int repetitionNr = 1; /// First test: repetitionNr=1 //==================================== // Transition or SetRoute - Start diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 9e0ef21fa..7cb7b91b7 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -328,6 +328,7 @@ MessageBoxForm.cs + diff --git a/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll b/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll index 073a497e9..674ac1743 100644 Binary files a/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll and b/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll differ