/// /// Copyright (c) 2015-2023 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; using System.IO; using Common; using SharedDatabase.Mappings; namespace SharedDatabase.Entities { public class TestRslt { /// Identity public virtual int Id { get; protected set; } public virtual Batch Batch { get; set; } public virtual TestData TestData { get; set; } public virtual Components Components { get; set; } public virtual int Part { get; set; } public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...) public virtual string MethodClass { get; set; } /// Not mapped to DB, does not depend on localization and customer /// Main results public virtual bool TestDone { get; set; } public virtual string Remark { get; set; } public virtual DateTime StartTime { get; set; } /// Date and time of the test start public virtual DateTime EndTime { get; set; } /// Date and time of the test end public virtual int FlowSetTime { get; set; } /// [s] Flow set time in seconds public virtual int TimeBtwnMassMsrmnts { get; set; } /// [s] Time between two mass measurements in seconds (if applicable) public virtual double TestTime { get; set; } /// [s] Test time in seconds public virtual double TestTimeCorrection { get; set; } /// [s] Correction of the test time due to diverter (0 for methods w/o diverter or when there is no correction table) public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB) public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected. public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table. public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement. /// When mass measurement is not available, corrected by a correction table. public virtual double MassStartRaw { get; set; } /// [kg] public virtual double MassStart { get; set; } /// [kg] public virtual double MassEndRaw { get; set; } /// [kg] public virtual double MassEnd { get; set; } /// [kg] public virtual double DensityIn { get; set; } /// [kg/m3] 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 Qdetected { 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 public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB) public virtual float DivStart50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB) public virtual float DivStart90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB) public virtual float DiverterEnd { get; set; } /// [s] Diverter switch time when test ends public virtual float DivEnd90 { get; set; } /// [s] Diverter switch time when test starts at level 90 (e.g. 90%) (not mapped to DB) public virtual float DivEnd50 { get; set; } /// [s] Diverter switch time when test starts at level 50 (e.g. 50%) (not mapped to DB) public virtual float DivEnd10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB) public virtual long ErrorFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc. public virtual long InfoFlags { get; set; } /// bitfield : bit0=E1, bit1=E2, bit2=E3, etc. /// Main results of heat meters public virtual double RefEnergy { get; set; } /// [J] Joul /// Auxiliary results public virtual float AmbTempMean { get; set; } /// [°C] Average ambient air temperature public virtual float AmbTempStart { get; set; } /// [°C] Ambient air temperature on test start public virtual float AmbTempEnd { get; set; } /// [°C] Ambient air temperature on test end public virtual float AmbTempMin { get; set; } /// [°C] Minimum ambient air temperature public virtual float AmbTempMax { get; set; } /// [°C] Maximum ambient air temperature public virtual float AmbPressMean { get; set; } /// [bar] Average ambient air pressure public virtual float AmbPressStart { get; set; } /// [bar] Ambient air pressure on test start public virtual float AmbPressEnd { get; set; } /// [bar] Ambient air pressure on test end public virtual float AmbPressMin { get; set; } /// [bar] Minimum ambient air pressure public virtual float AmbPressMax { get; set; } /// [bar] Maximum ambient air pressure public virtual float AmbHumiMean { get; set; } /// [%] Average ambient air relative humidity public virtual float AmbHumiStart { get; set; } /// [%] Ambient air relative humidity on test start public virtual float AmbHumiEnd { get; set; } /// [%] Ambient air relative humidity on test end public virtual float AmbHumiMin { get; set; } /// [%] Minimum ambient air relative humidity public virtual float AmbHumiMax { get; set; } /// [%] Maximum ambient air relative humidity public virtual float PressUpMean { get; set; } /// [bar] Input water pressure (average) public virtual float PressUpStart { get; set; } /// [bar] public virtual float PressUpEnd { get; set; } /// [bar] public virtual float PressUpMin { get; set; } /// [bar] public virtual float PressUpMax { get; set; } /// [bar] public virtual float PressDownMean { get; set; } /// [bar] public virtual float PressDownStart { get; set; } /// [bar] public virtual float PressDownEnd { get; set; } /// [bar] public virtual float PressDownMin { get; set; } /// [bar] public virtual float PressDownMax { get; set; } /// [bar] public virtual float PressDeltaMean { get; set; } /// [bar] public virtual float PressDeltaStart { get; set; } /// [bar] public virtual float PressDeltaEnd { get; set; } /// [bar] public virtual float PressDeltaMin { get; set; } /// [bar] public virtual float PressDeltaMax { get; set; } /// [bar] public virtual float TempUpMean { get; set; } /// [°C] public virtual float TempUpStart { get; set; } /// [°C] public virtual float TempUpEnd { get; set; } /// [°C] public virtual float TempUpMin { get; set; } /// [°C] public virtual float TempUpMax { get; set; } /// [°C] public virtual float TempDownMean { get; set; } /// [°C] public virtual float TempDownStart { get; set; } /// [°C] public virtual float TempDownEnd { get; set; } /// [°C] public virtual float TempDownMin { get; set; } /// [°C] public virtual float TempDownMax { get; set; } /// [°C] public virtual float TempDivMean { get; set; } /// [°C] public virtual float TempDivStart { get; set; } /// [°C] public virtual float TempDivEnd { get; set; } /// [°C] public virtual float TempDivMin { get; set; } /// [°C] public virtual float TempDivMax { get; set; } /// [°C] public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter public virtual float FlowMin { get; set; } /// [m3/h] public virtual float FlowMax { get; set; } /// [m3/h] public virtual float ConductMean { get; set; } /// [uS/cm] public virtual float ConductStart { get; set; } /// [uS/cm] public virtual float ConductEnd { get; set; } /// [uS/cm] public virtual float ConductMin { get; set; } /// [uS/cm] public virtual float ConductMax { get; set; } /// [uS/cm] public virtual float Uncertnt { get; set; } /// [%] Relative error uncertainty public virtual float UncertntScale { get; set; } /// [%] Contribution to uncertainty from scale public virtual float UncertntDensity { get; set; } /// [%] Contribution to uncertainty from density public virtual float UncertntTemp { get; set; } /// [%] Contribution to uncertainty from temperature public virtual float UncertntPressure { get; set; } /// [%] Contribution to uncertainty from pressure public virtual float Custom1 { get; set; } /// [°C] T ref hi mean public virtual float Custom2 { get; set; } /// [°C] T ref hi start public virtual float Custom3 { get; set; } /// [°C] T ref hi end public virtual float Custom4 { get; set; } /// [°C] T ref hi min public virtual float Custom5 { get; set; } /// [°C] T ref hi max public virtual float Custom6 { get; set; } /// [°C] T ref lo mean public virtual float Custom7 { get; set; } /// [°C] T ref lo start public virtual float Custom8 { get; set; } /// [°C] T ref lo end public virtual float Custom9 { get; set; } /// [°C] T ref lo min public virtual float Custom10 { get; set; } /// [°C] T ref lo max public virtual int Counter1 { get; set; } public virtual int Counter2 { get; set; } public virtual int Counter3 { get; set; } public virtual int Counter4 { get; set; } public virtual int Counter5 { get; set; } /// Wrappers public virtual string Name() { return Common.Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); } public virtual string Key() { return string.Format("{0}~{1}~{2}~{3}", TestData.Name, Part, TestData.Repeats, RepetitionNr); } /// Unique key public virtual int Repeats() { return TestData.Repeats; } public virtual double Qfrom() { return (TestData == null) ? 0 : !TestData.IsFromToInPct ? TestData.Qfrom : (TestData.Qtg >= 0) ? TestData.Qfrom * TestData.Qtg / 100 : TestData.Qfrom * Qdetected / 100; } public virtual double Qto() { return (TestData == null) ? 0 : !TestData.IsFromToInPct ? TestData.Qto : (TestData.Qtg >= 0) ? TestData.Qto * TestData.Qtg / 100 : TestData.Qto * Qdetected / 100; } public virtual double TargetVolume() { return TestData.TargetVolume; } public virtual double TargetTime() { return TestData.TargetTime; } public virtual string Method() { return TestData.Method; } public virtual string RefFlowmeter() { return (Components != null && Components.Flowmeter != null) ? Components.Flowmeter : string.Empty; } public virtual string Scale() { return (Components != null && Components.Scale != null) ? Components.Scale : string.Empty; } public virtual string Diverter() { return (Components != null && Components.Diverter != null) ? Components.Diverter : string.Empty; } public virtual string RegValve() { return (Components != null && Components.RegValve != null) ? Components.RegValve : string.Empty; } public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("StandingStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection") || MethodClass.Contains("DiverterTest") || MethodClass.Contains("ManualEntry")) : true; } public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest") || TestData.Method.ToLower().Contains("pmax")) : true; } public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("StandingStart") : true; } public virtual bool IsDiverter() { return (MethodClass != null) ? ((MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) || MethodClass.Contains("DiverterTest")) : true; } public virtual bool IsVolumeMethod() { return (MethodClass != null) ? (MethodClass.Contains("TestMethods.StandingStart.") || MethodClass.Contains("TestMethods.FlyingStart.")) : false; } public virtual string MethodElde() { if (MethodClass == null) return string.Empty; else if (MethodClass.Contains("TestMethods.FlyingStartMassCollection.")) return "MS"; else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionProlonged.")) return "MS"; else if (MethodClass.Contains("TestMethods.FlyingStartMassCollectionComparative.")) return "MS"; else if (MethodClass.Contains("TestMethods.FlyingStart.")) return "VS"; else if (MethodClass.Contains("TestMethods.StandingStartMassCollection.")) return "MP"; else if (MethodClass.Contains("TestMethods.StandingStartTankCollection.")) return "VP"; else if (MethodClass.Contains("TestMethods.StandingStart.")) return "VP"; else return string.Empty; } public virtual double ErrLimLo() { if (TestData.ErrLimLo <= TestData.ErrLimHi) { return TestData.ErrLimLo; /// Error limit of a water meter } else { /// Metrological class and nominal flow of a heat meter int metrClass = (int)Math.Round(TestData.ErrLimLo); double Qp = Math.Abs(TestData.ErrLimHi); double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided /// Calculate the error limit of a heat meter switch (metrClass) { default: case 1: return -Math.Min(3.5, 1.0 + 0.01 * Qp / Q); case 2: return -Math.Min(5.0, 2.0 + 0.02 * Qp / Q); case 3: return -Math.Min(5.0, 3.0 + 0.05 * Qp / Q); } } } public virtual double ErrLimHi() { if (TestData.ErrLimLo <= TestData.ErrLimHi) { return TestData.ErrLimHi; /// Error limit of a water meter } else { /// Metrological class and nominal flow of a heat meter int metrClass = (int)Math.Round(TestData.ErrLimLo); double Qp = Math.Abs(TestData.ErrLimHi); double Q = (TestTime == 0) ? 1 : Math.Max(3.6 * VolumeCTV / TestTime, 0.00001); /// Div. by zero avoided /// Calculate the error limit of a heat meter switch (metrClass) { default: case 1: return +Math.Min(3.5, 1.0 + 0.01 * Qp / Q); case 2: return +Math.Min(5.0, 2.0 + 0.02 * Qp / Q); case 3: return +Math.Min(5.0, 3.0 + 0.05 * Qp / Q); } } } public virtual double ErrLimMargin() { return TestData.ErrLimMargin; } public virtual float TempLimLo() { return TestData.TempLimLo; } public virtual float TempLimHi() { return TestData.TempLimHi; } public virtual bool Evaluate() { return TestData.Evaluate; } public virtual Publish Publish() { return (Publish)TestData.Publish; } public TestRslt() { MethodClass = string.Empty; Remark = string.Empty; } public TestRslt(Batch batch, TestData testData, int part, int repetitionNr) : this() { Batch = batch; TestData = testData; Part = part; RepetitionNr = repetitionNr; } public virtual void CopyContentFrom(TestRslt src) { if (src == null) return; Components = src.Components; /// ??? Part = src.Part; RepetitionNr = src.RepetitionNr; MethodClass = src.MethodClass; TestDone = src.TestDone; Remark = src.Remark; StartTime = src.StartTime; EndTime = src.EndTime; FlowSetTime = src.FlowSetTime; TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts; TestTime = src.TestTime; TestTimeCorrection = src.TestTimeCorrection; PulsesMaster = src.PulsesMaster; TotalPulsesMstr = src.TotalPulsesMstr; ConstMasterRaw = src.ConstMasterRaw; ConstMasterCorr = src.ConstMasterCorr; ConstMaster = src.ConstMaster; MassStartRaw = src.MassStartRaw; MassStart = src.MassStart; MassEndRaw = src.MassEndRaw; MassEnd = src.MassEnd; DensityIn = src.DensityIn; DensityLine = src.DensityLine; DensityDiv = src.DensityDiv; MassOfEvapWater = src.MassOfEvapWater; Qdetected = src.Qdetected; Flow = src.Flow; VolumeCTV = src.VolumeCTV; VolumeMaster = src.VolumeMaster; ErrorMaster = src.ErrorMaster; DiverterStart = src.DiverterStart; DivStart10 = src.DivStart10; DivStart50 = src.DivStart50; DivStart90 = src.DivStart90; DiverterEnd = src.DiverterEnd; DivEnd10 = src.DivEnd10; DivEnd50 = src.DivEnd50; DivEnd90 = src.DivEnd90; ErrorFlags = src.ErrorFlags; InfoFlags = src.InfoFlags; RefEnergy = src.RefEnergy; AmbTempMean = src.AmbTempMean; AmbTempStart = src.AmbTempStart; AmbTempEnd = src.AmbTempEnd; AmbTempMin = src.AmbTempMin; AmbTempMax = src.AmbTempMax; AmbPressMean = src.AmbPressMean; AmbPressStart = src.AmbPressStart; AmbPressEnd = src.AmbPressEnd; AmbPressMin = src.AmbPressMin; AmbPressMax = src.AmbPressMax; AmbHumiMean = src.AmbHumiMean; AmbHumiStart = src.AmbHumiStart; AmbHumiEnd = src.AmbHumiEnd; AmbHumiMin = src.AmbHumiMin; AmbHumiMax = src.AmbHumiMax; PressUpMean = src.PressUpMean; PressUpStart = src.PressUpStart; PressUpEnd = src.PressUpEnd; PressUpMin = src.PressUpMin; PressUpMax = src.PressUpMax; PressDownMean = src.PressDownMean; PressDownStart = src.PressDownStart; PressDownEnd = src.PressDownEnd; PressDownMin = src.PressDownMin; PressDownMax = src.PressDownMax; PressDeltaMean = src.PressDeltaMean; PressDeltaStart = src.PressDeltaStart; PressDeltaEnd = src.PressDeltaEnd; PressDeltaMin = src.PressDeltaMin; PressDeltaMax = src.PressDeltaMax; TempUpMean = src.TempUpMean; TempUpStart = src.TempUpStart; TempUpEnd = src.TempUpEnd; TempUpMin = src.TempUpMin; TempUpMax = src.TempUpMax; TempDownMean = src.TempDownMean; TempDownStart = src.TempDownStart; TempDownEnd = src.TempDownEnd; TempDownMin = src.TempDownMin; TempDownMax = src.TempDownMax; TempDivMean = src.TempDivMean; TempDivStart = src.TempDivStart; TempDivEnd = src.TempDivEnd; TempDivMin = src.TempDivMin; TempDivMax = src.TempDivMax; FlowMean = src.FlowMean; FlowStart = src.FlowStart; FlowEnd = src.FlowEnd; FlowMin = src.FlowMin; FlowMax = src.FlowMax; ConductMean = src.ConductMean; ConductStart = src.ConductStart; ConductEnd = src.ConductEnd; ConductMin = src.ConductMin; ConductMax = src.ConductMax; Uncertnt = src.Uncertnt; UncertntScale = src.UncertntScale; UncertntDensity = src.UncertntDensity; UncertntTemp = src.UncertntTemp; UncertntPressure = src.UncertntPressure; Custom1 = src.Custom1; Custom2 = src.Custom2; Custom3 = src.Custom3; Custom4 = src.Custom4; Custom5 = src.Custom5; Custom6 = src.Custom6; Custom7 = src.Custom7; Custom8 = src.Custom8; Custom9 = src.Custom9; Custom10 = src.Custom10; Counter1 = src.Counter1; Counter2 = src.Counter2; Counter3 = src.Counter3; Counter4 = src.Counter4; Counter5 = src.Counter5; } /// Wrapper public virtual string ErrorFlagsStr() { string eFlags = Utils.ErrorFlagsStr(ErrorFlags); #if LANG_PL return string.IsNullOrEmpty(eFlags) ? "brak" : eFlags; #else return eFlags; #endif } /// Wrapper public virtual string InfoFlagsStr() { return Utils.ErrorFlagsStr(InfoFlags); } public virtual bool IsPartCompatible(int waterMeterPartNr) { if ((this.Part == 0) || (waterMeterPartNr == 0)) return true; if ((this.Part % 10) == waterMeterPartNr) return true; if (((this.Part / 10) % 10) == waterMeterPartNr) return true; if (((this.Part / 100) % 10) == waterMeterPartNr) return true; if (((this.Part / 1000) % 10) == waterMeterPartNr) return true; return false; } public override string ToString() { return string.Format("batch={0}, procedure={1}, test={2}, part={3} start={4} {5}", Batch.BatchNr, Batch.ProcedureName, Name(), Part, StartTime.ToShortDateString(), StartTime.ToShortTimeString()); } public virtual string ToString(int i) { 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, Qdetected, Flow, VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, InfoFlags, AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax, AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax, AmbHumiMean, AmbHumiStart, AmbHumiEnd, AmbHumiMin, AmbHumiMax, PressUpMean, PressUpStart, PressUpEnd, PressUpMin, PressUpMax, PressDownMean, PressDownStart, PressDownEnd, PressDownMin, PressDownMax, PressDeltaMean, PressDeltaStart, PressDeltaEnd, PressDeltaMin, PressDeltaMax, TempUpMean, TempUpStart, TempUpEnd, TempUpMin, TempUpMax, TempDownMean, TempDownStart, TempDownEnd, TempDownMin, TempDownMax, TempDivMean, TempDivStart, TempDivEnd, TempDivMin, TempDivMax, FlowMean, FlowStart, FlowEnd, FlowMin, FlowMax, Custom1, Custom2, Custom3, Custom4, Custom5, Custom6, Custom7, Custom8, Custom9, Custom10, DiverterStart, DiverterEnd); } public virtual void WriteBinary(BinaryWriter writer, IList savedTestDatas) { writer.Write(Id); /// Save TestData or TestData.Name if (savedTestDatas != null && !savedTestDatas.Contains(TestData)) { writer.Write(true); TestData.WriteBinary(writer); savedTestDatas.Add(TestData); } else { writer.Write(false); writer.Write(TestData.Name); } /// Save Components if not null if (Components != null) { writer.Write(true); Components.WriteBinary(writer); /// Write Components } else { writer.Write(false); } writer.Write(Part); writer.Write(RepetitionNr); writer.Write((MethodClass != null) ? MethodClass : string.Empty); writer.Write(TestDone); writer.Write((Remark != null) ? Remark : string.Empty); writer.Write(StartTime.ToString()); writer.Write(EndTime.ToString()); writer.Write(FlowSetTime); writer.Write(TimeBtwnMassMsrmnts); writer.Write(TestTime); writer.Write(TestTimeCorrection); writer.Write(PulsesMaster); writer.Write(TotalPulsesMstr); writer.Write(ConstMasterRaw); writer.Write(ConstMasterCorr); writer.Write(ConstMaster); writer.Write(MassStartRaw); writer.Write(MassStart); writer.Write(MassEndRaw); writer.Write(MassEnd); writer.Write(DensityIn); writer.Write(DensityLine); writer.Write(DensityDiv); writer.Write(MassOfEvapWater); writer.Write(Qdetected); writer.Write(Flow); writer.Write(VolumeCTV); writer.Write(VolumeMaster); writer.Write(ErrorMaster); writer.Write(DiverterStart); writer.Write(DivStart10); writer.Write(DivStart50); writer.Write(DivStart90); writer.Write(DiverterEnd); writer.Write(DivEnd90); writer.Write(DivEnd50); writer.Write(DivEnd10); writer.Write(ErrorFlags); writer.Write(InfoFlags); writer.Write(RefEnergy); writer.Write(AmbTempMean); writer.Write(AmbTempStart); writer.Write(AmbTempEnd); writer.Write(AmbTempMin); writer.Write(AmbTempMax); writer.Write(AmbPressMean); writer.Write(AmbPressStart); writer.Write(AmbPressEnd); writer.Write(AmbPressMin); writer.Write(AmbPressMax); writer.Write(AmbHumiMean); writer.Write(AmbHumiStart); writer.Write(AmbHumiEnd); writer.Write(AmbHumiMin); writer.Write(AmbHumiMax); writer.Write(PressUpMean); writer.Write(PressUpStart); writer.Write(PressUpEnd); writer.Write(PressUpMin); writer.Write(PressUpMax); writer.Write(PressDownMean); writer.Write(PressDownStart); writer.Write(PressDownEnd); writer.Write(PressDownMin); writer.Write(PressDownMax); writer.Write(PressDeltaMean); writer.Write(PressDeltaStart); writer.Write(PressDeltaEnd); writer.Write(PressDeltaMin); writer.Write(PressDeltaMax); writer.Write(TempUpMean); writer.Write(TempUpStart); writer.Write(TempUpEnd); writer.Write(TempUpMin); writer.Write(TempUpMax); writer.Write(TempDownMean); writer.Write(TempDownStart); writer.Write(TempDownEnd); writer.Write(TempDownMin); writer.Write(TempDownMax); writer.Write(TempDivMean); writer.Write(TempDivStart); writer.Write(TempDivEnd); writer.Write(TempDivMin); writer.Write(TempDivMax); writer.Write(FlowMean); writer.Write(FlowStart); writer.Write(FlowEnd); writer.Write(FlowMin); writer.Write(FlowMax); writer.Write(Uncertnt); writer.Write(UncertntScale); writer.Write(UncertntDensity); writer.Write(UncertntTemp); writer.Write(UncertntPressure); writer.Write(Custom1); writer.Write(Custom2); writer.Write(Custom3); writer.Write(Custom4); writer.Write(Custom5); writer.Write(Custom6); writer.Write(Custom7); writer.Write(Custom8); writer.Write(Custom9); writer.Write(Custom10); writer.Write(Counter1); writer.Write(Counter2); writer.Write(Counter3); writer.Write(Counter4); writer.Write(Counter5); } public virtual void ReadBinary(BinaryReader reader, IList testDatas) { Id = reader.ReadInt32(); /// Retrieve TestData if (reader.ReadBoolean()) { (TestData = new TestData()).ReadBinary(reader); if (testDatas != null) testDatas.Add(TestData); } else { TestData = null; string testDataName = reader.ReadString(); foreach (var td in testDatas) { if (td.Name == testDataName) { TestData = td; break; } } } if (reader.ReadBoolean()) { (Components = new Components()).ReadBinary(reader); /// Read Components } Part = reader.ReadInt32(); RepetitionNr = reader.ReadInt32(); MethodClass = reader.ReadString(); TestDone = reader.ReadBoolean(); Remark = reader.ReadString(); StartTime = DateTime.Parse(reader.ReadString()); EndTime = DateTime.Parse(reader.ReadString()); FlowSetTime = reader.ReadInt32(); TimeBtwnMassMsrmnts = reader.ReadInt32(); TestTime = reader.ReadDouble(); TestTimeCorrection = reader.ReadDouble(); PulsesMaster = reader.ReadDouble(); TotalPulsesMstr = reader.ReadDouble(); ConstMasterRaw = reader.ReadDouble(); ConstMasterCorr = reader.ReadDouble(); ConstMaster = reader.ReadDouble(); MassStartRaw = reader.ReadDouble(); MassStart = reader.ReadDouble(); MassEndRaw = reader.ReadDouble(); MassEnd = reader.ReadDouble(); DensityIn = reader.ReadDouble(); DensityLine = reader.ReadDouble(); DensityDiv = reader.ReadDouble(); MassOfEvapWater = reader.ReadDouble(); Qdetected = reader.ReadDouble(); Flow = reader.ReadDouble(); VolumeCTV = reader.ReadDouble(); VolumeMaster = reader.ReadDouble(); ErrorMaster = reader.ReadDouble(); DiverterStart = reader.ReadSingle(); DivStart10 = reader.ReadSingle(); DivStart50 = reader.ReadSingle(); DivStart90 = reader.ReadSingle(); DiverterEnd = reader.ReadSingle(); DivEnd90 = reader.ReadSingle(); DivEnd50 = reader.ReadSingle(); DivEnd10 = reader.ReadSingle(); ErrorFlags = reader.ReadInt64(); InfoFlags = reader.ReadInt64(); RefEnergy = reader.ReadDouble(); AmbTempMean = reader.ReadSingle(); AmbTempStart = reader.ReadSingle(); AmbTempEnd = reader.ReadSingle(); AmbTempMin = reader.ReadSingle(); AmbTempMax = reader.ReadSingle(); AmbPressMean = reader.ReadSingle(); AmbPressStart = reader.ReadSingle(); AmbPressEnd = reader.ReadSingle(); AmbPressMin = reader.ReadSingle(); AmbPressMax = reader.ReadSingle(); AmbHumiMean = reader.ReadSingle(); AmbHumiStart = reader.ReadSingle(); AmbHumiEnd = reader.ReadSingle(); AmbHumiMin = reader.ReadSingle(); AmbHumiMax = reader.ReadSingle(); PressUpMean = reader.ReadSingle(); PressUpStart = reader.ReadSingle(); PressUpEnd = reader.ReadSingle(); PressUpMin = reader.ReadSingle(); PressUpMax = reader.ReadSingle(); PressDownMean = reader.ReadSingle(); PressDownStart = reader.ReadSingle(); PressDownEnd = reader.ReadSingle(); PressDownMin = reader.ReadSingle(); PressDownMax = reader.ReadSingle(); PressDeltaMean = reader.ReadSingle(); PressDeltaStart = reader.ReadSingle(); PressDeltaEnd = reader.ReadSingle(); PressDeltaMin = reader.ReadSingle(); PressDeltaMax = reader.ReadSingle(); TempUpMean = reader.ReadSingle(); TempUpStart = reader.ReadSingle(); TempUpEnd = reader.ReadSingle(); TempUpMin = reader.ReadSingle(); TempUpMax = reader.ReadSingle(); TempDownMean = reader.ReadSingle(); TempDownStart = reader.ReadSingle(); TempDownEnd = reader.ReadSingle(); TempDownMin = reader.ReadSingle(); TempDownMax = reader.ReadSingle(); TempDivMean = reader.ReadSingle(); TempDivStart = reader.ReadSingle(); TempDivEnd = reader.ReadSingle(); TempDivMin = reader.ReadSingle(); TempDivMax = reader.ReadSingle(); FlowMean = reader.ReadSingle(); FlowStart = reader.ReadSingle(); FlowEnd = reader.ReadSingle(); FlowMin = reader.ReadSingle(); FlowMax = reader.ReadSingle(); Uncertnt = reader.ReadSingle(); UncertntScale = reader.ReadSingle(); UncertntDensity = reader.ReadSingle(); UncertntTemp = reader.ReadSingle(); UncertntPressure = reader.ReadSingle(); Custom1 = reader.ReadSingle(); Custom2 = reader.ReadSingle(); Custom3 = reader.ReadSingle(); Custom4 = reader.ReadSingle(); Custom5 = reader.ReadSingle(); Custom6 = reader.ReadSingle(); Custom7 = reader.ReadSingle(); Custom8 = reader.ReadSingle(); Custom9 = reader.ReadSingle(); Custom10 = reader.ReadSingle(); Counter1 = reader.ReadInt32(); Counter2 = reader.ReadInt32(); Counter3 = reader.ReadInt32(); Counter4 = reader.ReadInt32(); Counter5 = reader.ReadInt32(); } } }