|
|
|
@@ -5,6 +5,7 @@ using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.IO.Ports;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Common;
|
|
|
|
|
using Config.Entities;
|
|
|
|
|
using TBF.Rig.Generic;
|
|
|
|
|
using TBF.Rig.GenericDevices;
|
|
|
|
@@ -45,7 +46,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
|
|
|
|
return (firstDigitPos < 0) ? 0 : (int.TryParse(Name.Substring(firstDigitPos), out position) ? position : 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.DataStream; } }
|
|
|
|
|
public RegisterReaderType RegisterReaderType { get { return RegisterReaderType.DataStream; } }
|
|
|
|
|
public double PulsesPerLtr { get { return 1000.0; } }
|
|
|
|
|
public double LtrsPerPulse { get { return 1 / PulsesPerLtr; } }
|
|
|
|
|
|
|
|
|
@@ -238,9 +239,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
|
|
|
|
/// <returns>Calculated Q2 correction factor</returns>
|
|
|
|
|
public double CalculateQ2CorrectionFactor(Results.Entities.MeterTestRslt q2adjResult, double calibTarget, double nominalFlow, int currentFactor = 0)
|
|
|
|
|
{
|
|
|
|
|
double nominalTestFlowLph = Config.Units.ConvertTo(Config.Unit.lph, nominalFlow);
|
|
|
|
|
double nominalTestFlowLph = Common.Units.ConvertTo(Common.Unit.lph, nominalFlow);
|
|
|
|
|
double volumeRefShiftedToTarget = q2adjResult.VolumeRef * (1.0 + calibTarget / 100.0);
|
|
|
|
|
double q2adjErrorShiftedToTarget = Config.Formulas.ErrorFromVolumes(q2adjResult.VolumeMeter, volumeRefShiftedToTarget);
|
|
|
|
|
double q2adjErrorShiftedToTarget = Formulas.ErrorFromVolumes(q2adjResult.VolumeMeter, volumeRefShiftedToTarget);
|
|
|
|
|
|
|
|
|
|
double A = 16.0 / ScalingFactor(); /// Raw units per ml: DN15=16, DN20=8, DN25=4, DN32=2, DN40=1
|
|
|
|
|
const double B = 8.0; /// Raw units per minute, 8
|
|
|
|
@@ -911,9 +912,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
|
|
|
|
switch (units)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case VolumeUnits.m3: return Config.Units.ConvertFrom(Config.Unit.m3, 1.0); /// liter
|
|
|
|
|
case VolumeUnits.UK_gallon: return Config.Units.ConvertFrom(Config.Unit.UKgal, 1.0); /// liter
|
|
|
|
|
case VolumeUnits.US_gallon: return Config.Units.ConvertFrom(Config.Unit.USgal, 1.0); /// liter
|
|
|
|
|
case VolumeUnits.m3: return Common.Units.ConvertFrom(Common.Unit.m3, 1.0); /// liter
|
|
|
|
|
case VolumeUnits.UK_gallon: return Common.Units.ConvertFrom(Common.Unit.UKgal, 1.0); /// liter
|
|
|
|
|
case VolumeUnits.US_gallon: return Common.Units.ConvertFrom(Common.Unit.USgal, 1.0); /// liter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|