ProcessData (aka BatchResults) serialization part 2
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -65,20 +65,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
set { }
|
||||
}
|
||||
|
||||
public string EndState
|
||||
{
|
||||
get { return endState; }
|
||||
set { endState = value; }
|
||||
}
|
||||
string endState;
|
||||
|
||||
public string BeginState
|
||||
{
|
||||
get { return beginState; }
|
||||
set { beginState = value; }
|
||||
}
|
||||
string beginState;
|
||||
|
||||
public bool Disabled
|
||||
{
|
||||
get { return disabled; }
|
||||
@@ -170,8 +156,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
|
||||
|
||||
/// <summary> Result of the last test used to calculate Q2 correction factors, etc </summary>
|
||||
public Results.Entities.MeterTestRslt LastTestResult2;
|
||||
public Results.Entities.MeterTestRslt LastTestResult;
|
||||
public Results.Entities.MeterTestRslt LastTestResult2;
|
||||
|
||||
|
||||
///
|
||||
@@ -184,7 +170,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
public double EndWMState { get { return endWMState; } }
|
||||
public double WMTestTime { get { return wmTestTime; } }
|
||||
|
||||
|
||||
double beginWMState;
|
||||
double endWMState;
|
||||
double wmVolume;
|
||||
@@ -426,8 +411,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
|
||||
disabled = false;
|
||||
commFailed = false;
|
||||
endState = string.Empty;
|
||||
beginState = string.Empty;
|
||||
|
||||
configStruct = null;
|
||||
calibrationStruct = null;
|
||||
@@ -984,5 +967,82 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
case MeterType.DN40: return 16.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void WriteBinary(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(disabled);
|
||||
writer.Write(commFailed);
|
||||
writer.Write(resultCode);
|
||||
writer.Write(PositiveCounting);
|
||||
|
||||
if (configStruct != null)
|
||||
{
|
||||
writer.Write(true);
|
||||
configStruct.WriteBinary(writer);
|
||||
}
|
||||
else writer.Write(false);
|
||||
|
||||
if (calibrationStruct != null)
|
||||
{
|
||||
writer.Write(true);
|
||||
calibrationStruct.WriteBinary(writer);
|
||||
}
|
||||
else writer.Write(false);
|
||||
|
||||
if (calibrationStructV4 != null)
|
||||
{
|
||||
writer.Write(true);
|
||||
calibrationStructV4.WriteBinary(writer);
|
||||
}
|
||||
else writer.Write(false);
|
||||
|
||||
writer.Write(OrigCalibFactor);
|
||||
writer.Write(OrigCalibFactorLNA);
|
||||
writer.Write(Q2ErrWOCorrection);
|
||||
writer.Write(Q2CorrRL);
|
||||
writer.Write(Q2CorrLR);
|
||||
writer.Write(Diff2Hz8Hz);
|
||||
writer.Write(Hz2CorrectionDone);
|
||||
writer.Write(Hz2Correction);
|
||||
|
||||
if (LastTestResult != null)
|
||||
{
|
||||
writer.Write(true);
|
||||
LastTestResult.WriteBinary(writer);
|
||||
}
|
||||
else writer.Write(false);
|
||||
|
||||
if (LastTestResult2 != null)
|
||||
{
|
||||
writer.Write(true);
|
||||
LastTestResult2.WriteBinary(writer);
|
||||
}
|
||||
else writer.Write(false);
|
||||
}
|
||||
|
||||
public void ReadBinary(BinaryReader reader)
|
||||
{
|
||||
disabled = reader.ReadBoolean();
|
||||
commFailed = reader.ReadBoolean();
|
||||
resultCode = reader.ReadInt32();
|
||||
PositiveCounting = reader.ReadBoolean();
|
||||
|
||||
if (reader.ReadBoolean()) (configStruct = new ConfigStruct()).ReadBinary(reader);
|
||||
if (reader.ReadBoolean()) (calibrationStruct = new CalibrationStruct()).ReadBinary(reader);
|
||||
if (reader.ReadBoolean()) (calibrationStructV4 = new CalibrationStructV4()).ReadBinary(reader);
|
||||
|
||||
OrigCalibFactor = reader.ReadUInt16();
|
||||
OrigCalibFactorLNA = reader.ReadUInt16();
|
||||
Q2ErrWOCorrection = reader.ReadDouble();
|
||||
Q2CorrRL = reader.ReadInt32();
|
||||
Q2CorrLR = reader.ReadInt32();
|
||||
Diff2Hz8Hz = reader.ReadDouble();
|
||||
Hz2CorrectionDone = reader.ReadBoolean();
|
||||
Hz2Correction = reader.ReadInt32();
|
||||
|
||||
if (reader.ReadBoolean()) (LastTestResult = new Results.Entities.MeterTestRslt()).ReadBinary(reader, null);
|
||||
if (reader.ReadBoolean()) (LastTestResult2 = new Results.Entities.MeterTestRslt()).ReadBinary(reader, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user