iPerlST: Use absolute value of volume difference in calculations. Comment added.
This commit is contained in:
+1
-1
@@ -454,7 +454,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
if (sensPath.RegisterReaders[i] is WaterMeters.iPerl.WaterMeter)
|
if (sensPath.RegisterReaders[i] is WaterMeters.iPerl.WaterMeter)
|
||||||
{
|
{
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter);
|
WaterMeters.iPerl.WaterMeter iPerl = (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter);
|
||||||
tstRslt.Meters[i].VolumeMeter = (float)(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
tstRslt.Meters[i].VolumeMeter = (float)Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV * (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart) / tstRslt.Time;
|
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV * (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart) / tstRslt.Time;
|
||||||
iPerl.VolumeLtrRef = (double)tstRslt.Meters[i].VolumeRef;
|
iPerl.VolumeLtrRef = (double)tstRslt.Meters[i].VolumeRef;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
/// DDDDDD Volume Int24 Value / 16000 * Scaling factor in Ltr
|
/// DDDDDD Volume Int24 Value / 16000 * Scaling factor in Ltr
|
||||||
/// EEEE Impedance Int16 Value
|
/// EEEE Impedance Int16 Value
|
||||||
/// FFFFFFFF Timestamp Uint32 Value / 8192
|
/// FFFFFFFF Timestamp Uint32 Value / 8192
|
||||||
/// GG
|
/// GG Checksum Byte
|
||||||
/// ----------------------------------------------------------------
|
/// ----------------------------------------------------------------
|
||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
/// DDDDDD Volume Int24 Value / 16000 * Scaling factor
|
/// DDDDDD Volume Int24 Value / 16000 * Scaling factor
|
||||||
/// EEEE Impedance Int16 Value
|
/// EEEE Impedance Int16 Value
|
||||||
/// FFFFFFFF Timestamp Uint32 Value / 8192
|
/// FFFFFFFF Timestamp Uint32 Value / 8192
|
||||||
/// GG
|
/// GG Checksum Byte
|
||||||
/// ----------------------------------------------------------------
|
/// ----------------------------------------------------------------
|
||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
|
|
||||||
public UInt16 CalculateNewCalibFactor(UInt16 originalCalibrationFactor)
|
public UInt16 CalculateNewCalibFactor(UInt16 originalCalibrationFactor)
|
||||||
{
|
{
|
||||||
double volumeMeter = VolumeLtrEnd - VolumeLtrStart;
|
double volumeMeter = Math.Abs(VolumeLtrEnd - VolumeLtrStart);
|
||||||
if (volumeMeter > 1E-2)
|
if (volumeMeter > 1E-2)
|
||||||
{
|
{
|
||||||
UInt16 newFactor = (UInt16)((double)originalCalibrationFactor * VolumeLtrRef / volumeMeter + 0.5);
|
UInt16 newFactor = (UInt16)((double)originalCalibrationFactor * VolumeLtrRef / volumeMeter + 0.5);
|
||||||
|
|||||||
Reference in New Issue
Block a user