120 lines
4.8 KiB
C#
120 lines
4.8 KiB
C#
using System;
|
|
using TBF.BenchControl.GenericDevices;
|
|
using TBF.Boxes;
|
|
|
|
namespace TBF.BenchControl.Sequences
|
|
{
|
|
public class ProcessData
|
|
{
|
|
public static IBenchInfo BenchInfo;
|
|
|
|
public static FloatBox AmbientTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
|
|
public static FloatBox AmbientPressure = new FloatBox() { Name = "Ambient Pressure", Format = "F0", Factor = 1000 }; /// [bar], printed by ToString() in [mbar]
|
|
public static FloatBox AmbientHumidity = new FloatBox() { Name = "Ambient Humidity", Format = "F1" }; /// [%]
|
|
public static FloatBox TempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; /// [°C]
|
|
public static FloatBox TempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" }; /// [°C]
|
|
public static FloatBox TempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" }; /// [°C]
|
|
public static FloatBox PressureUp = new FloatBox() { Name = "Pressure In", Format = "F2" }; /// [bar]
|
|
public static FloatBox PressureDown = new FloatBox() { Name = "Pressure Out", Format = "F2" }; /// [bar]
|
|
|
|
public static float LtrPerRefPulse; /// to calculate the ref.volume
|
|
public static int RefPulses;
|
|
public static int RefPulsesDelta;
|
|
public static FloatBox RefFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
|
public static FloatBox RefFlow = new FloatBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
|
|
|
public static DoubleBox Mass = new DoubleBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
|
public static DoubleBox StartMass = new DoubleBox() { Name = "Start Mass", Format = "F3" }; /// [kg]
|
|
public static DoubleBox EndMass = new DoubleBox() { Name = "End Mass", Format = "F3" }; /// [kg]
|
|
|
|
public static DateTime TestStartTime;
|
|
public static DateTime TestEndTime;
|
|
|
|
/// Heat meters only
|
|
public static FloatBox TempRefWarm1 = new FloatBox() { Name = "T ref warm 1", Format = "F3" }; /// [°C]
|
|
public static FloatBox TempRefWarm2 = new FloatBox() { Name = "T ref warm 2", Format = "F3" }; /// [°C]
|
|
public static FloatBox TempRefCold1 = new FloatBox() { Name = "T ref cold 1", Format = "F3" }; /// [°C]
|
|
public static FloatBox TempRefCold2 = new FloatBox() { Name = "T ref cold 2", Format = "F3" }; /// [°C]
|
|
|
|
public static Results.BatchResults BatchRslts;
|
|
|
|
public static IRegisterReader[] RegisterReaders;
|
|
///
|
|
static ProcessData()
|
|
{
|
|
///
|
|
/// RegisterReaders should never be null, RegisterReader.Length should be Config.Data.WMsCount
|
|
/// RegisterReader[i] where i = 0..Config.Data.WMsCount-1 may be null and should always be tested
|
|
///
|
|
RegisterReaders = new IRegisterReader[Config.Data.WMsCount];
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// To clear process values at the beginning of each test
|
|
/// </summary>
|
|
protected void ClearProcessValues()
|
|
{
|
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
{
|
|
if (RegisterReaders[i] != null) RegisterReaders[i].Clear();
|
|
}
|
|
|
|
RefPulses = 0;
|
|
RefFreq.Clear();
|
|
RefFlow.Clear();
|
|
Mass.Clear();
|
|
StartMass.Clear();
|
|
EndMass.Clear();
|
|
}
|
|
|
|
|
|
///
|
|
/// Statistics of 'continuous' variables (temperature, pressure, flow, etc.)
|
|
///
|
|
public static Statistics AmbientTempStat = new Statistics();
|
|
public static Statistics AmbientPressureStat = new Statistics();
|
|
public static Statistics AmbientHumidityStat = new Statistics();
|
|
public static Statistics TempInStat = new Statistics();
|
|
public static Statistics TempOutStat = new Statistics();
|
|
public static Statistics TempDivStat = new Statistics();
|
|
public static Statistics PressureUpStat = new Statistics();
|
|
public static Statistics PressureDownStat = new Statistics();
|
|
public static Statistics RefFlowStat = new Statistics();
|
|
|
|
public static Statistics Energy = new Statistics();
|
|
public static Statistics VolumeForEnergy = new Statistics();
|
|
public static int lastEnergyUpdateTime;
|
|
|
|
protected static void ClearAllStatistics()
|
|
{
|
|
AmbientTempStat.Clear();
|
|
AmbientPressureStat.Clear();
|
|
AmbientHumidityStat.Clear();
|
|
TempInStat.Clear();
|
|
TempOutStat.Clear();
|
|
TempDivStat.Clear();
|
|
PressureUpStat.Clear();
|
|
PressureDownStat.Clear();
|
|
RefFlowStat.Clear();
|
|
|
|
Energy.Clear();
|
|
VolumeForEnergy.Clear();
|
|
lastEnergyUpdateTime = 0;
|
|
}
|
|
|
|
protected static void UpdateAllStatistics()
|
|
{
|
|
AmbientTempStat.Update(AmbientTemp);
|
|
AmbientPressureStat.Update(AmbientPressure);
|
|
AmbientHumidityStat.Update(AmbientHumidity);
|
|
TempInStat.Update(TempIn);
|
|
TempOutStat.Update(TempOut);
|
|
TempDivStat.Update(TempDiv);
|
|
PressureUpStat.Update(PressureUp);
|
|
PressureDownStat.Update(PressureDown);
|
|
RefFlowStat.Update(RefFlow);
|
|
}
|
|
}
|
|
}
|