iPerlCommunication, etc: A correct calibration factor is written to iPerl.

This commit is contained in:
unknown
2015-08-19 21:12:10 +02:00
parent 3647740d4a
commit 440199b3bc
3 changed files with 23 additions and 11 deletions
@@ -456,6 +456,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
WaterMeters.iPerl.WaterMeter iPerl = (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter);
tstRslt.Meters[i].VolumeMeter = (float)(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV * (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart) / tstRslt.Time;
iPerl.VolumeLtrRef = (double)tstRslt.Meters[i].VolumeRef;
}
else
{
@@ -805,11 +805,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
CommErr error = CommErr.Write;
UInt16 factor = wm.CalibrationFactor; /// Original calibration factor
/// Write the calculated calibration factor
UInt16 newCalFactor = wm.CalculatedCalibrationFactor;
byte[] data = new byte[2] { (byte)(newCalFactor & 0x00FF), (byte)((newCalFactor >> 8) & 0x00FF) };
UInt16 newCalibFactor = wm.CalculateNewCalibFactor(wm.CalibrationFactor);
byte[] data = new byte[2] { (byte)(newCalibFactor & 0x00FF), (byte)((newCalibFactor >> 8) & 0x00FF) };
for (int j = 0; j < MaxCommRetries; j++)
{
if (0 == WriteRequestPort(boardNr, MessageID.Calibration, 2, 2, data, CommTimeout)) { error = CommErr.None; break; }