EnduranceDataLogging - initial version, ver. 2.12.416
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2016 Sensus Metering Systems
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using TBF.BenchControl.Sequences;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.Operations
|
||||||
|
{
|
||||||
|
public class EnduranceDataLoggingOp : IOperation
|
||||||
|
{
|
||||||
|
StreamWriter writer;
|
||||||
|
SequenceBase sequenceBase;
|
||||||
|
bool heatMeters;
|
||||||
|
|
||||||
|
public EnduranceDataLoggingOp(StreamWriter writer, SequenceBase sequenceBase)
|
||||||
|
{
|
||||||
|
this.writer = writer;
|
||||||
|
this.sequenceBase = sequenceBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
sequenceBase.LogEnduranceData(writer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Event Run()
|
||||||
|
{
|
||||||
|
sequenceBase.LogEnduranceData(writer);
|
||||||
|
return Event.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
writer.Flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,6 +67,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
protected IOperation checkUiOp;
|
protected IOperation checkUiOp;
|
||||||
|
|
||||||
protected IOperation processDataLoggingOp;
|
protected IOperation processDataLoggingOp;
|
||||||
|
protected IOperation enduranceDataLoggingOp;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -141,6 +142,34 @@ namespace TBF.BenchControl.Sequences
|
|||||||
TempRefLo2);
|
TempRefLo2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Endurance data logging
|
||||||
|
///
|
||||||
|
public void LogEnduranceHeader(System.IO.StreamWriter writer)
|
||||||
|
{
|
||||||
|
LogEnduranceHeader(writer, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogEnduranceHeader(System.IO.StreamWriter writer, string sectionName)
|
||||||
|
{
|
||||||
|
writer.WriteLine();
|
||||||
|
if (sectionName != null)
|
||||||
|
writer.Write(sectionName);
|
||||||
|
writer.WriteLine("Time T_up T_dn Pr_up Pr_dn Flow");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogEnduranceData(System.IO.StreamWriter writer)
|
||||||
|
{
|
||||||
|
|
||||||
|
writer.WriteLine(string.Format("{0:dd.MM.yyyy HH:mm.ss} {1} {2} {3} {4} {5}",
|
||||||
|
DateTime.Now,
|
||||||
|
TempUp,
|
||||||
|
TempDown,
|
||||||
|
PressUp,
|
||||||
|
PressDown,
|
||||||
|
RefFlow));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected Event EmptyTheTank(IValve emptyTankValve, IBalance balance)
|
protected Event EmptyTheTank(IValve emptyTankValve, IBalance balance)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,24 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||||
|
|
||||||
|
|
||||||
|
string enduranceLogDir = string.Format("C:\\TBF\\Results\\{0:yyyy}\\{0:MM}\\{0:dd}\\", BatchRslts.Batch.StartTime);
|
||||||
|
string enduranceLogName = string.Format("{0}{1:HHmm}.txt", enduranceLogDir, BatchRslts.Batch.StartTime);
|
||||||
|
System.IO.Directory.CreateDirectory(enduranceLogDir);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool writeHeader = !System.IO.File.Exists(enduranceLogName);
|
||||||
|
System.IO.StreamWriter writer = new System.IO.StreamWriter(enduranceLogName, true);
|
||||||
|
enduranceDataLoggingOp = new TBF.BenchControl.Operations.EnduranceDataLoggingOp(writer, this);
|
||||||
|
if (writeHeader)
|
||||||
|
LogEnduranceHeader(writer);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
enduranceDataLoggingOp = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||||
|
|
||||||
/// Notes:
|
/// Notes:
|
||||||
@@ -158,7 +176,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||||
.AddOperations(measureOperations)
|
.AddOperations(measureOperations)
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro,
|
.AddOperation(enduranceDataLoggingOp)
|
||||||
|
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro,
|
||||||
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
|
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@@ -203,7 +222,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
: null)
|
: null)
|
||||||
.AddOperation(queryEnd1)
|
.AddOperation(queryEnd1)
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
.EnterState();
|
.AddOperation(enduranceDataLoggingOp)
|
||||||
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
@@ -442,6 +462,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||||
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
|
.AddOperation(enduranceDataLoggingOp)
|
||||||
.AddOperation(cBrd.ExecuteCommandOp(Elde.Command.EnduranceCycleParamsUpload, Elde.Command.None, 0))
|
.AddOperation(cBrd.ExecuteCommandOp(Elde.Command.EnduranceCycleParamsUpload, Elde.Command.None, 0))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@@ -471,6 +492,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||||
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
|
.AddOperation(enduranceDataLoggingOp)
|
||||||
.AddOperation(cBrd.ExecuteCommandOp(Elde.Command.EnduranceCycleStart, Elde.Command.EnduranceCycleStop, 0))
|
.AddOperation(cBrd.ExecuteCommandOp(Elde.Command.EnduranceCycleStart, Elde.Command.EnduranceCycleStop, 0))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@@ -520,7 +542,8 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
|||||||
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
|
||||||
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
.AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
.EnterState();
|
.AddOperation(enduranceDataLoggingOp)
|
||||||
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.12.415.1")]
|
[assembly: AssemblyVersion("2.12.416.1")]
|
||||||
[assembly: AssemblyFileVersion("2.12.415.1")]
|
[assembly: AssemblyFileVersion("2.12.416.1")]
|
||||||
|
|||||||
@@ -491,6 +491,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\Modbus\QuidoRS\Factory.cs" />
|
<Compile Include="BenchControl\Modbus\QuidoRS\Factory.cs" />
|
||||||
<Compile Include="BenchControl\Modbus\QuidoRS\SetOutputsOp.cs" />
|
<Compile Include="BenchControl\Modbus\QuidoRS\SetOutputsOp.cs" />
|
||||||
|
<Compile Include="BenchControl\Operations\EnduranceDataLoggingOp.cs" />
|
||||||
<Compile Include="BenchControl\Operations\EnthalpyCalculationOp.cs" />
|
<Compile Include="BenchControl\Operations\EnthalpyCalculationOp.cs" />
|
||||||
<Compile Include="BenchControl\Output\FileWriters\Basic\FactoryCompound.cs" />
|
<Compile Include="BenchControl\Output\FileWriters\Basic\FactoryCompound.cs" />
|
||||||
<Compile Include="BenchControl\Output\FileWriters\Basic\FactoryHeatMeters.cs" />
|
<Compile Include="BenchControl\Output\FileWriters\Basic\FactoryHeatMeters.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user