Compare commits

..
Author SHA1 Message Date
Milan Hanajik b0a534315e Flow control problems when parallel flow meters are used fixed, ver. 3.2.1912 2022-05-16 09:47:59 +02:00
Milan Hanajik 158bba0d27 Bug fix in TempControl.Novus and Easytherm, both ProcParams contains Temp_A/B/C/D/E, related ConditionOp-s, ver. 3.2.1911 2022-05-13 17:49:44 +02:00
Milan Hanajik 4a1eb91c2f Various.CoverTest bug fix, ver. 3.2.1910 2022-05-13 13:48:33 +02:00
Milan Hanajik ae876a649a Tempterature controller setpoint set at the beginning of all tests in the main sequence, ver. 3.2.1909 2022-05-13 13:48:33 +02:00
Milan Hanajik e608c9fd6b UI.Procedures.ProcedureDlg Metrology 2 tab supports TempControl test parameter. 2022-05-13 13:48:17 +02:00
Milan Hanajik a8ba5d5113 string Test.TempControl and string TestData.TempControl added and used in sequences. 2022-05-13 13:47:53 +02:00
Milan Hanajik 2bae912fa0 1 ITempControl moved to GenericDevices, 2 Dummy.TempControl component, 3 TempControl.Easytherm changed to fit ITempControl. 2022-05-13 09:33:03 +02:00
Milan Hanajik 451faf1586 TempControl.Novus : Setpoint step is configurable (incl. rounding) 2022-05-12 12:16:12 +02:00
Milan Hanajik 1a49390ba8 ProcessTabPageCtrl supports compound meters. 2022-05-10 13:05:20 +02:00
Milan Hanajik 395e159522 Water flow related result items cleaned-up, Flow_ctv/_min/_max/_start_/end and Qc removed. 2022-05-10 13:05:20 +02:00
Milan Hanajik fefd846f13 Dead code removed (ProcessTabPageCtrl6/24/48). 2022-05-10 13:05:20 +02:00
Milan Hanajik 19d54d4990 ProcessTabPageCtrl : uses CB Activity, displays S/Ns, supports Flying start and compound meters, ver. 3.1.1907 2022-05-07 14:18:48 +02:00
Milan Hanajik e428897822 ControlBoard Activity added, updated in operations, values are defined in Enums. 2022-05-06 17:18:45 +02:00
Milan Hanajik 1b402566ed Bug fix in FlyingStartMassCollection simulation. 2022-05-06 17:18:45 +02:00
Milan Hanajik 5d23bcade3 Bug fix in Uni.RegValve.SetFlowOp : flowMeter.NominalFreq instead of 2000, ver. 3.1.1903 2022-05-05 10:42:30 +02:00
Milan Hanajik 56d68f0b63 ProcessTabPageCtrl displays PulsesPerLiter fo water meters, ver. 3.1.1902 2022-05-04 14:57:40 +02:00
Milan Hanajik c16e9a8d56 Changes in Results.Entities.TestRslt done in SharedDatabase.Entities.TestRslt as well. 2022-05-04 14:03:26 +02:00
Milan Hanajik 955e55f327 BenchInfo component is loaded and TBF.Data.SetData( ) is called in Program.Main(.) before MainWnd is created. 2022-05-04 12:38:12 +02:00
Milan Hanajik fbd9c976eb FlowMetersInParallel : StartStatistics(test), UpdateStatistics(delta), StopStatistics( ) 2022-05-04 10:56:38 +02:00
Milan Hanajik 2c0ae68db0 IFlowMeterSingle with GetRange(.) and CorrectedFlow(.), Test method calculations clean-up, refactorization, ver. 3.1.1901 2022-05-04 10:23:21 +02:00
Milan Hanajik 9a42e199e3 Uni.FlyingStartStopTestOp bug fix, ver. 3.1.1899 2022-04-29 15:36:45 +02:00
Milan Hanajik e3bb64ef0f Scale display bug fix when units are g, Parallel flowmeter initialization, ReadFlow() fix and logging, ver. 3.1.1898 2022-04-29 14:57:54 +02:00
103 changed files with 2610 additions and 15545 deletions
+14 -14
View File
@@ -34,10 +34,10 @@ namespace Config.Entities
public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoDrainingAfter { get; set; }
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual string TempControl { get; set; } /// Water temperature controller, null or empty = Do not control water temp
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
public virtual MassMethod MassMethod { get; set; } /// method of mass. measurement at the beginning/end of test: false=slow (precise), true=using immediate mass measurement and evaluation
@@ -90,15 +90,15 @@ namespace Config.Entities
Profile = TestProfile.UserDefined;
Publish = (sbyte)Common.Publish.Always;
DoEvaluate = true;
Repeats = 1;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
Repeats = 1;
DoDraining = false;
DoDrainingAfter = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
TempControl = string.Empty;
PumpPower = 60.0f; /// [%]
MassRepeats = 0; /// default
MassSpread = 0; /// default
@@ -168,10 +168,10 @@ namespace Config.Entities
result.Repeats = Repeats;
result.DoDraining = DoDraining;
result.DoDrainingAfter = DoDrainingAfter;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PumpPower = PumpPower;
result.TempControl = TempControl;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
result.MassMethod = MassMethod;
@@ -221,10 +221,10 @@ namespace Config.Entities
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoDrainingAfter.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(TempControl);
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(MassRepeats.ToString(ci));
output.WriteLine(MassSpread.ToString(ci));
output.WriteLine(((byte)MassMethod).ToString(ci));
@@ -273,10 +273,10 @@ namespace Config.Entities
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = bool.Parse(input.ReadLine());
tst.DoDrainingAfter = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.TempControl = input.ReadLine();
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.MassRepeats = int.Parse(input.ReadLine(), ci);
tst.MassSpread = float.Parse(input.ReadLine(), ci);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), ci);
@@ -336,9 +336,9 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "DoDraining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "DoDrainingAfter", DoDrainingAfter.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempControl) { diff.AppendFormat(fmt, "TempController", TempControl, ln); };
ln = inp.ReadLine(); if (ln != PumpPower.ToString(ci)) { diff.AppendFormat(fmt, "PumpPower", PumpPower.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassRepeats.ToString(ci)) { diff.AppendFormat(fmt, "MassRepeats", MassRepeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassSpread.ToString(ci)) { diff.AppendFormat(fmt, "MassSpread", MassSpread.ToString(ci), ln); };
+2 -2
View File
@@ -25,10 +25,10 @@ namespace Config.Mappings
Map(x => x.Repeats);
Map(x => x.DoDraining);
Map(x => x.DoDrainingAfter);
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PumpPower);
Map(x => x.TempControl);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
Map(x => x.MassMethod)
+12 -12
View File
@@ -680,13 +680,13 @@ namespace DeviceTest
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(20);
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(20);
operation1 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation2 = (tbfComponent1forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent1forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
@@ -724,13 +724,13 @@ namespace DeviceTest
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(20);
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(20);
operation21 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation22 = (tbfComponent2forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent2forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
@@ -768,13 +768,13 @@ namespace DeviceTest
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.TempControl.Easytherm.TControl)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureOp(20);
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Easytherm.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.TempControl.Novus.TControl)
{
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureOp(20);
operation31 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(10);
operation32 = (tbfComponent3forOp as TBF.Rig.Modbus.TempControl.Novus.TControl).SetTemperatureSetpointOp(20);
}
else if (tbfComponent3forOp is TBF.Rig.Modbus.UltrasoundLevelMeter.LevelMeter)
{
+5 -4
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -55,8 +55,7 @@ namespace Results.Entities
public virtual DateTime StartTime() { return TestRslt.StartTime; }
public virtual DateTime EndTime() { return TestRslt.EndTime; }
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; } /// [s]
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
public virtual double Flow() { return TestRslt.Flow; } /// [m3/h]
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; } /// [%]
public virtual double DensityLine() { return TestRslt.DensityLine; }
public virtual Components Components(){ return TestRslt.Components; }
@@ -76,7 +75,9 @@ namespace Results.Entities
public virtual string ProcedureName() { return WaterMeter.Batch.ProcedureName; }
public virtual int BatchNr() { return WaterMeter.Batch.BatchNr; }
public virtual string SerialNr() { return WaterMeter.SerialNr; }
public virtual string SerialNr() { return (CompoundMeterId == (byte)Common.CompoundMeterId.CompoundAux)
? WaterMeter.SerialNrAux
: WaterMeter.SerialNr; }
public virtual string EndState() { return WaterMeter.EndState; }
public virtual double QRise() { return WaterMeter.QRise; } /// [m3/h]
public virtual double QFall() { return WaterMeter.QFall; } /// [m3/h]
+40 -43
View File
@@ -26,10 +26,10 @@ namespace Results.Entities
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double ErrLimMargin { get; set; } /// [%] makes error limits tighter: 0 <= ErrLimMargin <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual string TempControl { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
@@ -45,22 +45,22 @@ namespace Results.Entities
public TestData(Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qtg = (double)test.Qtg;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TestTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
ErrLimMargin = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
Name = test.Name;
Repeats = test.Repeats;
Qtg = test.Qtg;
Qfrom = test.Qfrom;
Qto = test.Qto;
TargetVolume = test.Volume;
TargetTime = test.TestTime;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
ErrLimMargin = test.Uncertainty;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
TempControl = test.TempControl;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
}
/// <summary>
@@ -68,22 +68,22 @@ namespace Results.Entities
/// </summary>
public TestData(TestData oriTestData)
{
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
DoControlWaterTemp = oriTestData.DoControlWaterTemp;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
TempControl = oriTestData.TempControl;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
}
@@ -105,13 +105,10 @@ namespace Results.Entities
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (ErrLimMargin != td.ErrLimMargin) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
}
if (Publish != td.Publish) return false;
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
if (TempControl != td.TempControl) return false;
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
return true;
@@ -150,9 +147,9 @@ namespace Results.Entities
writer.Write(ErrLimLo);
writer.Write(ErrLimHi);
writer.Write(ErrLimMargin);
writer.Write(DoControlWaterTemp);
writer.Write(TempLimLo);
writer.Write(TempLimHi);
writer.Write(TempControl);
writer.Write(Publish);
writer.Write(Evaluate);
}
@@ -171,9 +168,9 @@ namespace Results.Entities
ErrLimLo = reader.ReadDouble();
ErrLimHi = reader.ReadDouble();
ErrLimMargin = reader.ReadDouble();
DoControlWaterTemp = reader.ReadBoolean();
TempLimLo = reader.ReadSingle();
TempLimHi = reader.ReadSingle();
TempControl = reader.ReadString();
Publish = reader.ReadSByte();
Evaluate = reader.ReadBoolean();
}
+10 -10
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -44,8 +44,8 @@ namespace Results.Entities
public virtual double DensityLine { get; set; } /// [kg/m3]
public virtual double DensityDiv { get; set; } /// [kg/m3]
public virtual double MassOfEvapWater { get; set; } /// [kg]
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual double FlowVolume { get; set; } /// [m3/h]
public virtual double SpareDbl { get; set; }
public virtual double Flow { get; set; } /// [m3/h] calculated from conventional true value
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
@@ -277,8 +277,8 @@ namespace Results.Entities
DensityLine = src.DensityLine;
DensityDiv = src.DensityDiv;
MassOfEvapWater = src.MassOfEvapWater;
FlowMass = src.FlowMass;
FlowVolume = src.FlowVolume;
SpareDbl = src.SpareDbl;
Flow = src.Flow;
VolumeCTV = src.VolumeCTV;
VolumeMaster = src.VolumeMaster;
ErrorMaster = src.ErrorMaster;
@@ -415,7 +415,7 @@ namespace Results.Entities
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} MassOfEvapWaater={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} InfoFlags={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
DensityIn, DensityLine, DensityDiv, MassOfEvapWater, FlowMass, FlowVolume,
DensityIn, DensityLine, DensityDiv, MassOfEvapWater, SpareDbl, Flow,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags,
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
@@ -484,8 +484,8 @@ namespace Results.Entities
writer.Write(DensityLine);
writer.Write(DensityDiv);
writer.Write(MassOfEvapWater);
writer.Write(FlowMass);
writer.Write(FlowVolume);
writer.Write(SpareDbl);
writer.Write(Flow);
writer.Write(VolumeCTV);
writer.Write(VolumeMaster);
writer.Write(ErrorMaster);
@@ -625,8 +625,8 @@ namespace Results.Entities
DensityLine = reader.ReadDouble();
DensityDiv = reader.ReadDouble();
MassOfEvapWater = reader.ReadDouble();
FlowMass = reader.ReadDouble();
FlowVolume = reader.ReadDouble();
SpareDbl = reader.ReadDouble();
Flow = reader.ReadDouble();
VolumeCTV = reader.ReadDouble();
VolumeMaster = reader.ReadDouble();
ErrorMaster = reader.ReadDouble();
+7 -7
View File
@@ -22,7 +22,7 @@ namespace Results
Test_start_time, /// 12
Test_end_time, /// 13
Test_time, /// 14
Flow, /// 15
Flow, /// 15 Calculated flow (use ConstMasterRaw/ConstMaster to calculate uncorrected flow of the reference flow meter)
T_up_mean, /// 16
T_down_mean, /// 17
T_div, /// 18
@@ -230,7 +230,7 @@ namespace Results
PMax_test_time, /// 199 Pressure test time
Start_valve_open_time, /// 200
Start_valve_close_time, /// 201
Qc, /// 202 Flow for a water meter
NotUsed202, /// 202
Degree__liter, /// 203 Water meter constant (degree per liter) specific for one test with camera
Camera_angle, /// 204
Camera_angle_start, /// 205
@@ -245,11 +245,11 @@ namespace Results
Medium, /// 213 Woda zimna/ciepla
Flow_ctv, /// 214
Flow_ctv_min, /// 215
Flow_ctv_max, /// 216
Flow_ctv_start, /// 217
Flow_ctv_end, /// 218
NotUsed214, /// 214
NotUsed215, /// 215
NotUsed216, /// 216
NotUsed217, /// 217
NotUsed218, /// 218
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
+4 -5
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -39,10 +39,9 @@ namespace Results.Mappings
Map(x => x.DensityIn);
Map(x => x.DensityLine);
Map(x => x.DensityDiv);
Map(x => x.MassOfEvapWater)
.Column("Buoyancy");
Map(x => x.FlowMass);
Map(x => x.FlowVolume);
Map(x => x.MassOfEvapWater).Column("Buoyancy");
Map(x => x.SpareDbl).Column("FlowMass");
Map(x => x.Flow).Column("FlowVolume");
Map(x => x.VolumeCTV);
Map(x => x.VolumeMaster);
Map(x => x.ErrorMaster);
+1 -1
View File
@@ -25,7 +25,7 @@ namespace Results.Output
IList<PointF> unsortedPoints = new List<PointF>();
foreach (var mtr in wm.RegularMeterTestRslts())
{
double flow = mtr.TestRslt.FlowVolume;
double flow = mtr.TestRslt.Flow;
var td = mtr.TestRslt.TestData;
if (mtr.IsPilotRslt() && flow > 0 && td.Evaluate &&
+278 -284
View File
@@ -134,374 +134,368 @@ namespace Results
{
AllItems = new List<WMeterRsltItemSpec>();
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => f));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.String, "String", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => f));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => string.Empty));
/// Common
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProcedureDescription)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_Method_Elde, Strings.Test_method + " Elde ()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).MethodElde())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.ProcedureDescription)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_Method_Elde, Strings.Test_method + " Elde ()", Quantity.String, ItemCategory.TestData, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).MethodElde())));
///
/// Volume
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_volume, Strings.Test_vol + "()", Quantity.Volume, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).TargetVolume())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.VolumeCTV, string.Format("{0} CTV ()", Strings.VName_Vol), Quantity.Volume, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).VolumeCTV)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume, string.Format("{0} Mt. ()", Strings.VName_Vol), Strings.Tooltip_Vol_Mt, Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeMeter) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeMeter) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_volume, string.Format("{0} rm ()", Strings.VName_Vol), Strings.Tooltip_Vol_rm, Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeRef) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeRef) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_main, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.main), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Volume_aux, string.Format("{0} {1} ()", Strings.VName_Vol, Strings.aux), Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume, Strings.Start_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeStart) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeStart) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_main, Strings.Start_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_volume_aux, Strings.Start_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume, Strings.End_volume + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).VolumeEnd) : ((w.GetMeterTestRslt(t) != null) ? FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).VolumeEnd) : string.Empty)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_main, Strings.End_volume_main + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_volume_aux, Strings.End_volume_aux + "()", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).VolumeEnd) : string.Empty));
///
/// Mass
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start_raw, string.Format("{0} ST raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).MassStartRaw)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start, string.Format("{0} ST ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).MassStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end_raw, string.Format("{0} EN raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).MassEndRaw)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end, string.Format("{0} EN ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).MassEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass, string.Format("{0} ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).MassEnd - w.GetTestRslt(t).MassStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start_raw, string.Format("{0} ST raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStartRaw)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_start, string.Format("{0} ST ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end_raw, string.Format("{0} EN raw ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEndRaw)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass_end, string.Format("{0} EN ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mass, string.Format("{0} ()", Strings.VName_Mass), Quantity.Mass, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).MassEnd - w.GetTestRslt(t).MassStart)));
///
/// Density
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetTestRslt(t).DensityLine)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", Formulas.DensityCorrection(w.Batch.SampleDensity, w.Batch.SampleTemp))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.Batch.SampleDensity)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RhoDistilledWtrAtMeLineTemp, string.Format("{0} of distilled water at T line", Strings.Density), Quantity.Density, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? 0 : Formulas.DistilledWaterDensityFromTemp((w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density, Strings.Density + " ()", Quantity.Density, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", w.GetTestRslt(t).DensityLine)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Density_correction, Strings.Density_correction + " ()", Quantity.Density, ItemCategory.BenchData, (w,t,u,f,p) => FormatDbl(u,f,p, "V3", Formulas.DensityCorrection(w.Batch.SampleDensity, w.Batch.SampleTemp))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Rho_Wa_calc, string.Format("{0} of sample", Strings.Density), Quantity.Density, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V4", w.Batch.SampleDensity)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RhoDistilledWtrAtMeLineTemp, string.Format("{0} of distilled water at T line", Strings.Density), Quantity.Density, ItemCategory.BenchData, (w,t,u,f,p) => FormatDbl(u,f,p, "V4", (w.GetTestRslt(t) == null) ? 0 : Formulas.DistilledWaterDensityFromTemp((w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2))));
///
/// Date and time
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_start_time, Strings.T_start + "()", Quantity.DateTime, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).StartTime.ToString() : string.Format(f, w.GetTestRslt(t).StartTime))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_end_time, Strings.T_end + "()", Quantity.DateTime, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : (string.IsNullOrEmpty(f) ? w.GetTestRslt(t).EndTime.ToString() : string.Format(f, w.GetTestRslt(t).EndTime))));
///
/// Time (duration)
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F1", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestTimeCorrection, "Test time correction ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).TestTimeCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TimeBtwnMassMsrmnts, "Time between mass measurements ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).TimeBtwnMassMsrmnts)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_close_time, "Start valve close time ()", "Start valve close time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "V3", w.GetMeterTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "F1", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestTimeCorrection, "Test time correction ()", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "F3", w.GetTestRslt(t).TestTimeCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TimeBtwnMassMsrmnts, "Time between mass measurements ()", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u,f,p, "F0", w.GetTestRslt(t).TimeBtwnMassMsrmnts)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u,f,p, "F0", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u,f,p, "F3", w.GetTestRslt(t).DiverterStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u,f,p, "F3", w.GetTestRslt(t).DiverterEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u,f,p, "F3", w.GetTestRslt(t).DiverterStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_close_time, "Start valve close time ()", "Start valve close time", Quantity.Time, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u,f,p, "F3", w.GetTestRslt(t).DiverterEnd)));
///
/// Flow
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).Qfrom())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).Qto())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).Flow)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} mean ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).FlowMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).FlowMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).FlowMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} start ()",Strings.VName_Flow), Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).FlowStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).FlowEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w,t,u,f,p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u,f,p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w,t,u,f,p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u,f,p, "V3", w.QFall)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w,t,u,f,p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u,f,p, "V3", w.QRise)) : ""));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterRaw, string.Format("k MID raw ()"),"Const. of the ref. flow meter uncorrected", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMasterRaw < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterRaw)))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterCorr,string.Format("k MID corr ()"), "Const. of the ref. flow meter corrected", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMasterCorr < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterCorr)))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const.of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster)))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterRaw, string.Format("k MID raw ()"),"Const.of the ref.flow meter uncorrected", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", ((w.GetTestRslt(t).ConstMasterRaw < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterRaw)))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMasterCorr,string.Format("k MID corr ()"), "Const.of the ref.flow meter corrected", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V4", ((w.GetTestRslt(t).ConstMasterCorr < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMasterCorr)))));
///
/// Temperature
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, string.Format("{0} UP ME ()", Strings.VName_Temp), Strings.Tooltip_T_up_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_start, string.Format("{0} UP ST ()", Strings.VName_Temp), Strings.Tooltip_T_up_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_end, string.Format("{0} UP EN ()", Strings.VName_Temp), Strings.Tooltip_T_up_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_avg, string.Format("{0} UP avg ()", Strings.VName_Temp), Strings.Tooltip_T_up_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_min, string.Format("{0} UP min ()", Strings.VName_Temp), Strings.Tooltip_T_up_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_max, string.Format("{0} UP max ()", Strings.VName_Temp), Strings.Tooltip_T_up_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempUpMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_mean, string.Format("{0} LN ME ()", Strings.VName_Temp), Strings.Tooltip_T_ln_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_start, string.Format("{0} LN ST ()", Strings.VName_Temp), Strings.Tooltip_T_ln_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_end, string.Format("{0} LN EN ()", Strings.VName_Temp), Strings.Tooltip_T_ln_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_avg, string.Format("{0} LN avg ()", Strings.VName_Temp), Strings.Tooltip_T_ln_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_min, string.Format("{0} LN min ()", Strings.VName_Temp), Strings.Tooltip_T_ln_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMin + w.GetTestRslt(t).TempDownMin) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_max, string.Format("{0} LN max ()", Strings.VName_Temp), Strings.Tooltip_T_ln_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempUpMax + w.GetTestRslt(t).TempDownMax) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, string.Format("{0} DW ME ()", Strings.VName_Temp), Strings.Tooltip_T_dw_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_start, string.Format("{0} DW ST ()", Strings.VName_Temp), Strings.Tooltip_T_dw_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_end, string.Format("{0} DW EN ()", Strings.VName_Temp), Strings.Tooltip_T_dw_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_avg, string.Format("{0} DW avg ()", Strings.VName_Temp), Strings.Tooltip_T_dw_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_min, string.Format("{0} DW min ()", Strings.VName_Temp), Strings.Tooltip_T_dw_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_max, string.Format("{0} DW max ()", Strings.VName_Temp), Strings.Tooltip_T_dw_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDownMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, string.Format("{0} DI ME ()", Strings.VName_Temp), Strings.Tooltip_T_di_me, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_start, string.Format("{0} DI ST ()", Strings.VName_Temp), Strings.Tooltip_T_di_st, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_end, string.Format("{0} DI EN ()", Strings.VName_Temp), Strings.Tooltip_T_di_en, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Strings.Tooltip_T_di_avg, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_min, string.Format("{0} DI min ()", Strings.VName_Temp), Strings.Tooltip_T_di_min, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_max, string.Format("{0} DI max ()", Strings.VName_Temp), Strings.Tooltip_T_di_max, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TempDivMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Batch.SampleTemp)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_mean, string.Format("{0} UP ME ()", Strings.VName_Temp), Strings.Tooltip_T_up_me, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempUpMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_start, string.Format("{0} UP ST ()", Strings.VName_Temp), Strings.Tooltip_T_up_st, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempUpStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_end, string.Format("{0} UP EN ()", Strings.VName_Temp), Strings.Tooltip_T_up_en, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempUpEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_avg, string.Format("{0} UP avg ()", Strings.VName_Temp), Strings.Tooltip_T_up_avg, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempUpEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_min, string.Format("{0} UP min ()", Strings.VName_Temp), Strings.Tooltip_T_up_min, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempUpMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_up_max, string.Format("{0} UP max ()", Strings.VName_Temp), Strings.Tooltip_T_up_max, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempUpMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_mean, string.Format("{0} LN ME ()", Strings.VName_Temp), Strings.Tooltip_T_ln_me, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpMean + w.GetTestRslt(t).TempDownMean) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_start, string.Format("{0} LN ST ()", Strings.VName_Temp), Strings.Tooltip_T_ln_st, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_end, string.Format("{0} LN EN ()", Strings.VName_Temp), Strings.Tooltip_T_ln_en, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_avg, string.Format("{0} LN avg ()", Strings.VName_Temp), Strings.Tooltip_T_ln_avg, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpStart + w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempUpEnd + w.GetTestRslt(t).TempDownEnd) / 4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_min, string.Format("{0} LN min ()", Strings.VName_Temp), Strings.Tooltip_T_ln_min, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpMin + w.GetTestRslt(t).TempDownMin) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_line_max, string.Format("{0} LN max ()", Strings.VName_Temp), Strings.Tooltip_T_ln_max, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempUpMax + w.GetTestRslt(t).TempDownMax) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_mean, string.Format("{0} DW ME ()", Strings.VName_Temp), Strings.Tooltip_T_dw_me, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_start, string.Format("{0} DW ST ()", Strings.VName_Temp), Strings.Tooltip_T_dw_st, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDownStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_end, string.Format("{0} DW EN ()", Strings.VName_Temp), Strings.Tooltip_T_dw_en, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDownEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_avg, string.Format("{0} DW avg ()", Strings.VName_Temp), Strings.Tooltip_T_dw_avg, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempDownStart + w.GetTestRslt(t).TempDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_min, string.Format("{0} DW min ()", Strings.VName_Temp), Strings.Tooltip_T_dw_min, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDownMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_down_max, string.Format("{0} DW max ()", Strings.VName_Temp), Strings.Tooltip_T_dw_max, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDownMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div, string.Format("{0} DI ME ()", Strings.VName_Temp), Strings.Tooltip_T_di_me, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDivMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_start, string.Format("{0} DI ST ()", Strings.VName_Temp), Strings.Tooltip_T_di_st, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDivStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_end, string.Format("{0} DI EN ()", Strings.VName_Temp), Strings.Tooltip_T_di_en, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDivEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_avg, string.Format("{0} DI avg ()", Strings.VName_Temp), Strings.Tooltip_T_di_avg, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).TempDivStart + w.GetTestRslt(t).TempDivEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_min, string.Format("{0} DI min ()", Strings.VName_Temp), Strings.Tooltip_T_di_min, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDivMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_div_max, string.Format("{0} DI max ()", Strings.VName_Temp), Strings.Tooltip_T_di_max, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).TempDivMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_rho_0, string.Format("{0} RO0", Strings.VName_Temp), Strings.Tooltip_T_rho_0, Quantity.Temperature, ItemCategory.BenchData, (w,t,u,f,p) => FormatDbl(u,f,p, "V3", w.Batch.SampleTemp)));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom1)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom3)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom6)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom7)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom8)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_mean, string.Format("{0} hi me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom1)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_start, string.Format("{0} hi st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_end, string.Format("{0} hi en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom3)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Hi_avg, string.Format("{0} hi av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom2 + w.GetTestRslt(t).Custom3) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_mean, string.Format("{0} lo me", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom6)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_start, string.Format("{0} lo st", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom7)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_end, string.Format("{0} lo en", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).Custom8)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.T_Lo_avg, string.Format("{0} lo av", Strings.VName_Temp), Quantity.Temperature, ItemCategory.Other, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", (w.GetTestRslt(t).Custom7 + w.GetTestRslt(t).Custom8) / 2)));
#endif
///
/// Pressure
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, string.Format("{0} UP ME ()", Strings.VName_Press), Strings.Tooltip_P_up_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, string.Format("{0} UP ST ()", Strings.VName_Press), Strings.Tooltip_P_up_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, string.Format("{0} UP EN ()", Strings.VName_Press), Strings.Tooltip_P_up_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_avg, string.Format("{0} UP avg ()", Strings.VName_Press), Strings.Tooltip_P_up_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpStart + w.GetTestRslt(t).PressUpEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_min, string.Format("{0} UP min ()", Strings.VName_Press), Strings.Tooltip_P_up_min, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_max, string.Format("{0} UP max ()", Strings.VName_Press), Strings.Tooltip_P_up_max, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, string.Format("{0} DW ME ()", Strings.VName_Press), Strings.Tooltip_P_dw_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, string.Format("{0} DW ST ()", Strings.VName_Press), Strings.Tooltip_P_dw_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDownStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, string.Format("{0} DW EN ()", Strings.VName_Press), Strings.Tooltip_P_dw_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDownEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_avg, string.Format("{0} DW avg ()", Strings.VName_Press), Strings.Tooltip_P_dw_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressDownStart + w.GetTestRslt(t).PressDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_min, string.Format("{0} DW min ()", Strings.VName_Press), Strings.Tooltip_P_dw_min, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDownMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_max, string.Format("{0} DW max ()", Strings.VName_Press), Strings.Tooltip_P_dw_max, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDownMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, string.Format("{0} DE ME ()", Strings.VName_Press), Strings.Tooltip_P_de_me, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, string.Format("{0} DE ST ()", Strings.VName_Press), Strings.Tooltip_P_de_st, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, string.Format("{0} DE EN ()", Strings.VName_Press), Strings.Tooltip_P_de_en, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_min, string.Format("{0} DE min ()", Strings.VName_Press), Strings.Tooltip_P_de_min, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_max, string.Format("{0} DE max ()", Strings.VName_Press), Strings.Tooltip_P_de_max, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_per_mtr, string.Format("{0} DE ME per mtr.()", Strings.VName_Press), "P delta mean per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressDeltaMean / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down, string.Format("{0} UP-DW ME ()", Strings.VName_Press), "P delta mean from UP/DW", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, string.Format("{0} UP-DW ME per mtr ()", Strings.VName_Press), "P delta mean from UP/DW per one meter", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean) / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_PMax_test_mean, string.Format("{0} PMax mean ()", Strings.VName_Press), "Mean PMax test pressure", Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).PressUpMean + w.GetTestRslt(t).PressDownMean) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up, string.Format("{0} UP ME ()", Strings.VName_Press), Strings.Tooltip_P_up_me, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_start, string.Format("{0} UP ST ()", Strings.VName_Press), Strings.Tooltip_P_up_st, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_end, string.Format("{0} UP EN ()", Strings.VName_Press), Strings.Tooltip_P_up_en, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_avg, string.Format("{0} UP avg ()", Strings.VName_Press), Strings.Tooltip_P_up_avg, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).PressUpStart + w.GetTestRslt(t).PressUpEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_min, string.Format("{0} UP min ()", Strings.VName_Press), Strings.Tooltip_P_up_min, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_up_max, string.Format("{0} UP max ()", Strings.VName_Press), Strings.Tooltip_P_up_max, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down, string.Format("{0} DW ME ()", Strings.VName_Press), Strings.Tooltip_P_dw_me, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_start, string.Format("{0} DW ST ()", Strings.VName_Press), Strings.Tooltip_P_dw_st, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDownStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_end, string.Format("{0} DW EN ()", Strings.VName_Press), Strings.Tooltip_P_dw_en, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDownEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_avg, string.Format("{0} DW avg ()", Strings.VName_Press), Strings.Tooltip_P_dw_avg, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).PressDownStart + w.GetTestRslt(t).PressDownEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_min, string.Format("{0} DW min ()", Strings.VName_Press), Strings.Tooltip_P_dw_min, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDownMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_down_max, string.Format("{0} DW max ()", Strings.VName_Press), Strings.Tooltip_P_dw_max, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDownMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean, string.Format("{0} DE ME ()", Strings.VName_Press), Strings.Tooltip_P_de_me, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_start, string.Format("{0} DE ST ()", Strings.VName_Press), Strings.Tooltip_P_de_st, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_end, string.Format("{0} DE EN ()", Strings.VName_Press), Strings.Tooltip_P_de_en, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_avg, string.Format("{0} DE avg ()", Strings.VName_Press), Strings.Tooltip_P_de_avg, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).PressDeltaStart + w.GetTestRslt(t).PressDeltaEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_min, string.Format("{0} DE min ()", Strings.VName_Press), Strings.Tooltip_P_de_min, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_max, string.Format("{0} DE max ()", Strings.VName_Press), Strings.Tooltip_P_de_max, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_per_mtr, string.Format("{0} DE ME per mtr.()", Strings.VName_Press), "P delta mean per one meter", Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressDeltaMean / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down, string.Format("{0} UP-DW ME ()", Strings.VName_Press), "P delta mean from UP/DW", Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_delta_mean_from_up_down_per_mtr, string.Format("{0} UP-DW ME per mtr ()", Strings.VName_Press), "P delta mean from UP/DW per one meter", Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).PressUpMean - w.GetTestRslt(t).PressDownMean) / Math.Max(1, w.GetTestRslt(t).Batch.WaterMeters.Count))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.P_PMax_test_mean, string.Format("{0} PMax mean ()", Strings.VName_Press), "Mean PMax test pressure", Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).PressUpMean + w.GetTestRslt(t).PressDownMean) / 2)));
///
/// Electrical conductivity of water
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct, string.Format("{0} ME ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_start, string.Format("{0} ST ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_end, string.Format("{0} EN ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_avg, string.Format("{0} avg ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).ConductStart + w.GetTestRslt(t).ConductEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_min, string.Format("{0} min ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_max, string.Format("{0} max ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).ConductMax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct, string.Format("{0} ME ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).ConductMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_start, string.Format("{0} ST ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).ConductStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_end, string.Format("{0} EN ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).ConductEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_avg, string.Format("{0} avg ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", (w.GetTestRslt(t).ConductStart + w.GetTestRslt(t).ConductEnd) / 2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_min, string.Format("{0} min ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).ConductMin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Conduct_max, string.Format("{0} max ()", Strings.VName_Conduct), Quantity.Conductivity, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V3", w.GetTestRslt(t).ConductMax)));
///
/// Ambient temperature/pressure/humidity/Buoyancy
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, string.Format("{0} Amb M", Strings.VName_Temp), Strings.Tooltip_T_Amb_M, Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempMean() : w.GetTestRslt(t).AmbTempMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, string.Format("{0} Amb M", Strings.VName_Press), Strings.Tooltip_P_Amb_M, Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressMean() : w.GetTestRslt(t).AmbPressMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Strings.Tooltip_Hu_Amb_M, Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiMean() : w.GetTestRslt(t).AmbHumiMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_temp_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempStart() : w.GetTestRslt(t).AmbTempStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbTempEnd() : w.GetTestRslt(t).AmbTempEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_press_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressStart(): w.GetTestRslt(t).AmbPressStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbPressEnd() : w.GetTestRslt(t).AmbPressEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_humi_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiStart() : w.GetTestRslt(t).AmbHumiStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiEnd() : w.GetTestRslt(t).AmbHumiEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy", Quantity.Number, ItemCategory.BenchData, (w, t, u, f, p) => FormatDbl(u, f, p, "V6", w.Batch.Buoyancy)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_temperature, string.Format("{0} Amb M", Strings.VName_Temp), Strings.Tooltip_T_Amb_M, Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempMean() : w.GetTestRslt(t).AmbTempMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_pressure, string.Format("{0} Amb M", Strings.VName_Press), Strings.Tooltip_P_Amb_M, Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressMean() : w.GetTestRslt(t).AmbPressMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Ambient_humidity, string.Format("{0} Amb M", Strings.VName_Humi), Strings.Tooltip_Hu_Amb_M, Quantity.Humidity, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiMean() : w.GetTestRslt(t).AmbHumiMean)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_temp_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Temp), Quantity.Temperature, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V3", (w.GetTestRslt(t) == null) ? w.Batch.AmbTempStart() : w.GetTestRslt(t).AmbTempStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbTempEnd() : w.GetTestRslt(t).AmbTempEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_press_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Press), Quantity.Pressure, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V4", (w.GetTestRslt(t) == null) ? w.Batch.AmbPressStart(): w.GetTestRslt(t).AmbPressStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbPressEnd() : w.GetTestRslt(t).AmbPressEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Amb_humi_start_end, string.Format("{0} Amb ST/EN", Strings.VName_Humi), Quantity.Humidity, ItemCategory.TestResult, (w,t,u,f,p) => FormatDbl(u,f,p, "V2", (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiStart() : w.GetTestRslt(t).AmbHumiStart, (w.GetTestRslt(t) == null) ? w.Batch.AmbHumiEnd() : w.GetTestRslt(t).AmbHumiEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Buoyancy, "Buoyancy", Quantity.Number, ItemCategory.BenchData, (w,t,u,f,p) => FormatDbl(u,f,p, "V6", w.Batch.Buoyancy)));
///
/// Error
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimLo())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimHi())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimMargin())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Lo, Strings.ErrLimLo + "()", Quantity.Error, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V2", w.GetTestRslt(t).ErrLimLo())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V2", w.GetTestRslt(t).ErrLimHi())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V2", w.GetTestRslt(t).ErrLimMargin())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V2", w.GetTestRslt(t).ErrorMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "V2", Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.LastError, string.Format("{0} rel. last ()", Strings.VName_Error), Strings.Tooltip_E_rel_last, Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).LastError)));
#else
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_heat_mtr_vol, string.Format("{0} rel.hm.vol. ()", Strings.VName_Error), Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_heat_mtr_vol, string.Format("{0} rel.hm.vol. ()", Strings.VName_Error), Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterVolume).Error) : string.Empty));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed, Strings.Result, Quantity.Boolean, ItemCategory.MeterResult, (w,t,u,f,p) => string.IsNullOrEmpty(t) ? w.PassedColorStr(f)
: ((w.GetMeterTestRslt(t) == null) ? "" : w.GetMeterTestRslt(t).PassedColorStr(f))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w, t, u, f, p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ThreeState, "Three state result", Quantity.Enumerated, ItemCategory.MeterResult, (w,t,u,f,p) => FormatThreeState(f, w.ThreeStateFromTests())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter, "Diverter", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Diverter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RegValve, "Reg. valve", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RegValve()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
AllItems.Add(new WMeterRsltItemSpec(ItemID.RefFlowmeter, "Ref. flowmeter", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RefFlowmeter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Scale, "Scale", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Scale()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter, "Diverter", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).Diverter()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RegValve, "Reg. valve", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null) ? FormatStr(f, w.GetTestRslt(t).RegValve()) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ResultOrErrorFlags, "Winiki lub E", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.PassedOrErrorFlagsStr()))); /// PL specific result
///
/// Water meter info
///
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.ProductName)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Producer)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeter_type, Strings.WM_Type, Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.ProductName)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Producer, Strings.Producer, Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Producer)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", w.WaterMeterData.DN)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.L, "L", Quantity.Length, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.L)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mounting, Strings.Mounting, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Mounting.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q4, "Q4_Qmax", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q4_Qmax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q3, "Q3_Qn", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V2", w.WaterMeterData.Q3_Qn)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2, "Q2_Qt", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q2_Qt)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q1, "Q1_Qmin", Quantity.Flow, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q1_Qmin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.DN, "DN", Quantity.Length, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V2", w.WaterMeterData.DN)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.L, "L", Quantity.Length, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.L)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Mounting, Strings.Mounting, Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Mounting.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q4, "Q4_Qmax", Quantity.Flow, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q4_Qmax)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q3, "Q3_Qn", Quantity.Flow, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V2", w.WaterMeterData.Q3_Qn)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2, "Q2_Qt", Quantity.Flow, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q2_Qt)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q1, "Q1_Qmin", Quantity.Flow, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.WaterMeterData.Q1_Qmin)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Metrological_class, Strings.MClass, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.MetrologicalClass)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Temperature_class, "Temperature class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.TemperatureClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pressure_loss_class, "Pressure loss class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.PressureLossClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_admissible_pressure, "Max. admissible pressure", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.MaxAdmissiblePressure.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.FlowProfileSensitivityClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.ApprovalInfo)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Certificate)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Medium, "Water cold/hot", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Medium.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Metrological_class, Strings.MClass, Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.MetrologicalClass)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Temperature_class, "Temperature class", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.TemperatureClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pressure_loss_class, "Pressure loss class", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.PressureLossClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_admissible_pressure, "Max. admissible pressure", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.MaxAdmissiblePressure.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_profile_sensitivity_class, "Flow profile sensitivity class", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.FlowProfileSensitivityClass.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Approval_info, Strings.Approval, Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.ApprovalInfo)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Certificate, "Certificate", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Certificate)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Medium, "Water cold/hot", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Medium.ToDescription())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text1)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text3, "Text3", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text3)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text4, "Text4", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, ItemCategory.MeterData, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Text5)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text1, "Text1", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Text1)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text2, "Text2", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Text2)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text3, "Text3", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Text3)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text4, "Text4", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Text4)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Text5, "Text5", Quantity.String, ItemCategory.MeterData, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Text5)));
/// Water meters results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Strings.Tooltip_sn, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RadioAddress, Strings.Radio_address, Strings.Tooltip_RA, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr, Strings.sn, Strings.Tooltip_sn, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.RadioAddress, Strings.Radio_address, Strings.Tooltip_RA, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.RadioAddress)));
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.OriRadioAddress, "Original " + Strings.Radio_address, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.OriRadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OriRadioAddress, "Original " + Strings.Radio_address, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.OriRadioAddress)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.PurchaseOrder)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.YearOfProduction)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.WMPosition)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Formatted_WM_ID, "Formatted WM ID", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? string.Format("{0}-{1}", w.BatchNr(), w.WMPosition) : string.Format(f, w.StartTime(), w.EndTime(), w.BatchNr(), w.WMPosition, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Purchase_order, Strings.PO, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.PurchaseOrder)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Year_of_production, Strings.Year, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.YearOfProduction)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_Position, Strings.Pos, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.WMPosition)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Formatted_WM_ID, "Formatted WM ID", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? string.Format("{0}-{1}", w.BatchNr(), w.WMPosition) : string.Format(f, w.StartTime(), w.EndTime(), w.BatchNr(), w.WMPosition, w.SerialNr)));
/// Water meters results (single)
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsPulses() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses_ni, Strings.RefPulses + "_ni()", Quantity.Pulses, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Pulses, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle, "Angle ()", "Angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_start, "Start angle ()", "Start angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeStart * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_end, "End angle ()", "End angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeEnd * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state, Strings.End_state, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.EndState)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses, Strings.Pulses + "()", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).IsPulses() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses_ni, Strings.RefPulses + "_ni()", Quantity.Pulses, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetMeterTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_pulses, Strings.RefPulses + "()", Quantity.Pulses, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).PulsesMaster)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle, "Angle ()", "Angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesMeter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_start, "Start angle ()", "Start angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeStart * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Camera_angle_end, "End angle ()", "End angle measured by a camera", Quantity.Pulses, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u,f,p, "F0", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).VolumeEnd * w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulse__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? 0 : w.GetMeterTestRslt(t).PulsesPerLiter)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulses_per_liter, Strings.PulsesLiter, Quantity.PulsePerLtr, ItemCategory.MeterData, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", w.WaterMeterData.PulsesPerLtr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Pulse__liter, Strings.PulsesLiter + "()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? 0 : w.GetMeterTestRslt(t).PulsesPerLiter)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Degree__liter, "Degree per liter ()", Quantity.PulsePerLtr, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).IsCamera() ? w.GetMeterTestRslt(t).PulsesPerLiter : 0)));
/// Water meters results (combined)
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.SerialNrAux)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndState)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndStateAux)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_main, Strings.Err_main + "()", Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundMain).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_aux, Strings.Err_aux + "()", Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => (w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux) != null) ? FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t, CompoundMeterId.CompoundAux).Error) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_main, string.Format("{0} {1}", Strings.sn, Strings.main), Strings.Tooltip_sn_main, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.SerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Serial_Nr_aux, string.Format("{0} {1}", Strings.sn, Strings.aux), Strings.Tooltip_sn_aux, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.SerialNrAux)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_main, Strings.EndState_main, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.EndState)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.EndStateAux)));
/// Batch info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_ID, Strings.Bench_ID, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_name, Strings.Bench_name, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.TestBenchName) ? w.Batch.TestBenchName : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address1, Strings.Address + " 1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address1) ? w.Batch.Address1 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address2, Strings.Address + " 2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address2) ? w.Batch.Address2 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address3, Strings.Address + " 3", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address3) ? w.Batch.Address3 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address4, Strings.Address + " 4", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address4) ? w.Batch.Address4 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address5, Strings.Address + " 5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address5) ? w.Batch.Address5 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.UserNumber)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Common.Utils.EncodedStrToUserName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Common.Utils.EncodedStrToFullName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Legalizator, Strings.Legalizator, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Common.Utils.EncodedStrToLegalizator(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.WatermetersStr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w, t, u, f, p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.PassedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.FailedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_ID, Strings.Bench_ID, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_name, Strings.Bench_name, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.TestBenchName) ? w.Batch.TestBenchName : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address1, Strings.Address + " 1", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address1) ? w.Batch.Address1 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address2, Strings.Address + " 2", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address2) ? w.Batch.Address2 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address3, Strings.Address + " 3", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address3) ? w.Batch.Address3 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address4, Strings.Address + " 4", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address4) ? w.Batch.Address4 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address5, Strings.Address + " 5", Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address5) ? w.Batch.Address5 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.UserNumber)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, Common.Utils.EncodedStrToUserName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, Common.Utils.EncodedStrToFullName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Legalizator, Strings.Legalizator, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, Common.Utils.EncodedStrToLegalizator(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Watermeters, Strings.WMs, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.Batch.WatermetersStr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_start_time, Strings.Start, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.StartTime.ToString() : string.Format(f, w.Batch.StartTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_end_time, Strings.End, Quantity.DateTime, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? w.Batch.EndTime.ToString() : string.Format(f, w.Batch.EndTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCount())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
/// Extra water meter data
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_remark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, string.Format("{0} {1}", Strings.Batch, Strings.Remark), Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, w.Batch.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "Assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "Complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Result_code, Strings.Result_code, Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.ResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WM_remark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Remark, string.Format("{0} {1}", Strings.Batch, Strings.Remark), Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => FormatStr(f, w.Batch.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w,t,u,f,p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "Assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.AssignedSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "Complete s/n", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.CompleteSerialNr)));
#if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w,t,u,f,p) => (w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Common.CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty));
#endif
#if IPERL
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (((w.Q2CorrRL != 0) || (w.Q2CorrLR != 0)) ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.FWVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactor, "iPerl OrigCalibFactor", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactor, "iPerl CalibFactor", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.CalibFactor)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w,t,u,f,p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w,t,u,f,p) => (((w.Q2CorrRL != 0) || (w.Q2CorrLR != 0)) ? Strings.Yes : Strings.No)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.Q2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.Q2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.Q2CorrFlowRight)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.FW_Version, "iPerl FW version", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.FWVersion)));
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, (w.Pruefindex % 100))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeID, "OraDB WM Type ID", Quantity.Number, ItemCategory.MeterData, (w, t, u, f, p) => FormatInt(f, w.WaterMeterData.WMTypeId)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeRev, "OraDB WM Type Rev.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.WMTypeRevision)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Max_test_index, "iPerl test index", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, (w.Pruefindex % 100))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeID, "OraDB WM Type ID", Quantity.Number, ItemCategory.MeterData, (w,t,u,f,p) => FormatInt(f, w.WaterMeterData.WMTypeId)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.OraWMTypeRev, "OraDB WM Type Rev.", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.WMTypeRevision)));
#endif
#endif
#if TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.PaletteNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.UmkartonNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_TestBench, "Prod iPerl test bench", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdTestBench)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_WMPosition, "Prod iPerl WM position", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdWMPosition)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UserName, "Prod iPerl user name", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdUserName)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PurchaseOrder, "Prod iPerl purchase order", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ProdPurchaseOrder)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Passed, "Prod iPerl passed", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => FormatBool(f,w.ProdPassed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_ResultCode, "Prod iPerl result code", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.ProdQ2CorrLR)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.RadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.PaletteNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.UmkartonNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_TestBench, "Prod iPerl test bench", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.ProdTestBench)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_WMPosition, "Prod iPerl WM position", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.ProdWMPosition)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UserName, "Prod iPerl user name", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.ProdUserName)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PurchaseOrder, "Prod iPerl purchase order", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.ProdPurchaseOrder)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Passed, "Prod iPerl passed", Quantity.Boolean,ItemCategory.MeterResult, (w,t,u,f,p) => FormatBool(f,w.ProdPassed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_ResultCode, "Prod iPerl result code", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.ProdResultCode)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrRL, "Prod iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.ProdQ2CorrRL)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_Q2CorrLR, "Prod iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w,t,u,f,p) => FormatInt(f, w.ProdQ2CorrLR)));
#endif
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).TestDone)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).Passed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.ErrorFlagsStrEx())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.InfoFlags, Strings.Info_flags + "()", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).InfoFlagsStr() : w.InfoFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E1) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E2) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E3) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E4) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E5, "E5 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E5) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E6, "E6 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E6) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E7, "E7 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E7) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E8, "E8 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E8) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E9, "E9 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E9) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E10, "E10 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E10) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E11, "E11 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E11) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E12, "E12 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E12) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E13, "E13 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E13) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E14) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E15) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E16) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E21) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E25, "E25 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E25) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E26, "E26 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E26) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E27, "E27 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E27) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E28, "E28 ()", Quantity.Boolean, ItemCategory.MeterResult, (w, t, u, f, p) => ((w.ErrorFlags & (int)ErrorFlagMask.E28) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPartStr, "Test part str.", Quantity.String, ItemCategory.TestResult, (w, t, u, f, p) => FormatEnum(f, (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).TestRslt.Part : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestDone, Strings.Test_done + "()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).TestDone)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPassed, Strings.Test_passed + "()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => FormatBool(f, (w.GetMeterTestRslt(t) != null) && w.GetMeterTestRslt(t).Passed)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlags, Strings.Error_flags + "()", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).ErrorFlagsStr() : w.ErrorFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.ErrorFlagsEx, Strings.Error_flags + "Ex", Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.ErrorFlagsStrEx())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.InfoFlags, Strings.Info_flags + "()", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => FormatStr(f, (w.GetTestRslt(t) != null) ? w.GetTestRslt(t).InfoFlagsStr() : w.InfoFlagsStr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E1, "E1 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E1) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E2, "E2 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E2) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E3, "E3 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E3) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E4, "E4 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E4) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E5, "E5 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E5) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E6, "E6 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E6) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E7, "E7 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E7) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E8, "E8 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E8) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E9, "E9 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E9) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E10, "E10 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E10) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E11, "E11 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E11) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E12, "E12 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E12) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E13, "E13 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E13) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E14, "E14 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E14) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E15, "E15 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E15) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E16, "E16 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E16) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E21, "E21 ()", Quantity.Boolean, ItemCategory.TestResult, (w,t,u,f,p) => (w.GetTestRslt(t) != null && (w.GetTestRslt(t).ErrorFlags & (int)ErrorFlagMask.E21) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E25, "E25 ()", Quantity.Boolean, ItemCategory.MeterResult, (w,t,u,f,p) => ((w.ErrorFlags & (int)ErrorFlagMask.E25) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E26, "E26 ()", Quantity.Boolean, ItemCategory.MeterResult, (w,t,u,f,p) => ((w.ErrorFlags & (int)ErrorFlagMask.E26) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E27, "E27 ()", Quantity.Boolean, ItemCategory.MeterResult, (w,t,u,f,p) => ((w.ErrorFlags & (int)ErrorFlagMask.E27) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.E28, "E28 ()", Quantity.Boolean, ItemCategory.MeterResult, (w,t,u,f,p) => ((w.ErrorFlags & (int)ErrorFlagMask.E28) != 0) ? Strings.Yes : Strings.No));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TestPartStr, "Test part str.", Quantity.String, ItemCategory.TestResult, (w,t,u,f,p) => FormatEnum(f, (w.GetMeterTestRslt(t) != null) ? w.GetMeterTestRslt(t).TestRslt.Part : 0)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WMRemark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_row_nr, "Table row #", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? TableRowNr.ToString() : string.Format(f, TableRowNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Table_column_nr, "Table column #", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => string.IsNullOrEmpty(f) ? TableColumnNr.ToString() : string.Format(f, TableColumnNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.WMRemark, string.Format("{0} {1}", Strings.Water_Meter, Strings.Remark), Quantity.String, ItemCategory.MeterResult, (w,t,u,f,p) => FormatStr(f, w.Remark)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Counter1,
string.Format(Strings.Counter_0, 1),
Quantity.Number,
ItemCategory.Other,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return (w.GetTestRslt(t) != null) ? FormatInt(f, w.GetTestRslt(t).Counter1) : string.Empty;
}));
@@ -510,7 +504,7 @@ namespace Results
string.Format(Strings.Counter_0, 2),
Quantity.Number,
ItemCategory.Other,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return (w.GetTestRslt(t) != null) ? FormatInt(f, w.GetTestRslt(t).Counter2) : string.Empty;
}));
@@ -519,7 +513,7 @@ namespace Results
string.Format(Strings.Counter_0, 3),
Quantity.Number,
ItemCategory.Other,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return (w.GetTestRslt(t) != null) ? FormatInt(f, w.GetTestRslt(t).Counter3) : string.Empty;
}));
@@ -528,7 +522,7 @@ namespace Results
string.Format(Strings.Counter_0, 4),
Quantity.Number,
ItemCategory.Other,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return (w.GetTestRslt(t) != null) ? FormatInt(f, w.GetTestRslt(t).Counter4) : string.Empty;
}));
@@ -537,7 +531,7 @@ namespace Results
string.Format(Strings.Counter_0, 5),
Quantity.Number,
ItemCategory.Other,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return (w.GetTestRslt(t) != null) ? FormatInt(f, w.GetTestRslt(t).Counter5) : string.Empty;
}));
@@ -546,7 +540,7 @@ namespace Results
string.Format(Strings.Counter_0, 6),
Quantity.Number,
ItemCategory.TestResult,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return FormatInt(f, w.Batch.Counter6);
}));
@@ -555,7 +549,7 @@ namespace Results
string.Format(Strings.Counter_0, 7),
Quantity.Number,
ItemCategory.TestResult,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return FormatInt(f, w.Batch.Counter7);
}));
@@ -564,7 +558,7 @@ namespace Results
string.Format(Strings.Counter_0, 8),
Quantity.Number,
ItemCategory.TestResult,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return FormatInt(f, w.Batch.Counter8);
}));
@@ -573,7 +567,7 @@ namespace Results
string.Format(Strings.Counter_0, 9),
Quantity.Number,
ItemCategory.TestResult,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return FormatInt(f, w.Batch.Counter9);
}));
@@ -582,7 +576,7 @@ namespace Results
string.Format(Strings.Counter_0, 10),
Quantity.Number,
ItemCategory.TestResult,
(w, t, u, f, p) =>
(w,t,u,f,p) =>
{
return FormatInt(f, w.Batch.Counter10);
}));
+2 -1
View File
@@ -663,7 +663,8 @@ namespace SchematicDrawing
if (dshape.Shape == Shape.Scale)
{
Rectangle r = dshape.GetRotatedFlippedImageRectangle(item);
int level = (int)Math.Round((r.Height - 2) * Math.Max(0, Math.Min(msrdVal, itm.MsrdValLimHi)) / itm.MsrdValLimHi);
int level = (int)Math.Round((r.Height - 2)
* Math.Max(0, Math.Min(measuredValues[msrdValIx], itm.MsrdValLimHi)) / itm.MsrdValLimHi);
e.Graphics.FillRectangle(brushWater, r.X + 2, r.Y + r.Height - 2 - level, r.Width - 4, level);
}
+2 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -43,8 +43,7 @@ namespace SharedDatabase.Entities
public virtual DateTime StartTime() { return TestRslt.StartTime; }
public virtual DateTime EndTime() { return TestRslt.EndTime; }
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; } /// [s]
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
public virtual double Flow() { return TestRslt.Flow; } /// [m3/h]
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; } /// [%]
public virtual double DensityLine() { return TestRslt.DensityLine; }
public virtual Components Components(){ return TestRslt.Components; }
+41 -44
View File
@@ -26,10 +26,10 @@ namespace SharedDatabase.Entities
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double ErrLimMargin { get; set; } /// [%] makes error limits tighter: 0 <= ErrLimMargin <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual string TempControl { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
@@ -45,22 +45,22 @@ namespace SharedDatabase.Entities
public TestData(Config.Entities.Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qtg = (double)test.Qtg;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TestTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
ErrLimMargin = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
Name = test.Name;
Repeats = test.Repeats;
Qtg = test.Qtg;
Qfrom = test.Qfrom;
Qto = test.Qto;
TargetVolume = test.Volume;
TargetTime = test.TestTime;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
ErrLimMargin = test.Uncertainty;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
TempControl = test.TempControl;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
}
/// <summary>
@@ -68,22 +68,22 @@ namespace SharedDatabase.Entities
/// </summary>
public TestData(TestData oriTestData)
{
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
DoControlWaterTemp = oriTestData.DoControlWaterTemp;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
TempControl = oriTestData.TempControl;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
}
@@ -105,13 +105,10 @@ namespace SharedDatabase.Entities
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (ErrLimMargin != td.ErrLimMargin) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
}
if (Publish != td.Publish) return false;
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
if (TempControl != td.TempControl) return false;
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
return true;
@@ -150,9 +147,9 @@ namespace SharedDatabase.Entities
writer.Write(ErrLimLo);
writer.Write(ErrLimHi);
writer.Write(ErrLimMargin);
writer.Write(DoControlWaterTemp);
writer.Write(TempLimLo);
writer.Write(TempLimHi);
writer.Write(TempControl);
writer.Write(Publish);
writer.Write(Evaluate);
}
@@ -171,9 +168,9 @@ namespace SharedDatabase.Entities
ErrLimLo = reader.ReadDouble();
ErrLimHi = reader.ReadDouble();
ErrLimMargin = reader.ReadDouble();
DoControlWaterTemp = reader.ReadBoolean();
TempLimLo = reader.ReadSingle();
TempLimHi = reader.ReadSingle();
TempControl = reader.ReadString();
Publish = reader.ReadSByte();
Evaluate = reader.ReadBoolean();
}
+10 -10
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -43,8 +43,8 @@ namespace SharedDatabase.Entities
public virtual double DensityLine { get; set; } /// [kg/m3]
public virtual double DensityDiv { get; set; } /// [kg/m3]
public virtual double MassOfEvapWater { get; set; } /// [kg]
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual double FlowVolume { get; set; } /// [m3/h]
public virtual double SpareDbl { get; set; }
public virtual double Flow { get; set; } /// [m3/h] calculated from conventional true value
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
@@ -276,8 +276,8 @@ namespace SharedDatabase.Entities
DensityLine = src.DensityLine;
DensityDiv = src.DensityDiv;
MassOfEvapWater = src.MassOfEvapWater;
FlowMass = src.FlowMass;
FlowVolume = src.FlowVolume;
SpareDbl = src.SpareDbl;
Flow = src.Flow;
VolumeCTV = src.VolumeCTV;
VolumeMaster = src.VolumeMaster;
ErrorMaster = src.ErrorMaster;
@@ -414,7 +414,7 @@ namespace SharedDatabase.Entities
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} MassOfEvapWaater={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} DiverterStart={85} DiverterEnd={86} ErrorFlags={23} InfoFlags={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
DensityIn, DensityLine, DensityDiv, MassOfEvapWater, FlowMass, FlowVolume,
DensityIn, DensityLine, DensityDiv, MassOfEvapWater, SpareDbl, Flow,
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags,
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
@@ -483,8 +483,8 @@ namespace SharedDatabase.Entities
writer.Write(DensityLine);
writer.Write(DensityDiv);
writer.Write(MassOfEvapWater);
writer.Write(FlowMass);
writer.Write(FlowVolume);
writer.Write(SpareDbl);
writer.Write(Flow);
writer.Write(VolumeCTV);
writer.Write(VolumeMaster);
writer.Write(ErrorMaster);
@@ -624,8 +624,8 @@ namespace SharedDatabase.Entities
DensityLine = reader.ReadDouble();
DensityDiv = reader.ReadDouble();
MassOfEvapWater = reader.ReadDouble();
FlowMass = reader.ReadDouble();
FlowVolume = reader.ReadDouble();
SpareDbl = reader.ReadDouble();
Flow = reader.ReadDouble();
VolumeCTV = reader.ReadDouble();
VolumeMaster = reader.ReadDouble();
ErrorMaster = reader.ReadDouble();
+5 -6
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
@@ -38,11 +38,10 @@ namespace SharedDatabase.Mappings
Map(x => x.DensityIn);
Map(x => x.DensityLine);
Map(x => x.DensityDiv);
Map(x => x.MassOfEvapWater)
.Column("Buoyancy");
Map(x => x.FlowMass);
Map(x => x.FlowVolume);
Map(x => x.VolumeCTV);
Map(x => x.MassOfEvapWater).Column("Buoyancy");
Map(x => x.SpareDbl).Column("FlowMass");
Map(x => x.Flow).Column("FlowVolume");
Map(x => x.VolumeCTV);
Map(x => x.VolumeMaster);
Map(x => x.ErrorMaster);
Map(x => x.DiverterStart);
+39 -13
View File
@@ -40,6 +40,8 @@ namespace TBF
public const string LocalSettingsBackupName = "config.backup.xml";
public static System.Globalization.CultureInfo AltCulture;
static IList<Procedure> listOfProcedures;
/// <summary>
/// Selected procedure data
@@ -360,12 +362,42 @@ namespace TBF
///
/// Connect to Config database.
/// This triggers an exception in case user is a power user and there is no Config database.
///
IList<Procedure> listOfProcedures = TBF.DB.CreateSession(DBKind.Config)
.QueryOver<Procedure>()
.Where(x => (x.ProcedureState == ProcedureState.Active))
.And(x => (x.Name == LocalSettings.LastProcedureName))
.List();
///
ISession session = TBF.DB.CreateSession(DBKind.Config);
if (!string.IsNullOrEmpty(LocalSettings.LastProcedureName))
{
listOfProcedures = session.QueryOver<Procedure>()
.Where(x => (x.ProcedureState == ProcedureState.Active))
.And(x => (x.Name == LocalSettings.LastProcedureName))
.List();
}
/// Search for 'BenchInfo' component
var components = session.QueryOver<Config.Entities.Component>()
.Where(x => x.ClassName == "DataContainer.BenchInfo")
.List();
if (components.Count > 0)
{
var cfg = new TBF.Rig.DataContainer.BenchInfo.Factory().CmpntCfgFromCmpntEntity(components[0])
as TBF.Rig.DataContainer.BenchInfo.ComponentCfg;
TBF.Data.SetData(cfg.WaterMetersCount, cfg.CompoundMetersCount, cfg.LinesCount);
}
else
{
/// Search for 'iPerlBenchInfo' component
components = session.QueryOver<Config.Entities.Component>()
.Where(x => x.ClassName == "DataContainer.iPerlBenchInfo")
.List();
if (components.Count > 0)
{
var cfg = new TBF.Rig.DataContainer.iPerlBenchInfo.Factory().CmpntCfgFromCmpntEntity(components[0])
as TBF.Rig.DataContainer.iPerlBenchInfo.ComponentCfg;
TBF.Data.SetData(cfg.WaterMetersCount, cfg.CompoundMetersCount, cfg.LinesCount);
}
}
session.Close();
///
/// Connect to Results database and determine the last saved batch number.
@@ -447,13 +479,7 @@ namespace TBF
///
if (LocalSettings.LastProcedureName != null)
{
IList<Procedure> listOfProcedures = TBF.DB.CreateSession(DBKind.Config)
.QueryOver<Procedure>()
.Where(x => (x.ProcedureState == ProcedureState.Active))
.And(x => (x.Name == LocalSettings.LastProcedureName))
.List();
if (listOfProcedures.Count == 1)
if (listOfProcedures != null && listOfProcedures.Count == 1)
{
log.InfoFormat("Pre-selecting the procedure {0}", LocalSettings.LastProcedureName);
SelectedProcedure = listOfProcedures[0];
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sensus")]
[assembly: AssemblyProduct("TestBenchFramework")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2021 Sensus Slovensko, a.s.")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2022 Sensus Slovensko, a.s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.1.1896.0")]
[assembly: AssemblyFileVersion("3.1.1896.0")]
[assembly: AssemblyVersion("3.2.1912.0")]
[assembly: AssemblyFileVersion("3.2.1912.0")]
+1 -1
View File
@@ -1105,7 +1105,7 @@ namespace TBF.Resources {
}
/// <summary>
/// Looks up a localized string similar to Control water temp..
/// Looks up a localized string similar to Water temp. control.
/// </summary>
internal static string Control_water_temp_chdr {
get {
+1 -1
View File
@@ -1733,7 +1733,7 @@
<value>Save</value>
</data>
<data name="Control_water_temp_chdr" xml:space="preserve">
<value>Control water temp.</value>
<value>Water temp. control</value>
</data>
<data name="Temp_lim_hi_chdr" xml:space="preserve">
<value>Temp. lim. hi</value>
+19
View File
@@ -0,0 +1,19 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System;
using Common;
namespace TBF.Rig.ControlBoard
{
public enum Activity
{
[Description("Idle")] Idle,
[Description("Setting flow")] SettingFlow,
[Description("Flying start/stop test")] FlyingStartStopTest,
[Description("Flying start/stop test with div.")] FlyingStartStopTestWithDiverter,
[Description("Standing start/stop test")] StandingStartStopTest,
[Description("Test completed")] TestCompleted,
Count
}
}
+7 -1
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2021-2022 Sensus Slovensko a.s.
///
using System;
using Config.Entities;
using Dirichlet.Numerics;
using TBF.Boxes;
@@ -16,6 +19,9 @@ namespace TBF.Rig.ControlBoard
/// </summary>
void ClearProcessValues();
Activity Activity { get; } /// Control board activity
void SetActivity(Activity a);
///
/// Values valid always
///
+9 -1
View File
@@ -42,6 +42,10 @@ namespace TBF.Rig.ControlBoard.Papouch
OutputPath devices;
public Activity Activity { get { return activity; } } /// Control board activity
Activity activity;
public void SetActivity(Activity a) { activity = a; }
enum SelectedOp
{
@@ -338,7 +342,11 @@ namespace TBF.Rig.ControlBoard.Papouch
/// <summary>
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
/// </summary>
public void ClearProcessValues() { }
public void ClearProcessValues()
{
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
SetActivity(Activity.Idle);
}
/// <summary>
/// Set valves to new positions.
@@ -24,7 +24,7 @@ namespace TBF.Rig.ControlBoard.Uni
readonly Statistics divStartPlotter;
readonly Statistics divStopPlotter;
readonly TBF.Rig.Uni.RegValve.RegValve regV;
readonly TBF.Rig.Uni.FlowMeter.FlowMeter flowMeter;
readonly TBF.Rig.GenericDevices.IFlowMeter flowMeter;
readonly TBF.Rig.Uni.Diverter.Diverter diverter;
/// <summary>
@@ -63,7 +63,7 @@ namespace TBF.Rig.ControlBoard.Uni
this.divStartPlotter = divStartPlotter;
this.divStopPlotter = divStopPlotter;
flowMeter = devices.FlowMeter as TBF.Rig.Uni.FlowMeter.FlowMeter;
flowMeter = devices.FlowMeter;
if (flowMeter == null) throw new ArgumentNullException("Invalid flow meter");
regV = devices.RegValve as TBF.Rig.Uni.RegValve.RegValve;
@@ -96,6 +96,7 @@ namespace TBF.Rig.ControlBoard.Uni
regV.Idx1, flowMeter.Idx1, (diverter != null) ? diverter.DiverterNr : 0, qFrom, qTo);
/// Start the test (and the flow measurement)
uniCB.SetActivity((diverter != null) ? Activity.FlyingStartStopTestWithDiverter : Activity.FlyingStartStopTest);
uniCB.StartTest(false, flowMeter.Idx1, (diverter != null) ? diverter.DiverterNr : 0, (diverter != null) ? diverter.StartThreshold : 0,
true, withDiverter, false, isProlonged, pulsesCount, massPulsesCount);
@@ -144,8 +145,8 @@ namespace TBF.Rig.ControlBoard.Uni
double reqFlowLo = (0.7 * qFrom) + (0.3 * reqFlowAve); /// Move the lower limit 15% of the range up
double reqFlowHi = (0.7 * qTo) + (0.3 * reqFlowAve); /// Move the upper limit 15% of the range down
///
uniCB.SetFlow(false, regV.Idx1, 2000 * reqFlowLo / flowMeter.NominalFlow,
2000 * reqFlowHi / flowMeter.NominalFlow);
uniCB.SetFlow(false, regV.Idx1, 2000.0 * reqFlowLo / flowMeter.NominalFlow,
2000.0 * reqFlowHi / flowMeter.NominalFlow);
if (readDivTransition)
{
/// Schedule reading diverter transition data
@@ -212,6 +213,7 @@ namespace TBF.Rig.ControlBoard.Uni
public void Stop()
{
log.Info("Op.Stop()");
uniCB.SetActivity((opState == OpState.TestCompleted) ? Activity.TestCompleted : Activity.Idle);
uniCB.StopAll(false);
}
}
@@ -74,6 +74,7 @@ namespace TBF.Rig.ControlBoard.Uni
log.InfoFormat("Start() Et#={0} pulses={1} withDiverter={2}", flowMeter.Idx1, pulsesCount, withDiverter);
/// Start the test (and the flow measurement)
uniCB.SetActivity(Activity.StandingStartStopTest);
uniCB.StartTest(false, flowMeter.Idx1, (withDiverter ? diverter.DiverterNr : 0), 0,
false, withDiverter, true, false, pulsesCount);
@@ -122,6 +123,7 @@ namespace TBF.Rig.ControlBoard.Uni
public void Stop()
{
log.Info("Stop()");
uniCB.SetActivity((opState == OpState.TestCompleted) ? Activity.TestCompleted : Activity.Idle);
uniCB.StopAll(false);
}
}
+11 -3
View File
@@ -82,7 +82,11 @@ namespace TBF.Rig.ControlBoard.Uni
ScopeAnalyzerData scopeAnalyzerData;
SwitchCountersData switchCounterData;
public UInt64 State { get { return Data.State; } } /// Control board state
public UInt64 State { get { return Data.State; } } /// Control board state
public Activity Activity { get { return activity; } } /// Control board activity
Activity activity;
public void SetActivity(Activity a) { activity = a; }
/// Quido RS
TBF.Rig.Modbus.QuidoRS.QuidoRS quidoRS;
@@ -90,7 +94,7 @@ namespace TBF.Rig.ControlBoard.Uni
/// Current flow meter ID
public int FlowmeterId { get { return Convert.ToInt32(Data.State & (ulong)StatusP.FlowmtrNrMask); } }
public UInt64 DigitalInputs { get { return Data.Vstupy; } } /// Digital inputs
public UInt64 DigitalInputs { get { return Data.Vstupy; } } /// Digital inputs
public Int16 AnalogInput(int channel)
{
@@ -601,7 +605,11 @@ namespace TBF.Rig.ControlBoard.Uni
///
/// Interface functions
///
public void ClearProcessValues() { } /// Called from ProcessData.ClearProcessValues() at the beginning of each test
public void ClearProcessValues()
{
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
SetActivity(Activity.Idle);
}
public double TestTimeWM(int wmNr1)
{
@@ -146,6 +146,9 @@ namespace TBF.Rig.DataEntry.Double24
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
{
comboBoxes[i].Items.Add((Program.LocalSettings.LastSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastSNTexts[i]);
}
if (Program.LocalSettings.LastAuxSNTextsCount == textBoxesCount)
{
column2ComboBoxes[i].Items.Add((Program.LocalSettings.LastAuxSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastAuxSNTexts[i]);
}
+1 -1
View File
@@ -22,7 +22,7 @@ namespace TBF.Rig.Dummy.FlowMeter
public IDrawingItem DrawingItem { get { return flowMeterCfg as IDrawingItem; } }
public double LtrPerPulseCorrected(double flow, int rangeIx)
public double LtrPerPulseCorrected(double flow, float temperature)
{
return flow;
}
+37
View File
@@ -0,0 +1,37 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.Rig.GenericDevices;
using TBF.Boxes;
namespace TBF.Rig.Dummy.TempControl
{
public class Component : ComponentBase, ITempControl
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
public bool MsrmntAvailable { get { return true; } }
public double MeasuredVal { get { return ReadTemperature(); } }
public double MsrdValLimLo { get { return 5.0; } }
public double MsrdValLimHi { get { return 95.0; } }
public string MsrdFormat { get { return "{0:F1} C"; } }
public Common.Unit MsrdUnit { get { return Common.Unit.C; } }
public string AltString { get { return string.Empty; } }
public Component() { }
public Component(Generic.IComponentCfg cfg) : base(cfg) { log.FatalFormat("{0} initialized: {1}", Name, this); }
public override void Initialize() { }
public double ReadTemperature() { return 25.0; }
public bool SetTemperatureSetpoint(double reqTempC) { return true; }
public IOperation ReadTempOp(ref DoubleBox temp) { return null; }
public IOperation ReadTempOp(ref DoubleBox temp, Event tempDone) { return null; }
public IOperation SetTemperatureSetpointOp(double temperature) { return null; }
}
}
+26
View File
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
using TBF.Rig.Configs.NameOnly;
namespace TBF.Rig.Dummy.TempControl
{
public class Factory : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(GetType().Namespace.Substring(14), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}
+14 -13
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
@@ -13,15 +13,9 @@ namespace TBF.Rig.GenericDevices
public interface IFlowMeter : IComponent
{
/// <summary>
/// Nominal flow in m3/h at the nominal output frequency (see below).
/// In case of a flowmeter couple, the sum of two nominal flows (reached at sum of nominal freq.).
/// Reference flow meter communicated to the board: 1-based index, 0 for parallel flow meters
/// </summary>
double NominalFlow { get; }
/// <summary>
/// Nominal frequency in Hz.
/// </summary>
double NominalFreq { get; }
int Idx1 { get; }
/// <summary>
/// Nominal (uncorrected) volume per flowmeter pulse in [l].
@@ -32,12 +26,19 @@ namespace TBF.Rig.GenericDevices
/// Corrected volume per flowmeter pulse in [l].
/// </summary>
/// <param name="flow">Water flow in [m3/h]</param>
double LtrPerPulseCorrected(double flow, int rangeIx);
/// <param name="temperature">Water temperature in [°C]</param>
double LtrPerPulseCorrected(double flow, float temperature);
/// <summary>
/// Reference flow meter communicated to the board: 1-based index, 0 for flow meter twins
/// Nominal flow in m3/h at the nominal output frequency (see below).
/// In case of a flowmeter couple, the sum of two nominal flows (reached at sum of nominal freq.).
/// </summary>
int Idx1 { get; }
double NominalFlow { get; }
/// <summary>
/// Nominal frequency in Hz.
/// </summary>
double NominalFreq { get; }
/// <summary>
/// Returns current flow value in [m3/h]
@@ -51,7 +52,7 @@ namespace TBF.Rig.GenericDevices
/// <returns>Frequency in Hz</returns>
double ReadFrequency();
/// <summary>
/// <summary>
/// Events: FlowDone, Error
/// </summary>
/// <param name="flow">Reference to a variable for the measured flow in xxx</param>
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
namespace TBF.Rig.GenericDevices
{
public interface IFlowMeterSingle : IFlowMeter
{
/// <summary>
/// Determine flow meter range
/// </summary>
/// <param name="tempRngLo">Lower boundary of temperature</param>
/// <param name="tempRngHi">Upper boundary of temperature</param>
/// <returns>flow meter range (0..5) or -1 if no range fits the specified temperature range</returns>
int GetRange(float tempRngLo, float tempRngHi);
/// <summary>
/// Apply flow measurement correction
/// </summary>
/// <param name="flow">Measured flow in [m3/h]</param>
/// <param name="rng">Tange 0..5</param>
/// <returns>Corrected flow in [m3/h]</returns>
double CorrectedFlow(double flow, int rng);
}
}
+19
View File
@@ -0,0 +1,19 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System;
namespace TBF.Rig.GenericDevices
{
public interface ITempControl : ITempMeter
{
/// <summary>
/// Set temperature controller setpoint to specified value in °C
/// </summary>
/// <param name="reqTempC">Temperature in °C</param>
/// <returns>true = OK, false = any error</returns>
bool SetTemperatureSetpoint(double temperatureC);
IOperation SetTemperatureSetpointOp(double temperatureC);
}
}
+5 -5
View File
@@ -334,11 +334,11 @@ namespace TBF.Rig.Modbus.TankSelector
AddCondition(Strings.Select_WARM_tank, createOps, new SelectTankOp(this, TankId.Warm));
AddCondition(Strings.Select_HOT_tank, createOps, new SelectTankOp(this, TankId.Hot));
AddCondition(Strings.Unselect_current_tank, createOps, new UnselectTankOp(this));
AddCondition(Strings.Set_hot_water_heating_temperature, createOps, hotHeating.SetRequiredTemperatureOp());
AddCondition(Strings.Set_hot_water_cooling_temperature, createOps, hotCooling.SetRequiredTemperatureOp());
AddCondition(Strings.Set_warm_water_heating_temperature, createOps, warmHeating.SetRequiredTemperatureOp());
AddCondition(Strings.Set_warm_water_cooling_temperature, createOps, warmCooling.SetRequiredTemperatureOp());
AddCondition(Strings.Set_cold_water_cooling_temperature, createOps, coldCooling.SetRequiredTemperatureOp());
//AddCondition(Strings.Set_hot_water_heating_temperature, createOps, hotHeating.SetRequiredTemperatureOp());
//AddCondition(Strings.Set_hot_water_cooling_temperature, createOps, hotCooling.SetRequiredTemperatureOp());
//AddCondition(Strings.Set_warm_water_heating_temperature, createOps, warmHeating.SetRequiredTemperatureOp());
//AddCondition(Strings.Set_warm_water_cooling_temperature, createOps, warmCooling.SetRequiredTemperatureOp());
//AddCondition(Strings.Set_cold_water_cooling_temperature, createOps, coldCooling.SetRequiredTemperatureOp());
AddCondition("Start heating hot water", createOps, new SetQuidoBitOp(quidoRS, QuidoOutputs.HeatingHotTank, true));
AddCondition("Stop heating hot water", createOps, new SetQuidoBitOp(quidoRS, QuidoOutputs.HeatingHotTank, false));
AddCondition("Start cooling hot water", createOps, new SetQuidoBitOp(quidoRS, QuidoOutputs.CoolingHotTank, true));
+133 -106
View File
@@ -5,136 +5,163 @@ using System.IO;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.Generic;
using TBF.Rig.Sequences;
namespace TBF.Rig.Modbus.TempControl.Easytherm
{
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public float RequiredTemp; /// [°C] target temperature for a temperature controller or 0=not communicated to the controller
public double Temp_A; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_B; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_C; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_D; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_E; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public override void InitializeAll()
public override void InitializeAll()
{
Temp_A = 10.0;
Temp_B = 20.0;
Temp_C = 30.0;
Temp_D = 40.0;
Temp_E = 50.0;
}
string[] paramNames = new string[]
{
RequiredTemp = 0.0f;
}
string[] paramNames = new string[]
{
Strings.Required_temperature_C,
string.Format("{0} A [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} B [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} C [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} D [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} E [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override string ToString(int i)
{
switch (i)
{
case 0: return (RequiredTemp == 0) ? "---" : RequiredTemp.ToString();
default: return string.Empty;
}
}
public override string ToString(int i)
{
switch (i)
{
case 0: return (Temp_A == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_A).ToString();
case 1: return (Temp_B == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_B).ToString();
case 2: return (Temp_C == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_C).ToString();
case 3: return (Temp_D == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_D).ToString();
case 4: return (Temp_E == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_E).ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
public CfgUpdateFlags UpdateParam(int i, string str)
{
bool isDash = (str == "-" || str == "--" || str == "---");
switch (i)
{
case 0:
if (strValue == "-" || strValue == "--" || strValue == "---")
{
RequiredTemp = 0;
}
else
{
RequiredTemp = Utils.ParseUFloat(strValue);
}
Temp_A = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
default:
case 1:
Temp_B = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
}
}
case 2:
Temp_C = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
case 3:
Temp_D = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
case 4:
Temp_E = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
default:
return CfgUpdateFlags.None;
}
}
/// <summary>
/// Verifiy the string representation of the parameter
/// </summary>
/// <param name="i">Parameter ID</param>
/// <param name="strValue">String representation of the parameter</param>
/// <param name="message">In case false is returned this is the error messsage to be displayed</param>
/// <returns>true = parameter OK, false = parameter NOK</returns>
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
/// <summary>
/// Verifiy the string representation of the parameter
/// </summary>
/// <param name="i">Parameter ID</param>
/// <param name="str">String representation of the parameter</param>
/// <param name="message">In case false is returned this is the error messsage to be displayed</param>
/// <returns>true = parameter OK, false = parameter NOK</returns>
public bool ValidateParam(int i, string str, out string message)
{
message = string.Empty;
float temp;
switch (i)
{
case 0: /// T_hot_heating
if (strValue == "-" || strValue == "--" || strValue == "---" ||
(Utils.TryParseUFloat(strValue, out temp) && (temp == 0 || (temp >= 5 && temp <= 95.0f))))
{
return true;
}
double ddummy;
switch (i)
{
case 0: /// T_hot_heating
if (str == "-" || str == "--" || str == "---" ||
(Utils.TryParseUDouble(str, out ddummy) && (ddummy == 0 || (ddummy >= 5 && ddummy <= 95.0))))
{
return true;
}
break;
default:
message = "Invalid index";
return false;
}
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ProcParams prms)
{
prms.RequiredTemp = this.RequiredTemp;
}
void CopyContentTo(ProcParams prms)
{
prms.Temp_A = Temp_A;
prms.Temp_B = Temp_B;
prms.Temp_C = Temp_C;
prms.Temp_D = Temp_D;
prms.Temp_E = Temp_E;
}
public IParamsProvider Clone()
{
ProcParams pars = new ProcParams();
CopyContentTo(pars);
return pars;
}
public IParamsProvider Clone()
{
ProcParams pars = new ProcParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcParams;
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcParams;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
/// <summary>
/// Parameterless constructor initializes the parameters
/// </summary>
public ProcParams()
{
}
/// <summary>
/// Parameterless constructor initializes the parameters
/// </summary>
public ProcParams()
{
}
public ProcParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcParams(ComponentProcedure procParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
public ProcParams(ComponentProcedure procParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
@@ -7,14 +7,15 @@ using TBF.Boxes;
namespace TBF.Rig.Modbus.TempControl.Easytherm
{
public class SetRequiredTemperatureOp : IOperation
public class SetTemperatureSetpointOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(SetRequiredTemperatureOp));
public override string ToString() { return string.Format("SetRequiredTemperatureOp({0})", eventDone); }
private static readonly ILog log = LogManager.GetLogger(typeof(SetTemperatureSetpointOp));
public override string ToString() { return string.Format("SetTemperatureSetpointOp({0})", eventDone); }
/// Set by the constructor
readonly TControl easytherm;
readonly Event eventDone;
readonly double temperature;
readonly Event eventDone;
/// <summary>
/// Events: PressureInDone, PressureOutDone or Error
@@ -22,23 +23,24 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
/// <param name="easytherm">Pressure meter reference</param>
/// <param name="pressure">Reference to the measured pressure variable, value is in bar</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public SetRequiredTemperatureOp(TControl easytherm, Event eventDone)
public SetTemperatureSetpointOp(TControl easytherm, double temperature, Event eventDone)
{
if (easytherm == null) throw new ArgumentNullException("easytherm");
this.easytherm = easytherm;
this.temperature = temperature;
this.eventDone = eventDone;
log.Debug(this.ToString());
}
public SetRequiredTemperatureOp(TControl easytherm)
: this(easytherm, Event.ConditionMet)
public SetTemperatureSetpointOp(TControl easytherm, double temperature)
: this(easytherm, temperature, Event.ConditionMet)
{
}
/// <summary>Start this operation</summary>
public void Start()
{
easytherm.SetTemperatureSetpoint();
easytherm.SetTemperatureSetpoint(temperature);
}
/// <summary>Run this operation</summary>
+155 -56
View File
@@ -6,17 +6,20 @@ using System.Collections.Generic;
using log4net;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using SchematicDrawing;
using TBF.Rig.GenericDevices;
using TBF.Boxes;
namespace TBF.Rig.Modbus.TempControl.Easytherm
{
public class TControl : ComponentBase, IDevice, ITempControl
{
public class TControl : ComponentBase, Generic.IDevice, ITempControl, ISequenceCondition,
IDrawingItCmpntWithSetpoint, IDrawingItCmpntWithMeasuredVal, IDrawingItCmpntWithCustomBmp
{
private static readonly ILog log = LogManager.GetLogger(typeof(TControl));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly TControlCfg easythermCfg;
public IDrawingItem DrawingItem { get { return easythermCfg as IDrawingItem; } }
Common.Modbus modbus;
int ticketNumber; /// 0 .. number of devices registered for regular polling - 1
@@ -29,11 +32,76 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
public string MsrdFormat { get { return easythermCfg.MsrdFormat; } }
public string AltString { get { return string.Empty; } }
private float temperatureSetPoint;
public double SetpointVal
{
get { return temperatureSetPoint; }
set { SetTemperatureSetpoint(value); }
}
///
public void IncreaseSetpoint()
{
double tempStepC = isFahrenheit ? Units.ConvertFrom(Unit.F, easythermCfg.SetpStep) : easythermCfg.SetpStep;
double newSetpoint;
if (easythermCfg.RoundToSetpStep)
{
double roundedSetpoint = tempStepC * Math.Round(temperatureSetPoint / tempStepC);
newSetpoint = (roundedSetpoint <= temperatureSetPoint) ? (roundedSetpoint + tempStepC) : roundedSetpoint;
}
else
{
newSetpoint = temperatureSetPoint + tempStepC;
}
SetTemperatureSetpoint(Math.Min(newSetpoint, 95.0));
}
///
public void DecreaseSetpoint()
{
double tempStepC = isFahrenheit ? Units.ConvertFrom(Unit.F, easythermCfg.SetpStep) : easythermCfg.SetpStep;
double newSetpoint;
if (easythermCfg.RoundToSetpStep)
{
double roundedSetpoint = tempStepC * Math.Round(temperatureSetPoint / tempStepC);
newSetpoint = (roundedSetpoint >= temperatureSetPoint) ? (roundedSetpoint - tempStepC) : roundedSetpoint;
}
else
{
newSetpoint = temperatureSetPoint - tempStepC;
}
SetTemperatureSetpoint(Math.Max(newSetpoint, 5.0));
}
public DrawingShape GetCustomBitmap()
{
switch (easythermCfg.Sz)
{
case Sz.S:
return isHeating ? (isCooling ? TControlCfg.DSBothS : TControlCfg.DSHeatingS)
: (isCooling ? TControlCfg.DSCoolingS : TControlCfg.DSIdleS);
case Sz.M:
return isHeating ? (isCooling ? TControlCfg.DSBothM : TControlCfg.DSHeatingM)
: (isCooling ? TControlCfg.DSCoolingM : TControlCfg.DSIdleM);
default:
case Sz.L:
return isHeating ? (isCooling ? TControlCfg.DSBothL : TControlCfg.DSHeatingL)
: (isCooling ? TControlCfg.DSCoolingL : TControlCfg.DSIdleL);
case Sz.XL:
return isHeating ? (isCooling ? TControlCfg.DSBothXL : TControlCfg.DSHeatingXL)
: (isCooling ? TControlCfg.DSCoolingXL : TControlCfg.DSIdleXL);
}
}
private double temperatureSetPoint;
private bool temperatureSetPointValid;
private bool temperatureSetPointRequested;
double actualTemperature;
public float requiredTemp { get { return easythermCfg.ProcParams.RequiredTemp; } }
bool isHeating { get { return false; } } /// TODO: ??? Output x: Heating
bool isCooling { get { return false; } } /// TODO: ??? Output y: Cooling
bool isFahrenheit { get { return false; } }
public TControl() { }
@@ -42,7 +110,9 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
: base(cfg)
{
easythermCfg = cfg as TControlCfg;
}
CreateConditions(true);
}
/// <summary>Initialize this device</summary>
public override void Initialize()
@@ -66,7 +136,7 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
if (telegram.Length == 7 && telegram[1] == (byte)Function.ReadHoldingRegisters && telegram[2] == 2)
{
ushort value = (ushort)(256 * telegram[3] + telegram[4]);
temperatureSetPoint = (float)value * 0.04f;
temperatureSetPoint = Convert.ToDouble(value) * 0.04;
temperatureSetPointValid = true;
log.InfoFormat("{0} - Received current temperature setpoint = {1}", Name, temperatureSetPoint);
@@ -74,7 +144,7 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
else if (telegram.Length == 7 && telegram[1] == (byte)Function.ReadInputRegister && telegram[2] == 2)
{
ushort value = (ushort)(256 * telegram[3] + telegram[4]);
actualTemperature = (double)value * 0.04;
actualTemperature = Convert.ToDouble(value) * 0.04;
log.InfoFormat("{0} - Received actual temperature = {1}", Name, actualTemperature);
}
@@ -83,22 +153,24 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
public void RunDeviceAfter()
{
if (modbus.IsMyTurn(ticketNumber))
if (DebugLevel != DebugMode.Simulate && DebugLevel != DebugMode.FailureDuringOperation &&
modbus.IsMyTurn(ticketNumber))
{
if (!temperatureSetPointValid && !temperatureSetPointRequested)
{
RequestTemperatureSetpoint();
//RequestTemperatureSetpoint();
temperatureSetPointRequested = true;
}
else if (temperatureSetPointValid && requiredTemp != temperatureSetPoint)
{
SetTemperatureSetpoint(requiredTemp);
log.InfoFormat("{0} - Set new temperature setpoint = {1}", Name, requiredTemp);
}
else if (modbus.IsMyTurn(ticketNumber))
{
RequestActualTemperature();
}
/// TODO: ???
//else if (temperatureSetPointValid && requiredTemp != temperatureSetPoint)
//{
// SetTemperatureSetpoint(requiredTemp);
// log.InfoFormat("{0} - Set new temperature setpoint = {1}", Name, requiredTemp);
//}
//else if (modbus.IsMyTurn(ticketNumber))
//{
// RequestActualTemperature();
//}
}
}
@@ -106,52 +178,38 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
public void StopDevice2() { }
/// <summary>
/// Set Easytherm controller to required temperature procedure parameter
/// </summary>
/// <returns>true = OK, false = any error</returns>
public bool SetTemperatureSetpoint()
{
return SetTemperatureSetpoint(requiredTemp);
}
/// <summary>
/// Set Easytherm controller to specified temperature
/// </summary>
/// <param name="temperature">Temperature in °C</param>
/// <param name="temperatureC">Temperature in °C</param>
/// <returns>true = OK, false = any error</returns>
public bool SetTemperatureSetpoint(float temperature)
public bool SetTemperatureSetpoint(double temperatureC)
{
if (temperature != 0 && (temperature < 5 || temperature > 95.0f))
if (temperatureC != 0 && (temperatureC < 5.0 || temperatureC > 95.0))
{
return false; /// required temperature out of range
}
if (temperatureSetPointValid && (temperature == temperatureSetPoint))
if (temperatureSetPointValid && (temperatureC == temperatureSetPoint))
{
return true; /// already set to the required temperature
}
if (temperature != 0) /// temperature==0 disables sending the setpoint
if (temperatureC != 0) /// temperature==0 disables sending the setpoint
{
//ushort temperatureSetpoint = (ushort)temperature; // in °C
//ushort destAddress = (ushort)1002;
ushort usTempSetpoint = (ushort)((10000.0f / 400.0f) * temperature); // in 0.01% of range (400 °C)
ushort usTempSetpoint = (ushort)((10000.0f / 400.0f) * temperatureC); // in 0.01% of range (400 °C)
ushort destAddress = (ushort)2;
///
SendValueToEasytherm(Function.PresetSingleRegister, destAddress, usTempSetpoint);
}
temperatureSetPoint = temperature;
temperatureSetPoint = temperatureC;
temperatureSetPointValid = true;
return true;
}
public void RequestTemperatureSetpoint()
{
SendValueToEasytherm(Function.ReadHoldingRegisters, (ushort)2, (ushort)1); // rel.address=2, 1 word
}
public void RequestActualTemperature()
{
SendValueToEasytherm(Function.ReadInputRegister, (ushort)0, (ushort)1); // rel.address=x, 1 word
@@ -176,9 +234,6 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
///
/// Operations, etc.
///
double actualTemperature;
public double ReadTemperature()
{
return actualTemperature;
@@ -189,19 +244,9 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
/// Events: SetOpututsDone, Error
/// </summary>
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
public IOperation SetRequiredTemperatureOp()
public IOperation SetTemperatureSetpointOp(double temperature)
{
return new SetRequiredTemperatureOp(this);
}
/// <summary>
/// Events: SetOpututsDone, Error
/// </summary>
/// <param name="temperature">Reference to a variable for the pressure in Bar</param>
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
public IOperation SetTemperatureOp(float temperature)
{
return new SetTemperatureOp(this, temperature);
return new SetTemperatureSetpointOp(this, temperature);
}
public IOperation ReadTempOp(ref DoubleBox temp)
@@ -213,5 +258,59 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
{
return new ReadTempOp(this, ref temp, eventDone);
}
}
///
/// ISequenceCondition interface implementation (conditions in transition sequences)
///
IList<string> sequenceConditionNames;
IList<IOperation> sequenceConditions;
public int ConditionsCount { get { return sequenceConditions != null ? sequenceConditions.Count : 0; } }
/// Strings are added to the combo-box for transition sequence condition selection
public string ConditionName(int i)
{
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
return sequenceConditionNames[i];
else
return string.Empty;
}
/// Operations are executed as a part of a transition sequence
public IOperation ConditionOp(int i)
{
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
return sequenceConditions[i];
else
return null;
}
void ClearConditions()
{
sequenceConditionNames = new List<string>();
sequenceConditions = new List<IOperation>();
}
void AddCondition(string conditionName, bool createOperation, IOperation conditionOperation)
{
sequenceConditionNames.Add(conditionName);
if (createOperation) sequenceConditions.Add(conditionOperation);
}
/// <summary>
/// Create a list of conditions
/// </summary>
/// <param name="createOps">true = create names and condition operations, false = create names only</param>
void CreateConditions(bool createOps)
{
ClearConditions();
AddCondition("Set temperature setpoint A", createOps, SetTemperatureSetpointOp(easythermCfg.ProcParams.Temp_A));
AddCondition("Set temperature setpoint B", createOps, SetTemperatureSetpointOp(easythermCfg.ProcParams.Temp_B));
AddCondition("Set temperature setpoint C", createOps, SetTemperatureSetpointOp(easythermCfg.ProcParams.Temp_C));
AddCondition("Set temperature setpoint D", createOps, SetTemperatureSetpointOp(easythermCfg.ProcParams.Temp_D));
AddCondition("Set temperature setpoint E", createOps, SetTemperatureSetpointOp(easythermCfg.ProcParams.Temp_E));
}
}
}
@@ -8,12 +8,13 @@ using System.Xml.Serialization;
using Common;
using Config.Entities;
using SchematicDrawing;
using TBF.Resources;
using TBF.Rig.Generic;
namespace TBF.Rig.Modbus.TempControl.Easytherm
{
public class TControlCfg : ComponentCfgBase, IChildComponentCfg, IParamsProvider,
IDrawingItemWithSetpoint, IDrawingItemWithMeasuredVal
IDrawingItemWithSetpoint, IDrawingItemWithMeasuredVal, IDrawingItemWithCustomBmp
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TControlCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -52,6 +53,9 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
public string SetpFormat { get; set; } /// 3
public Unit SetpUnit { get; set; } /// 4
public double SetpStep { get; set; } /// 5
public bool RoundToSetpStep { get; set; } /// 6
[XmlIgnore]
public IList<GNode> GNodes { get; set; }
@@ -65,6 +69,7 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
/// Private parameterless constructor invoked by all other (public) constructors
TControlCfg()
{
ProcParams = new ProcParams(true);
GNodes = new List<GNode>();
}
@@ -72,7 +77,6 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
: this()
{
this.Factory = factory;
ProcParams = CreateProcParamsProvider() as ProcParams;
Name = "Novus";
ParentName = "Modbus";
@@ -94,6 +98,8 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
MsrdUnit = Unit.C;
SetpFormat = "{0:F1} °C";
SetpUnit = Unit.C;
SetpStep = 1.0;
RoundToSetpStep = true;
}
string[] paramNames = new string[]
@@ -103,6 +109,8 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
"Unit of measured temperature", /// 2
"Setpoint format", /// 3
"Unit of temperature setpoint", /// 4
"Setpoint step", /// 5
"Round to setpoint step", /// 6
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
@@ -114,6 +122,8 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
case 2:
case 4:
return new string[] { "°C", "°F", "K" };
case 6:
return new string[] { Strings.yes, Strings.no };
default:
return null;
}
@@ -129,6 +139,8 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
case 2: return (MsrdUnit == Unit.K) ? "K" : (MsrdUnit == Unit.F) ? "°F" : "°C";
case 3: return SetpFormat;
case 4: return (SetpUnit == Unit.K) ? "K" : (SetpUnit == Unit.F) ? "°F" : "°C";
case 5: return SetpStep.ToString();
case 6: return RoundToSetpStep ? Strings.yes : Strings.no;
default:
return string.Format("{0}({1}) address={2}", Name, string.IsNullOrEmpty(ParentName) ? "-" : ParentName, ModbusAddress);
}
@@ -142,11 +154,15 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
case 1: MsrdFormat = str; return CfgUpdateFlags.RestartRqrd;
case 2: MsrdUnit = (str == "°K" || str == "K") ? Unit.K
: (str == "°F" || str == "F") ? Unit.F
: Unit.C; return CfgUpdateFlags.RestartRqrd;
: Unit.C;
return CfgUpdateFlags.RestartRqrd;
case 3: SetpFormat = str; return CfgUpdateFlags.RestartRqrd;
case 4: SetpUnit = (str == "°K" || str == "K") ? Unit.K
: (str == "°F" || str == "F") ? Unit.F
: Unit.C; return CfgUpdateFlags.RestartRqrd;
: Unit.C;
return CfgUpdateFlags.RestartRqrd;
case 5: SetpStep = Utils.ParseUDouble(str); return CfgUpdateFlags.RestartRqrd;
case 6: RoundToSetpStep = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
@@ -155,6 +171,7 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
{
message = string.Empty;
int idummy;
double ddummy;
switch (i)
{
@@ -168,6 +185,12 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
case 4:
if (str == "°K" || str == "K" || str == "°F" || str == "F" || str == "°C" || str == "C") return true;
break;
case 5:
if (Utils.TryParseUDouble(str, out ddummy)) return true;
break;
case 6:
if (str == Strings.yes || str == Strings.no) return true;
break;
default:
message = "Invalid index";
return false;
@@ -200,6 +223,8 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
prms.MsrdUnit = MsrdUnit;
prms.MsrdValLimLo = MsrdValLimLo;
prms.MsrdValLimHi = MsrdValLimHi;
prms.SetpStep = SetpStep;
prms.RoundToSetpStep = RoundToSetpStep;
}
public IParamsProvider Clone()
@@ -213,5 +238,41 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
{
return true; /// =OK, do nothing
}
}
///
/// SchematicDrawing support
///
public DrawingShape GetSampleBitmap()
{
return (Sz == Sz.S) ? DSCoolingS : (Sz == Sz.M) ? DSCoolingM : (Sz == Sz.XL) ? DSCoolingXL : DSCoolingL;
}
///
/// Static part, DrawingShape constructor arguments depend on bitmap properties
///
public static DrawingShape DSIdleS, DSHeatingS, DSCoolingS, DSBothS;
public static DrawingShape DSIdleM, DSHeatingM, DSCoolingM, DSBothM;
public static DrawingShape DSIdleL, DSHeatingL, DSCoolingL, DSBothL;
public static DrawingShape DSIdleXL, DSHeatingXL, DSCoolingXL, DSBothXL;
///
static TControlCfg()
{
DSIdleS = new DrawingShape(Shape.Custom, Sz.S, 2, 2, null, null, 0, 0, 20, 20, Properties.Resources.TControl_S_idle);
DSHeatingS = new DrawingShape(Shape.Custom, Sz.S, 2, 2, null, null, 0, 0, 20, 20, Properties.Resources.TControl_S_heating);
DSCoolingS = new DrawingShape(Shape.Custom, Sz.S, 2, 2, null, null, 0, 0, 20, 20, Properties.Resources.TControl_S_cooling);
DSBothS = new DrawingShape(Shape.Custom, Sz.S, 2, 2, null, null, 0, 0, 20, 20, Properties.Resources.TControl_S_both);
DSIdleM = new DrawingShape(Shape.Custom, Sz.S, 3, 4, null, null, 0, 5, 30, 30, Properties.Resources.TControl_M_idle);
DSHeatingM = new DrawingShape(Shape.Custom, Sz.S, 3, 4, null, null, 0, 5, 30, 30, Properties.Resources.TControl_M_heating);
DSCoolingM = new DrawingShape(Shape.Custom, Sz.S, 3, 4, null, null, 0, 5, 30, 30, Properties.Resources.TControl_M_cooling);
DSBothM = new DrawingShape(Shape.Custom, Sz.S, 3, 4, null, null, 0, 5, 30, 30, Properties.Resources.TControl_M_both);
DSIdleL = new DrawingShape(Shape.Custom, Sz.S, 4, 4, null, null, 0, 0, 40, 40, Properties.Resources.TControl_L_idle);
DSHeatingL = new DrawingShape(Shape.Custom, Sz.S, 4, 4, null, null, 0, 0, 40, 40, Properties.Resources.TControl_L_heating);
DSCoolingL = new DrawingShape(Shape.Custom, Sz.S, 4, 4, null, null, 0, 0, 40, 40, Properties.Resources.TControl_L_cooling);
DSBothL = new DrawingShape(Shape.Custom, Sz.S, 4, 4, null, null, 0, 0, 40, 40, Properties.Resources.TControl_L_both);
DSIdleXL = new DrawingShape(Shape.Custom, Sz.S, 5, 6, null, null, 0, 5, 50, 50, Properties.Resources.TControl_XL_idle);
DSHeatingXL = new DrawingShape(Shape.Custom, Sz.S, 5, 6, null, null, 0, 5, 50, 50, Properties.Resources.TControl_XL_heating);
DSCoolingXL = new DrawingShape(Shape.Custom, Sz.S, 5, 6, null, null, 0, 5, 50, 50, Properties.Resources.TControl_XL_cooling);
DSBothXL = new DrawingShape(Shape.Custom, Sz.S, 5, 6, null, null, 0, 5, 50, 50, Properties.Resources.TControl_XL_both);
}
}
}
@@ -1,12 +0,0 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System;
namespace TBF.Rig.Modbus.TempControl
{
public interface ITempControl : GenericDevices.ITempMeter
{
IOperation SetRequiredTemperatureOp();
}
}
+51 -24
View File
@@ -5,8 +5,9 @@ using System.IO;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.Generic;
using TBF.Rig.Sequences;
namespace TBF.Rig.Modbus.TempControl.Novus
{
@@ -15,17 +16,29 @@ namespace TBF.Rig.Modbus.TempControl.Novus
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public float RequiredTemp; /// [°C] target temperature for a temperature controller or 0=not communicated to the controller
public double Temp_A; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_B; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_C; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_D; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public double Temp_E; /// [°C] Target temperature for a tempe. controller or 0=not communicated to the controller
public override void InitializeAll()
{
RequiredTemp = 0.0f;
}
Temp_A = 10.0;
Temp_B = 20.0;
Temp_C = 30.0;
Temp_D = 40.0;
Temp_E = 50.0;
}
string[] paramNames = new string[]
{
Strings.Required_temperature_C,
string.Format("{0} A [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} B [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} C [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} D [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
string.Format("{0} E [{1}]", Strings.Temperature, ProcessData.TempUnit.ToDescription()),
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
@@ -34,26 +47,36 @@ namespace TBF.Rig.Modbus.TempControl.Novus
{
switch (i)
{
case 0: return (RequiredTemp == 0) ? "---" : RequiredTemp.ToString();
default: return string.Empty;
case 0: return (Temp_A == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_A).ToString();
case 1: return (Temp_B == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_B).ToString();
case 2: return (Temp_C == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_C).ToString();
case 3: return (Temp_D == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_D).ToString();
case 4: return (Temp_E == 0) ? "---" : Units.ConvertTo(ProcessData.TempUnit, Temp_E).ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
public CfgUpdateFlags UpdateParam(int i, string str)
{
bool isDash = (str == "-" || str == "--" || str == "---");
switch (i)
{
case 0:
if (strValue == "-" || strValue == "--" || strValue == "---")
{
RequiredTemp = 0;
}
else
{
RequiredTemp = Utils.ParseUFloat(strValue);
}
Temp_A = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
default:
case 1:
Temp_B = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
case 2:
Temp_C = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
case 3:
Temp_D = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
case 4:
Temp_E = isDash ? 0 : Units.ConvertFrom(ProcessData.TempUnit, Utils.ParseUDouble(str));
return CfgUpdateFlags.None;
default:
return CfgUpdateFlags.None;
}
}
@@ -62,19 +85,19 @@ namespace TBF.Rig.Modbus.TempControl.Novus
/// Verifiy the string representation of the parameter
/// </summary>
/// <param name="i">Parameter ID</param>
/// <param name="strValue">String representation of the parameter</param>
/// <param name="str">String representation of the parameter</param>
/// <param name="message">In case false is returned this is the error messsage to be displayed</param>
/// <returns>true = parameter OK, false = parameter NOK</returns>
public bool ValidateParam(int i, string strValue, out string message)
public bool ValidateParam(int i, string str, out string message)
{
message = string.Empty;
float temp;
double ddummy;
switch (i)
{
case 0: /// T_hot_heating
if (strValue == "-" || strValue == "--" || strValue == "---" ||
(Utils.TryParseUFloat(strValue, out temp) && (temp == 0 || (temp >= 5 && temp <= 95.0f))))
if (str == "-" || str == "--" || str == "---" ||
(Utils.TryParseUDouble(str, out ddummy) && (ddummy == 0 || (ddummy >= 5 && ddummy <= 95.0))))
{
return true;
}
@@ -90,8 +113,12 @@ namespace TBF.Rig.Modbus.TempControl.Novus
void CopyContentTo(ProcParams prms)
{
prms.RequiredTemp = this.RequiredTemp;
}
prms.Temp_A = Temp_A;
prms.Temp_B = Temp_B;
prms.Temp_C = Temp_C;
prms.Temp_D = Temp_D;
prms.Temp_E = Temp_E;
}
public IParamsProvider Clone()
{
@@ -7,38 +7,39 @@ using TBF.Boxes;
namespace TBF.Rig.Modbus.TempControl.Novus
{
public class SetRequiredTemperatureOp : IOperation
public class SetTemperatureSetpointOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(SetRequiredTemperatureOp));
public override string ToString() { return string.Format("SetRequiredTemperatureOp({0})", eventDone); }
private static readonly ILog log = LogManager.GetLogger(typeof(SetTemperatureSetpointOp));
public override string ToString() { return string.Format("SetTemperatureSetpointOp({0})", eventDone); }
/// Set by the constructor
readonly TControl tempControl;
readonly double temperature;
readonly Event eventDone;
/// <summary>
/// Events: PressureInDone, PressureOutDone or Error
/// </summary>
/// <param name="tempControl">Pressure meter reference</param>
/// <param name="pressure">Reference to the measured pressure variable, value is in bar</param>
/// <param name="tempControl">Temp. controller reference</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public SetRequiredTemperatureOp(TControl tempControl, Event eventDone)
public SetTemperatureSetpointOp(TControl tempControl, double temperature, Event eventDone)
{
if (tempControl == null) throw new ArgumentNullException("tempControl");
this.tempControl = tempControl;
this.temperature = temperature;
this.eventDone = eventDone;
log.Debug(this.ToString());
}
public SetRequiredTemperatureOp(TControl tempControl)
: this(tempControl, Event.ConditionMet)
public SetTemperatureSetpointOp(TControl tempControl, double temperature)
: this(tempControl, temperature, Event.ConditionMet)
{
}
/// <summary>Start this operation</summary>
public void Start()
{
tempControl.SetTemperatureSetpoint();
tempControl.SetTemperatureSetpoint(temperature);
}
/// <summary>Run this operation</summary>
+85 -67
View File
@@ -9,11 +9,11 @@ using Common;
using Config.Entities;
using SchematicDrawing;
using TBF.Boxes;
using TBF.Rig.Generic;
using TBF.Rig.GenericDevices;
namespace TBF.Rig.Modbus.TempControl.Novus
{
public class TControl : ComponentBase, IDevice, ITempControl, GenericDevices.ISequenceCondition,
public class TControl : ComponentBase, Generic.IDevice, ITempControl, ISequenceCondition,
IDrawingItCmpntWithSetpoint, IDrawingItCmpntWithMeasuredVal, IDrawingItCmpntWithCustomBmp
{
private static readonly ILog log = LogManager.GetLogger(typeof(TControl));
@@ -49,19 +49,40 @@ namespace TBF.Rig.Modbus.TempControl.Novus
///
public void IncreaseSetpoint()
{
double temperatureStep = isFahrenheit ? Units.ConvertFrom(Unit.F, 0.5) : 0.5;
double newSetpoint = Math.Min(temperatureSetPoint + temperatureStep, 95.0);
SetTemperatureSetpoint(newSetpoint);
double tempStepC = isFahrenheit ? Units.ConvertFrom(Unit.F, novusCfg.SetpStep) : novusCfg.SetpStep;
double newSetpoint;
if (novusCfg.RoundToSetpStep)
{
double roundedSetpoint = tempStepC * Math.Round(temperatureSetPoint / tempStepC);
newSetpoint = (roundedSetpoint <= temperatureSetPoint) ? (roundedSetpoint + tempStepC) : roundedSetpoint;
}
else
{
newSetpoint = temperatureSetPoint + tempStepC;
}
SetTemperatureSetpoint(Math.Min(newSetpoint, 95.0));
}
///
public void DecreaseSetpoint()
{
double temperatureStep = isFahrenheit ? Units.ConvertFrom(Unit.F, 0.5) : 0.5;
double newSetpoint = Math.Max(temperatureSetPoint - temperatureStep, 5.0);
SetTemperatureSetpoint(newSetpoint);
double tempStepC = isFahrenheit ? Units.ConvertFrom(Unit.F, novusCfg.SetpStep) : novusCfg.SetpStep;
double newSetpoint;
if (novusCfg.RoundToSetpStep)
{
double roundedSetpoint = tempStepC * Math.Round(temperatureSetPoint / tempStepC);
newSetpoint = (roundedSetpoint >= temperatureSetPoint) ? (roundedSetpoint - tempStepC) : roundedSetpoint;
}
else
{
newSetpoint = temperatureSetPoint - tempStepC;
}
SetTemperatureSetpoint(Math.Max(newSetpoint, 5.0));
}
public DrawingShape GetCustomBitmap()
{
switch (novusCfg.Sz)
@@ -99,22 +120,14 @@ namespace TBF.Rig.Modbus.TempControl.Novus
bool isFahrenheit { get { return (status2 & (1 << 9)) != 0; } }
public float requiredTemp
{
get
{
return novusCfg.ProcParams != null ? novusCfg.ProcParams.RequiredTemp : 0;
}
}
public TControl() { }
public TControl(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
novusCfg = cfg as TControlCfg;
CreateConditions(true);
}
/// <summary>Initialize this device</summary>
@@ -224,41 +237,32 @@ namespace TBF.Rig.Modbus.TempControl.Novus
/// <summary>
/// Set Easytherm controller to required temperature procedure parameter
/// Set temperature controller setpoint to specified value
/// </summary>
/// <param name="temperatureC">Temperature in °C</param>
/// <returns>true = OK, false = any error</returns>
public bool SetTemperatureSetpoint()
public bool SetTemperatureSetpoint(double temperatureC)
{
return SetTemperatureSetpoint(requiredTemp);
}
/// <summary>
/// Set Easytherm controller to specified temperature
/// </summary>
/// <param name="reqTempC">Temperature in °C</param>
/// <returns>true = OK, false = any error</returns>
public bool SetTemperatureSetpoint(double reqTempC)
{
if (reqTempC != 0 && (reqTempC < 5.0 || reqTempC > 95.0))
if (temperatureC != 0 && (temperatureC < 5.0 || temperatureC > 95.0))
{
return false; /// required temperature out of range
}
if (novusDataValid && (reqTempC == temperatureSetPoint))
if (novusDataValid && (temperatureC == temperatureSetPoint))
{
return true; /// already set to the required temperature
}
if (reqTempC != 0) /// temperature==0 disables sending the setpoint
if (temperatureC != 0) /// temperature==0 disables sending the setpoint
{
double reqTemp = isFahrenheit ? Units.ConvertTo(Unit.F, reqTempC) : reqTempC;
double reqTemp = isFahrenheit ? Units.ConvertTo(Unit.F, temperatureC) : temperatureC;
Int16 tempSetpointInt16 = Convert.ToInt16(Math.Round(10 * reqTemp)); /// setpoint in 0.1 °C or °F
ushort destAddress = SetpointAddress;
///
SendValueToNovus(Function.PresetSingleRegister, destAddress, tempSetpointInt16);
}
temperatureSetPoint = reqTempC;
temperatureSetPoint = temperatureC;
return true;
}
@@ -290,19 +294,9 @@ namespace TBF.Rig.Modbus.TempControl.Novus
/// Events: SetOpututsDone, Error
/// </summary>
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
public IOperation SetRequiredTemperatureOp()
public IOperation SetTemperatureSetpointOp(double temperature)
{
return new SetRequiredTemperatureOp(this);
}
/// <summary>
/// Events: SetOpututsDone, Error
/// </summary>
/// <param name="temperature">Reference to a variable for the pressure in Bar</param>
/// <returns>SetOutputsOp instance reference casted to IOperaton</returns>
public IOperation SetTemperatureOp(float temperature)
{
return new SetTemperatureOp(this, temperature);
return new SetTemperatureSetpointOp(this, temperature);
}
public IOperation ReadTempOp(ref DoubleBox temp)
@@ -316,33 +310,57 @@ namespace TBF.Rig.Modbus.TempControl.Novus
}
public int ConditionsCount
{
get { return 3; }
}
///
/// ISequenceCondition interface implementation (conditions in transition sequences)
///
IList<string> sequenceConditionNames;
IList<IOperation> sequenceConditions;
public int ConditionsCount { get { return sequenceConditions != null ? sequenceConditions.Count : 0; } }
/// Strings are added to the combo-box for transition sequence condition selection
public string ConditionName(int i)
{
switch (i)
{
case 0: return string.Format("{0} open_the_drain_valve", Name);
case 1: return string.Format("{0} close_the_drain_valve", Name);
case 2: return string.Format("{0} wait_until_the_tank_is_empty", Name);
default: return string.Empty;
}
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
return sequenceConditionNames[i];
else
return string.Empty;
}
/// Operation to be executed as a part of a transition sequence
/// Operations are executed as a part of a transition sequence
public IOperation ConditionOp(int i)
{
switch (i)
{
case 0: return null;
case 1: return null;
case 2: return null;
default: return null;
}
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
return sequenceConditions[i];
else
return null;
}
void ClearConditions()
{
sequenceConditionNames = new List<string>();
sequenceConditions = new List<IOperation>();
}
void AddCondition(string conditionName, bool createOperation, IOperation conditionOperation)
{
sequenceConditionNames.Add(conditionName);
if (createOperation) sequenceConditions.Add(conditionOperation);
}
/// <summary>
/// Create a list of conditions
/// </summary>
/// <param name="createOps">true = create names and condition operations, false = create names only</param>
void CreateConditions(bool createOps)
{
ClearConditions();
AddCondition("Set temperature setpoint A", createOps, SetTemperatureSetpointOp(novusCfg.ProcParams.Temp_A));
AddCondition("Set temperature setpoint B", createOps, SetTemperatureSetpointOp(novusCfg.ProcParams.Temp_B));
AddCondition("Set temperature setpoint C", createOps, SetTemperatureSetpointOp(novusCfg.ProcParams.Temp_C));
AddCondition("Set temperature setpoint D", createOps, SetTemperatureSetpointOp(novusCfg.ProcParams.Temp_D));
AddCondition("Set temperature setpoint E", createOps, SetTemperatureSetpointOp(novusCfg.ProcParams.Temp_E));
}
}
}
@@ -8,6 +8,7 @@ using System.Xml.Serialization;
using Common;
using Config.Entities;
using SchematicDrawing;
using TBF.Resources;
using TBF.Rig.Generic;
namespace TBF.Rig.Modbus.TempControl.Novus
@@ -52,6 +53,9 @@ namespace TBF.Rig.Modbus.TempControl.Novus
public string SetpFormat { get; set; } /// 3
public Unit SetpUnit { get; set; } /// 4
public double SetpStep { get; set; } /// 5
public bool RoundToSetpStep { get; set; } /// 6
[XmlIgnore]
public IList<GNode> GNodes { get; set; }
@@ -66,6 +70,7 @@ namespace TBF.Rig.Modbus.TempControl.Novus
/// Private parameterless constructor invoked by all other (public) constructors
TControlCfg()
{
ProcParams = new ProcParams(true);
GNodes = new List<GNode>();
}
@@ -73,7 +78,6 @@ namespace TBF.Rig.Modbus.TempControl.Novus
: this()
{
this.Factory = factory;
ProcParams = CreateProcParamsProvider() as ProcParams;
Name = "Novus";
ParentName = "Modbus";
@@ -95,6 +99,8 @@ namespace TBF.Rig.Modbus.TempControl.Novus
MsrdUnit = Unit.C;
SetpFormat = "{0:F1} °C";
SetpUnit = Unit.C;
SetpStep = 1.0;
RoundToSetpStep = true;
}
string[] paramNames = new string[]
@@ -104,6 +110,8 @@ namespace TBF.Rig.Modbus.TempControl.Novus
"Unit of measured temperature", /// 2
"Setpoint format", /// 3
"Unit of temperature setpoint", /// 4
"Setpoint step", /// 5
"Round to setpoint step", /// 6
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
@@ -115,6 +123,8 @@ namespace TBF.Rig.Modbus.TempControl.Novus
case 2:
case 4:
return new string[] { "°C", "°F", "K" };
case 6:
return new string[] { Strings.yes, Strings.no };
default:
return null;
}
@@ -130,6 +140,8 @@ namespace TBF.Rig.Modbus.TempControl.Novus
case 2: return (MsrdUnit == Unit.K) ? "K" : (MsrdUnit == Unit.F) ? "°F" : "°C";
case 3: return SetpFormat;
case 4: return (SetpUnit == Unit.K) ? "K" : (SetpUnit == Unit.F) ? "°F" : "°C";
case 5: return SetpStep.ToString();
case 6: return RoundToSetpStep ? Strings.yes : Strings.no;
default:
return string.Format("{0}({1}) address={2}", Name, string.IsNullOrEmpty(ParentName) ? "-" : ParentName, ModbusAddress);
}
@@ -143,11 +155,15 @@ namespace TBF.Rig.Modbus.TempControl.Novus
case 1: MsrdFormat = str; return CfgUpdateFlags.RestartRqrd;
case 2: MsrdUnit = (str == "°K" || str == "K") ? Unit.K
: (str == "°F" || str == "F") ? Unit.F
: Unit.C; return CfgUpdateFlags.RestartRqrd;
: Unit.C;
return CfgUpdateFlags.RestartRqrd;
case 3: SetpFormat = str; return CfgUpdateFlags.RestartRqrd;
case 4: SetpUnit = (str == "°K" || str == "K") ? Unit.K
: (str == "°F" || str == "F") ? Unit.F
: Unit.C; return CfgUpdateFlags.RestartRqrd;
: Unit.C;
return CfgUpdateFlags.RestartRqrd;
case 5: SetpStep = Utils.ParseUDouble(str); return CfgUpdateFlags.RestartRqrd;
case 6: RoundToSetpStep = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
}
@@ -156,6 +172,7 @@ namespace TBF.Rig.Modbus.TempControl.Novus
{
message = string.Empty;
int idummy;
double ddummy;
switch (i)
{
@@ -169,6 +186,12 @@ namespace TBF.Rig.Modbus.TempControl.Novus
case 4:
if (str == "°K" || str == "K" || str == "°F" || str == "F" || str == "°C" || str == "C") return true;
break;
case 5:
if (Utils.TryParseUDouble(str, out ddummy)) return true;
break;
case 6:
if (str == Strings.yes || str == Strings.no) return true;
break;
default:
message = "Invalid index";
return false;
@@ -201,6 +224,8 @@ namespace TBF.Rig.Modbus.TempControl.Novus
prms.MsrdUnit = MsrdUnit;
prms.MsrdValLimLo = MsrdValLimLo;
prms.MsrdValLimHi = MsrdValLimHi;
prms.SetpStep = SetpStep;
prms.RoundToSetpStep = RoundToSetpStep;
}
public IParamsProvider Clone()
+5 -2
View File
@@ -3,6 +3,7 @@
///
using System;
using log4net;
using TBF.Rig.Sequences;
namespace TBF.Rig.Operations
{
@@ -73,12 +74,14 @@ namespace TBF.Rig.Operations
private void AccumulateEnthalpy()
{
/// Calculate # of reference pulses
int newRefPulses = Rig.Sequences.ProcessData.RefPulses;
int newRefPulses = ProcessData.RefPulses;
int deltaPulses = newRefPulses - lastRefPulses;
lastRefPulses = newRefPulses;
/// Calculate volume [l]
double deltaVolume = deltaPulses * Rig.Sequences.ProcessData.LtrPerRefPulse;
double deltaVolume = (ProcessData.Devices != null && ProcessData.Devices.FlowMeter != null)
? deltaPulses * ProcessData.Devices.FlowMeter.LtrPerPulse
: 0;
for (int i = 0; i < enthalpy.Length; i++)
{
@@ -92,7 +92,7 @@ namespace TBF.Rig.Output.DB.SaveFlowmeterCorrections
if (tr.Repeats() == 1)
{
flow = tr.FlowVolume;
flow = tr.Flow;
errorMaster = tr.ErrorMaster;
}
else
@@ -103,7 +103,7 @@ namespace TBF.Rig.Output.DB.SaveFlowmeterCorrections
{
if (tr2.TestDone && (tr2.TestData.Name == tr.TestData.Name))
{
flow += tr2.FlowVolume;
flow += tr2.Flow;
errorMaster += tr2.ErrorMaster;
count++;
}
@@ -381,7 +381,7 @@ namespace TBF.Rig.Output.FileWriters.IperlLogger
if (mtr != null)
{
logger.WriteLine(string.Format("Q{0}bestanden={1}", flID, 1));
logger.WriteLine(string.Format("Durchfluss{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
logger.WriteLine(string.Format("Durchfluss{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.Flow()), 5, true)));
logger.WriteLine(string.Format("Fehler{0}={1}", flID, mtr.Error.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("ZeitImpulse{0}={1}", flID, mtr.TestTime.ToString(Program.AltCulture)));
logger.WriteLine(string.Format("Impulse{0}={1}", flID, 0));
@@ -395,7 +395,7 @@ namespace TBF.Rig.Output.FileWriters.IperlLogger
logger.WriteLine(string.Format("Q{0}KorrBestanden={1}", flID, mtr.Passed ? 1 : 0));
logger.WriteLine(string.Format("Anfangsstand{0}={1}", flID, mtr.VolumeStart).ToString(Program.AltCulture));
logger.WriteLine(string.Format("Endstand{0}={1}", flID, mtr.VolumeEnd).ToString(Program.AltCulture));
logger.WriteLine(string.Format("QMittelwert{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.FlowVolume()), 5, true)));
logger.WriteLine(string.Format("QMittelwert{0}={1}", flID, Utils.DoubleToStr(Units.ConvertTo(Unit.lph, mtr.Flow()), 5, true)));
logger.WriteLine(string.Format("QStandardAbweichung{0}={1}", flID, 0));
logger.WriteLine(string.Format("ImpedanzMittelwert{0}={1}", flID, "0,00000"));
logger.WriteLine(string.Format("AusfallGrund{0}={1}", flID, 0));
+9 -1
View File
@@ -937,11 +937,15 @@ namespace TBF.Rig.Sequences
StateMachine.ControlBoard.Devices = outPath;
ProcessData.RegisterReaders = (sensPath != null && sensPath.RegisterReaders != null) ? sensPath.RegisterReaders : null;
/// Set temperature control setpoint
ITempControl tControl = TbfComponents.FindComponent(testInst.Test.TempControl) as ITempControl;
if (tControl != null) tControl.SetTemperatureSetpoint((testInst.Test.TempLimLo + testInst.Test.TempLimHi) / 2.0);
///
/// Execute one test (single repetition of a repeated test)
/// Previously:
/// e = testMethod.Execute(test, outerLoopMode, (outerLoopMode ? outerLoopCounter: repetNr));
///
///
Event rsltTransBefore = Event.Done;
Event rsltTransBetween = Event.Done;
Event rsltTransAfter = Event.Done;
@@ -1126,6 +1130,10 @@ namespace TBF.Rig.Sequences
StateMachine.ControlBoard.Devices = outPath;
ProcessData.RegisterReaders = (sensPath != null && sensPath.RegisterReaders != null) ? sensPath.RegisterReaders : null;
/// Set temperature control setpoint
ITempControl tControl = TbfComponents.FindComponent(test.TempControl) as ITempControl;
if (tControl != null) tControl.SetTemperatureSetpoint((test.TempLimLo + test.TempLimHi) / 2.0);
Event rsltTransBefore = Event.Done;
Event rsltTransAfter = Event.Done;
{
+46 -33
View File
@@ -246,10 +246,6 @@ namespace TBF.Rig.Sequences
public static DoubleBox PressDelta = new DoubleBox() { Name = "Pressure Delta", Format = "F2" }; /// [bar]
public static FloatBox Conductivity = new FloatBox(750) { Name = "Conductivity", Format = "F0" }; /// [uS/cm], default is 750
public static double LtrPerRefPulse; /// to calculate the ref.volume
//{
// get { return (Devices != null && Devices.FlowMeter != null) ? Devices.FlowMeter.LtrPerPulseCorrected : 0; }
//}
public static int RefPulses { get { return StateMachine.ControlBoard.RefPulses; } }
public static int RefPulsesDelta;
public static DoubleBox RefFrequency = new DoubleBox() { Name = "RefFreq", Format = "F2" };
@@ -361,39 +357,48 @@ namespace TBF.Rig.Sequences
public static Statistics DiverterStart = new Statistics(new Plotter("Div start"));
public static Statistics DiverterEnd = new Statistics(new Plotter("Div end"));
public static int machineTimeStart;
public static int lastMachineTime;
protected static void StartNewStatistics(int machineTime, int batchNr, string testName, int repetition, int skippedSamplesCount)
static int machineTimeStart;
static int lastMachineTime;
static IFlowMeter flowMeter;
///
protected static void StartNewStatistics(IFlowMeter flowMeter,
int batchNr, Config.Entities.Test test, int repetition, int skippedSamplesCount)
{
machineTimeStart = machineTime;
lastMachineTime = machineTime;
ProcessData.flowMeter = flowMeter;
AmbTempStat.Start (batchNr, testName, repetition);
AmbPressStat.Start(batchNr, testName, repetition);
AmbHumiStat.Start (batchNr, testName, repetition);
machineTimeStart = lastMachineTime = StateMachine.Time;
TempUpStat.Start (batchNr, testName, repetition, skippedSamplesCount);
TempDownStat.Start (batchNr, testName, repetition, skippedSamplesCount);
TempDiffStat.Start (batchNr, testName, repetition, skippedSamplesCount);
TempDivStat.Start (batchNr, testName, repetition, skippedSamplesCount);
PressUpStat.Start (batchNr, testName, repetition, skippedSamplesCount);
PressDownStat.Start (batchNr, testName, repetition, skippedSamplesCount);
PressDeltaStat.Start(batchNr, testName, repetition, skippedSamplesCount);
ConductStat.Start (batchNr, testName, repetition, skippedSamplesCount);
RefFlowStat.Start (batchNr, testName, repetition, skippedSamplesCount);
MassStat.Start (batchNr, testName, repetition, skippedSamplesCount);
AmbTempStat.Start (batchNr, test.Name, repetition);
AmbPressStat.Start(batchNr, test.Name, repetition);
AmbHumiStat.Start (batchNr, test.Name, repetition);
TempUpStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
TempDownStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
TempDiffStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
TempDivStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
PressUpStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
PressDownStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
PressDeltaStat.Start(batchNr, test.Name, repetition, skippedSamplesCount);
ConductStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
RefFlowStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
MassStat.Start (batchNr, test.Name, repetition, skippedSamplesCount);
TempRefHiStat.Start(batchNr, testName, repetition);
TempRefLoStat.Start (batchNr, testName, repetition);
Energy.Start (batchNr, testName, repetition);
VolumeForEnergy.Start(batchNr, testName, repetition);
TempRefHiStat.Start (batchNr, test.Name, repetition);
TempRefLoStat.Start (batchNr, test.Name, repetition);
Energy.Start (batchNr, test.Name, repetition);
VolumeForEnergy.Start(batchNr, test.Name, repetition);
lastEnergyUpdateTime = 0;
if (flowMeter is Uni.FlowMetersInParallel.FlowMeter)
{
(flowMeter as Uni.FlowMetersInParallel.FlowMeter).StartStatistics(test);
}
}
protected static void UpdateAllStatistics(int machineTime)
protected static void UpdateAllStatistics()
{
int timeDelta = machineTime - lastMachineTime;
int timeDelta = StateMachine.Time - lastMachineTime;
lastMachineTime = StateMachine.Time;
AmbTempStat.Update(AmbTemp);
AmbPressStat.Update(AmbPress);
@@ -409,6 +414,11 @@ namespace TBF.Rig.Sequences
ConductStat.Update(Conductivity);
RefFlowStat.Update(RefFlow);
if (flowMeter is Uni.FlowMetersInParallel.FlowMeter)
{
(flowMeter as Uni.FlowMetersInParallel.FlowMeter).UpdateStatistics(timeDelta);
}
double massIncreasePerSec;
MassStat.Update(Mass, out massIncreasePerSec);
FlowFromMassIncrease = 3600 * massIncreasePerSec / Formulas.DistilledWaterDensityFromTemp(TempDiv.Val);
@@ -418,8 +428,6 @@ namespace TBF.Rig.Sequences
TempRefHiStat.Update((TempRefHi1.Val + TempRefHi2.Val) / 2);
TempRefLoStat.Update((TempRefLo1.Val + TempRefLo2.Val) / 2);
}
lastMachineTime = machineTime;
}
protected static void StopRecordingStatistics()
@@ -440,6 +448,11 @@ namespace TBF.Rig.Sequences
MassStat.Stop();
FlowFromMassIncrease = 0;
if (flowMeter is Uni.FlowMetersInParallel.FlowMeter)
{
(flowMeter as Uni.FlowMetersInParallel.FlowMeter).StopStatistics();
}
TempRefHiStat.Stop();
TempRefLoStat.Stop();
Energy.Stop();
@@ -479,7 +492,7 @@ namespace TBF.Rig.Sequences
Utils.DoubleToStr(RefFlow.Val, 4), /// flow measured by the reference flow meter in m3/h
StateMachine.ControlBoard.TestTime.ToString("F3"),/// test time in s
StateMachine.ControlBoard.RefPulses, /// reference flow meter pulses count
Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"), /// volume in l
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000", /// volume in l
benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C
benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of line in degree C
outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C
@@ -509,7 +522,7 @@ namespace TBF.Rig.Sequences
Utils.DoubleToStr(RefFlow.Val, 4),
StateMachine.ControlBoard.TestTime.ToString("F3"),
StateMachine.ControlBoard.RefPulses,
Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"),
outPath.FlowMeter != null ? Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1 / outPath.FlowMeter.LtrPerPulse).ToString("F3") : "0.000",
benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C
benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of test in degree C
outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C
+21 -24
View File
@@ -1114,7 +1114,7 @@ namespace TBF.Rig.Sequences
sb.Append(";"); sb.Append(tstRslt.Batch.SampleTemp); /// BE
sb.Append(";"); sb.Append(tstRslt.FlowMax); /// BF pipe expansion: teraz vynechat
sb.Append(";"); sb.Append(tstRslt.FlowMin); /// BG [kg/h] Qm
sb.Append(";"); sb.Append(tstRslt.FlowVolume); /// BH [l/h] Qv
sb.Append(";"); sb.Append(tstRslt.Flow); /// BH [l/h] Qv
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// BI [l] Vet .... komercne prava hodnota objemu - podla vahy
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// BJ [l] Velm ... objem podla etalonu (Prolonged: objem do vahy podla impulzov hradlovanych klapkou)
sb.Append(";"); sb.Append(tstRslt.TestTimeCorrection); /// BK [s] test time correction (diverter correction)
@@ -1382,13 +1382,12 @@ namespace TBF.Rig.Sequences
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Formulas.RealDensity() / 1000.0f;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime;
tstRslt.FlowVolume = 3.6 * outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.Flow = 3.6 * outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.MassOfEvapWater = 0;
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine; /// [l] commercially true volume
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, 0); /// Corrected master pulses per liter
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (outPath.FlowMeter.LtrPerPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
@@ -1497,14 +1496,15 @@ namespace TBF.Rig.Sequences
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Formulas.RealDensity() / 1000.0f;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime;
tstRslt.FlowVolume = 3.6 * outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.Flow = 3.6 * outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.MassOfEvapWater = 0;
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine; /// [l] commercially true volume
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, 0); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (outPath.FlowMeter.LtrPerPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityLine;
/// [l] commercially true volume
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean);
/// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (outPath.FlowMeter.LtrPerPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
@@ -1573,9 +1573,9 @@ namespace TBF.Rig.Sequences
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
tstRslt.PulsesMaster = (LtrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / LtrPerRefPulse) : 1;
tstRslt.ConstMasterRaw = LtrPerRefPulse;
tstRslt.ConstMaster = LtrPerRefPulse;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulse;
tstRslt.PulsesMaster = (tstRslt.ConstMasterRaw > 1E-6) ? (tstRslt.TargetVolume() / tstRslt.ConstMasterRaw) : 1;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Formulas.RealDensity() / 1000.0f;
@@ -1584,8 +1584,7 @@ namespace TBF.Rig.Sequences
tstRslt.DensityLine = Formulas.RealDensity();
tstRslt.DensityDiv = Formulas.RealDensity();
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.Flow = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.VolumeCTV = tstRslt.TargetVolume();
tstRslt.VolumeMaster = tstRslt.TargetVolume();
tstRslt.ErrorMaster = 0;
@@ -1705,9 +1704,9 @@ namespace TBF.Rig.Sequences
tstRslt.FlowSetTime = 10;
tstRslt.TestTime = tstRslt.TargetTime();
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
tstRslt.PulsesMaster = (LtrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / LtrPerRefPulse) : 1;
tstRslt.ConstMasterRaw = LtrPerRefPulse;
tstRslt.ConstMaster = LtrPerRefPulse;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulse;
tstRslt.PulsesMaster = (tstRslt.ConstMasterRaw > 1E-6) ? (tstRslt.TargetVolume() / tstRslt.ConstMasterRaw) : 1;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Formulas.RealDensity() / 1000.0f;
@@ -1716,8 +1715,7 @@ namespace TBF.Rig.Sequences
tstRslt.DensityLine = Formulas.RealDensity();
tstRslt.DensityDiv = Formulas.RealDensity();
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.Flow = tstRslt.TargetVolume() / tstRslt.TargetTime();
tstRslt.VolumeCTV = tstRslt.TargetVolume();
tstRslt.VolumeMaster = tstRslt.TargetVolume();
tstRslt.ErrorMaster = 0;
@@ -1854,7 +1852,6 @@ namespace TBF.Rig.Sequences
log.FatalFormat(" Flow: {0}", RefFlow);
log.FatalFormat(" Mass: {0}", (outPath.Scale is IScale) ? (outPath.Scale as IScale).Mass : 0);
log.FatalFormat(" Start mass: {0}", StartMass);
log.FatalFormat(" Liter/ref.pulse: {0}", LtrPerRefPulse);
log.FatalFormat(" Reference pulses: {0}", RefPulses);
}
+1
View File
@@ -51,6 +51,7 @@ namespace TBF.Rig
Factories.Add(new Dummy.Diverter.Factory());
Factories.Add(new Dummy.FlowMeter.Factory());
Factories.Add(new Dummy.RegValve.Factory());
Factories.Add(new Dummy.TempControl.Factory());
Factories.Add(new Dummy.Valve.Factory());
Factories.Add(new Uni.FlowMeter.Factory());
Factories.Add(new Uni.FlowMetersInParallel.Factory());
+39 -48
View File
@@ -97,28 +97,15 @@ namespace TBF.Rig.TestMethods.Adjustment
float simulatedError = 4.5f; /// %
bool stopCycle = false;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
int rangeIx = (outPath.FlowMeter is IFlowMeterSingle)
? (outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi)
: 0; /// Default range, used for non-Elde and parallel flowmeters
if (rangeIx == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
TBF.Rig.ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
@@ -154,7 +141,6 @@ namespace TBF.Rig.TestMethods.Adjustment
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int flowSetTime = 0;
/// Start the test, initialize test results
@@ -276,7 +262,7 @@ namespace TBF.Rig.TestMethods.Adjustment
flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -370,7 +356,7 @@ namespace TBF.Rig.TestMethods.Adjustment
{
/// Measurement loop preparation
int totalPulses = Convert.ToInt32(Math.Round(test.Volume / outPath.FlowMeter.LtrPerPulse));
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Measurement loop
State.Create(string.Format("{0}({1}) : FlyingStartStopTestOp is running", test.Method, test.Name))
@@ -388,7 +374,7 @@ namespace TBF.Rig.TestMethods.Adjustment
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -414,37 +400,42 @@ namespace TBF.Rig.TestMethods.Adjustment
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Raw data
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Corrected value
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ErrorMaster = 0.0f; /// Not available without mass measurement
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -76,25 +76,11 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
return Simulate(test, repetitionNr, isLastRepetition, testParams);
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IScale scale = outPath.Scale as IScale;
@@ -155,13 +141,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
cBrd.StopAll(false);
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -351,7 +331,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
case Event.UiCmdStop: goto stopTest;
}
flowsForDetection[0] = cBrd.RefFrequency * outPath.FlowMeter.NominalFlow / 2000.0;
flowsForDetection[0] = cBrd.RefFrequency * outPath.FlowMeter.NominalFlow / outPath.FlowMeter.NominalFreq;
double diff = RegisterReaders[Math.Max(0, test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[Math.Max(0, test.Part - 1) * 2 + 1];
pulseFreqsForDetection[0] = diff / (double)(StateMachine.Time - lastTime);
lastTime = StateMachine.Time;
@@ -548,7 +528,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
///
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Read the diverter switch time
@@ -580,7 +560,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
}
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
/// TODO: Reimplement
//for (int i = 0; i < TBF.Data.CompoundWMsCount; i++)
@@ -675,45 +655,51 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.RefPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean); /// Corrected master pulses per liter
/// Main results
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -88,27 +88,12 @@ namespace TBF.Rig.TestMethods.DiverterTest
TBF.Rig.ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
IScale scale = cBrd.Devices.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
@@ -142,8 +127,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
if (benchPath.PressMtrDown != null) readTempPressOps.Add(benchPath.PressMtrDown.ReadPressureOp(ref PressDown));
if (benchPath.PressMtrDelta != null) readTempPressOps.Add(benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -307,7 +291,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -450,7 +434,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
/// Diverter test loop
///
int remainingPulses = totalPulses;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -500,7 +484,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -648,42 +632,47 @@ namespace TBF.Rig.TestMethods.DiverterTest
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cumulativeTestTime[0]; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cumulativeEtPulses[0]); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.MassOfEvapWater = (double)tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean); /// Corrected master pulses per liter
/// Main results
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = testParams.DivRepetitions * outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume);
tstRslt.TestTimeCorrection = testParams.DivRepetitions * outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
+1 -1
View File
@@ -44,7 +44,7 @@ namespace TBF.Rig.TestMethods.Dummy
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath));
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(null, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Read pressure and temperature once
State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name))
+41 -52
View File
@@ -68,28 +68,13 @@ namespace TBF.Rig.TestMethods.Endurance
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
ControlBoard.Uni.UniCB eldeCB = cBrd as ControlBoard.Uni.UniCB;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
@@ -141,8 +126,7 @@ namespace TBF.Rig.TestMethods.Endurance
enduranceDataLoggingOp = null;
}
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -215,7 +199,7 @@ namespace TBF.Rig.TestMethods.Endurance
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -313,7 +297,7 @@ namespace TBF.Rig.TestMethods.Endurance
queryEnd1 = cBrd.QueryMeasurementEndOp();
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Measurement loop - begin
State.Create(string.Format("{0}({1}) : Reading watermeters", test.Method, test.Name))
@@ -345,7 +329,7 @@ namespace TBF.Rig.TestMethods.Endurance
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -378,37 +362,42 @@ namespace TBF.Rig.TestMethods.Endurance
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected value
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [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.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ErrorMaster = 0.0f; /// Not available without mass measurement
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -524,7 +513,7 @@ namespace TBF.Rig.TestMethods.Endurance
cBrd.StopAll(false);
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
///
@@ -568,7 +557,7 @@ namespace TBF.Rig.TestMethods.Endurance
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
}
while (!e.Contains(Event.CommandCompleted));
@@ -607,7 +596,7 @@ namespace TBF.Rig.TestMethods.Endurance
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -635,7 +624,7 @@ namespace TBF.Rig.TestMethods.Endurance
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
+14 -36
View File
@@ -64,27 +64,12 @@ namespace TBF.Rig.TestMethods.FixedStart
HeatMeters.TestParams heatMetersTestParams,
DebugMode debugLevel)
{
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
@@ -125,13 +110,7 @@ namespace TBF.Rig.TestMethods.FixedStart
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -351,7 +330,7 @@ namespace TBF.Rig.TestMethods.FixedStart
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -538,7 +517,7 @@ namespace TBF.Rig.TestMethods.FixedStart
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -572,7 +551,7 @@ namespace TBF.Rig.TestMethods.FixedStart
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
if (heatMetersTestParams != null)
{
@@ -585,7 +564,7 @@ namespace TBF.Rig.TestMethods.FixedStart
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -653,8 +632,8 @@ namespace TBF.Rig.TestMethods.FixedStart
cBrd.StopAll(false);
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
double flowVolume = 3.6 * outPath.FlowMeter.LtrPerPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, Convert.ToSingle(TempDownStat.Average));
double volumeCTV = constMasterCorr * Convert.ToDouble(endPulses - startPulses);
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
@@ -814,9 +793,8 @@ namespace TBF.Rig.TestMethods.FixedStart
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Flow = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = constMasterCorr; /// Corrected master pulses per liter
tstRslt.ConstMaster = constMasterCorr; /// Corrected master pulses per liter
@@ -71,27 +71,12 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
return new List<Event> { Event.ConfigurationError };
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
@@ -134,13 +119,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -394,7 +373,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -427,7 +406,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -544,29 +523,33 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
/// Corrected values
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
tstRslt.MassOfEvapWater = massOfEvaporatedWater;
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
/// Main results
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean);
/// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
@@ -577,6 +560,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -75,26 +75,12 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
TestPart = test.Part,
};
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm;
if (!(dataEntryCmpnt is GenericDevices.IDataEntryForCamera))
@@ -143,13 +129,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -369,7 +349,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
}
while (true);
}
else if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
else if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -576,7 +556,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -610,7 +590,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
if (heatMetersTestParams != null)
{
@@ -623,7 +603,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -693,8 +673,8 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
cBrd.StopAll(false);
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
double flowVolume = 3.6 * outPath.FlowMeter.LtrPerPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, Convert.ToSingle(TempDownStat.Average));
double volumeCTV = constMasterCorr * Convert.ToDouble(endPulses - startPulses);
if (debugLevel == Common.DebugMode.Simulate) volumeCTV = test.Volume;
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
@@ -811,9 +791,8 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Flow = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = constMasterCorr; /// Corrected master pulses per liter
@@ -84,25 +84,12 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
IScale scale = cBrd.Devices.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
else if (outPath.FlowMeter is TBF.Rig.Dummy.FlowMeter.FlowMeter)
{
var flowm = outPath.FlowMeter as TBF.Rig.Dummy.FlowMeter.FlowMeter;
@@ -150,13 +137,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -488,7 +469,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -522,7 +503,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
if (heatMetersTestParams != null)
{
@@ -535,7 +516,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -790,52 +771,55 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = 0;
TimeSpan duration = TestEndTime - TestStartTime;
tstRslt.TestTime = duration.TotalSeconds; /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
/// Corrected values
tstRslt.MassStart = massStart;
tstRslt.MassEnd = massEnd;
tstRslt.MassOfEvapWater = massOfEvaporatedWater;
tstRslt.FlowMass = 3600.0 * (massEnd - massStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
/// Main results
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
if (cBrd is ControlBoard.Papouch.PapouchCB)
{
/// Test bench with Papouch control board without reference flow meter
tstRslt.VolumeMaster = volumeCTV; /// [l] volume from the master flow meter
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.ConstMasterRaw = 1; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = 1; /// Corrected master pulses per liter
tstRslt.VolumeMaster = tstRslt.VolumeCTV;
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ConstMasterRaw = 1; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = 1; /// Corrected master pulses per liter
tstRslt.ConstMaster = 1;
tstRslt.ErrorMaster = 0;
}
else
{
/// Test bench with ELDE control board and reference 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.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean);
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr
: (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
}
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -98,26 +98,12 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
return new List<Event> { Event.ConfigurationError };
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm;
if (!(dataEntryCmpnt is GenericDevices.IDataEntryForCamera))
@@ -168,14 +154,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -431,7 +410,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
}
while (true);
}
else if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
else if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -650,7 +629,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -684,7 +663,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
if (heatMetersTestParams != null)
{
@@ -697,7 +676,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -895,40 +874,44 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = massStart;
tstRslt.MassEnd = massEnd;
tstRslt.MassOfEvapWater = massOfEvaporatedWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.MassOfEvapWater = massOfEvaporatedWater;
tstRslt.FlowMass = 3600.0 * (massEnd - massStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
double flow = 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.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster);
/// Calculated master pulses per liter
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -87,27 +87,12 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
IVolumeMeter tank = outPath.Scale as IVolumeMeter;
bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
@@ -148,13 +133,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
DoubleBox volumeBox = new DoubleBox();
@@ -326,7 +305,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -503,7 +482,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
/// Measurement loop - begin
@@ -537,7 +516,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
if (compoundTestParams != null)
{
@@ -728,9 +707,9 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
@@ -738,29 +717,33 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [kg/h]
double flow = 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.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.VolumeCTV = volumeCTV;
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -70,28 +70,13 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
@@ -126,8 +111,7 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -249,7 +233,7 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
TestEndTime = DateTime.Now;
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -290,9 +274,9 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
@@ -301,27 +285,34 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
tstRslt.FlowSetTime = Convert.ToInt32(Math.Round(tstRslt.TestTime)); /// [s] test time = flow set time
tstRslt.PulsesMaster = 0;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = 0;
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.TimeBtwnMassMsrmnts = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Corrected values
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Corrected master pulses per liter
/// Main results
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// TODO: ???
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -72,28 +72,13 @@ namespace TBF.Rig.TestMethods.FlyingStart
ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as ControlBoard.Uni.UniCB;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
@@ -127,8 +112,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -310,7 +294,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -382,7 +366,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Measurement loop
State.Create(string.Format("{0}({1}) : FlyingStartStopTestOp is running", test.Method, test.Name))
@@ -407,7 +391,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -423,7 +407,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -461,40 +445,53 @@ namespace TBF.Rig.TestMethods.FlyingStart
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassEndRaw = 0;
tstRslt.TimeBtwnMassMsrmnts = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
/// Corrected data
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [kg/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
/// Main result calculation
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = 0.0; /// Not available without a mass measurement
tstRslt.ConstMaster = tstRslt.ConstMasterCorr;
/// More corrected data
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = 0;
tstRslt.DivStart10 = 0;
tstRslt.DivStart50 = 0;
tstRslt.DivStart90 = 0;
tstRslt.DiverterEnd = 0;
tstRslt.DivEnd90 = 0;
tstRslt.DivEnd50 = 0;
tstRslt.DivEnd10 = 0;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null)
? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
if (compoundTestParams != null)
@@ -102,27 +102,12 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
new List<Event> { Event.ConfigurationError };
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
@@ -165,8 +150,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
: heatMetersTestParams.NextTestVolume);
/// 'totalPulses' calculation has to be inside test repetition loop for this method !!!
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)((repetitionNr == 1 ? test.Volume : nextTestVolume) / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32((repetitionNr == 1 ? test.Volume : nextTestVolume) / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -388,7 +372,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -531,7 +515,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)((repetitionNr == 1) ? test.TestTime : (test.TestTime * nextTestVolume / test.Volume));
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -564,7 +548,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -580,7 +564,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -686,39 +670,47 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
double flowMID = 3.6 * tstRslt.ConstMasterRaw * tstRslt.PulsesMaster / tstRslt.TestTime;
/// Corrected value
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
if (repetitionNr == 1)
{
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
/// Raw data
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
/// Corrected values
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
/// Main results
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -731,6 +723,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -739,21 +732,23 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
{
Results.Entities.TestRslt tstResRepet1 = BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, test.Repeats, 1), test.Part);
/// Not used
tstRslt.MassStartRaw = 0;
tstRslt.MassEndRaw = 0;
tstRslt.TimeBtwnMassMsrmnts = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstResRepet1.ConstMaster; /// Master constant ( pulses per liter) from the first repetition (=against the scale)
/// Main results
tstRslt.ConstMaster = tstResRepet1.ConstMaster; /// From the first repetition (=from mass measurement)
tstRslt.VolumeMaster = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = tstRslt.VolumeMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = tstResRepet1.ErrorMaster; /// Cannot be determined without a mass measurement
tstRslt.DiverterStart = 0;
/// Not used
tstRslt.DiverterStart = 0;
tstRslt.DivStart10 = 0;
tstRslt.DivStart50 = 0;
tstRslt.DivStart90 = 0;
@@ -767,13 +762,12 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.InfoFlags = infoFlags;
}
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
if (compoundTestParams != null)
{
@@ -96,26 +96,12 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
TBF.Rig.ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
string vlvNames = (singleTestParams != null) ? singleTestParams.ValveName
: ((compoundTestParams != null) ? compoundTestParams.ValveName
@@ -180,8 +166,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -408,7 +393,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -628,7 +613,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -655,7 +640,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -670,7 +655,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -772,43 +757,47 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = StartMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = EndMass.Val + (refMass - (measuredRefMass.Val - StartMass.Val));
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = StartMass.Val;
tstRslt.MassEnd = EndMass.Val + (refMass - (measuredRefMass.Val - StartMass.Val));
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean); /// Corrected master pulses per liter
/// Main results
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine; /// [l] commercially true volume
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -821,6 +810,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -86,26 +86,12 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as ControlBoard.Uni.UniCB;
IScale scale = outPath.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
float volumeToTank = (singleTestParams != null) ? singleTestParams.VolumeToTank
: ((compoundTestParams != null) ? compoundTestParams.VolumeToTank : heatMetersTestParams.VolumeToTank);
@@ -158,9 +144,8 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
Event retVal = Event.Done;
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int targetTotalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int targetMassPulses = (int)(volumeToTank / LtrPerRefPulse + 0.5f);
int targetTotalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
int targetMassPulses = Convert.ToInt32(volumeToTank / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -387,7 +372,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -530,7 +515,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -650,47 +635,50 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Raw data
UpdateTempPressDensAmb(tstRslt);
double totalPulses = Convert.ToDouble(cBrd.RefPulses);
double massPulses = Convert.ToDouble(cBrd.MassRefPulses);
/// Main results
double totalPulses = Convert.ToDouble(cBrd.RefPulses);
double massPulses = Convert.ToDouble(cBrd.MassRefPulses);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time (TODO: or cBrd.ImpulseTime(0) ???)
tstRslt.PulsesMaster = massPulses; /// Pulses of the master flow meter (test total)
tstRslt.TotalPulsesMstr = totalPulses;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time (TODO: or cBrd.ImpulseTime(0) ???)
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) * totalPulses / (tstRslt.TestTime * massPulses); /// [kg/h]
double flow = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume of collected water
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * massPulses; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.ConstMasterRaw * totalPulses / tstRslt.TestTime; /// [m3/h]
/// Corrected data
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main result calculation
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine; /// [l] commercially true volume of collected water
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * massPulses; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Master pulses per liter from a correction table and a flow
tstRslt.ConstMaster = (massPulses != 0) ? (tstRslt.VolumeCTV / massPulses) : tstRslt.ConstMasterCorr;
/// Master pulses per liter from the measured mass
tstRslt.Flow = 3.6 * totalPulses * tstRslt.VolumeCTV / (massPulses * tstRslt.TestTime); /// Flow from VolumeCTV, ratio of pulses and time
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * totalPulses * tstRslt.VolumeCTV / (massPulses * tstRslt.TestTime);
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.ConstMaster = (massPulses != 0) ? (tstRslt.VolumeCTV / massPulses) : tstRslt.ConstMasterCorr;
/// Master pulses per liter from the measured mass
/// More corrected data
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -703,8 +691,11 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null)
? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle)
: 0;
tstRslt.InfoFlags = infoFlags;
if (compoundTestParams != null)
@@ -1024,7 +1015,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
UpdateEnergy(heatMetersTestParams);
if (showRemainingTimeMsg) ShowRemainingTime(Math.Max(estimtdEndTime - StateMachine.Time, 0));
@@ -1049,7 +1040,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -99,26 +99,12 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as ControlBoard.Uni.UniCB;
IScale scale = cBrd.Devices.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
@@ -156,8 +142,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
if(heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if(heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = cBrd.Devices.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -387,7 +372,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -540,11 +525,11 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -572,7 +557,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -588,7 +573,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -693,43 +678,47 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h] flow before correction from the master flow meter
/// Corrected data
tstRslt.MassStart = MeasurementCorrection.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);
tstRslt.MassEnd = MeasurementCorrection.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections);
tstRslt.MassOfEvapWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.TestTime; /// [kg/h]
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater) / tstRslt.DensityLine; /// [l] commercially true volume
double mass = tstRslt.MassEnd - tstRslt.MassStart + tstRslt.MassOfEvapWater;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main result calculation
tstRslt.VolumeCTV = 1000 * tstRslt.Batch.Buoyancy * mass / tstRslt.DensityLine;
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Master pulses per liter from a correction table and a flow
tstRslt.ConstMaster = (tstRslt.PulsesMaster != 0) ? (tstRslt.VolumeCTV / tstRslt.PulsesMaster) : tstRslt.ConstMasterCorr;
/// Master pulses per liter from the measured mass
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// Flow from VolumeCTV and time
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (tstRslt.PulsesMaster != 0) ? (tstRslt.VolumeCTV / tstRslt.PulsesMaster) : tstRslt.ConstMasterCorr;
/// Master pulses per liter from the measured mass
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
@@ -742,8 +731,11 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle) : 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null)
? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle)
: 0;
tstRslt.InfoFlags = infoFlags;
if (compoundTestParams != null)
@@ -1146,13 +1138,13 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
/// Simulate flow
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(null, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
IntBox remainingTime = new IntBox((int)test.TestTime);
State.Create(string.Format("{0}({1}) : Simulation", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp((int)test.TestTime, remainingTime))
.EnterState();
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp((int)test.TestTime, remainingTime))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
@@ -1174,7 +1166,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
PressUp.Val = 2.7f;
PressDown.Val = 2.2f;
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
}
while (!e.Contains(Event.TimerExpired));
@@ -43,8 +43,11 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection.Single
{
/// DebugLevel == DebugMode.Simulate
(new FlyingStartMassCollectionSeq()).MakeSimulatedTrivial(test, repetNr, test.Part);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetNr, Progress.Completed));
Bridge.OnTestCompleted(this,
new TestCompletedEventArgs(test.Name,
ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, test.Repeats, repetNr),
test.Part)));
return new List<Event> { Event.Done };
}
}
@@ -100,26 +100,12 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)
{
@@ -162,8 +148,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
DoubleBox volumeBox = new DoubleBox();
@@ -302,7 +287,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -377,7 +362,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
/// Measurement loop preparation
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
DiverterStart.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
DiverterEnd.Start(BatchRslts.Batch.BatchNr, test.Name, repetitionNr);
@@ -404,7 +389,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -489,9 +474,9 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
@@ -499,32 +484,36 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.TimeBtwnMassMsrmnts = 0;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
/// Corrected values
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = volumeBox.Val; /// [l]
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.VolumeCTV = volumeBox.Val; /// [l]
if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon))
{
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow);
tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flowMID);
tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection;
tstRslt.VolumeCTV /= tstRslt.TestTime;
}
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
/// Calculated master pulses per liter
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime;
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val;
tstRslt.DivStart10 = 0;
+6 -7
View File
@@ -235,8 +235,8 @@ namespace TBF.Rig.TestMethods.LeakTest
while (e.Contains(Event.TimerBusy));
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
UpdateAllStatistics(StateMachine.Time);
StartNewStatistics(null, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
UpdateAllStatistics();
if (testParams.MaxMassIncrease > 0)
{
@@ -259,7 +259,7 @@ namespace TBF.Rig.TestMethods.LeakTest
goto stopTest;
}
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
}
while (!e.Contains(Event.ScaleDone) && !e.Contains(Event.Next));
}
@@ -283,7 +283,7 @@ namespace TBF.Rig.TestMethods.LeakTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
if (remainingTime > 60)
@@ -318,7 +318,7 @@ namespace TBF.Rig.TestMethods.LeakTest
goto stopTest;
}
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
}
while (!e.Contains(Event.ScaleDone) && !e.Contains(Event.Next));
}
@@ -392,8 +392,7 @@ namespace TBF.Rig.TestMethods.LeakTest
}
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 0; /// [m3/h]
tstRslt.Flow = 0; /// [m3/h]
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = 0; /// Convert the flow to [m3/h]
@@ -69,8 +69,7 @@ namespace TBF.Rig.TestMethods.ManualEntry
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = 0;
tstRslt.Flow = 0;
tstRslt.VolumeMaster = 0;
tstRslt.ConstMasterRaw = 0;
tstRslt.ConstMasterCorr = 0;
+4 -5
View File
@@ -166,8 +166,8 @@ namespace TBF.Rig.TestMethods.PMaxTest
///
int flowSetTime = (int)Math.Round((DateTime.Now - TestStartTime).TotalSeconds);
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
UpdateAllStatistics(StateMachine.Time);
StartNewStatistics(null, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
UpdateAllStatistics();
int startTime = StateMachine.Time;
int endTime = startTime + testParams.DurationPMax;
@@ -187,7 +187,7 @@ namespace TBF.Rig.TestMethods.PMaxTest
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
int remainingTime = Math.Max(endTime - StateMachine.Time, 0);
if (remainingTime > 60)
@@ -233,8 +233,7 @@ namespace TBF.Rig.TestMethods.PMaxTest
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 0; /// [m3/h]
tstRslt.Flow = 0; /// [m3/h]
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ConstMasterRaw = 0; /// Convert the flow to [m3/h]
+18 -33
View File
@@ -59,25 +59,11 @@ namespace TBF.Rig.TestMethods.PulsesTest
{
float simulatedError = 4.5f; /// %
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
@@ -115,8 +101,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath));
@@ -237,7 +222,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -345,7 +330,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Measurement loop - begin
while (true)
@@ -360,7 +345,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -393,21 +378,21 @@ namespace TBF.Rig.TestMethods.PulsesTest
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [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.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Flow = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean);
/// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Not available without mass measurement
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
@@ -59,28 +59,13 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
{
float simulatedError = 4.5f; /// %
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
@@ -116,9 +101,7 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
/// Read pressure and temperature once before calling Bridge.OnTestSelected(...)
State.Create(string.Format("{0}({1}) : Measuring process data", test.Method, test.Name))
@@ -239,7 +222,7 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -347,7 +330,7 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
/// Measurement loop - preparation
queryEnd1 = cBrd.QueryMeasurementEndOp();
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, 0);
/// Measurement loop - begin
while (true)
@@ -362,7 +345,7 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
}
@@ -388,37 +371,43 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = 0;
tstRslt.MassStart = 0;
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.RefPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
double flowMID = 3.6 * tstRslt.VolumeMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average);
tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First);
tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last);
tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min);
tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max);
/// Corrected values
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, tstRslt.TempDownMean);
/// Main results
tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = 0;
tstRslt.DiverterEnd = 0;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -58,8 +58,7 @@ namespace TBF.Rig.TestMethods.RoiDetection
/// LtrPerRefPulse and totalPulses are only to make time estimates
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
//====================
// Start the test
@@ -38,28 +38,13 @@ namespace TBF.Rig.TestMethods.SensitivityTest
return new List<Event> { Event.Done }; /// TODO: Test method simulation
}
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo
&& eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
@@ -105,13 +90,7 @@ namespace TBF.Rig.TestMethods.SensitivityTest
//--------------------------------
cBrd.StopAll(false);
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -295,7 +274,7 @@ namespace TBF.Rig.TestMethods.SensitivityTest
}
/// TODO: !!! The following can only be done for compound meters
flowsForDetection[0] = cBrd.RefFrequency * outPath.FlowMeter.NominalFlow / 2000.0f;
flowsForDetection[0] = cBrd.RefFrequency * outPath.FlowMeter.NominalFlow / outPath.FlowMeter.NominalFreq;
for (int i = 0; i < Data.WMsCount; i++)
{
double diff = (RegisterReaders[i] != null) ? (RegisterReaders[i].WMPulses - lastWMPulses[i]) : 0;
@@ -454,8 +433,7 @@ namespace TBF.Rig.TestMethods.SensitivityTest
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = 0;
tstRslt.Flow = 0;
tstRslt.VolumeCTV = 0;
tstRslt.VolumeMaster = 0;
tstRslt.ConstMasterRaw = 0;
@@ -66,28 +66,13 @@ namespace TBF.Rig.TestMethods.StandingStart
DebugMode debugLevel)
{
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo && eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
break;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
int waterMetersCount = Math.Min(BenchInfo.WaterMetersCount, sensPath.RegisterReaders.Length);
@@ -130,13 +115,7 @@ namespace TBF.Rig.TestMethods.StandingStart
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -360,7 +339,7 @@ namespace TBF.Rig.TestMethods.StandingStart
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -568,7 +547,7 @@ namespace TBF.Rig.TestMethods.StandingStart
StartTime = (double)StateMachine.Time;
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int initialPulsesCount = RefPulses;
@@ -595,7 +574,7 @@ namespace TBF.Rig.TestMethods.StandingStart
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -611,7 +590,7 @@ namespace TBF.Rig.TestMethods.StandingStart
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -659,8 +638,8 @@ namespace TBF.Rig.TestMethods.StandingStart
TestEndTime = DateTime.Now;
int endPulses = cBrd.RefPulses;
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
double flowMID = 3.6 * outPath.FlowMeter.LtrPerPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowMID, Convert.ToSingle(TempDownStat.Average));
double volumeCTV = constMasterCorr * Convert.ToDouble(endPulses - startPulses);
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
@@ -818,20 +797,20 @@ namespace TBF.Rig.TestMethods.StandingStart
tstRslt.MassEndRaw = 0;
tstRslt.MassEnd = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.FlowMass = 0;
tstRslt.FlowVolume = flowVolume; /// [m3/h]
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.Flow = flowMID; /// [m3/h]
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.VolumeMaster = outPath.FlowMeter.LtrPerPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterCorr = constMasterCorr; /// Corrected master pulses per liter
tstRslt.ConstMaster = constMasterCorr; /// Corrected master pulses per liter
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeCTV = constMasterCorr * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.ErrorMaster = 0;
tstRslt.FlowMean = (float)RefFlowStat.Average;
tstRslt.FlowStart = (float)RefFlowStat.First;
tstRslt.FlowEnd = (float)RefFlowStat.Last;
tstRslt.FlowMin = (float)RefFlowStat.Min;
tstRslt.FlowMax = (float)RefFlowStat.Max;
/// Flow statistics correction
tstRslt.FlowMean = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Average / tstRslt.ConstMasterRaw);
tstRslt.FlowStart = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.First / tstRslt.ConstMasterRaw);
tstRslt.FlowEnd = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Last / tstRslt.ConstMasterRaw);
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
@@ -84,26 +84,12 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
IScale scale = cBrd.Devices.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
if (outPath.FlowMeter is Uni.FlowMeter.FlowMeter)
if ((outPath.FlowMeter is IFlowMeterSingle) &&
(outPath.FlowMeter as IFlowMeterSingle).GetRange(test.TempLimLo, test.TempLimHi) == -1)
{
Uni.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Uni.FlowMeter.FlowMeter;
rangeIx = -1; /// Indicates invalid range
for (int r = 0; r <= 5; r++)
{
if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo && eldeFM.GetTempHi(r) >= test.TempLimHi)
{
rangeIx = r;
break;
}
}
if (rangeIx == -1)
{
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError };
}
}
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
}
IList<Event> e; /// Events from currently running operations
int waterMetersCount = Math.Min(BenchInfo.WaterMetersCount, sensPath.RegisterReaders.Length);
@@ -148,13 +134,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
int totalPulses = Convert.ToInt32(test.Volume / outPath.FlowMeter.LtrPerPulse);
///============================================================================================
@@ -410,7 +390,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);
@@ -652,7 +632,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
StartTime = (double)StateMachine.Time;
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int initialPulsesCount = RefPulses;
@@ -679,7 +659,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
/// Update statistics
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = outPath.FlowMeter.ReadFlow();
UpdateAllStatistics(StateMachine.Time);
UpdateAllStatistics();
#region Heat meters
@@ -695,7 +675,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
//double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime);
double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C]
double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C]
double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l]
double deltaVolume = outPath.FlowMeter.LtrPerPulse * RefPulsesDelta; /// [l]
double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)]
Energy.Update(deltaEnergy);
VolumeForEnergy.Update(deltaVolume);
@@ -781,7 +761,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
double massStart = MeasurementCorrection.CorrectedValue(StartMass.Val, scale.Corrections);
double massEnd = MeasurementCorrection.CorrectedValue(EndMass.Val, scale.Corrections);
double densityOut = Formulas.WaterDensityFromTempPress((TempUpStat.Average + TempDownStat.Average) / 2,
(PressUpStat.Average + PressDownStat.Average) / 2);
(PressUpStat.Average + PressDownStat.Average) / 2);
double buoyancy = Formulas.Buoyancy();
double massOfEvaporatedWater = (double)(tMass2 - tMass1) * outPath.Scale.EvaporationRate(TempDivStat.Average);
double volumeCTV = 1000.0 * buoyancy * (massEnd - massStart + massOfEvaporatedWater) / densityOut;
@@ -925,42 +905,44 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
UpdateTempPressDensAmb(tstRslt);
/// Main results
/// Raw data
UpdateTempPressDensAmb(tstRslt);
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = Math.Max(1.0, DateTimeBox.DurationSec(timeStampStart, timeStampEnd)); /// Min. 1s to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = massStart;
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = massEnd;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
/// Corrected values
tstRslt.MassStart = massStart;
tstRslt.MassEnd = massEnd;
tstRslt.MassOfEvapWater = massOfEvaporatedWater;
tstRslt.FlowMass = 3600.0 * (massEnd - massStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * volumeCTV / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
/// Main results
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.Flow = 3.6 * volumeCTV / tstRslt.TestTime; /// [m3/h]
if (cBrd is ControlBoard.Uni.UniCB)
{
/// Test bench with Uni control board and q reference flow meter
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.Flow, tstRslt.TempDownMean);
tstRslt.VolumeMaster = tstRslt.ConstMasterRaw * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMaster = (tstRslt.VolumeMaster != 0) ? (tstRslt.ConstMasterRaw * tstRslt.VolumeCTV / tstRslt.VolumeMaster) : tstRslt.ConstMasterCorr;
}
else
{
/// Test bench with Papouch control board without reference flow meter
tstRslt.VolumeMaster = volumeCTV; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = 1; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = 1; /// Corrected master pulses per liter
tstRslt.VolumeMaster = volumeCTV; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = 1; /// Uncorrected master flowmeter coefficient
tstRslt.ConstMasterCorr = 1; /// Corrected master pulses per liter
tstRslt.ConstMaster = 1;
}
/// Calculated master pulses per lite
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
tstRslt.FlowMean = (float)RefFlowStat.Average;
@@ -971,6 +953,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
tstRslt.DiverterStart = switchTimeStart;
tstRslt.DiverterEnd = switchTimeEnd;
long infoFlags = 0;
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
tstRslt.InfoFlags = infoFlags;
@@ -551,8 +551,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
tstRslt.MassEnd = oriTestRslt.MassEnd;
tstRslt.MassOfEvapWater = oriTestRslt.MassOfEvapWater;
tstRslt.FlowMass = oriTestRslt.FlowMass;
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
tstRslt.SpareDbl = oriTestRslt.SpareDbl;
tstRslt.Flow = oriTestRslt.Flow;
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
@@ -703,8 +703,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
tstRslt.MassEnd = oriTestRslt.MassEnd;
tstRslt.MassOfEvapWater = oriTestRslt.MassOfEvapWater;
tstRslt.FlowMass = oriTestRslt.FlowMass;
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
tstRslt.SpareDbl = oriTestRslt.SpareDbl;
tstRslt.Flow = oriTestRslt.Flow;
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
@@ -855,8 +855,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
tstRslt.MassEndRaw = testRsltQ2ac.MassEndRaw;
tstRslt.MassEnd = testRsltQ2ac.MassEnd;
tstRslt.MassOfEvapWater = testRsltQ2ac.MassOfEvapWater;
tstRslt.FlowMass = testRsltQ2ac.FlowMass;
tstRslt.FlowVolume = testRsltQ2ac.FlowVolume;
tstRslt.SpareDbl = testRsltQ2ac.SpareDbl;
tstRslt.Flow = testRsltQ2ac.Flow;
tstRslt.VolumeCTV = testRsltQ2ac.VolumeCTV;
tstRslt.VolumeMaster = testRsltQ2ac.VolumeMaster;
tstRslt.ErrorMaster = testRsltQ2ac.ErrorMaster;
+43 -9
View File
@@ -13,12 +13,13 @@ using TBF.Resources;
namespace TBF.Rig.Uni.FlowMeter
{
public class FlowMeter : ComponentBase, GenericDevices.IFlowMeter, GenericDevices.IHasCalendarEvents, IDrawingItCmpntWithMeasuredVal
public class FlowMeter : ComponentBase, GenericDevices.IFlowMeterSingle, GenericDevices.IHasCalendarEvents, IDrawingItCmpntWithMeasuredVal
{
private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly FlowMeterCfg flowMeterCfg;
public int Idx1 { get { return (flowMeterCfg != null) ? flowMeterCfg.Idx1 : 0; } }
public double NominalFlow { get { return (flowMeterCfg != null) ? flowMeterCfg.NominalFlow : 0; } }
public double NominalFreq { get { return (flowMeterCfg != null) ? flowMeterCfg.NominalFreq : 2000; } }
@@ -28,7 +29,7 @@ namespace TBF.Rig.Uni.FlowMeter
public double GetTempHi(int ix) { return flowMeterCfg.GetTempHi(ix); }
public double GetPressLo(int ix) { return flowMeterCfg.GetPressLo(ix); }
public double GetPressHi(int ix) { return flowMeterCfg.GetPressHi(ix); }
public SchematicDrawing.IDrawingItem DrawingItem { get { return flowMeterCfg as SchematicDrawing.IDrawingItem; } }
public string MsrdFormat { get { return flowMeterCfg.MsrdFormat; } }
@@ -82,20 +83,46 @@ namespace TBF.Rig.Uni.FlowMeter
}
public double LtrPerPulseCorrected(double flow, int rangeIx)
/// <summary>
/// Determine flow meter range
/// </summary>
/// <param name="tempRngLo">Lower boundary of temperature</param>
/// <param name="tempRngHi">Upper boundary of temperature</param>
/// <returns>flow meter range (0..5) or -1 if no range fits the specified temperature range</returns>
public int GetRange(float tempRngLo, float tempRngHi)
{
for (int rng = 0; rng <= 5; rng++)
{
if (RangeEnabled(rng) && GetTempLo(rng) <= tempRngLo && tempRngHi <= GetTempHi(rng))
{
return rng;
}
}
return -1;
}
public double LtrPerPulseCorrected(double flow, float temperature)
{
/// Apply correction
var rangeCorrections = new List<MeasurementCorrection>();
foreach (var corr in Corrections)
{
if (corr.RangeIx == rangeIx) rangeCorrections.Add(corr);
}
double correctedFlow = MeasurementCorrection.CorrectedValue(flow, rangeCorrections);
int rng = GetRange(temperature, temperature);
double correctedFlow = (measurementCorrections == null || rng < 0) ? flow : CorrectedFlow(flow, rng);
return (LtrPerPulse * correctedFlow / flow);
}
/// <summary>
/// Apply flow measurement correction
/// </summary>
/// <param name="flow">Measured flow in [m3/h]</param>
/// <param name="rng">Tange 0..5</param>
/// <returns>Corrected flow in [m3/h]</returns>
public double CorrectedFlow(double flow, int rng)
{
return MeasurementCorrection.CorrectedValue(flow, measurementCorrections[rng]);
}
readonly UniCB uniCB;
IList<MeasurementCorrection>[] measurementCorrections;
public FlowMeter() { }
@@ -108,6 +135,13 @@ namespace TBF.Rig.Uni.FlowMeter
uniCB = TbfComponents.FindComponent(cfg.ParentName, components) as UniCB;
if (uniCB == null) throw new Exception(string.Format("Cannot find {0} (a parent of {1})", cfg.ParentName, Name));
measurementCorrections = new IList<MeasurementCorrection>[6];
for (int i = 0; i < measurementCorrections.Length; i++) measurementCorrections[i] = new List<MeasurementCorrection>();
foreach (var corr in Corrections)
{
if (corr.RangeIx >= 0 && corr.RangeIx < measurementCorrections.Length) measurementCorrections[corr.RangeIx].Add(corr);
}
log.Warn(this.ToString());
}
+2 -2
View File
@@ -30,7 +30,7 @@ namespace TBF.Rig.Uni.FlowMeter
///
public int Idx1; /// 0 /// 1..7, (DEWA300 : I1+I2=48, I1+I3=80, I2_I3=96, I1+I2+I3=112)
public double NominalFlow; /// 1 /// Nominal flow in m3/h at nominal output frequency (typ. 2000 Hz)
public double NominalFreq; /// 2 /// Nominal flow in m3/h at nominal output frequency (typ. 2000 Hz)
public double NominalFreq; /// 2 /// Nominal frequency in Hz (typ. 2000 Hz)
public string MsrdFormat { get; set; } /// 3
public Unit MsrdUnit { get; set; } /// 4
public Unit TempUnit; /// 5
@@ -292,7 +292,7 @@ namespace TBF.Rig.Uni.FlowMeter
NominalFlow = 1;
NominalFreq = 2000;
MsrdFormat = "{0:F3} m2/h";
MsrdFormat = "{0:F3} m3/h";
MsrdUnit = Unit.m3ph;
MsrdValLimLo = 0;
MsrdValLimHi = NominalFlow;
+93 -96
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2021 Sensus Slovensko a.s.
/// Copyright (c) 2021-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -17,10 +17,11 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly FlowMeterCfg flowMeterCfg;
readonly UniCB uniCB;
readonly IFlowMeter flowMeter1;
readonly IFlowMeter flowMeter2;
readonly IFlowMeter flowMeter3;
UniCB uniCB;
IFlowMeterSingle flowMtr1;
IFlowMeterSingle flowMtr2;
IFlowMeterSingle flowMtr3;
double nominalFlow;
double nominalFreq;
double ltrPerPulse;
@@ -38,70 +39,17 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
public double MsrdValLimLo { get { return flowMeterCfg.MsrdValLimLo; } set { flowMeterCfg.MsrdValLimLo = value; } }
public double MsrdValLimHi { get { return flowMeterCfg.MsrdValLimHi; } set { flowMeterCfg.MsrdValLimHi = value; } }
double[] refFreq; /// 0..sum, 1..I11, 2..I12, 3..I13
int[] refPulses;
public double LtrPerPulseCorrected(double flow, int rangeIx)
{
log.DebugFormat("LtrPerPulseCorrected({0}, {1}) started", flow, rangeIx);
refFreq[0] = uniCB.RefFrequency;
refFreq[1] = uniCB.RefFrequency1;
refFreq[2] = uniCB.RefFrequency2;
refFreq[3] = uniCB.RefFrequency3;
log.DebugFormat("refFreq[] = ({0}, {1}, {2}, {3})", refFreq[0], refFreq[1], refFreq[2], refFreq[3]);
refPulses[0] = uniCB.RefPulses;
refPulses[1] = uniCB.RefPulses1;
refPulses[2] = uniCB.RefPulses2;
refPulses[3] = uniCB.RefPulses3;
log.DebugFormat("refPulses[] = ({0}, {1}, {2}, {3})", refPulses[0], refPulses[1], refPulses[2], refPulses[3]);
double flow1, flow2, flow3;
double contribution1, contribution2, contribution3;
if (refPulses[0] != 0)
{
/// Division by zero prevented inside this 'if'
double ltrPerPulseCorrected = 0;
if (flowMeter1 != null)
{
double ratio = (double)refPulses[flowMeter1.Idx1] / (double)refPulses[0];
flow1 = flow * ratio;
contribution1 = flowMeter1.LtrPerPulseCorrected(flow1, rangeIx) * ratio;
ltrPerPulseCorrected += contribution1;
log.DebugFormat("flowmeter1 = {0}, flow1 = {1}, contribution1 = {2}", flowMeter1.Name, flow1, contribution1);
}
if (flowMeter2 != null)
{
double ratio = (double)refPulses[flowMeter2.Idx1] / (double)refPulses[0];
flow2 = flow * ratio;
contribution2 = flowMeter2.LtrPerPulseCorrected(flow2, rangeIx) * ratio;
ltrPerPulseCorrected += contribution2;
log.DebugFormat("flowmeter2 = {0}, flow2 = {1}, contribution2 = {2}", flowMeter2.Name, flow2, contribution2);
}
if (flowMeter3 != null)
{
double ratio = (double)refPulses[flowMeter3.Idx1] / (double)refPulses[0];
flow3 = flow * ratio;
contribution3 = flowMeter3.LtrPerPulseCorrected(flow3, rangeIx) * ratio;
ltrPerPulseCorrected += contribution3;
log.DebugFormat("flowmeter3 = {0}, flow3 = {1}, contribution3 = {2}", flowMeter3.Name, flow3, contribution3);
}
log.DebugFormat("LtrPerPulseCorrected() returns {0}", ltrPerPulseCorrected);
return ltrPerPulseCorrected;
}
else
{
log.DebugFormat("LtrPerPulseCorrected() returns 1");
return 1;
}
}
public bool MsrmntAvailable
{
get { return true; }
get
{
bool result = true;
if (flowMtr1 != null) result = result && flowMtr1.MsrmntAvailable;
if (flowMtr2 != null) result = result && flowMtr2.MsrmntAvailable;
if (flowMtr3 != null) result = result && flowMtr3.MsrmntAvailable;
return result;
}
}
public double MeasuredVal
@@ -112,52 +60,46 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
public string AltString { get { return "Invalid format"; } }
public FlowMeter()
{
refFreq = new double[4];
refPulses = new int[4];
}
public FlowMeter() { }
public FlowMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
flowMeterCfg = cfg as FlowMeterCfg;
uniCB = TbfComponents.FindComponent(cfg.ParentName, components) as UniCB;
if (uniCB == null) throw new Exception("Cannot find " + Name + " parent");
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter1)) flowMeter1 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter1, components) as IFlowMeter;
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter2)) flowMeter2 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter2, components) as IFlowMeter;
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter3)) flowMeter3 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter3, components) as IFlowMeter;
log.Warn(this.ToString());
}
public override void Initialize()
{
uniCB = TbfComponents.FindComponent(flowMeterCfg.ParentName) as UniCB;
if (uniCB == null) throw new Exception("Cannot find " + Name + " parent");
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter1)) flowMtr1 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter1) as IFlowMeterSingle;
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter2)) flowMtr2 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter2) as IFlowMeterSingle;
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter3)) flowMtr3 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter3) as IFlowMeterSingle;
nominalFlow = 0;
flowMetersCount = 0;
flowMetersBitfield = 0;
if (flowMeter1 != null)
if (flowMtr1 != null)
{
nominalFlow += flowMeter1.NominalFlow;
nominalFreq += flowMeter1.NominalFreq;
flowMetersBitfield |= (4 << flowMeter1.Idx1);
nominalFlow += flowMtr1.NominalFlow;
nominalFreq += flowMtr1.NominalFreq;
flowMetersBitfield |= (4 << flowMtr1.Idx1);
flowMetersCount++;
}
if (flowMeter2 != null)
if (flowMtr2 != null)
{
nominalFlow += flowMeter2.NominalFlow;
nominalFreq += flowMeter2.NominalFreq;
flowMetersBitfield |= (4 << flowMeter2.Idx1);
nominalFlow += flowMtr2.NominalFlow;
nominalFreq += flowMtr2.NominalFreq;
flowMetersBitfield |= (4 << flowMtr2.Idx1);
flowMetersCount++;
}
if (flowMeter3 != null)
if (flowMtr3 != null)
{
nominalFlow += flowMeter3.NominalFlow;
nominalFreq += flowMeter3.NominalFreq;
flowMetersBitfield |= (4 << flowMeter3.Idx1);
nominalFlow += flowMtr3.NominalFlow;
nominalFreq += flowMtr3.NominalFreq;
flowMetersBitfield |= (4 << flowMtr3.Idx1);
flowMetersCount++;
}
if (flowMetersCount == 0) throw new Exception("Missing flowmeters");
@@ -166,13 +108,13 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
ltrPerPulse = nominalFlow / (3.6 * nominalFreq); /// Nominal freq. is sum of particular nominal frquencies
refFreq = new double[4];
refPulses = new int[4];
log.FatalFormat("{0} initialized: {1} nom.flow={2} m3/h nom.freq={3} Hz bitfield=0x{4:X2}",
Name, this, nominalFlow, nominalFreq, flowMetersBitfield);
}
public double ReadFlow()
{
return nominalFlow * ReadFrequency() / (3.6 * nominalFreq);
return ReadFrequency() * nominalFlow / nominalFreq;
}
public double ReadFrequency()
@@ -200,5 +142,60 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
{
return new ReadFlowOp(this, ref flow, flowDone);
}
}
double flowRawSum;
double flowSum;
int timeSum;
int rng1;
int rng2;
int rng3;
public void StartStatistics(Config.Entities.Test test)
{
flowRawSum = 0;
flowSum = 0;
timeSum = 0;
if (flowMtr1 != null) rng1 = Math.Max(0, flowMtr1.GetRange(test.TempLimLo, test.TempLimHi));
if (flowMtr2 != null) rng2 = Math.Max(0, flowMtr2.GetRange(test.TempLimLo, test.TempLimHi));
if (flowMtr3 != null) rng3 = Math.Max(0, flowMtr3.GetRange(test.TempLimLo, test.TempLimHi));
}
public void UpdateStatistics(int timeDelta)
{
double tempFlow;
if (flowMtr1 != null)
{
flowRawSum += timeDelta * (tempFlow = flowMtr1.ReadFlow());
flowSum += timeDelta * flowMtr1.CorrectedFlow(tempFlow, rng1); ;
}
if (flowMtr2 != null)
{
flowRawSum += timeDelta * (tempFlow = flowMtr2.ReadFlow());
flowSum += timeDelta * flowMtr2.CorrectedFlow(tempFlow, rng2); ;
}
if (flowMtr3 != null)
{
flowRawSum += timeDelta * (tempFlow = flowMtr3.ReadFlow());
flowSum += timeDelta * flowMtr3.CorrectedFlow(tempFlow, rng3); ;
}
timeSum += timeDelta;
}
public void StopStatistics()
{
flowRawSum /= Convert.ToDouble(timeSum);
flowSum /= Convert.ToDouble(timeSum);
log.WarnFormat("StopStatistics() flowRawSum = {0:F3} m3/h flowSum = {1:F3} m3/h", flowRawSum, flowSum);
}
public double LtrPerPulseCorrected(double flow, float temperature)
{
double ltrPerPulseCorrected = (flowRawSum == 0) ? LtrPerPulse : LtrPerPulse * flowSum / flowRawSum;
log.WarnFormat("LtrPerPulseCorrected() flow = {0:F3} m3/h flowRawSum = {1:F3} m3/h flowSum = {2:F3} m3/h temperature = {3:F1} C ltrPerPulseCorrected = {4}", flow, flowRawSum, flowSum, temperature, ltrPerPulseCorrected);
return ltrPerPulseCorrected;
}
}
}
@@ -83,7 +83,7 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
Flowmeter1 = "I11";
Flowmeter2 = "I12";
Flowmeter3 = string.Empty;
MsrdFormat = "{0:F3} m2/h";
MsrdFormat = "{0:F3} m3/h";
MsrdUnit = Unit.m3ph;
}
+2 -2
View File
@@ -228,8 +228,8 @@ namespace TBF.Rig.Uni.RegValve
if (StateMachine.Time > setFlowTime)
{
uniCB.SetFlow(false, regV.Idx1, 2000 * currentReqFlowLo / flowMeter.NominalFlow,
2000 * currentReqFlowHi / flowMeter.NominalFlow);
uniCB.SetFlow(false, regV.Idx1, 2000.0 * currentReqFlowLo / flowMeter.NominalFlow,
2000.0 * currentReqFlowHi / flowMeter.NominalFlow);
log.InfoFormat("Run(): rv#={0} TARGET: flowLo={1} flowHi={2}", regV.Idx1, currentReqFlowLo, currentReqFlowHi);
+1 -1
View File
@@ -169,7 +169,7 @@ namespace TBF.Rig.Uni.RegValveAnalog
///
if (flowMtrFreq != 0)
{
double flow = flowMtrFreq * nominalFlow / 2000.0;
double flow = flowMtrFreq * nominalFlow / 2000.0; /// TODO: ???
if (measuredFlow != null) measuredFlow.Val = flow;
if (flow >= reqFlowAve) currentReqFlowLo = finalReqFlowLo;
if (flow <= reqFlowAve) currentReqFlowHi = finalReqFlowHi;
+1 -1
View File
@@ -173,7 +173,7 @@ namespace TBF.Rig.Uni.RegValveTandem
///
if (flowMtrFreq != 0)
{
double flow = flowMtrFreq * nominalFlow / 2000.0;
double flow = flowMtrFreq * nominalFlow / 2000.0; /// TODO: ???
if (measuredFlow != null) measuredFlow.Val = flow;
if (flow >= reqFlowAve) currentReqFlowLo = finalReqFlowLo;
if (flow <= reqFlowAve) currentReqFlowHi = finalReqFlowHi;
+2 -2
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
/// Copyright (c) 2017-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -46,7 +46,7 @@ namespace TBF.Rig.Various.CoverTest
if (myCfg.BypassGroup4 != Common.GID.None) groups.Add(myCfg.BypassGroup4);
bypassLevel = groups.ToArray();
log.FatalFormat("{0} - Successfully initialized", Name);
log.FatalFormat("{0} initialized: {1}", Name, this);
}
+3 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
/// Copyright (c) 2017-2022 Sensus Slovensko a.s.
///
using System.IO;
using System.Collections.Generic;
@@ -12,7 +12,7 @@ using TBF.Resources;
namespace TBF.Rig.Various.CoverTest
{
public class CoverTestCfg : ComponentCfgBase, IComponentCfg, IParamsProvider, IDrawingItem
public class CoverTestCfg : ComponentCfgBase, IComponentCfg, IParamsProvider, IRouteBasedDrawingItem
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CoverTestCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -71,7 +71,7 @@ namespace TBF.Rig.Various.CoverTest
public void InitializeAll()
{
BitNr = 80;
BitNr = 119;
Inverted = false;
Message = Strings.Close_the_cover;
BypassGroup1 = GID.TestingSpecialists;
+3 -3
View File
@@ -32,7 +32,7 @@ namespace TBF.Rig.Various.ErrorFlags
/// Any E# is 'true' on error, 'false' when OK
/// Average flow
bool E1 = (testRslt.FlowVolume < testRslt.Qfrom()) || (testRslt.FlowVolume > testRslt.Qto());
bool E1 = (testRslt.Flow < testRslt.Qfrom()) || (testRslt.Flow > testRslt.Qto());
/// Max. and min. up and down water temperature
bool E2 = ProcessData.TempUpStat.Min < testRslt.TempLimLo()
@@ -88,8 +88,8 @@ namespace TBF.Rig.Various.ErrorFlags
|| ProcessData.PressDownStat.Max > errorsCfg.TestParams.Pressure_max;
/// Max. and min. flow
double rectifiedFlowMin = (testRslt.FlowMean == 0) ? testRslt.FlowMin : testRslt.FlowMin * testRslt.FlowVolume / testRslt.FlowMean;
double rectifiedFlowMax = (testRslt.FlowMean == 0) ? testRslt.FlowMax : testRslt.FlowMax * testRslt.FlowVolume / testRslt.FlowMean;
double rectifiedFlowMin = (testRslt.FlowMean == 0) ? testRslt.FlowMin : testRslt.FlowMin * testRslt.Flow / testRslt.FlowMean;
double rectifiedFlowMax = (testRslt.FlowMean == 0) ? testRslt.FlowMax : testRslt.FlowMax * testRslt.Flow / testRslt.FlowMean;
bool E21 = rectifiedFlowMin < testRslt.Qfrom() || rectifiedFlowMax > testRslt.Qto();
/// Electrical conductivity of water
+7 -30
View File
@@ -204,6 +204,7 @@
<Compile Include="Rig\Configs\ParamsProvider\ComponentCfgCtrl.designer.cs">
<DependentUpon>ComponentCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\ControlBoard\Enums.cs" />
<Compile Include="Rig\ControlBoard\IAdvancedControlBoard.cs" />
<Compile Include="Rig\ControlBoard\IControlBoard.cs" />
<Compile Include="Rig\ControlBoard\Papouch\PapouchCB.cs" />
@@ -603,11 +604,14 @@
<Compile Include="Rig\Dummy\RegValve\Factory.cs" />
<Compile Include="Rig\Dummy\RegValve\SetFlowOp.cs" />
<Compile Include="Rig\Dummy\RegValve\SetRegValvePositionOp.cs" />
<Compile Include="Rig\Dummy\TempControl\Component.cs" />
<Compile Include="Rig\Dummy\TempControl\Factory.cs" />
<Compile Include="Rig\Dummy\Valve\Component.cs" />
<Compile Include="Rig\Dummy\Valve\Factory.cs" />
<Compile Include="Rig\GenericDevices\ICalibInfoCfg.cs" />
<Compile Include="Rig\GenericDevices\IEvaporation.cs" />
<Compile Include="Rig\GenericDevices\IEventTrigger.cs" />
<Compile Include="Rig\GenericDevices\IFlowMeterSingle.cs" />
<Compile Include="Rig\GenericDevices\IHasCalendarEvents.cs" />
<Compile Include="Rig\GenericDevices\IParallelOutput.cs" />
<Compile Include="Rig\GenericDevices\IReceivesDataFromRadio.cs" />
@@ -635,6 +639,7 @@
<Compile Include="Rig\GenericDevices\IStatisticsMonitoring.cs" />
<Compile Include="Rig\GenericDevices\ITankDraining.cs" />
<Compile Include="Rig\GenericDevices\ITankDrainingCfg.cs" />
<Compile Include="Rig\GenericDevices\ITempControl.cs" />
<Compile Include="Rig\GenericDevices\ITestMethodWith2ndPass.cs" />
<Compile Include="Rig\GenericDevices\IVolumeMeter.cs" />
<Compile Include="Rig\Hart\Common\Enums.cs" />
@@ -741,15 +746,14 @@
<Compile Include="Rig\Modbus\TempControl\Easytherm\Factory.cs" />
<Compile Include="Rig\Modbus\TempControl\Easytherm\ProcParams.cs" />
<Compile Include="Rig\Modbus\TempControl\Easytherm\ReadTempOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Easytherm\SetRequiredTemperatureOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Easytherm\SetTemperatureSetpointOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Easytherm\SetTemperatureOp.cs" />
<Compile Include="Rig\Modbus\TempControl\ITempControl.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\Factory.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\TControl.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\TControlCfg.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\ProcParams.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\ReadTempOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\SetRequiredTemperatureOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\SetTemperatureSetpointOp.cs" />
<Compile Include="Rig\Modbus\TempControl\Novus\SetTemperatureOp.cs" />
<Compile Include="Rig\Modbus\TempMeter\Groch\ReadTempOp.cs" />
<Compile Include="Rig\Modbus\TempMeter\Groch\TempMeter.cs" />
@@ -2354,24 +2358,6 @@
<Compile Include="UI\Process\ProcessTabPageCtrl.Designer.cs">
<DependentUpon>ProcessTabPageCtrl.cs</DependentUpon>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl24.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl24.designer.cs">
<DependentUpon>ProcessTabPageCtrl24.cs</DependentUpon>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl48.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl48.designer.cs">
<DependentUpon>ProcessTabPageCtrl48.cs</DependentUpon>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl6.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UI\Process\ProcessTabPageCtrl6.designer.cs">
<DependentUpon>ProcessTabPageCtrl6.cs</DependentUpon>
</Compile>
<Compile Include="UI\ResultsMI\DeleteFromOracleForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -3250,15 +3236,6 @@
<EmbeddedResource Include="UI\Process\ProcessTabPageCtrl.resx">
<DependentUpon>ProcessTabPageCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Process\ProcessTabPageCtrl24.resx">
<DependentUpon>ProcessTabPageCtrl24.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Process\ProcessTabPageCtrl48.resx">
<DependentUpon>ProcessTabPageCtrl48.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\Process\ProcessTabPageCtrl6.resx">
<DependentUpon>ProcessTabPageCtrl6.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\ResultsMI\DeleteFromOracleForm.resx">
<DependentUpon>DeleteFromOracleForm.cs</DependentUpon>
</EmbeddedResource>
-21
View File
@@ -150,27 +150,6 @@ namespace TBF.UI
/// Load the list of components from the database
var session = TBF.DB.CreateSession(DBKind.Config);
cmpntEntities = session.QueryOver<Config.Entities.Component>().OrderBy(x => x.ItemNr).Asc.List();
///
/// Set TBF.Data members when there is a BenchInfo or an iPerlBenchInfo component
///
foreach (var cmpnt in cmpntEntities)
{
if (cmpnt.ClassName == "DataContainer.BenchInfo")
{
var cfg = new TBF.Rig.DataContainer.BenchInfo.Factory().CmpntCfgFromCmpntEntity(cmpnt)
as TBF.Rig.DataContainer.BenchInfo.ComponentCfg;
TBF.Data.SetData(cfg.WaterMetersCount, cfg.CompoundMetersCount, cfg.LinesCount);
break;
}
else if (cmpnt.ClassName == "DataContainer.iPerlBenchInfo")
{
var cfg = new TBF.Rig.DataContainer.iPerlBenchInfo.Factory().CmpntCfgFromCmpntEntity(cmpnt)
as TBF.Rig.DataContainer.iPerlBenchInfo.ComponentCfg;
TBF.Data.SetData(cfg.WaterMetersCount, cfg.CompoundMetersCount, cfg.LinesCount);
break;
}
}
}
catch (Exception)
{
+8 -8
View File
@@ -277,7 +277,7 @@
<value>23, 3, 3, 3</value>
</data>
<data name="procedureComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>353, 33</value>
<value>359, 33</value>
</data>
<data name="procedureComboBox.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@@ -352,7 +352,7 @@
<value>389, 39</value>
</data>
<data name="splitContainer2.SplitterDistance" type="System.Int32, mscorlib">
<value>353</value>
<value>359</value>
</data>
<data name="splitContainer2.SplitterWidth" type="System.Int32, mscorlib">
<value>1</value>
@@ -739,7 +739,7 @@
<value>processTabPageCtrl</value>
</data>
<data name="&gt;&gt;processTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.Process.ProcessTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.Process.ProcessTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;processTabPageCtrl.Parent" xml:space="preserve">
<value>processTabPage</value>
@@ -817,7 +817,7 @@
<value>resultsTabPageCtrl</value>
</data>
<data name="&gt;&gt;resultsTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.ResultsMI.ResultsTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.ResultsMI.ResultsTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;resultsTabPageCtrl.Parent" xml:space="preserve">
<value>resultsTabPage</value>
@@ -868,7 +868,7 @@
<value>graphsTabPageCtrl</value>
</data>
<data name="&gt;&gt;graphsTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.Graphs.GraphsTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.Graphs.GraphsTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;graphsTabPageCtrl.Parent" xml:space="preserve">
<value>graphsTabPage</value>
@@ -922,7 +922,7 @@
<value>eventLogsTabPageCtrl</value>
</data>
<data name="&gt;&gt;eventLogsTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.EventLogs.EventLogsTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.EventLogs.EventLogsTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;eventLogsTabPageCtrl.Parent" xml:space="preserve">
<value>eventLogsTabPage</value>
@@ -973,7 +973,7 @@
<value>calendarTabPageCtrl</value>
</data>
<data name="&gt;&gt;calendarTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.Calendar.CalendarTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.Calendar.CalendarTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;calendarTabPageCtrl.Parent" xml:space="preserve">
<value>calendarTabPage</value>
@@ -1024,7 +1024,7 @@
<value>picturesTabPageCtrl</value>
</data>
<data name="&gt;&gt;picturesTabPageCtrl.Type" xml:space="preserve">
<value>TBF.UI.Camera.PicturesTabPageCtrl, TBF, Version=3.1.1843.0, Culture=neutral, PublicKeyToken=null</value>
<value>TBF.UI.Camera.PicturesTabPageCtrl, TBF, Version=3.1.1901.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;picturesTabPageCtrl.Parent" xml:space="preserve">
<value>picturesTabPage</value>
+14 -9
View File
@@ -49,6 +49,7 @@ namespace TBF.UI.Procedures
public IList<IRegValve> RegulValves;
public IList<ITestMethod> TestMethods;
public IList<ITestMethod> UsedTestMethods;
public IList<ITempControl> TempControllers;
ComboBox methodCBox;
/// Auxiliary private lists
@@ -150,6 +151,7 @@ namespace TBF.UI.Procedures
Valves = Rig.BuiltIn.ValveBase.GetMasterValves(TbfComponents);
RegulValves = new List<IRegValve>();
TestMethods = new List<ITestMethod>();
TempControllers = new List<ITempControl>();
dataEntryComboBox.Items.Add("---");
printer1ComboBox.Items.Add("---");
printer2ComboBox.Items.Add("---");
@@ -166,7 +168,8 @@ namespace TBF.UI.Procedures
{
if (cmpnt is IRegValve) RegulValves.Add(cmpnt as IRegValve);
if (cmpnt is ITestMethod) TestMethods.Add(cmpnt as ITestMethod);
if (cmpnt is IDataEntry) dataEntryComboBox.Items.Add(cmpnt.Cfg.Name);
if (cmpnt is ITempControl) TempControllers.Add(cmpnt as ITempControl);
if (cmpnt is IDataEntry) dataEntryComboBox.Items.Add(cmpnt.Cfg.Name);
if (cmpnt is IResultsPrinter)
{
printer1ComboBox.Items.Add(cmpnt.Cfg.Name);
@@ -1211,7 +1214,7 @@ namespace TBF.UI.Procedures
TempLimLo,
TempLimHi,
TempUnit,
ControlWaterTemp,
TempControl,
ShortPulses,
Publish,
Evaluate,
@@ -1245,9 +1248,9 @@ namespace TBF.UI.Procedures
if (Units.IsTemperature(u)) tempUnitBox.Items.Add(u.ToDescription());
}
ComboBox yesNo2CBox = new ComboBox(); /// control for Control water temp.
yesNo2CBox.Items.Add(Strings.yes);
yesNo2CBox.Items.Add(Strings.no);
ComboBox tempControlBox = new ComboBox(); /// control for Control water temp.
tempControlBox.Items.Add("---");
foreach (var tc in TempControllers) tempControlBox.Items.Add(tc.Name);
ComboBox yesNo3CBox = new ComboBox(); /// control for Evaluate
yesNo3CBox.Items.Add(Strings.yes);
@@ -1260,7 +1263,7 @@ namespace TBF.UI.Procedures
new TextBox(), /// Temp.Lim. -
new TextBox(), /// Temp.Lim. +
tempUnitBox,
yesNo2CBox, /// Control water temp.
tempControlBox, /// Water temp. control
new TextBox(), /// Short pulses
publishCBox, /// Publish
yesNo3CBox, /// Evaluate
@@ -1294,7 +1297,7 @@ namespace TBF.UI.Procedures
lvi.SubItems.Add(Units.ConvertTo(test.TempUnit, test.TempLimLo).ToString());
lvi.SubItems.Add(Units.ConvertTo(test.TempUnit, test.TempLimHi).ToString());
lvi.SubItems.Add(test.TempUnit.ToDescription());
lvi.SubItems.Add(test.DoControlWaterTemp ? Strings.yes : Strings.no);
lvi.SubItems.Add(string.IsNullOrEmpty(test.TempControl) ? "---" : test.TempControl);
lvi.SubItems.Add(test.ShortPulses.ToString());
lvi.SubItems.Add(((Publish)test.Publish).ToDescription());
lvi.SubItems.Add(test.DoEvaluate ? Strings.yes : Strings.no);
@@ -1315,7 +1318,9 @@ namespace TBF.UI.Procedures
entity.ItemNr = i;
entity.Name = lvi.SubItems[(int)Mtrlgy2Clmn.Name].Text;
entity.Part = lvi.SubItems[(int)Mtrlgy2Clmn.Part].Text.Equals("-") ? 0 : int.Parse(lvi.SubItems[(int)Mtrlgy2Clmn.Part].Text);
entity.DoControlWaterTemp = lvi.SubItems[(int)Mtrlgy2Clmn.ControlWaterTemp].Text.Equals(Strings.yes);
entity.TempControl = lvi.SubItems[(int)Mtrlgy2Clmn.TempControl].Text.Equals("---")
? string.Empty
: lvi.SubItems[(int)Mtrlgy2Clmn.TempControl].Text;
entity.ShortPulses = int.Parse(lvi.SubItems[(int)Mtrlgy2Clmn.ShortPulses].Text);
entity.DoEvaluate = lvi.SubItems[(int)Mtrlgy2Clmn.Evaluate].Text.Equals(Strings.yes);
@@ -1441,7 +1446,7 @@ namespace TBF.UI.Procedures
if (uint.TryParse(e.DisplayText, out udummy)) return;
break;
case Mtrlgy2Clmn.ControlWaterTemp:
case Mtrlgy2Clmn.TempControl:
case Mtrlgy2Clmn.Publish:
case Mtrlgy2Clmn.Evaluate:
/// Combo boxes
+39 -15
View File
@@ -30,9 +30,10 @@
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.metersListView = new System.Windows.Forms.ListView();
this.testDataListView = new System.Windows.Forms.ListView();
this.metersListView = new System.Windows.Forms.ListView();
this.processDrawingCtrl = new SchematicDrawing.SchematicDrawingCtrl();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -41,6 +42,9 @@
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -75,25 +79,12 @@
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.metersListView);
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(250, 580);
this.splitContainer2.SplitterDistance = 200;
this.splitContainer2.SplitterWidth = 15;
this.splitContainer2.TabIndex = 0;
//
// metersListView
//
this.metersListView.AllowColumnReorder = true;
this.metersListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.metersListView.FullRowSelect = true;
this.metersListView.GridLines = true;
this.metersListView.Location = new System.Drawing.Point(0, 0);
this.metersListView.Name = "metersListView";
this.metersListView.Size = new System.Drawing.Size(250, 365);
this.metersListView.TabIndex = 0;
this.metersListView.UseCompatibleStateImageBehavior = false;
this.metersListView.View = System.Windows.Forms.View.Details;
//
// testDataListView
//
this.testDataListView.AllowColumnReorder = true;
@@ -107,6 +98,19 @@
this.testDataListView.UseCompatibleStateImageBehavior = false;
this.testDataListView.View = System.Windows.Forms.View.Details;
//
// metersListView
//
this.metersListView.AllowColumnReorder = true;
this.metersListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.metersListView.FullRowSelect = true;
this.metersListView.GridLines = true;
this.metersListView.Location = new System.Drawing.Point(0, 0);
this.metersListView.Name = "metersListView";
this.metersListView.Size = new System.Drawing.Size(250, 200);
this.metersListView.TabIndex = 0;
this.metersListView.UseCompatibleStateImageBehavior = false;
this.metersListView.View = System.Windows.Forms.View.Details;
//
// processDrawingCtrl
//
this.processDrawingCtrl.AltStrings = null;
@@ -129,6 +133,22 @@
this.processDrawingCtrl.SupressRedraws = false;
this.processDrawingCtrl.TabIndex = 0;
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.metersListView);
this.splitContainer3.Size = new System.Drawing.Size(250, 365);
this.splitContainer3.SplitterDistance = 200;
this.splitContainer3.TabIndex = 0;
//
// ProcessTabPageCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -144,6 +164,9 @@
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -155,5 +178,6 @@
private System.Windows.Forms.SplitContainer splitContainer2;
private SchematicDrawing.SchematicDrawingCtrl processDrawingCtrl;
private System.Windows.Forms.ListView testDataListView;
private System.Windows.Forms.SplitContainer splitContainer3;
}
}
+348 -150
View File
@@ -7,7 +7,6 @@ using System.Linq;
using System.Windows.Forms;
using log4net;
using Common;
using Config.Entities;
using SchematicDrawing;
using TBF.Resources;
using TBF.Rig.Sequences;
@@ -33,6 +32,7 @@ namespace TBF.UI.Process
Volume,
Pulses,
RefPulses,
PulsesPerLtr,
SerialNr,
Count
}
@@ -42,13 +42,14 @@ namespace TBF.UI.Process
int volumeIx;
int refErrorIx;
MetersKind currentMetersKind;
MetersKind metersKind;
public ProcessTabPageCtrl()
{
InitializeComponent();
InitializeTableOfMeters(metersListView, ProcessData.WMsCount);
InitializeDrawing();
InitializeTestDataTable(testDataListView, null);
InitializeTableOfMeters(metersListView, MetersKind.Single, TBF.Data.WMsCount);
InitializeDrawing(MetersKind.Single);
Bridge.ProcedureSelectedHandler += delegate(object sender, ProcedureSelectedEventArgs args)
{
@@ -82,15 +83,6 @@ namespace TBF.UI.Process
}
catch (Exception e) { log.ErrorFormat("ProcessTabPageCtrl.OnTestCompleted() failed: {0}", e.Message); }
};
Bridge.ProcedureCompletedHandler += delegate(object sender, ProcedureCompletedEventArgs args)
{
try {
if (InvokeRequired) Invoke(new EventHandler<ProcedureCompletedEventArgs>(OnProcedureCompleted), sender, args);
else OnProcedureCompleted(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPageCtrl.OnProcedureCompleted() failed: {0}", e.Message); }
};
}
@@ -103,12 +95,13 @@ namespace TBF.UI.Process
/// metersListViewEx columns
var cols = ls.ProcMetersColWidths;
metersListView.Columns.Add(Strings.Nr, (cols != null && cols.Length > 0) ? cols[0] : 30 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Error, (cols != null && cols.Length > 1) ? cols[1] : 50 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Volume, (cols != null && cols.Length > 2) ? cols[2] : 50 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Pulses, (cols != null && cols.Length > 3) ? cols[3] : 60 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Ref_pulses, (cols != null && cols.Length > 4) ? cols[4] : 75 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.SerialNr, (cols != null && cols.Length > 5) ? cols[5] : 100 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Nr, (cols != null && cols.Length > 0) ? cols[0] : 40 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Error, (cols != null && cols.Length > 1) ? cols[1] : 50 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Volume, (cols != null && cols.Length > 2) ? cols[2] : 50 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Pulses, (cols != null && cols.Length > 3) ? cols[3] : 60 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.Ref_pulses, (cols != null && cols.Length > 4) ? cols[4] : 75 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.PulsesPerLtr, (cols != null && cols.Length > 5) ? cols[5] : 90 * MainWnd.Dpi / Constants.Dpi100pct);
metersListView.Columns.Add(Strings.SerialNr, (cols != null && cols.Length > 6) ? cols[6] : 100 * MainWnd.Dpi / Constants.Dpi100pct);
/// testDataListViewEx columns
cols = ls.ProcTestDataColWidths;
@@ -194,37 +187,37 @@ namespace TBF.UI.Process
lv.Items.Add(lvi = new ListViewItem(new string[] {
Strings.Test,
args.Test.Name,
args != null ? args.Test.Name : "---",
string.Empty
}));
lv.Items.Add(lvi = new ListViewItem(new string[] {
Strings.Repetition,
string.Format("{0} / {1}", args.RepetitionNr, args.Test.Repeats),
args != null ? string.Format("{0} / {1}", args.RepetitionNr, args.Test.Repeats) : "---",
string.Empty
}));
lv.Items.Add(new ListViewItem(new string[] {
Strings.Q_from,
Units.ConvertTo(ProcessData.FlowUnit, args.Test.Qfrom).ToString(),
args != null ? Units.ConvertTo(ProcessData.FlowUnit, args.Test.Qfrom).ToString() : "---",
ProcessData.FlowUnit.ToDescription()
}));
lv.Items.Add(new ListViewItem(new string[] {
Strings.Q_to,
Units.ConvertTo(ProcessData.FlowUnit, args.Test.Qto).ToString(),
args != null ? Units.ConvertTo(ProcessData.FlowUnit, args.Test.Qto).ToString() : "---",
ProcessData.FlowUnit.ToDescription()
}));
lv.Items.Add(new ListViewItem(new string[] {
Strings.Target_volume,
Units.ConvertTo(ProcessData.VolumeUnit, args.Test.Volume).ToString(),
args != null ? Units.ConvertTo(ProcessData.VolumeUnit, args.Test.Volume).ToString() : "---",
ProcessData.VolumeUnit.ToDescription()
}));
lv.Items.Add(new ListViewItem(new string[] {
Strings.Test_time,
args.Test.TestTime.ToString(),
args != null ? args.Test.TestTime.ToString() : "---",
Unit.s.ToDescription()
}));
@@ -256,8 +249,7 @@ namespace TBF.UI.Process
Unit.Pct.ToDescription()
}));
log.DebugFormat("InitializeTestDataTable: startMassIx={0} massIx={1} volumeIx={2} refErrorIx={3} itemsCount={4}",
startMassIx, massIx, volumeIx, refErrorIx, lv.Items.Count);
splitContainer2.SplitterDistance = 45 + 17 * lv.Items.Count;
}
@@ -268,38 +260,78 @@ namespace TBF.UI.Process
/// <param name="listView">ListView control</param>
/// <param name="wmsCount">Water meters count</param>
/// <param name="waterMeters">Optional water meters to be used as list view item tags</param>
void InitializeTableOfMeters(ListView listView, int wmsCount, IList<Results.Entities.WaterMeter> waterMeters = null)
void InitializeTableOfMeters(ListView listView, MetersKind metersKind, int wmsCount,
IList<Results.Entities.WaterMeter> waterMeters = null)
{
if (listView.Items.Count != wmsCount)
int rowsCount = (metersKind == MetersKind.Combined) ? (3 * wmsCount) : wmsCount;
splitContainer3.SplitterDistance = 45 + 17 * rowsCount;
if (listView.Items.Count != rowsCount)
{
/// Executed when the number of water meters or register readers changes
/// Nr. of water meters has changed => All table rows are re-initialized
listView.Items.Clear();
for (int i = 0; i < wmsCount; i++)
{
listView.Items.Add(new ListViewItem((i + 1).ToString()));
if (metersKind == MetersKind.Combined)
{
listView.Items.Add(new ListViewItem(string.Format("{0}", i + 1))); /// Compound
listView.Items.Add(new ListViewItem(string.Format("{0} main", i + 1))); /// Compound - Main
listView.Items.Add(new ListViewItem(string.Format("{0} aux", i + 1))); /// Compound - Aux
}
else
{
listView.Items.Add(new ListViewItem(string.Format("{0}", i + 1))); /// Single
}
}
}
for (int i = 0; i < wmsCount; i++)
/// Add or Update subitems 1 .. (int)Column.Count
for (int i = 0; i < rowsCount; i++)
{
if (listView.Items[i].SubItems.Count == (int)Column.Count)
{
for (int j = 1; j < (int)Column.Count; j++) /// Column 1 .. Column.Count-1
{
listView.Items[i].SubItems[j].Text = ".";
}
for (int j = 1; j < (int)Column.Count; j++) listView.Items[i].SubItems[j].Text = ".";
}
else
{
for (int j = 1; j < (int)Column.Count; j++) /// Column 1 .. Column.Count-1
{
listView.Items[i].SubItems.Add(".");
}
for (int j = 1; j < (int)Column.Count; j++) listView.Items[i].SubItems.Add(".");
}
}
if (waterMeters != null && i < waterMeters.Count)
/// Update Tag-s of ListView items with references to water meters, display serial numbers
for (int i = 0; i < wmsCount; i++)
{
if (waterMeters != null && waterMeters[i] != null)
{
listView.Items[i].Tag = waterMeters[i];
if (metersKind == MetersKind.Combined)
{
/// Compound
listView.Items[3 * i].Tag = waterMeters[i];
/// Compound - Main
listView.Items[3 * i + 1].Tag = waterMeters[i];
if (!string.IsNullOrEmpty(waterMeters[i].SerialNr))
{
listView.Items[3 * i + 1].SubItems[(int)Column.SerialNr].Text = waterMeters[i].SerialNr;
}
/// Compound - Aux
listView.Items[3 * i + 2].Tag = waterMeters[i];
if (!string.IsNullOrEmpty(waterMeters[i].SerialNrAux))
{
listView.Items[3 * i + 2].SubItems[(int)Column.SerialNr].Text = waterMeters[i].SerialNrAux;
}
}
else
{
/// Single
listView.Items[i].Tag = waterMeters[i];
if (!string.IsNullOrEmpty(waterMeters[i].SerialNr))
{
listView.Items[i].SubItems[(int)Column.SerialNr].Text = waterMeters[i].SerialNr;
}
}
}
}
}
@@ -326,13 +358,13 @@ namespace TBF.UI.Process
///
int scaleId, tankId, drainValveId, diverterId, regValveId, flowMeterId, startValveId;
int pumpId, tempInId, tempOutId, tempDivId, pressUpId, pressDownId;
int wm1Id, wm2Id, wmLastId, j1, j2, j3, j4, j5, j6, j7;
int wm1Id, wm2Id, wmLastId, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11;
///
int scaleMsrdIx, flowMeterMsrdIx, tempMtrUpMsrdIx, tempMtrDownMsrdIx, tempMtrDivMsrdIx;
int pressMtrUpMsrdIx, pressMtrDownMsrdIx;
///
int regValveSetpIx, pumpSetpIx;
///
IDrawingItCmpntWithMeasuredVal[] cmpntWithMeasuredVal;
IDrawingItCmpntWithSetpoint[] cmpntWithSetpoint;
IDrawingItCmpntWithCustomBmp[] cmpntWithCustomBmp;
@@ -342,10 +374,11 @@ namespace TBF.UI.Process
/// Initialize hydraulical schematic drawing.
/// This should be called before initialization of handlers.
/// </summary>
void InitializeDrawing()
void InitializeDrawing(MetersKind mtrKind)
{
processDrawingCtrl.SupressRedraws = true;
processDrawingCtrl.ClearItems();
int id = 1;
int msrdIx = 0;
int setpIx = 0;
@@ -401,32 +434,61 @@ namespace TBF.UI.Process
MsrdValLimLo = -0.1, MsrdValLimHi = 25,
});
/// WM 1
processDrawingCtrl.AddItem(
wm1Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm1Id = id++), Name = "WM1",
X = 120, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
if (mtrKind == MetersKind.Combined)
{
/// WM 1 main
processDrawingCtrl.AddItem(
wm1Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm1Id = id++), Name = "WM1 main",
X = 230, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// WM 2
processDrawingCtrl.AddItem(
wm2Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm2Id = id++), Name = "WM2",
X = 180, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// WM 1 aux
processDrawingCtrl.AddItem(
wm2Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm2Id = id++), Name = "WM1 aux",
X = 230, Y = 240, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// WM last
processDrawingCtrl.AddItem(
wmLastCfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wmLastId = id++), Name = "WMn",
X = 310, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// Junctions to connect Aux meter
processDrawingCtrl.AddItem(new Configuration("J3", new Factory()) { Id = (j3 = id++), Shape = Shape.Junction, X = 170, Y = 370, Sz = Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J4", new Factory()) { Id = (j4 = id++), Shape = Shape.Junction, X = 170, Y = 250, Sz = Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J5", new Factory()) { Id = (j5 = id++), Shape = Shape.Junction, X = 310, Y = 250, Sz = Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J6", new Factory()) { Id = (j6 = id++), Shape = Shape.Junction, X = 310, Y = 370, Sz = Sz.L, });
}
else
{
/// WM 1
processDrawingCtrl.AddItem(
wm1Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm1Id = id++), Name = "WM1",
X = 120, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// WM 2
processDrawingCtrl.AddItem(
wm2Cfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wm2Id = id++), Name = "WM2",
X = 180, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
/// WM last
processDrawingCtrl.AddItem(
wmLastCfg = new TBF.Rig.WaterMeters.WaterMeter.WaterMeterCfg(new TBF.Rig.WaterMeters.WaterMeter.WaterMeterFactory())
{
Id = (wmLastId = id++), Name = "WMn",
X = 310, Y = 360, Shape = Shape.WaterM, Sz = Sz.L, Orient = Orient.R, Flip = false,
LblX = 0, LblY = -24, LblOrient = Orient.R,
});
}
/// T down
tempMtrDownMsrdIx = msrdIx++;
@@ -453,7 +515,7 @@ namespace TBF.UI.Process
});
/// Junction
processDrawingCtrl.AddItem(new Configuration("J3", new Factory()) { Id=(j3=id++), Shape=Shape.Junction, X=460, Y=370, Sz=Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J7", new Factory()) { Id=(j7=id++), Shape=Shape.Junction, X=460, Y=370, Sz=Sz.L, });
/// Start valve
processDrawingCtrl.AddItem(
@@ -489,8 +551,8 @@ namespace TBF.UI.Process
});
/// Junctions
processDrawingCtrl.AddItem(new Configuration("J4", new Factory()) { Id=(j4=id++), Shape=Shape.Junction, X=460, Y=80, Sz=Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J5", new Factory()) { Id=(j5=id++), Shape=Shape.Junction, X=630, Y=40, Sz=Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J8", new Factory()) { Id=(j8=id++), Shape=Shape.Junction, X=460, Y=80, Sz=Sz.L, });
processDrawingCtrl.AddItem(new Configuration("J9", new Factory()) { Id=(j9=id++), Shape=Shape.Junction, X=630, Y=40, Sz=Sz.L, });
/// T div
tempMtrDivMsrdIx = msrdIx++;
@@ -539,8 +601,8 @@ namespace TBF.UI.Process
});
/// Junctions
processDrawingCtrl.AddItem(new Configuration("J6", new Factory()) { Id=(j6=id++), Shape=Shape.Junction, X=680, Y=390, Sz=Sz.None, });
processDrawingCtrl.AddItem(new Configuration("J7", new Factory()) { Id=(j7=id++), Shape=Shape.Junction, X=620, Y=390, Sz=Sz.None, });
processDrawingCtrl.AddItem(new Configuration("J10", new Factory()) { Id=(j10=id++), Shape=Shape.Junction, X=680, Y=390, Sz=Sz.None, });
processDrawingCtrl.AddItem(new Configuration("J11", new Factory()) { Id=(j11=id++), Shape=Shape.Junction, X=620, Y=390, Sz=Sz.None, });
processDrawingCtrl.MsrmntAvailableFlags = new bool[msrdIx];
processDrawingCtrl.MeasuredValues = new double[msrdIx];
@@ -554,25 +616,54 @@ namespace TBF.UI.Process
processDrawingCtrl.PipesS = new string[0];
processDrawingCtrl.PipesM = new string[0];
processDrawingCtrl.PipesL = new string[]
if (mtrKind == MetersKind.Combined)
{
string.Format("{0}~0~{1}~0", tankId, pumpId),
string.Format("{0}~1~{1}~0", pumpId, j1),
string.Format("{0}~0~{1}~0", j1, j2),
string.Format("{0}~0~{1}~0", j2, wm1Id),
string.Format("{0}~1~{1}~0", wm1Id, wm2Id),
string.Format("{0}~1~{1}~0", wm2Id, wmLastId),
string.Format("{0}~1~{1}~0", wmLastId, j3),
string.Format("{0}~0~{1}~0", j3, startValveId),
string.Format("{0}~1~{1}~0", startValveId, flowMeterId),
string.Format("{0}~1~{1}~0", flowMeterId, regValveId),
string.Format("{0}~1~{1}~0", regValveId, j4),
string.Format("{0}~0~{1}~0", j4, j5),
string.Format("{0}~0~{1}~0", j5, diverterId),
string.Format("{0}~0~{1}~0", scaleId, drainValveId),
string.Format("{0}~1~{1}~0", drainValveId, j6),
string.Format("{0}~1~{1}~0", diverterId, j7)
};
processDrawingCtrl.PipesL = new string[]
{
string.Format("{0}~0~{1}~0", tankId, pumpId),
string.Format("{0}~1~{1}~0", pumpId, j1),
string.Format("{0}~0~{1}~0", j1, j2),
string.Format("{0}~0~{1}~0", j2, j3),
string.Format("{0}~0~{1}~0", j3, j4),
string.Format("{0}~0~{1}~0", j3, wm1Id),
string.Format("{0}~0~{1}~0", j4, wm2Id),
string.Format("{0}~1~{1}~0", wm2Id, j5),
string.Format("{0}~1~{1}~0", wm1Id, j6),
string.Format("{0}~0~{1}~0", j5, j6),
string.Format("{0}~0~{1}~0", j6, j7),
string.Format("{0}~0~{1}~0", j7, startValveId),
string.Format("{0}~1~{1}~0", startValveId, flowMeterId),
string.Format("{0}~1~{1}~0", flowMeterId, regValveId),
string.Format("{0}~1~{1}~0", regValveId, j8),
string.Format("{0}~0~{1}~0", j8, j9),
string.Format("{0}~0~{1}~0", j9, diverterId),
string.Format("{0}~0~{1}~0", scaleId, drainValveId),
string.Format("{0}~1~{1}~0", drainValveId, j10),
string.Format("{0}~1~{1}~0", diverterId, j11)
};
}
else
{
processDrawingCtrl.PipesL = new string[]
{
string.Format("{0}~0~{1}~0", tankId, pumpId),
string.Format("{0}~1~{1}~0", pumpId, j1),
string.Format("{0}~0~{1}~0", j1, j2),
string.Format("{0}~0~{1}~0", j2, wm1Id),
string.Format("{0}~1~{1}~0", wm1Id, wm2Id),
string.Format("{0}~1~{1}~0", wm2Id, wmLastId),
string.Format("{0}~1~{1}~0", wmLastId, j7),
string.Format("{0}~0~{1}~0", j7, startValveId),
string.Format("{0}~1~{1}~0", startValveId, flowMeterId),
string.Format("{0}~1~{1}~0", flowMeterId, regValveId),
string.Format("{0}~1~{1}~0", regValveId, j8),
string.Format("{0}~0~{1}~0", j8, j9),
string.Format("{0}~0~{1}~0", j9, diverterId),
string.Format("{0}~0~{1}~0", scaleId, drainValveId),
string.Format("{0}~1~{1}~0", drainValveId, j10),
string.Format("{0}~1~{1}~0", diverterId, j11)
};
}
processDrawingCtrl.PipesXL = new string[0];
processDrawingCtrl.Route = 0;
@@ -583,14 +674,19 @@ namespace TBF.UI.Process
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
{
currentMetersKind = args.Procedure.MetersKind;
Invalidate();
}
metersKind = args.Procedure.MetersKind;
InitializeDrawing(metersKind);
InitializeTestDataTable(testDataListView, null);
InitializeTableOfMeters(metersListView, metersKind,
(metersKind == MetersKind.Combined) ? TBF.Data.CompoundWMsCount : TBF.Data.WMsCount);
}
void OnTestSelected(object sender, TestSelectedEventArgs args)
{
InitializeTestDataTable(testDataListView, args);
InitializeTableOfMeters(metersListView, ProcessData.WMsCount, ProcessData.BatchRslts.Batch.WaterMeters);
InitializeTableOfMeters(metersListView, metersKind,
(metersKind == MetersKind.Combined) ? TBF.Data.CompoundWMsCount : TBF.Data.WMsCount,
ProcessData.BatchRslts.Batch.WaterMeters);
processDrawingCtrl.SupressRedraws = true;
@@ -641,14 +737,19 @@ namespace TBF.UI.Process
diverterCfg.Name = (args.OutputPath != null && args.OutputPath.Diverter != null) ? args.OutputPath.Diverter.Name : "n/a";
scaleCfg.Name = (args.OutputPath != null && args.OutputPath.Scale != null) ? args.OutputPath.Scale.Name : "n/a";
scaleCfg.Capacity = (args.OutputPath != null && args.OutputPath.Scale != null) ? args.OutputPath.Scale.Capacity : 100.0;
scaleCfg.Name = (args.OutputPath != null && args.OutputPath.Scale != null) ? args.OutputPath.Scale.Name : "n/a";
scaleCfg.Capacity = (args.OutputPath != null && args.OutputPath.Scale != null) ? args.OutputPath.Scale.Capacity : 100.0;
drainValveCfg.Name = (args.OutputPath != null && args.OutputPath.Scale != null && args.OutputPath.Scale.DrainValve != null)
? args.OutputPath.Scale.DrainValve.Name : "n/a";
/// Meters path
if (args.MetersPath != null && args.MetersPath.RegisterReaders != null)
if (metersKind == MetersKind.Combined)
{
wm1Cfg.Name = "WM1 main";
wm2Cfg.Name = "WM1 aux";
}
else if (args.MetersPath != null && args.MetersPath.RegisterReaders != null)
{
var rrs = args.MetersPath.RegisterReaders;
int first = 0;
@@ -764,32 +865,52 @@ namespace TBF.UI.Process
///
/// Update test data
///
double density = Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2,
(ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2);
double volumeCtv = 1000 * Formulas.Buoyancy() * (ProcessData.Mass - ProcessData.StartMass.Val) / density;
//double refVolume = cBrd.RefPulses * cBrd.Devices.FlowMeter.LtrPerPulse;
double refVolume = ProcessData.LtrPerRefPulse * ProcessData.RefPulses;
double refError = Formulas.ErrorFromVolumes(refVolume, volumeCtv);
if (refErrorIx != 0 && testDataListView.Items.Count > refErrorIx)
{
if (ProcessData.StartMass.Valid)
{
double converted = Units.ConvertTo(ProcessData.MassUnit, ProcessData.StartMass.Val);
testDataListView.Items[startMassIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 6));
converted = Units.ConvertTo(ProcessData.MassUnit, ProcessData.Mass - ProcessData.StartMass.Val);
testDataListView.Items[massIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 6));
converted = Units.ConvertTo(ProcessData.VolumeUnit, volumeCtv);
testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
testDataListView.Items[refErrorIx].SubItems[1].Text = refError.ToString(Common.Utils.SignificantDigitsToFmt(refError, 3));
}
else
{
testDataListView.Items[startMassIx].SubItems[1].Text = "---";
testDataListView.Items[massIx].SubItems[1].Text = "---";
}
if (TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.FlyingStartStopTestWithDiverter)
{
double density = Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2,
(ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2);
double volumeCtv = 1000 * Formulas.Buoyancy() * (ProcessData.Mass - ProcessData.StartMass.Val) / density;
//double refVolume = cBrd.RefPulses * cBrd.Devices.FlowMeter.LtrPerPulse;
double refVolume = (ProcessData.Devices != null && ProcessData.Devices.FlowMeter != null)
? ProcessData.Devices.FlowMeter.LtrPerPulse * ProcessData.RefPulses : 0;
double refError = Formulas.ErrorFromVolumes(refVolume, volumeCtv);
double converted = Units.ConvertTo(ProcessData.VolumeUnit, volumeCtv);
testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
testDataListView.Items[refErrorIx].SubItems[1].Text = refError.ToString(Common.Utils.SignificantDigitsToFmt(refError, 3));
}
else if (TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.FlyingStartStopTest)
{
double refVolume = (ProcessData.Devices != null && ProcessData.Devices.FlowMeter != null)
? ProcessData.Devices.FlowMeter.LtrPerPulse * ProcessData.RefPulses : 0;
double converted = Units.ConvertTo(ProcessData.VolumeUnit, refVolume);
testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
testDataListView.Items[refErrorIx].SubItems[1].Text = "---";
}
else if (TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.StandingStartStopTest)
{
/// TODO: ???
//var converted = Units.ConvertTo(ProcessData.VolumeUnit, volumeCtv);
//testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
//testDataListView.Items[refErrorIx].SubItems[1].Text = "---";
}
else
{
testDataListView.Items[volumeIx].SubItems[1].Text = "---";
testDataListView.Items[refErrorIx].SubItems[1].Text = "---";
}
@@ -798,20 +919,61 @@ namespace TBF.UI.Process
///
/// Update water meter states
///
if (ProcessData.Devices != null && ProcessData.Devices.FlowMeter != null && ProcessData.RegisterReaders != null)
var rrs = ProcessData.RegisterReaders;
if (ProcessData.Devices != null && ProcessData.Devices.FlowMeter != null && rrs != null &&
(TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.FlyingStartStopTest ||
TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.FlyingStartStopTestWithDiverter ||
TBF.Rig.StateMachine.ControlBoard.Activity == TBF.Rig.ControlBoard.Activity.StandingStartStopTest))
{
for (int i = 0; i < Math.Min(metersListView.Items.Count, ProcessData.RegisterReaders.Length); i++)
{
var lvi = metersListView.Items[i];
var rr = ProcessData.RegisterReaders[i];
var rr = rrs[i];
if (rr != null && Math.Abs(rr.WMVolume) > float.Epsilon && refVolume > float.Epsilon)
/// Update a list view item
if (metersKind == MetersKind.Single && rr != null && rr.WMPulses != 0 && rr.WMRefPulses != 0)
{
/// Update a list view item
lvi.SubItems[(int)Column.Error].Text = Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
lvi.SubItems[(int)Column.Volume].Text = rr.WMVolume.ToString("F1");
/// Single meter
double wmVolume = rr.WMPulses * rr.LtrsPerPulse;
double wmRefVolume = rr.WMRefPulses * ProcessData.Devices.FlowMeter.LtrPerPulse;
double error = Formulas.ErrorFromVolumes(wmVolume, wmRefVolume);
lvi.SubItems[(int)Column.Error].Text = error.ToString(Common.Utils.SignificantDigitsToFmt(error, 2));
double converted = Units.ConvertTo(ProcessData.VolumeUnit, wmVolume);
lvi.SubItems[(int)Column.Volume].Text = rr.WMVolume.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = rr.WMPulses.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = rr.WMRefPulses.ToString();
lvi.SubItems[(int)Column.PulsesPerLtr].Text = rr.PulsesPerLtr.ToString();
}
else if (metersKind == MetersKind.Combined && (i % 3) == 0 && i + 2 < ProcessData.RegisterReaders.Length &&
rrs[i + 1] != null && rrs[i + 1].WMPulses != 0 && rrs[i + 1].WMRefPulses != 0 &&
rrs[i + 2] != null && rrs[i + 2].WMPulses != 0 && rrs[i + 2].WMRefPulses != 0)
{
/// Total result (sum of main and aux meter) of a compound meter
double wmVolume = rrs[i + 1].WMPulses * rrs[i + 1].LtrsPerPulse + rrs[i + 2].WMPulses * rrs[i + 2].LtrsPerPulse;
double wmRefVolume = rr.WMRefPulses * ProcessData.Devices.FlowMeter.LtrPerPulse;
double error = Formulas.ErrorFromVolumes(wmVolume, wmRefVolume);
lvi.SubItems[(int)Column.Error].Text = error.ToString(Common.Utils.SignificantDigitsToFmt(error, 2));
double converted = Units.ConvertTo(ProcessData.VolumeUnit, wmVolume);
lvi.SubItems[(int)Column.Volume].Text = rr.WMVolume.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = "---";
lvi.SubItems[(int)Column.RefPulses].Text = rrs[i + 1].WMRefPulses.ToString();
lvi.SubItems[(int)Column.PulsesPerLtr].Text = "---";
}
else if (metersKind == MetersKind.Combined && (i % 3) != 0 && rr != null && rr.WMPulses != 0 && rr.WMRefPulses != 0)
{
/// Main and aux meter of a compound meter
double wmVolume = rr.WMPulses * rr.LtrsPerPulse;
lvi.SubItems[(int)Column.Error].Text = "---";
double converted = Units.ConvertTo(ProcessData.VolumeUnit, wmVolume);
lvi.SubItems[(int)Column.Volume].Text = rr.WMVolume.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = rr.WMPulses.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = "---";
lvi.SubItems[(int)Column.PulsesPerLtr].Text = rr.PulsesPerLtr.ToString();
}
else if (metersKind == MetersKind.HeatMeter)
{
/// Heat meter
/// TODO: ???
}
else
{
@@ -819,6 +981,7 @@ namespace TBF.UI.Process
lvi.SubItems[(int)Column.Volume].Text = string.Empty;
lvi.SubItems[(int)Column.Pulses].Text = string.Empty;
lvi.SubItems[(int)Column.RefPulses].Text = string.Empty;
lvi.SubItems[(int)Column.PulsesPerLtr].Text = string.Empty;
}
if (rr is TBF.Rig.RegisterReaders.S640Stream.S640Stream)
@@ -843,10 +1006,6 @@ namespace TBF.UI.Process
void UpdateRouteMsrdValuesAndSetpoints(UInt128 route)
{
//if (route != processDrawingCtrl.Route)
//{
// int a = 5;
//}
processDrawingCtrl.Route = route;
for (int i = 0; i < cmpntWithMeasuredVal.Length; i++)
@@ -880,52 +1039,91 @@ namespace TBF.UI.Process
return;
}
int wmsCount = Math.Min(ProcessData.RegisterReaders.Length, ProcessData.BatchRslts.Batch.WaterMeters.Count);
/// TODO: ??? update mass
//double converted = Units.ConvertTo(ProcessData.VolumeUnit, args.TestRslt.MassEnd - args.TestRslt.MassStart);
//testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
if (metersListView.Items.Count != wmsCount)
double converted = Units.ConvertTo(ProcessData.VolumeUnit, args.TestRslt.VolumeCTV);
testDataListView.Items[volumeIx].SubItems[1].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
testDataListView.Items[refErrorIx].SubItems[1].Text = args.TestRslt.ErrorMaster.ToString(Common.Utils.SignificantDigitsToFmt(args.TestRslt.ErrorMaster, 3));
int wmsCount = (metersKind == MetersKind.Combined) ? TBF.Data.CompoundWMsCount : TBF.Data.WMsCount;
int rowsCount = (metersKind == MetersKind.Combined) ? 2 * TBF.Data.CompoundWMsCount : TBF.Data.WMsCount;
if (metersListView.Items.Count != rowsCount)
{
/// Invoked only when the number of water meters or register readers changes
metersListView.Items.Clear();
for (int i = 0; i < wmsCount; i++)
{
var lvi = new ListViewItem((i + 1).ToString()); /// Column 0
for (Column c = (Column)1; c < Column.Count; c++) /// Column 1 .. Column.Count-1
{
lvi.SubItems.Add(".");
}
lvi.Tag = ProcessData.BatchRslts.Batch.WaterMeters[i];
metersListView.Items.Add(lvi);
}
InitializeTableOfMeters(metersListView, metersKind, wmsCount);
}
if (args.TestRslt != null)
{
for (int i = 0; i < wmsCount; i++)
{
var wm = metersListView.Items[i].Tag as Results.Entities.WaterMeter;
var wm = ProcessData.BatchRslts.Batch.WaterMeters[i];
if (wm != null && !wm.Disabled)
{
Results.Entities.MeterTestRslt mtr = wm.MeterTestRslts.FirstOrDefault(x => x.TestRslt == args.TestRslt);
if (mtr != null)
/// Update list view items
if (metersKind == MetersKind.Single)
{
var lvi = metersListView.Items[i];
var mtr = wm.MeterTestRslts.FirstOrDefault(x => x.TestRslt == args.TestRslt && x.CompoundMeterId == (byte)Common.CompoundMeterId.Single);
if (mtr != null && i < metersListView.Items.Count)
{
var lvi = metersListView.Items[i];
lvi.SubItems[(int)Column.Error].Text = mtr.Error.ToString(Common.Utils.SignificantDigitsToFmt(mtr.Error, 3));
converted = Units.ConvertTo(ProcessData.VolumeUnit, mtr.VolumeMeter);
lvi.SubItems[(int)Column.Volume].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = mtr.PulsesMeter.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = mtr.PulsesMaster.ToString();
if (!string.IsNullOrEmpty(mtr.SerialNr())) lvi.SubItems[(int)Column.SerialNr].Text = mtr.SerialNr();
}
}
else if (metersKind == MetersKind.Combined)
{
var mtr = wm.MeterTestRslts.FirstOrDefault(x => x.TestRslt == args.TestRslt && x.CompoundMeterId == (byte)Common.CompoundMeterId.Compound);
var mtrMain = wm.MeterTestRslts.FirstOrDefault(x => x.TestRslt == args.TestRslt && x.CompoundMeterId == (byte)Common.CompoundMeterId.CompoundMain);
var mtrAux = wm.MeterTestRslts.FirstOrDefault(x => x.TestRslt == args.TestRslt && x.CompoundMeterId == (byte)Common.CompoundMeterId.CompoundAux);
if (mtr != null && 3 * i < metersListView.Items.Count)
{
/// Compound meter (sum)
var lvi = metersListView.Items[3 * i];
lvi.SubItems[(int)Column.Error].Text = mtr.Error.ToString(Common.Utils.SignificantDigitsToFmt(mtr.Error, 3));
converted = Units.ConvertTo(ProcessData.VolumeUnit, mtr.VolumeMeter);
lvi.SubItems[(int)Column.Volume].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = "---";
lvi.SubItems[(int)Column.RefPulses].Text = mtr.PulsesMaster.ToString();
}
/// Update a list view item
lvi.SubItems[(int)Column.Error].Text = mtr.Error.ToString("F1");
lvi.SubItems[(int)Column.Volume].Text = mtr.VolumeMeter.ToString("F1");
lvi.SubItems[(int)Column.Pulses].Text = mtr.PulsesMeter.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = mtr.PulsesMaster.ToString();
lvi.SubItems[(int)Column.SerialNr].Text = mtr.SerialNr();
if (mtrMain != null && 3 * i + 1 < metersListView.Items.Count)
{
/// Compound meter - main
var lvi = metersListView.Items[3 * i + 1];
lvi.SubItems[(int)Column.Error].Text = "---";
converted = Units.ConvertTo(ProcessData.VolumeUnit, mtrMain.VolumeMeter);
lvi.SubItems[(int)Column.Volume].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = mtrMain.PulsesMeter.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = "---";
if (!string.IsNullOrEmpty(mtrMain.SerialNr())) lvi.SubItems[(int)Column.SerialNr].Text = mtrMain.SerialNr();
}
if (mtrAux != null && 3 * i + 2 < metersListView.Items.Count)
{
/// Compound meter - aux
var lvi = metersListView.Items[3 * i + 2];
lvi.SubItems[(int)Column.Error].Text = "---";
converted = Units.ConvertTo(ProcessData.VolumeUnit, mtrAux.VolumeMeter);
lvi.SubItems[(int)Column.Volume].Text = converted.ToString(Common.Utils.SignificantDigitsToFmt(converted, 5));
lvi.SubItems[(int)Column.Pulses].Text = mtrAux.PulsesMeter.ToString();
lvi.SubItems[(int)Column.RefPulses].Text = "---";
if (!string.IsNullOrEmpty(mtrAux.SerialNr())) lvi.SubItems[(int)Column.SerialNr].Text = mtrAux.SerialNr();
}
}
}
}
}
}
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
{
}
private void ProcessTabPageCtrl_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics formGraphics = this.CreateGraphics();
File diff suppressed because it is too large Load Diff
-667
View File
@@ -1,667 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Common;
using Config.Entities;
using Results.Entities;
using TBF.Rig.Sequences;
using TBF.UiBridge;
using TBF.Resources;
#pragma warning disable 162 /// Disables 'Unreachable code detected' warning
namespace TBF.UI.Process
{
public partial class ProcessTabPageCtrl24 : UserControl
{
static readonly ILog log = LogManager.GetLogger(typeof(ProcessTabPageCtrl24));
MetersKind currentMetersKind;
int textBoxesCount;
Label[] meter;
Label[] sensor;
Label[] pulses;
Label[] refPulses;
Label[] volume;
Label[] error;
Label[] passed;
Label[] cmpndVolume;
Label[] cmpndError;
Label[] cmpndPassed;
bool pumpOn = true;
bool diverterToTank = true;
/// <summary>
/// Constructor, initializes anonymous event handlers
/// </summary>
public ProcessTabPageCtrl24()
{
currentMetersKind = MetersKind.Single;
InitializeComponent();
textBoxesCount = 24;
meter = new Label[] {
meter1Label, meter2Label, meter3Label, meter4Label, meter5Label, meter6Label,
meter7Label, meter8Label, meter9Label, meter10Label, meter11Label, meter12Label,
meter13Label, meter14Label, meter15Label, meter16Label, meter17Label, meter18Label,
meter19Label, meter20Label, meter21Label, meter22Label, meter23Label, meter24Label,
};
sensor = new Label[] {
sensor1Label, sensor2Label, sensor3Label, sensor4Label, sensor5Label, sensor6Label,
sensor7Label, sensor8Label, sensor9Label, sensor10Label, sensor11Label, sensor12Label,
sensor13Label, sensor14Label, sensor15Label, sensor16Label, sensor17Label, sensor18Label,
sensor19Label, sensor20Label, sensor21Label, sensor22Label, sensor23Label, sensor24Label,
};
pulses = new Label[] {
pulses1Label, pulses2Label, pulses3Label, pulses4Label, pulses5Label, pulses6Label,
pulses7Label, pulses8Label, pulses9Label, pulses10Label, pulses11Label, pulses12Label,
pulses13Label, pulses14Label, pulses15Label, pulses16Label, pulses17Label, pulses18Label,
pulses19Label, pulses20Label, pulses21Label, pulses22Label, pulses23Label, pulses24Label,
};
refPulses = new Label[] {
refPulses1Label, refPulses2Label, refPulses3Label, refPulses4Label, refPulses5Label, refPulses6Label,
refPulses7Label, refPulses8Label, refPulses9Label, refPulses10Label, refPulses11Label, refPulses12Label,
refPulses13Label, refPulses14Label, refPulses15Label, refPulses16Label, refPulses17Label, refPulses18Label,
refPulses19Label, refPulses20Label, refPulses21Label, refPulses22Label, refPulses23Label, refPulses24Label,
};
volume = new Label[] {
volume1Label, volume2Label, volume3Label, volume4Label, volume5Label, volume6Label,
volume7Label, volume8Label, volume9Label, volume10Label, volume11Label, volume12Label,
volume13Label, volume14Label, volume15Label, volume16Label, volume17Label, volume18Label,
volume19Label, volume20Label, volume21Label, volume22Label, volume23Label, volume24Label,
};
error = new Label[] {
error1Label, error2Label, error3Label, error4Label, error5Label, error6Label,
error7Label, error8Label, error9Label, error10Label, error11Label, error12Label,
error13Label, error14Label, error15Label, error16Label, error17Label, error18Label,
error19Label, error20Label, error21Label, error22Label, error23Label, error24Label,
};
passed = new Label[] {
passed1Label, passed2Label, passed3Label, passed4Label, passed5Label, passed6Label,
passed7Label, passed8Label, passed9Label, passed10Label, passed11Label, passed12Label,
passed13Label, passed14Label, passed15Label, passed16Label, passed17Label, passed18Label,
passed19Label, passed20Label, passed21Label, passed22Label, passed23Label, passed24Label,
};
cmpndVolume = new Label[] { volume1zLabel, volume2zLabel, volume3zLabel };
cmpndError = new Label[] { error1zLabel, error2zLabel, error3zLabel };
cmpndPassed = new Label[] { passed1zLabel, passed2zLabel, passed3zLabel };
ShuffleLabels(Data.WMsCount, Data.LineSize);
Bridge.ProcedureSelectedHandler += delegate(object sndr, ProcedureSelectedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<ProcedureSelectedEventArgs>(OnProcedureSelected), sndr, args);
else
OnProcedureSelected(sndr, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage24.OnProcedureSelected() failed: {0}", e.Message); }
};
Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<TestSelectedEventArgs>(OnTestSelected), sender, args);
else
OnTestSelected(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage24.OnTestSelected() failed: {0}", e.Message); }
};
Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<TestCompletedEventArgs>(OnTestCompleted), sender, args);
else
OnTestCompleted(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage24.OnTestCompleted() failed: {0}", e.Message); }
};
Bridge.ProcedureCompletedHandler += delegate(object sender, ProcedureCompletedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<ProcedureCompletedEventArgs>(OnProcedureCompleted), sender, args);
else
OnProcedureCompleted(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage24.OnProcedureCompleted() failed: {0}", e.Message); }
};
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// Enable only used labels.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleLabels(int wmsCount, int lineSize)
{
if (wmsCount < textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
meter[dest] = meter[l * lineSize + l * gap + i];
meter[dest].Visible = true;
meter[dest].Text = string.Format("Meter {0}", dest + 1);
sensor[dest] = sensor[l * lineSize + l * gap + i];
sensor[dest].Visible = true;
pulses[dest] = pulses[l * lineSize + l * gap + i];
pulses[dest].Visible = true;
refPulses[dest] = refPulses[l * lineSize + l * gap + i];
refPulses[dest].Visible = true;
volume[dest] = volume[l * lineSize + l * gap + i];
volume[dest].Visible = true;
error[dest] = error[l * lineSize + l * gap + i];
error[dest].Visible = true;
passed[dest] = passed[l * lineSize + l * gap + i];
passed[dest].Visible = true;
dest++;
}
}
textBoxesCount = wmsCount;
}
}
private void ProcessTabPageCtrl_Load(object sender, EventArgs e)
{
Once();
ResetLabelsAndTargetVals();
ResetReadings();
}
void Once()
{
}
void UpdateVisibility(MetersKind metersKind)
{
bool visible = (metersKind == MetersKind.Single || metersKind == MetersKind.HeatMeter);
for (int i = 2 * TBF.Data.CompoundWMsCount; i < textBoxesCount; i++)
{
meter[i].Visible = visible;
sensor[i].Visible = visible;
pulses[i].Visible = visible;
refPulses[i].Visible = visible;
volume[i].Visible = visible;
error[i].Visible = visible;
passed[i].Visible = visible;
}
groupBox1z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 1);
groupBox2z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 2);
groupBox3z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 3);
}
/// <summary>
/// Called when a new procedure is selected
/// </summary>
void ResetLabelsAndTargetVals()
{
/// Target values
targetFlowLowLabel.Text = "---";
targetFlowHighLabel.Text = "---";
targetVolumeLabel.Text = "---";
targetRefCountLabel.Text = "---";
estmtdTimeLabel.Text = "---";
//
refFlowCmpntLabel.Text = "---";
regValveCmpntLabel.Text = "---";
/// Water pressure
prInCmpntLabel.Text = "---";
prOutCmpntLabel.Text = "---";
/// Water temperature
tInCmpntLabel.Text = "---";
tOutCmpntLabel.Text = "---";
tDivCmpntLabel.Text = "---";
scaleCmpntLabel.Text = "---";
if (currentMetersKind == MetersKind.Single || currentMetersKind == MetersKind.HeatMeter)
{
watermeterPictureBox1.Visible = true;
watermeterPictureBox2.Visible = true;
watermeterPictureBox3.Visible = true;
watermeterPictureBox4.Visible = true;
watermeterPictureBox5.Visible = true;
watermeterPictureBox6.Visible = true;
watermeterPictureBox1z.Visible = false;
watermeterPictureBox2z.Visible = false;
watermeterPictureBox3z.Visible = false;
groupBox1z.Visible = false;
groupBox2z.Visible = false;
groupBox3z.Visible = false;
sensor1Label.Text = "---";
for (int i = 0; i < textBoxesCount; i++)
{
sensor[i].Text = "---";
}
}
else if (currentMetersKind == MetersKind.Combined)
{
watermeterPictureBox1.Visible = false;
watermeterPictureBox2.Visible = true;
watermeterPictureBox3.Visible = false;
watermeterPictureBox4.Visible = false;
watermeterPictureBox5.Visible = false;
watermeterPictureBox6.Visible = false;
watermeterPictureBox1z.Visible = true;
watermeterPictureBox2z.Visible = false;
watermeterPictureBox3z.Visible = false;
groupBox1z.Visible = true;
groupBox2z.Visible = false;
groupBox3z.Visible = false;
sensor1Label.Visible = true;
sensor1Label.Text = "---";
sensor2Label.Visible = true;
sensor2Label.Text = "---";
}
}
/// <summary>
/// Called when a new procedure or a new test procedure is selected
/// </summary>
void ResetReadings()
{
/// Top part
airTempLabel.Text = "---";
airPressLabel.Text = "---";
airHumiLabel.Text = "---";
refPulsesLabel.Text = "---";
refFreqLabel.Text = "---";
refFlowLabel.Text = "---";
refVolumeLabel.Text = "---";
regValvePosLabel.Text = "---";
tDivLabel.Text = "---";
tInLabel.Text = "---";
tOutLabel.Text = "---";
prInLabel.Text = "---";
prOutLabel.Text = "---";
massLabel.Text = "---";
massDiffLabel.Text = "---";
volumeCtvLabel.Text = "---";
refErrorLabel.Text = "---";
/// Meters
pulses1Label.Text = "---";
refPulses1Label.Text = "---";
volume1Label.Text = "---";
error1Label.Text = "---";
passed1Label.Text = "---";
if (currentMetersKind == MetersKind.Single || currentMetersKind == MetersKind.HeatMeter)
{
for (int i = 0; i < textBoxesCount; i++)
{
pulses[i].Text = "---";
refPulses[i].Text = "---";
volume[i].Text = "---";
error[i].Text = "---";
passed[i].Text = "---";
}
}
else if (currentMetersKind == MetersKind.Combined)
{
for (int i = 0; i < 2; i++)
{
pulses[i].Text = "---";
refPulses[i].Text = "---";
volume[i].Text = "---";
error[i].Text = "---";
passed[i].Text = "---";
}
volume1zLabel.Text = "---";
error1zLabel.Text = "---";
passed1zLabel.Text = "---";
}
}
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
{
currentMetersKind = args.Procedure.MetersKind;
UpdateVisibility(currentMetersKind);
ResetLabelsAndTargetVals();
ResetReadings();
Invalidate();
}
void OnTestSelected(object sender, TestSelectedEventArgs args)
{
/// Readings and target values
ResetReadings();
/// Target values
targetFlowLowLabel.Text = args.Test.Qfrom.ToString("F3");
targetFlowHighLabel.Text = args.Test.Qto.ToString("F3");
targetVolumeLabel.Text = args.Test.Volume.ToString("F1");
//targetRefCountLabel.Text = args.TotalPulses.ToString();
estmtdTimeLabel.Text = args.Test.TestTime.ToString("F1");
/// Names of virtual bench components
if (args.BenchPath.PressMtrUp != null) prInCmpntLabel.Text = args.BenchPath.PressMtrUp.Name;
if (args.BenchPath.PressMtrDown != null) prOutCmpntLabel.Text = args.BenchPath.PressMtrDown.Name;
if (args.BenchPath.TempMtrUp != null) tInCmpntLabel.Text = args.BenchPath.TempMtrUp.Name;
if (args.BenchPath.TempMtrDown != null) tOutCmpntLabel.Text = args.BenchPath.TempMtrDown.Name;
if (args.OutputPath.TempMtrDiv != null) tDivCmpntLabel.Text = args.OutputPath.TempMtrDiv.Name;
if (args.OutputPath.FlowMeter != null) refFlowCmpntLabel.Text = args.OutputPath.FlowMeter.Name;
if (args.OutputPath.RegValve != null) regValveCmpntLabel.Text = args.OutputPath.RegValve.Name;
if (args.OutputPath.Scale != null) scaleCmpntLabel.Text = args.OutputPath.Scale.Name;
for (int i = 0; i < textBoxesCount; i++)
{
sensor[i].Text = (args.MetersPath.RegisterReaders[i] == null) ? "" : args.MetersPath.RegisterReaders[i].Cfg.Name;
}
if (args.FeedingPath != null && (args.FeedingPath.Pump is Rig.GenericDevices.IPumpFM))
{
pumpPctTextBox.Visible = true;
pumpPctTextBox.Text = (args.FeedingPath.Pump as Rig.GenericDevices.IPumpFM).Power.ToString("F0") + " %";
}
else
{
pumpPctTextBox.Visible = false;
}
}
void OnProcessDataChanged(object sender, ProcessDataEventArgs args)
{
///
/// Always available
///
airTempLabel.Text = ProcessData.AmbTemp.ToString();
airPressLabel.Text = Common.Units.ConvertTo(Common.Unit.mbar, ProcessData.AmbPress.Val).ToString("F0");
airHumiLabel.Text = ProcessData.AmbHumi.ToString();
tInLabel.Text = ProcessData.TempUp.ToString();
tOutLabel.Text = ProcessData.TempDown.ToString();
tDivLabel.Text = ProcessData.TempDiv.ToString();
prInLabel.Text = ProcessData.PressUp.ToString();
prOutLabel.Text = ProcessData.PressDown.ToString();
//massLabel.Text = ProcessData.Mass.ToString();
if (args.TestPhase == Progress.FlowSetting ||
args.TestPhase == Progress.Test)
{
///
/// Available when setting the flow and during a test
///
refFreqLabel.Text = ProcessData.RefFrequency.ToString();
refFlowLabel.Text = Utils.DoubleToStr(ProcessData.RefFlow.Val, 4);
}
if (args.TestPhase == Progress.Test)
{
///
/// Available only during a test
///
refPulsesLabel.Text = ProcessData.RefPulses.ToString();
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses;
refVolumeLabel.Text = refVolume.ToString("F2");
//double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
//massDiffLabel.Text = massDiff.ToString("F3");
//double volumeCtv = 1000 * Formulas.Buoyancy() * massDiff / Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2,
// (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2);
//volumeCtvLabel.Text = volumeCtv.ToString("F2");
//double refError = Formulas.ErrorFromVolumes(refVolume, volumeCtv);
//refErrorLabel.Text = refError.ToString("F3");
if (currentMetersKind == MetersKind.Single || currentMetersKind == MetersKind.HeatMeter)
{
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
{
Rig.GenericDevices.IRegReader rr = ProcessData.RegisterReaders[i];
if (rr != null)
{
pulses[i].Text = rr.WMPulses.ToString();
refPulses[i].Text = rr.WMRefPulses.ToString();
volume[i].Text = rr.WMVolume.ToString("F1");
error[i].Text = Formulas.ErrorFromVolumes(rr.WMVolume, rr.WMRefPulses * ProcessData.LtrPerRefPulse).ToString("F1");
}
}
}
else if (currentMetersKind == MetersKind.Combined)
{
for (int compMtr = 0; compMtr < TBF.Data.CompoundWMsCount; compMtr++)
{
int end = Math.Min(2 * compMtr + 2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
double compoundVolume = 0;
for (int i = 2 * compMtr; i < end; i++)
{
Rig.GenericDevices.IRegReader rr = ProcessData.RegisterReaders[i];
if (rr != null)
{
pulses[i].Text = rr.WMPulses.ToString();
refPulses[i].Text = rr.WMRefPulses.ToString();
volume[i].Text = rr.WMVolume.ToString("F1");
error[i].Text = Formulas.ErrorFromVolumes(rr.WMVolume, rr.WMRefPulses * ProcessData.LtrPerRefPulse).ToString("F1");
compoundVolume += rr.WMVolume;
}
}
cmpndVolume[compMtr].Text = compoundVolume.ToString("F1");
cmpndError[compMtr].Text = Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
}
}
}
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
//{
// //if (pumpOn != args.PumpOn)
// //{
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
// // else pumpPictureBox.Image = System.Resources.
// //}
// pumpOn = args.PumpOn;
// diverterToTank = args.DivToTank;
// Invalidate();
//}
}
void OnTestCompleted(object sender, TestCompletedEventArgs args)
{
if (args == null) return;
TestRslt tRes = args.TestRslt;
if (tRes == null) return;
airTempLabel.Text = tRes.AmbTempMean.ToString("F1");
airPressLabel.Text = Common.Units.ConvertTo(Common.Unit.mbar, tRes.AmbPressMean).ToString("F0");
airHumiLabel.Text = tRes.AmbHumiMean.ToString("F1");
tInLabel.Text = tRes.TempUpMean.ToString("F2");
tOutLabel.Text = tRes.TempDownMean.ToString("F2");
tDivLabel.Text = tRes.TempDivMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F2");
prOutLabel.Text = tRes.PressDownMean.ToString("F2");
//massLabel.Text = ProcessData.Mass.ToString();
massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3");
refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
refFreqLabel.Text = "---";
refFlowLabel.Text = Utils.DoubleToStr(tRes.FlowVolume, 4);
refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
//regValvePosLabel.Text = tstRslt.
volumeCtvLabel.Text = tRes.VolumeCTV.ToString("F1");
refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
if (!tRes.Batch.Compound)
{
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.BatchRslts.Batch.WaterMeters.Count); i++)
{
WaterMeter wm = ProcessData.BatchRslts.Batch.WaterMeters[i];
MeterTestRslt mtr = (wm != null && !wm.Disabled) ? wm.GetMeterTestRslt(args.TestName) : null;
if (mtr != null)
{
pulses[i].Text = mtr.PulsesMeter.ToString("F0");
refPulses[i].Text = mtr.PulsesMaster.ToString("F0");
volume[i].Text = mtr.VolumeMeter.ToString("F2");
error[i].Text = mtr.Error.ToString("F2");
passed[i].Text = mtr.Passed ? Strings.Passed : Strings.Failed;
}
}
}
else
{
for (int compMtr = 0; compMtr < TBF.Data.CompoundWMsCount; compMtr++)
{
WaterMeter wm = ProcessData.BatchRslts.Batch.WaterMeters[compMtr];
if (wm == null) continue;
int end = Math.Min(textBoxesCount, TBF.Data.WMsCount);
MeterTestRslt mtrMain = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.CompoundMain);
if ((mtrMain != null) && (2 * compMtr < end))
{
pulses[2 * compMtr].Text = mtrMain.PulsesMeter.ToString("F0");
refPulses[2 * compMtr].Text = mtrMain.PulsesMaster.ToString("F0");
volume[2 * compMtr].Text = mtrMain.VolumeMeter.ToString("F2");
error[2 * compMtr].Text = mtrMain.Error.ToString("F2");
passed[2 * compMtr].Text = mtrMain.Passed ? Strings.Passed : Strings.Failed;
}
MeterTestRslt mtrAux = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.CompoundAux);
if ((mtrAux != null) && (2 * compMtr + 1 < end))
{
pulses[2 * compMtr + 1].Text = mtrAux.PulsesMeter.ToString("F0");
refPulses[2 * compMtr + 1].Text = mtrAux.PulsesMaster.ToString("F0");
volume[2 * compMtr + 1].Text = mtrAux.VolumeMeter.ToString("F2");
error[2 * compMtr + 1].Text = mtrAux.Error.ToString("F2");
passed[2 * compMtr + 1].Text = mtrAux.Passed ? Strings.Passed : Strings.Failed;
}
MeterTestRslt mtrComp = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.Compound);
if (mtrComp != null)
{
cmpndVolume[compMtr].Text = mtrComp.VolumeMeter.ToString("F2");
cmpndError[compMtr].Text = mtrComp.Error.ToString("F2");
cmpndPassed[compMtr].Text = mtrComp.Passed ? Strings.Passed : Strings.Failed;
}
}
}
}
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
{
}
private void ProcessTabPageCtrl_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics formGraphics = this.CreateGraphics();
System.Drawing.SolidBrush filledBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Blue);
System.Drawing.SolidBrush emptyBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Gray);
System.Drawing.SolidBrush benchBrush = (pumpOn ? filledBrush : emptyBrush);
int diam = 14; // pipe diameter (pixels)
int left = 20; // left-most pipe x-coordinate
int top = 14; // top-most pipe y-coordinate
int topLeft = 876;
int topRight = 966;
int divTop = 40;
int bottom = 504; // bottom-most pipe y-coordinate
int benchTop = 378; // bench-pipe top y-coordinate
int pumpLeft = 779;
int pumpWdth = 38;
/// Pipes
formGraphics.FillRectangle(filledBrush,new Rectangle(pumpLeft+pumpWdth, bottom-diam, 65, diam)); // tank -> pump
formGraphics.FillRectangle(benchBrush, new Rectangle(left, bottom-diam, pumpLeft-left, diam)); // pump ->bench horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(left, benchTop, diam, bottom-benchTop)); // ->bench vertical
formGraphics.FillRectangle(benchBrush, new Rectangle(left + diam, benchTop, topLeft-left, diam)); // bench horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(topLeft, top + diam, diam, benchTop-top-diam)); // bench -> top vertical
formGraphics.FillRectangle(benchBrush, new Rectangle(topLeft, top, topRight-topLeft, diam)); // top horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(topRight-diam, top+diam, diam, divTop-top-diam)); // top -> diverter vertical
/// Combined meters bypasses
if (watermeterPictureBox1z.Visible) PaintBypass(formGraphics, benchBrush, 186, benchTop + diam);
if (watermeterPictureBox2z.Visible) PaintBypass(formGraphics, benchBrush, 470, benchTop + diam);
if (watermeterPictureBox3z.Visible) PaintBypass(formGraphics, benchBrush, 754, benchTop + diam);
/// Diverter
int displacement = diverterToTank ? 25 : -25;
Point[] points = new Point[4];
points[0].X = topRight - diam;
points[0].Y = divTop;
points[1].X = topRight;
points[1].Y = divTop;
points[2].X = topRight + displacement;
points[2].Y = divTop + 50;
points[3].X = topRight - diam + displacement;
points[3].Y = divTop + 50;
formGraphics.FillPolygon(benchBrush, points);
/// Sink
formGraphics.FillEllipse(emptyBrush, topRight - diam / 2 - 45, divTop + 50, 40, 30);
formGraphics.DrawEllipse(Pens.Black, topRight - diam / 2 - 45, divTop + 50, 40, 30);
/// Tank
formGraphics.DrawRectangle(Pens.Black, topRight - diam / 2, divTop + 51, 60, 80);
emptyBrush.Dispose();
filledBrush.Dispose();
formGraphics.Dispose();
}
private void PaintBypass(System.Drawing.Graphics formGraphics, System.Drawing.SolidBrush brush, int startX, int startY)
{
int w = 80;
int h = 43;
int diam = 10; // pipe diameter (pixels)
formGraphics.FillRectangle(brush, new Rectangle(startX, startY, diam, h - diam));
formGraphics.FillRectangle(brush, new Rectangle(startX, startY + h - diam, w, diam));
formGraphics.FillRectangle(brush, new Rectangle(startX + w - diam, startY, diam, h));
}
}
}
-327
View File
@@ -1,327 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="reservoirPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAI4AAABtCAYAAAB3LVkkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAEuSURBVHhe7dIxDoAwEAQx/v/pQFJQBaRM7ZN8zbZzPTcg
mG/AAeGQCIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIc
EuGQCIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIcEuGQ
CIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIcEuGQCIdE
OCTCIREOiXBIhEMiHJIVzm6AP8IhEQ6JcEiEQyIcEuGQCIdEOCTCIREOiXBIhEMiHBLhkKxw5tuN8EU4
JMIhEQ6JcEiEQyIcEuGQCIdEOCTCIXnDgRPXuAF1p5ji1T6jKwAAAABJRU5ErkJggg==
</value>
</data>
<data name="pumpPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAALTSURBVFhH7Ze9ajJBFIbXP0iRBAL+QMDa3hRqIbkAQSw1
iCRaWHgHuQBLwU7SpLBKaRmSXhOwScQmZW5AUqWb7Lt6ds7uHmMkO3x8kOKBXefMOw/O7jLHWq1W6jdE
IhFlWVYAqXYf9hbLZDIOXKJUKqlms+nCx+LxuFM/Ho/FvG38SGw6napGo+FZsN/v/4hqterOSaVSqtfr
iWv42SlWLBY9QoQkIcHFOMvlUlyP+FYsl8uJoUCSkNgmhi2W1iREsdFopMrlshtycmLZW2Cp62sdLElI
cLH7e0tdXOiMWCymKpVKYH0ginGp01NLKbXmt2KUc35uqcNDnTWfzwMOATG+fbe3OixMMfD+rrPwz/k9
PGL8Qef/FBGmGHh+1nl45haLRVAMnwQqwjPlDwFhiwFsK40PBoOgGP9O4UGXQkyIARoHATEaaLflycCU
GN5WqqnX6+Sjf4zFLPX0JE8GpsRALqezN+iboyN5EmFS7PFRZ2/QN9IEjkkxcHys8230jVTM+SdijYZc
zDEt9vGh823WF62WXMwxLQao1mZ98Se2A6q1WV/8ie2Aam30jVTIMS32f33HwM2NPIEwKYaD48GBzrfQ
80WjUecGx93PT3kiMCl2d6ezHXDEQDNKPzw8yBOBSTGqKRQKajKZ6PNYMpl0B3E+kiabEiuVdO5wOPQe
FNEh0yBaLCnAhNjbm85MJBKOi0fMudkUAJzF/SFhi728oAnRmbPZTBZD2w5rFOFFwJvCg8IWu7zUea1W
y/UAHjECfR5NQItFQWGJvb5a6upKZ7Xb7YCDKIa2nSYB2tYwxPBM8e0DkoMoBtC2838OnJ3pa0lCgovx
tw90Oh1xbbBVjECHzMMISUKCi3H8z5SfnWJo29Eh+4MlCQm/GF4u/vZtY6cYB80oLZDP51263a5Hho9l
s1mnHl90+nj+hL3EOOl02oFE/dB4rVYT53/PSn0BMb7xlEsaQlIAAAAASUVORK5CYII=
</value>
</data>
<data name="watermeterPictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="flowMeterPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAN+SURBVFhHtZi5SgRBEIbbW8QjkRXBKxPWEwRF1EjQSBDE
RFBxDdRdEDxBUDDyJXwBH8DAzNxQQdDIR9g3aOfv3emp6qkd5zL4PHqqqn/6qO5qVa1WdVwqlYpWSqVG
iumztrZm2NraqtlLRo3IW9j6+rphZGQkbO8aS3x8fOiDg4Owc0ImJib04+OjjYvR8Tk5OeH2VIBEuVzm
DqC9XauODq3u76MZH6/Zuf4en5+f+ufnx7Czs8O+tba2RgsbR2DiYNjb0+ruThbSCPj097M46ByiNjY2
WPvKyopZa6Kwl5cXY2AdOju1mp+XO03C7q5WU1NMiM/g4KD++vrSs7OzjYUxUZg2qZMsjI0xUT09PXZa
8T80hISFpu/8XA6ehclJ1kdLS0u0MLbQMVL/IWpxMeiD0Oktl+/vb6vFCkNKsIZYU1LQrFBRXV21NjKt
T09PYWEsT+Wx0F28HGbjg+vr4BtpDwmjH1nAPFhYCGJjpKgogIGofz87OwuEsV2InEOdsrK0FMT2dp9o
A3wbDytsYGCg1ogFf3srO6bB2X3q5ka2A9vb1s4Ks45xjpm4zM0FcbGZrq5kO5/9fWtfLBYdYZJDGpaX
g5i9vbKNRP1cLRQKWnV3d+crbHo6iAeSLI26sKamJvwmQSTjJHjnnI2FG8LFhWzXCH4TsX/IxnGhO7uv
T7b5C1HYzIxsHAc6UkCyiUOuI+ZeY5JOHyU3YXT3pZ0+ChWWOl3QPIWFLtkkpS7MpAsmDHcxycHFzeiX
l7JdEo6PtWpuNvGssC4crOgAiiUnCj37kDzzOsJI5n94eKgJGxoaCjqLOsTpLSHvO5sf18PMIn68vr4G
H1DNSI7u9P119iUBxUc9LgoRKwyYg9PvFNUMdaQ3T1xdom4JaSAz9vz8zIWhQrad47zznaTrcJ6cntr4
o6OjRgsTZv7xBQDPKPI6nAcofuo7Eby/v8vCULa3tbVxMUC6DmcFy4X0sedtOqqFCbONxMEgBc6C8x5S
KpXCGtwG9y3BgGmVOkgD1hSZPuBqAEwYfXVB2Y4KmQbIVNYhJQwPs3iHh4dMDMUKo+9TeODw21Eh02AG
FA7I1JIAytERy+gUd025GGGbm5vMCa8uvgHKdlTI9LsFR1gUzpQBpAS6+xqh7JunR4cX7O3tTTQEq6ur
rJOk+MkzDp59zYlOXyP+83GYU9W/sZE2jpG87/4AAAAASUVORK5CYII=
</value>
</data>
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAjCAYAAAD48HgdAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAN0SURBVFhHxZg5SDNBGIZHiTZBEA9UEESE2ARvxIMIVuJV
qY0iKoithSBok87CIFgZwUIQlEDEo7EQBRuJKNiYSsFSsDJaeRTf7zvLbvb4drObqH/xNNmZ93symWsj
UqkU6RkeHiYhxH9B72ERA1NTU2zH3+T29tbgwIqdnp7KxvPzgoh+j89PQUVFgmZnZy0OrBg4OzuTcuEw
H5orT0/KSE1OTrL1bcXAxcWF7Hxzw4fnAnILCwvZusBRDAQCARny9sYXyIbVVWcpkFEMBINBKijgi3hl
eVkZrYeHB7aWiisxdb5VVvLF3ILFhJyRkRG2jh5XYiAej8vQtTW+qBuqqwUNDQ2x+WZci4GlpSUpt7nJ
F7bj40NQcbGg/v5+NpfDkxhoaGiQcqkUL8GB9kofPpPDsxioqKiQhd7feRE9h4eC8vPz6erqSuu/sbFB
VVVVEp/Pp4mD7u5u2SYrsUQiIUP8fl5GZXtbKZZMJi0ZJycn37t+kZRWpe7u7rTnWYmBo6MjGeY03/C8
tbVV6zM3N0dtbW2aiMri4qL8svr8rMWAWiQWs0oFg4La29tpfHycxsbGDCItLS20srIin4XDYTY7JzFQ
X18vix0cpKUCAeOIgNHRUZqentb6mUfITM5ioLa2lpqarDJYJJ2dnWyfTGQthvsTMMuocH284Flsd3eX
SktLKS8vzyLz/CyorOwPxSYmJqirq8sigom7t7cnf8re3vQcwzN8xmW5xVZsZmZGHracTCQS0dph8vf0
pKUAFgLa4pk+0wsGMezIjY2NFpm+vj65tPVtQU1NDYVCRikVbCHou7W1ZennBoOYuvQBNkanm8Dx8bFs
hyOHEwN1dUoWNmMuwwmDWHNzM0WjUUMDDvV+lkjwQnpwbPn9fnp8fGSz7HA1+fXEYjEplUzyImZw0KM9
9jQuzw7PYpiD5eWCvr54EY54XJHDlYnL5PAk1tHR8T0P+eKZiEYVOYw4l23GtRjOOgRzRd0yMKDI7e/v
szX0uBI7Pz+XgevrfEEv4IUGWVwdPRnF7u/vZdDODl8oG3w+XIuCbD0VR7HLy0t5JuqvND/B66syaniZ
5uoCR7FQKCQDXl74ArkQiSjvAtfX12xtW7HBwUEqKfG2LXgFf9jgi2PDNtdnxRYWFmQHnHe/jd1isIip
b0B/Df4sTHuk6B/rrIep2LXHGgAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox1z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox2z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox3z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
</root>
File diff suppressed because it is too large Load Diff
-696
View File
@@ -1,696 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using Common;
using Config.Entities;
using Results.Entities;
using TBF.Rig.Sequences;
using TBF.UiBridge;
using TBF.Resources;
#pragma warning disable 162 /// Disables 'Unreachable code detected' warning
namespace TBF.UI.Process
{
public partial class ProcessTabPageCtrl48 : UserControl
{
static readonly ILog log = LogManager.GetLogger(typeof(ProcessTabPageCtrl48));
MetersKind currentMetersKind;
int textBoxesCount;
Label[] meter;
Label[] sensor;
Label[] pulses;
Label[] refPulses;
Label[] volume;
Label[] error;
Label[] passed;
Label[] cmpndVolume;
Label[] cmpndError;
Label[] cmpndPassed;
bool pumpOn = true;
bool diverterToTank = true;
/// <summary>
/// Constructor, initializes anonymous event handlers
/// </summary>
public ProcessTabPageCtrl48()
{
currentMetersKind = MetersKind.Single;
InitializeComponent();
textBoxesCount = 40;
meter = new Label[] {
meter1Label, meter2Label, meter3Label, meter4Label, meter5Label,
meter6Label, meter7Label, meter8Label, meter9Label, meter10Label,
meter11Label, meter12Label, meter13Label, meter14Label, meter15Label,
meter16Label, meter17Label, meter18Label, meter19Label, meter20Label,
meter21Label, meter22Label, meter23Label, meter24Label, meter25Label,
meter26Label, meter27Label, meter28Label, meter29Label, meter30Label,
meter31Label, meter32Label, meter33Label, meter34Label, meter35Label,
meter36Label, meter37Label, meter38Label, meter39Label, meter40Label,
};
sensor = new Label[] {
sensor1Label, sensor2Label, sensor3Label, sensor4Label, sensor5Label,
sensor6Label, sensor7Label, sensor8Label, sensor9Label, sensor10Label,
sensor11Label, sensor12Label, sensor13Label, sensor14Label, sensor15Label,
sensor16Label, sensor17Label, sensor18Label, sensor19Label, sensor20Label,
sensor21Label, sensor22Label, sensor23Label, sensor24Label, sensor25Label,
sensor26Label, sensor27Label, sensor28Label, sensor29Label, sensor30Label,
sensor31Label, sensor32Label, sensor33Label, sensor34Label, sensor35Label,
sensor36Label, sensor37Label, sensor38Label, sensor39Label, sensor40Label,
};
pulses = new Label[] {
pulses1Label, pulses2Label, pulses3Label, pulses4Label, pulses5Label,
pulses6Label, pulses7Label, pulses8Label, pulses9Label, pulses10Label,
pulses11Label, pulses12Label, pulses13Label, pulses14Label, pulses15Label,
pulses16Label, pulses17Label, pulses18Label, pulses19Label, pulses20Label,
pulses21Label, pulses22Label, pulses23Label, pulses24Label, pulses25Label,
pulses26Label, pulses27Label, pulses28Label, pulses29Label, pulses30Label,
pulses31Label, pulses32Label, pulses33Label, pulses34Label, pulses35Label,
pulses36Label, pulses37Label, pulses38Label, pulses39Label, pulses40Label,
};
refPulses = new Label[] {
refPulses1Label, refPulses2Label, refPulses3Label, refPulses4Label, refPulses5Label,
refPulses6Label, refPulses7Label, refPulses8Label, refPulses9Label, refPulses10Label,
refPulses11Label, refPulses12Label, refPulses13Label, refPulses14Label, refPulses15Label,
refPulses16Label, refPulses17Label, refPulses18Label, refPulses19Label, refPulses20Label,
refPulses21Label, refPulses22Label, refPulses23Label, refPulses24Label, refPulses25Label,
refPulses26Label, refPulses27Label, refPulses28Label, refPulses29Label, refPulses30Label,
refPulses31Label, refPulses32Label, refPulses33Label, refPulses34Label, refPulses35Label,
refPulses36Label, refPulses37Label, refPulses38Label, refPulses39Label, refPulses40Label,
};
volume = new Label[] {
volume1Label, volume2Label, volume3Label, volume4Label, volume5Label,
volume6Label, volume7Label, volume8Label, volume9Label, volume10Label,
volume11Label, volume12Label, volume13Label, volume14Label, volume15Label,
volume16Label, volume17Label, volume18Label, volume19Label, volume20Label,
volume21Label, volume22Label, volume23Label, volume24Label, volume25Label,
volume26Label, volume27Label, volume28Label, volume29Label, volume30Label,
volume31Label, volume32Label, volume33Label, volume34Label, volume35Label,
volume36Label, volume37Label, volume38Label, volume39Label, volume40Label,
};
error = new Label[] {
error1Label, error2Label, error3Label, error4Label, error5Label,
error6Label, error7Label, error8Label, error9Label, error10Label,
error11Label, error12Label, error13Label, error14Label, error15Label,
error16Label, error17Label, error18Label, error19Label, error20Label,
error21Label, error22Label, error23Label, error24Label, error25Label,
error26Label, error27Label, error28Label, error29Label, error30Label,
error31Label, error32Label, error33Label, error34Label, error35Label,
error36Label, error37Label, error38Label, error39Label, error40Label,
};
passed = new Label[] {
passed1Label, passed2Label, passed3Label, passed4Label, passed5Label,
passed6Label, passed7Label, passed8Label, passed9Label, passed10Label,
passed11Label, passed12Label, passed13Label, passed14Label, passed15Label,
passed16Label, passed17Label, passed18Label, passed19Label, passed20Label,
passed21Label, passed22Label, passed23Label, passed24Label, passed25Label,
passed26Label, passed27Label, passed28Label, passed29Label, passed30Label,
passed31Label, passed32Label, passed33Label, passed34Label, passed35Label,
passed36Label, passed37Label, passed38Label, passed39Label, passed40Label,
};
cmpndVolume = new Label[] { volume1zLabel, volume2zLabel, volume3zLabel };
cmpndError = new Label[] { error1zLabel, error2zLabel, error3zLabel };
cmpndPassed = new Label[] { passed1zLabel, passed2zLabel, passed3zLabel };
ShuffleLabels(TBF.Data.WMsCount, TBF.Data.LineSize);
Bridge.ProcedureSelectedHandler += delegate(object sndr, ProcedureSelectedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<ProcedureSelectedEventArgs>(OnProcedureSelected), sndr, args);
else
OnProcedureSelected(sndr, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage48.OnProcedureSelected() failed: {0}", e.Message); }
};
Bridge.TestSelectedHandler += delegate(object sender, TestSelectedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<TestSelectedEventArgs>(OnTestSelected), sender, args);
else
OnTestSelected(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage48.OnTestSelected() failed: {0}", e.Message); }
};
Bridge.TestCompletedHandler += delegate(object sender, TestCompletedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<TestCompletedEventArgs>(OnTestCompleted), sender, args);
else
OnTestCompleted(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage48.OnTestCompleted() failed: {0}", e.Message); }
};
Bridge.ProcedureCompletedHandler += delegate(object sender, ProcedureCompletedEventArgs args)
{
try
{
if (InvokeRequired)
Invoke(new EventHandler<ProcedureCompletedEventArgs>(OnProcedureCompleted), sender, args);
else
OnProcedureCompleted(sender, args);
}
catch (Exception e) { log.ErrorFormat("ProcessTabPage48.OnProcedureCompleted() failed: {0}", e.Message); }
};
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// Enable only used labels.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleLabels(int wmsCount, int lineSize)
{
if (wmsCount <= textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
meter[dest] = meter[l * lineSize + l * gap + i];
meter[dest].Visible = true;
meter[dest].Text = string.Format("Meter {0}", dest + 1);
sensor[dest] = sensor[l * lineSize + l * gap + i];
sensor[dest].Visible = true;
pulses[dest] = pulses[l * lineSize + l * gap + i];
pulses[dest].Visible = true;
refPulses[dest] = refPulses[l * lineSize + l * gap + i];
refPulses[dest].Visible = true;
volume[dest] = volume[l * lineSize + l * gap + i];
volume[dest].Visible = true;
error[dest] = error[l * lineSize + l * gap + i];
error[dest].Visible = true;
passed[dest] = passed[l * lineSize + l * gap + i];
passed[dest].Visible = true;
dest++;
}
}
textBoxesCount = wmsCount;
}
}
private void ProcessTabPageCtrl_Load(object sender, EventArgs e)
{
Once();
ResetLabelsAndTargetVals();
ResetReadings();
}
void Once()
{
}
void UpdateVisibility(MetersKind metersKind)
{
bool visible = (metersKind == MetersKind.Single);
for (int i = 2 * TBF.Data.CompoundWMsCount; i < textBoxesCount; i++)
{
meter[i].Visible = visible;
sensor[i].Visible = visible;
pulses[i].Visible = visible;
refPulses[i].Visible = visible;
volume[i].Visible = visible;
error[i].Visible = visible;
passed[i].Visible = visible;
}
groupBox1z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 1);
groupBox2z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 2);
groupBox3z.Visible = (metersKind == MetersKind.Combined) && (TBF.Data.CompoundWMsCount >= 3);
}
/// <summary>
/// Called when a new procedure is selected
/// </summary>
void ResetLabelsAndTargetVals()
{
/// Target values
targetFlowLowLabel.Text = "---";
targetFlowHighLabel.Text = "---";
targetVolumeLabel.Text = "---";
targetRefCountLabel.Text = "---";
estmtdTimeLabel.Text = "---";
//
refFlowCmpntLabel.Text = "---";
regValveCmpntLabel.Text = "---";
/// Water pressure
prInCmpntLabel.Text = "---";
prOutCmpntLabel.Text = "---";
/// Water temperature
tInCmpntLabel.Text = "---";
tOutCmpntLabel.Text = "---";
tDivCmpntLabel.Text = "---";
scaleCmpntLabel.Text = "---";
if (currentMetersKind == MetersKind.Single)
{
watermeterPictureBox1.Visible = true;
watermeterPictureBox2.Visible = true;
watermeterPictureBox3.Visible = true;
watermeterPictureBox4.Visible = true;
watermeterPictureBox5.Visible = true;
watermeterPictureBox6.Visible = true;
watermeterPictureBox1z.Visible = false;
watermeterPictureBox2z.Visible = false;
watermeterPictureBox3z.Visible = false;
groupBox1z.Visible = false;
groupBox2z.Visible = false;
groupBox3z.Visible = false;
sensor1Label.Text = "---";
for (int i = 0; i < textBoxesCount; i++)
{
sensor[i].Text = "---";
}
}
else if (currentMetersKind == MetersKind.Combined)
{
watermeterPictureBox1.Visible = false;
watermeterPictureBox2.Visible = true;
watermeterPictureBox3.Visible = false;
watermeterPictureBox4.Visible = false;
watermeterPictureBox5.Visible = false;
watermeterPictureBox6.Visible = false;
watermeterPictureBox1z.Visible = true;
watermeterPictureBox2z.Visible = false;
watermeterPictureBox3z.Visible = false;
groupBox1z.Visible = true;
groupBox2z.Visible = false;
groupBox3z.Visible = false;
sensor1Label.Visible = true;
sensor1Label.Text = "---";
sensor2Label.Visible = true;
sensor2Label.Text = "---";
}
}
/// <summary>
/// Called when a new procedure or a new test procedure is selected
/// </summary>
void ResetReadings()
{
/// Top part
airTempLabel.Text = "---";
airPressLabel.Text = "---";
airHumiLabel.Text = "---";
refPulsesLabel.Text = "---";
refFreqLabel.Text = "---";
refFlowLabel.Text = "---";
refVolumeLabel.Text = "---";
regValvePosLabel.Text = "---";
tDivLabel.Text = "---";
tInLabel.Text = "---";
tOutLabel.Text = "---";
prInLabel.Text = "---";
prOutLabel.Text = "---";
massLabel.Text = "---";
massDiffLabel.Text = "---";
volumeCtvLabel.Text = "---";
refErrorLabel.Text = "---";
/// Meters
pulses1Label.Text = "---";
refPulses1Label.Text = "---";
volume1Label.Text = "---";
error1Label.Text = "---";
passed1Label.Text = "---";
if (currentMetersKind == MetersKind.Single)
{
for (int i = 0; i < textBoxesCount; i++)
{
pulses[i].Text = "---";
refPulses[i].Text = "---";
volume[i].Text = "---";
error[i].Text = "---";
passed[i].Text = "---";
}
}
else if (currentMetersKind == MetersKind.Combined)
{
for (int i = 0; i < 2; i++)
{
pulses[i].Text = "---";
refPulses[i].Text = "---";
volume[i].Text = "---";
error[i].Text = "---";
passed[i].Text = "---";
}
volume1zLabel.Text = "---";
error1zLabel.Text = "---";
passed1zLabel.Text = "---";
}
}
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
{
currentMetersKind = args.Procedure.MetersKind;
UpdateVisibility(currentMetersKind);
ResetLabelsAndTargetVals();
ResetReadings();
Invalidate();
}
void OnTestSelected(object sender, TestSelectedEventArgs args)
{
/// Readings and target values
ResetReadings();
/// Target values
targetFlowLowLabel.Text = args.Test.Qfrom.ToString("F3");
targetFlowHighLabel.Text = args.Test.Qto.ToString("F3");
targetVolumeLabel.Text = args.Test.Volume.ToString("F1");
//targetRefCountLabel.Text = args.TotalPulses.ToString();
estmtdTimeLabel.Text = args.Test.TestTime.ToString("F1");
/// Names of virtual bench components
if (args.BenchPath.PressMtrUp != null) prInCmpntLabel.Text = args.BenchPath.PressMtrUp.Name;
if (args.BenchPath.PressMtrDown != null) prOutCmpntLabel.Text = args.BenchPath.PressMtrDown.Name;
if (args.BenchPath.TempMtrUp != null) tInCmpntLabel.Text = args.BenchPath.TempMtrUp.Name;
if (args.BenchPath.TempMtrDown != null) tOutCmpntLabel.Text = args.BenchPath.TempMtrDown.Name;
if (args.OutputPath.TempMtrDiv != null) tDivCmpntLabel.Text = args.OutputPath.TempMtrDiv.Name;
if (args.OutputPath.FlowMeter != null) refFlowCmpntLabel.Text = args.OutputPath.FlowMeter.Name;
if (args.OutputPath.RegValve != null) regValveCmpntLabel.Text = args.OutputPath.RegValve.Name;
if (args.OutputPath.Scale != null) scaleCmpntLabel.Text = args.OutputPath.Scale.Name;
for (int i = 0; i < textBoxesCount; i++)
{
sensor[i].Text = (args.MetersPath.RegisterReaders[i] == null) ? "" : args.MetersPath.RegisterReaders[i].Cfg.Name;
}
if (args.FeedingPath != null && (args.FeedingPath.Pump is Rig.GenericDevices.IPumpFM))
{
pumpPctTextBox.Visible = true;
pumpPctTextBox.Text = (args.FeedingPath.Pump as Rig.GenericDevices.IPumpFM).Power.ToString("F0") + " %";
}
else
{
pumpPctTextBox.Visible = false;
}
}
void OnProcessDataChanged(object sender, ProcessDataEventArgs args)
{
///
/// Always available
///
airTempLabel.Text = ProcessData.AmbTemp.ToString();
airPressLabel.Text = Common.Units.ConvertTo(Common.Unit.mbar, ProcessData.AmbPress.Val).ToString("F0");
airHumiLabel.Text = ProcessData.AmbHumi.ToString();
tInLabel.Text = ProcessData.TempUp.ToString();
tOutLabel.Text = ProcessData.TempDown.ToString();
tDivLabel.Text = ProcessData.TempDiv.ToString();
prInLabel.Text = ProcessData.PressUp.ToString();
prOutLabel.Text = ProcessData.PressDown.ToString();
//massLabel.Text = ProcessData.Mass.ToString();
if (args.TestPhase == Progress.FlowSetting ||
args.TestPhase == Progress.Test)
{
///
/// Available when setting the flow and during a test
///
refFreqLabel.Text = ProcessData.RefFrequency.ToString();
refFlowLabel.Text = Utils.DoubleToStr(ProcessData.RefFlow.Val, 4);
}
if (args.TestPhase == Progress.Test)
{
///
/// Available only during a test
///
refPulsesLabel.Text = ProcessData.RefPulses.ToString();
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses;
refVolumeLabel.Text = refVolume.ToString("F2");
//double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
//massDiffLabel.Text = massDiff.ToString("F3");
//double volumeCtv = 1000 * Formulas.Buoyancy() * massDiff / Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2,
// (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2);
//volumeCtvLabel.Text = volumeCtv.ToString("F2");
//double refError = Formulas.ErrorFromVolumes(refVolume, volumeCtv);
//refErrorLabel.Text = refError.ToString("F3");
if (currentMetersKind == MetersKind.Single)
{
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
{
Rig.GenericDevices.IRegReader rr = ProcessData.RegisterReaders[i];
if (rr != null)
{
pulses[i].Text = rr.WMPulses.ToString();
refPulses[i].Text = rr.WMRefPulses.ToString();
volume[i].Text = rr.WMVolume.ToString("F1");
error[i].Text = Formulas.ErrorFromVolumes(rr.WMVolume, rr.WMRefPulses * ProcessData.LtrPerRefPulse).ToString("F1");
}
}
}
else if (currentMetersKind == MetersKind.Combined)
{
for (int compMtr = 0; compMtr < TBF.Data.CompoundWMsCount; compMtr++)
{
int end = Math.Min(2 * compMtr+2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
double compoundVolume = 0;
for (int i = 2 * compMtr; i < end; i++)
{
Rig.GenericDevices.IRegReader rr = ProcessData.RegisterReaders[i];
if (rr != null)
{
pulses[i].Text = rr.WMPulses.ToString();
refPulses[i].Text = rr.WMRefPulses.ToString();
volume[i].Text = rr.WMVolume.ToString("F1");
error[i].Text = Formulas.ErrorFromVolumes(rr.WMVolume, rr.WMRefPulses * ProcessData.LtrPerRefPulse).ToString("F1");
compoundVolume += rr.WMVolume;
}
}
cmpndVolume[compMtr].Text = compoundVolume.ToString("F1");
cmpndError[compMtr].Text = Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
}
}
}
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
//{
// //if (pumpOn != args.PumpOn)
// //{
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
// // else pumpPictureBox.Image = System.Resources.
// //}
// pumpOn = args.PumpOn;
// diverterToTank = args.DivToTank;
// Invalidate();
//}
}
void OnTestCompleted(object sender, TestCompletedEventArgs args)
{
if (args == null) return;
TestRslt tRes = args.TestRslt;
if (tRes == null) return;
airTempLabel.Text = tRes.AmbTempMean.ToString("F1");
airPressLabel.Text = Common.Units.ConvertTo(Common.Unit.mbar, tRes.AmbPressMean).ToString("F0");
airHumiLabel.Text = tRes.AmbHumiMean.ToString("F1");
tInLabel.Text = tRes.TempUpMean.ToString("F2");
tOutLabel.Text = tRes.TempDownMean.ToString("F2");
tDivLabel.Text = tRes.TempDivMean.ToString("F2");
prInLabel.Text = tRes.PressUpMean.ToString("F2");
prOutLabel.Text = tRes.PressDownMean.ToString("F2");
//massLabel.Text = ProcessData.Mass.ToString();
massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3");
refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
refFreqLabel.Text = "---";
refFlowLabel.Text = Utils.DoubleToStr(tRes.FlowVolume, 4);
refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
//regValvePosLabel.Text = tstRslt.
volumeCtvLabel.Text = tRes.VolumeCTV.ToString("F1");
refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
if (!tRes.Batch.Compound)
{
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.BatchRslts.Batch.WaterMeters.Count); i++)
{
WaterMeter wm = ProcessData.BatchRslts.Batch.WaterMeters[i];
MeterTestRslt mtr = (wm != null) ? wm.GetMeterTestRslt(args.TestName) : null;
if (mtr != null)
{
pulses[i].Text = mtr.PulsesMeter.ToString("F0");
refPulses[i].Text = mtr.PulsesMaster.ToString("F0");
volume[i].Text = mtr.VolumeMeter.ToString("F2");
error[i].Text = mtr.Error.ToString("F2");
passed[i].Text = mtr.Passed ? Strings.Passed : Strings.Failed;
}
}
}
else
{
for (int compMtr = 0; compMtr < TBF.Data.CompoundWMsCount; compMtr++)
{
WaterMeter wm = ProcessData.BatchRslts.Batch.WaterMeters[compMtr];
if (wm == null && !wm.Disabled) continue;
int end = Math.Min(textBoxesCount, TBF.Data.WMsCount);
MeterTestRslt mtrMain = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.CompoundMain);
if ((mtrMain != null) && (2 * compMtr < end))
{
pulses[2 * compMtr].Text = mtrMain.PulsesMeter.ToString("F0");
refPulses[2 * compMtr].Text = mtrMain.PulsesMaster.ToString("F0");
volume[2 * compMtr].Text = mtrMain.VolumeMeter.ToString("F2");
error[2 * compMtr].Text = mtrMain.Error.ToString("F2");
passed[2 * compMtr].Text = mtrMain.Passed ? Strings.Passed : Strings.Failed;
}
MeterTestRslt mtrAux = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.CompoundAux);
if ((mtrAux != null) && (2 * compMtr + 1 < end))
{
pulses[2 * compMtr + 1].Text = mtrAux.PulsesMeter.ToString("F0");
refPulses[2 * compMtr + 1].Text = mtrAux.PulsesMaster.ToString("F0");
volume[2 * compMtr + 1].Text = mtrAux.VolumeMeter.ToString("F2");
error[2 * compMtr + 1].Text = mtrAux.Error.ToString("F2");
passed[2 * compMtr + 1].Text = mtrAux.Passed ? Strings.Passed : Strings.Failed;
}
MeterTestRslt mtrComp = wm.GetMeterTestRslt(args.TestName, CompoundMeterId.Compound);
if (mtrComp != null)
{
cmpndVolume[compMtr].Text = mtrComp.VolumeMeter.ToString("F2");
cmpndError[compMtr].Text = mtrComp.Error.ToString("F2");
cmpndPassed[compMtr].Text = mtrComp.Passed ? Strings.Passed : Strings.Failed;
}
}
}
}
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
{
}
private void ProcessTabPageCtrl_Paint(object sender, PaintEventArgs e)
{
System.Drawing.Graphics formGraphics = this.CreateGraphics();
System.Drawing.SolidBrush filledBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Blue);
System.Drawing.SolidBrush emptyBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Gray);
System.Drawing.SolidBrush benchBrush = (pumpOn ? filledBrush : emptyBrush);
int diam = 14; // pipe diameter (pixels)
int left = 20; // left-most pipe x-coordinate
int top = 14; // top-most pipe y-coordinate
int topLeft = 876;
int topRight = 966;
int divTop = 40;
int bottom = 504; // bottom-most pipe y-coordinate
int benchTop = 378; // bench-pipe top y-coordinate
int pumpLeft = 779;
int pumpWdth = 38;
/// Pipes
formGraphics.FillRectangle(filledBrush,new Rectangle(pumpLeft+pumpWdth, bottom-diam, 65, diam)); // tank -> pump
formGraphics.FillRectangle(benchBrush, new Rectangle(left, bottom-diam, pumpLeft-left, diam)); // pump ->bench horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(left, benchTop, diam, bottom-benchTop)); // ->bench vertical
formGraphics.FillRectangle(benchBrush, new Rectangle(left + diam, benchTop, topLeft-left, diam)); // bench horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(topLeft, top + diam, diam, benchTop-top-diam)); // bench -> top vertical
formGraphics.FillRectangle(benchBrush, new Rectangle(topLeft, top, topRight-topLeft, diam)); // top horizontal
formGraphics.FillRectangle(benchBrush, new Rectangle(topRight-diam, top+diam, diam, divTop-top-diam)); // top -> diverter vertical
/// Combined meters bypasses
if (watermeterPictureBox1z.Visible) PaintBypass(formGraphics, benchBrush, 186, benchTop + diam);
if (watermeterPictureBox2z.Visible) PaintBypass(formGraphics, benchBrush, 470, benchTop + diam);
if (watermeterPictureBox3z.Visible) PaintBypass(formGraphics, benchBrush, 754, benchTop + diam);
/// Diverter
int displacement = diverterToTank ? 25 : -25;
Point[] points = new Point[4];
points[0].X = topRight - diam;
points[0].Y = divTop;
points[1].X = topRight;
points[1].Y = divTop;
points[2].X = topRight + displacement;
points[2].Y = divTop + 50;
points[3].X = topRight - diam + displacement;
points[3].Y = divTop + 50;
formGraphics.FillPolygon(benchBrush, points);
/// Sink
formGraphics.FillEllipse(emptyBrush, topRight - diam / 2 - 45, divTop + 50, 40, 30);
formGraphics.DrawEllipse(Pens.Black, topRight - diam / 2 - 45, divTop + 50, 40, 30);
/// Tank
formGraphics.DrawRectangle(Pens.Black, topRight - diam / 2, divTop + 51, 60, 80);
emptyBrush.Dispose();
filledBrush.Dispose();
formGraphics.Dispose();
}
private void PaintBypass(System.Drawing.Graphics formGraphics, System.Drawing.SolidBrush brush, int startX, int startY)
{
int w = 80;
int h = 43;
int diam = 10; // pipe diameter (pixels)
formGraphics.FillRectangle(brush, new Rectangle(startX, startY, diam, h - diam));
formGraphics.FillRectangle(brush, new Rectangle(startX, startY + h - diam, w, diam));
formGraphics.FillRectangle(brush, new Rectangle(startX + w - diam, startY, diam, h));
}
}
}
-327
View File
@@ -1,327 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="reservoirPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAI4AAABtCAYAAAB3LVkkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAEuSURBVHhe7dIxDoAwEAQx/v/pQFJQBaRM7ZN8zbZzPTcg
mG/AAeGQCIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIc
EuGQCIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIcEuGQ
CIdEOCTCIREOiXBIhEMiHBLhkAiHRDgkwiERDolwSIRDIhwS4ZAIh0Q4JMIhEQ6JcEiEQyIcEuGQCIdE
OCTCIREOiXBIhEMiHJIVzm6AP8IhEQ6JcEiEQyIcEuGQCIdEOCTCIREOiXBIhEMiHBLhkKxw5tuN8EU4
JMIhEQ6JcEiEQyIcEuGQCIdEOCTCIXnDgRPXuAF1p5ji1T6jKwAAAABJRU5ErkJggg==
</value>
</data>
<data name="pumpPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAALTSURBVFhH7Ze9ajJBFIbXP0iRBAL+QMDa3hRqIbkAQSw1
iCRaWHgHuQBLwU7SpLBKaRmSXhOwScQmZW5AUqWb7Lt6ds7uHmMkO3x8kOKBXefMOw/O7jLHWq1W6jdE
IhFlWVYAqXYf9hbLZDIOXKJUKqlms+nCx+LxuFM/Ho/FvG38SGw6napGo+FZsN/v/4hqterOSaVSqtfr
iWv42SlWLBY9QoQkIcHFOMvlUlyP+FYsl8uJoUCSkNgmhi2W1iREsdFopMrlshtycmLZW2Cp62sdLElI
cLH7e0tdXOiMWCymKpVKYH0ginGp01NLKbXmt2KUc35uqcNDnTWfzwMOATG+fbe3OixMMfD+rrPwz/k9
PGL8Qef/FBGmGHh+1nl45haLRVAMnwQqwjPlDwFhiwFsK40PBoOgGP9O4UGXQkyIARoHATEaaLflycCU
GN5WqqnX6+Sjf4zFLPX0JE8GpsRALqezN+iboyN5EmFS7PFRZ2/QN9IEjkkxcHys8230jVTM+SdijYZc
zDEt9vGh823WF62WXMwxLQao1mZ98Se2A6q1WV/8ie2Aam30jVTIMS32f33HwM2NPIEwKYaD48GBzrfQ
80WjUecGx93PT3kiMCl2d6ezHXDEQDNKPzw8yBOBSTGqKRQKajKZ6PNYMpl0B3E+kiabEiuVdO5wOPQe
FNEh0yBaLCnAhNjbm85MJBKOi0fMudkUAJzF/SFhi728oAnRmbPZTBZD2w5rFOFFwJvCg8IWu7zUea1W
y/UAHjECfR5NQItFQWGJvb5a6upKZ7Xb7YCDKIa2nSYB2tYwxPBM8e0DkoMoBtC2838OnJ3pa0lCgovx
tw90Oh1xbbBVjECHzMMISUKCi3H8z5SfnWJo29Eh+4MlCQm/GF4u/vZtY6cYB80oLZDP51263a5Hho9l
s1mnHl90+nj+hL3EOOl02oFE/dB4rVYT53/PSn0BMb7xlEsaQlIAAAAASUVORK5CYII=
</value>
</data>
<data name="watermeterPictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="flowMeterPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAN+SURBVFhHtZi5SgRBEIbbW8QjkRXBKxPWEwRF1EjQSBDE
RFBxDdRdEDxBUDDyJXwBH8DAzNxQQdDIR9g3aOfv3emp6qkd5zL4PHqqqn/6qO5qVa1WdVwqlYpWSqVG
iumztrZm2NraqtlLRo3IW9j6+rphZGQkbO8aS3x8fOiDg4Owc0ImJib04+OjjYvR8Tk5OeH2VIBEuVzm
DqC9XauODq3u76MZH6/Zuf4en5+f+ufnx7Czs8O+tba2RgsbR2DiYNjb0+ruThbSCPj097M46ByiNjY2
WPvKyopZa6Kwl5cXY2AdOju1mp+XO03C7q5WU1NMiM/g4KD++vrSs7OzjYUxUZg2qZMsjI0xUT09PXZa
8T80hISFpu/8XA6ehclJ1kdLS0u0MLbQMVL/IWpxMeiD0Oktl+/vb6vFCkNKsIZYU1LQrFBRXV21NjKt
T09PYWEsT+Wx0F28HGbjg+vr4BtpDwmjH1nAPFhYCGJjpKgogIGofz87OwuEsV2InEOdsrK0FMT2dp9o
A3wbDytsYGCg1ogFf3srO6bB2X3q5ka2A9vb1s4Ks45xjpm4zM0FcbGZrq5kO5/9fWtfLBYdYZJDGpaX
g5i9vbKNRP1cLRQKWnV3d+crbHo6iAeSLI26sKamJvwmQSTjJHjnnI2FG8LFhWzXCH4TsX/IxnGhO7uv
T7b5C1HYzIxsHAc6UkCyiUOuI+ZeY5JOHyU3YXT3pZ0+ChWWOl3QPIWFLtkkpS7MpAsmDHcxycHFzeiX
l7JdEo6PtWpuNvGssC4crOgAiiUnCj37kDzzOsJI5n94eKgJGxoaCjqLOsTpLSHvO5sf18PMIn68vr4G
H1DNSI7u9P119iUBxUc9LgoRKwyYg9PvFNUMdaQ3T1xdom4JaSAz9vz8zIWhQrad47zznaTrcJ6cntr4
o6OjRgsTZv7xBQDPKPI6nAcofuo7Eby/v8vCULa3tbVxMUC6DmcFy4X0sedtOqqFCbONxMEgBc6C8x5S
KpXCGtwG9y3BgGmVOkgD1hSZPuBqAEwYfXVB2Y4KmQbIVNYhJQwPs3iHh4dMDMUKo+9TeODw21Eh02AG
FA7I1JIAytERy+gUd025GGGbm5vMCa8uvgHKdlTI9LsFR1gUzpQBpAS6+xqh7JunR4cX7O3tTTQEq6ur
rJOk+MkzDp59zYlOXyP+83GYU9W/sZE2jpG87/4AAAAASUVORK5CYII=
</value>
</data>
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAjCAYAAAD48HgdAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAN0SURBVFhHxZg5SDNBGIZHiTZBEA9UEESE2ARvxIMIVuJV
qY0iKoithSBok87CIFgZwUIQlEDEo7EQBRuJKNiYSsFSsDJaeRTf7zvLbvb4drObqH/xNNmZ93symWsj
UqkU6RkeHiYhxH9B72ERA1NTU2zH3+T29tbgwIqdnp7KxvPzgoh+j89PQUVFgmZnZy0OrBg4OzuTcuEw
H5orT0/KSE1OTrL1bcXAxcWF7Hxzw4fnAnILCwvZusBRDAQCARny9sYXyIbVVWcpkFEMBINBKijgi3hl
eVkZrYeHB7aWiisxdb5VVvLF3ILFhJyRkRG2jh5XYiAej8vQtTW+qBuqqwUNDQ2x+WZci4GlpSUpt7nJ
F7bj40NQcbGg/v5+NpfDkxhoaGiQcqkUL8GB9kofPpPDsxioqKiQhd7feRE9h4eC8vPz6erqSuu/sbFB
VVVVEp/Pp4mD7u5u2SYrsUQiIUP8fl5GZXtbKZZMJi0ZJycn37t+kZRWpe7u7rTnWYmBo6MjGeY03/C8
tbVV6zM3N0dtbW2aiMri4qL8svr8rMWAWiQWs0oFg4La29tpfHycxsbGDCItLS20srIin4XDYTY7JzFQ
X18vix0cpKUCAeOIgNHRUZqentb6mUfITM5ioLa2lpqarDJYJJ2dnWyfTGQthvsTMMuocH284Flsd3eX
SktLKS8vzyLz/CyorOwPxSYmJqirq8sigom7t7cnf8re3vQcwzN8xmW5xVZsZmZGHracTCQS0dph8vf0
pKUAFgLa4pk+0wsGMezIjY2NFpm+vj65tPVtQU1NDYVCRikVbCHou7W1ZennBoOYuvQBNkanm8Dx8bFs
hyOHEwN1dUoWNmMuwwmDWHNzM0WjUUMDDvV+lkjwQnpwbPn9fnp8fGSz7HA1+fXEYjEplUzyImZw0KM9
9jQuzw7PYpiD5eWCvr54EY54XJHDlYnL5PAk1tHR8T0P+eKZiEYVOYw4l23GtRjOOgRzRd0yMKDI7e/v
szX0uBI7Pz+XgevrfEEv4IUGWVwdPRnF7u/vZdDODl8oG3w+XIuCbD0VR7HLy0t5JuqvND/B66syaniZ
5uoCR7FQKCQDXl74ArkQiSjvAtfX12xtW7HBwUEqKfG2LXgFf9jgi2PDNtdnxRYWFmQHnHe/jd1isIip
b0B/Df4sTHuk6B/rrIep2LXHGgAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox1z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox2z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
<data name="watermeterPictureBox3z.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACYAAAAeCAYAAABAFGxuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAIGSURBVFhH7de/SwJhGAfwtwJpUlBwaVIEcXDVxcUxQaS1
QdLVwTnQv0AcGgUdo9U1dNAWHVwiEQKFaAkCwZqq5el53rvT03v8cXqeDQ0fjXu97/PFO+w9MZlMYFO1
Wg2EEJbg8vX+iy3i8vW2KHaEznbkgm63C6PRiJ1DtijmQLCjMRLg8/mgUqmwsw5UTEN5UfD7/ZDL5eZm
mSqWz+cxyMpimhZS7r12uy1n4d/GG3O5Y8QFWyWCTpCcRy8lRK3XeUJcoJVGaFrsXj34V9hYrFrtQSj0
wa4Z2VgsGh1Dq9WS79z6PBuLkUbjQZZLJN7Y9ZkVxYrFgQzZl3j83TBz5oDFms02uN3fhrmKAxbzer8M
M2dWFNsH7R4Lh+mXnf+MwsZi6fSLLBUMfrLr82wsVio9ssd5NhYzZ1rsEhXVg4dA3ybN12CnSCQCRCkY
UP0gLmAfnpGQHfQM+zGlIO257hAXZLUMJJPJuQ6yx+KBfr+P/3CreAIVTOoC9uEK8Q8mS3ew5XIZYrEY
nuhCN2qQlQZIQL1eZ+ev3VoHAgFwOOjSXqNXNXRXSqlOp8POJBvt+Xu9ngwS4lQN3oVy+egJybLHt2w2
K0OFOFeHmJFByn5+2eXTM1WMDIdD8Hg8coAQtyquCKGfHVq/kOekUik2k2O6mKZQKOBAKrea0+nE7Y2b
zVhuAr/Ce2bVcGWw1gAAAABJRU5ErkJggg==
</value>
</data>
</root>

Some files were not shown because too many files have changed in this diff Show More