Results, FlyingStartMassCollection and CombinedWithDetection : Main and Aux meter pulses, Div. switch time, ver. 3.7.2094
This commit is contained in:
@@ -124,9 +124,6 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefHi2));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
|
||||
float switchTimeStart = 0.001f; /// in seconds, original vale is 1 ms
|
||||
float switchTimeEnd = 0.001f; /// in seconds, original vale is 1 ms
|
||||
|
||||
/// Specific for combined meters
|
||||
int[] lastWMPulses = new int[2 * TBF.Data.CompoundWMsCount];
|
||||
@@ -680,63 +677,75 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
|
||||
tstRslt.FlowMin = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Min / tstRslt.ConstMasterRaw);
|
||||
tstRslt.FlowMax = Convert.ToSingle(tstRslt.ConstMaster * RefFlowStat.Max / tstRslt.ConstMasterRaw);
|
||||
|
||||
tstRslt.DiverterStart = switchTimeStart;
|
||||
tstRslt.DiverterEnd = switchTimeEnd;
|
||||
tstRslt.DiverterStart = (outPath.Diverter != null) ? outPath.Diverter.SwitchTimeStart.Val : 0;
|
||||
tstRslt.DivStart10 = 0;
|
||||
tstRslt.DivStart50 = 0;
|
||||
tstRslt.DivStart90 = 0;
|
||||
tstRslt.DiverterEnd = (outPath.Diverter != null) ? outPath.Diverter.SwitchTimeEnd.Val : 0;
|
||||
tstRslt.DivEnd90 = 0;
|
||||
tstRslt.DivEnd50 = 0;
|
||||
tstRslt.DivEnd10 = 0;
|
||||
log.DebugFormat("Diverter switch time [s]: Start: {0}ms ({1} {2} {3}) End: {4}ms ({5} {6} {7})",
|
||||
(tstRslt.DiverterStart * 1000).ToString("F0"), tstRslt.DivStart10, tstRslt.DivStart50, tstRslt.DivStart90,
|
||||
(tstRslt.DiverterEnd * 1000).ToString("F0"), tstRslt.DivEnd90, tstRslt.DivEnd50, tstRslt.DivEnd10);
|
||||
|
||||
long infoFlags = 0;
|
||||
tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, switchTimeStart, switchTimeEnd, out infoFlags, out stopCycle) : 0;
|
||||
tstRslt.ErrorFlags = (ErrorFlagsComp != null)
|
||||
? ErrorFlagsComp.GetErrorFlags(tstRslt, true, false, tstRslt.DiverterStart, tstRslt.DiverterEnd, out infoFlags, out stopCycle)
|
||||
: 0;
|
||||
tstRslt.InfoFlags = infoFlags;
|
||||
|
||||
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.CompoundAux);
|
||||
var mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.CompoundMain);
|
||||
var auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.CompoundAux);
|
||||
|
||||
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||
{
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||
var oneMTR = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
if (oneMTR != null && regReader != null)
|
||||
{
|
||||
meterRslt.RegReaderType = (int)regReader.RegisterReaderType;
|
||||
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||
oneMTR.RegReaderType = (int)regReader.RegisterReaderType;
|
||||
oneMTR.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||
|
||||
/// Optionally supress pulses from the large water meter
|
||||
meterRslt.PulsesMeter = (isAux == 0 && testParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
|
||||
meterRslt.TestTime = cBrd.TestTime;
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
oneMTR.PulsesMeter = (isAux == 0 && testParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
|
||||
oneMTR.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
|
||||
oneMTR.TestTime = cBrd.TestTime;
|
||||
oneMTR.VolumeStart = 0;
|
||||
oneMTR.VolumeEnd = 0;
|
||||
oneMTR.VolumeRef = tstRslt.VolumeCTV;
|
||||
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
///
|
||||
if (meterRslt.PulsesMaster != 0)
|
||||
{
|
||||
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
|
||||
}
|
||||
if (oneMTR.PulsesMaster != 0)
|
||||
{
|
||||
oneMTR.PulsesMeter *= (tstRslt.PulsesMaster / oneMTR.PulsesMaster);
|
||||
oneMTR.PulsesMaster = tstRslt.PulsesMaster;
|
||||
}
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||
oneMTR.VolumeMeter = oneMTR.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
|
||||
oneMTR.Error = Formulas.ErrorFromVolumes(oneMTR.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||
}
|
||||
}
|
||||
|
||||
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.Compound);
|
||||
var compoundMTR = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Compound);
|
||||
|
||||
if (compoundMeterRslt != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||
if (compoundMTR != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||
{
|
||||
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.VolumeCTV, tstRslt.TestTime) + test.Uncertainty)
|
||||
&& (compoundMeterRslt.Error <= test.GetErrLimHi(tstRslt.VolumeCTV, tstRslt.TestTime) - test.Uncertainty)
|
||||
compoundMTR.VolumeRef = tstRslt.VolumeCTV;
|
||||
compoundMTR.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||
compoundMTR.PulsesMaster = tstRslt.PulsesMaster;
|
||||
compoundMTR.TestTime = tstRslt.TestTime;
|
||||
compoundMTR.Error = Formulas.ErrorFromVolumes(compoundMTR.VolumeMeter, compoundMTR.VolumeRef);
|
||||
compoundMTR.Passed = (compoundMTR.Error >= test.GetErrLimLo(tstRslt.VolumeCTV, tstRslt.TestTime) + test.Uncertainty)
|
||||
&& (compoundMTR.Error <= test.GetErrLimHi(tstRslt.VolumeCTV, tstRslt.TestTime) - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMTR.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMTR.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
|
||||
if (Qrise != 0) BatchRslts.Batch.WaterMeters[i].QRise = Qrise;
|
||||
|
||||
@@ -737,52 +737,53 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
||||
{
|
||||
if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue;
|
||||
|
||||
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.CompoundAux);
|
||||
var mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.CompoundMain);
|
||||
var auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.CompoundAux);
|
||||
|
||||
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||
{
|
||||
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||
IRegReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||
var oneMTR = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||
|
||||
if (meterRslt != null && regReader != null)
|
||||
if (oneMTR != null && regReader != null)
|
||||
{
|
||||
meterRslt.RegReaderType = (int)regReader.RegisterReaderType;
|
||||
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||
oneMTR.RegReaderType = (int)regReader.RegisterReaderType;
|
||||
oneMTR.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||
|
||||
/// Optionally supress pulses from the large water meter
|
||||
meterRslt.PulsesMeter = (isAux == 0 && compoundTestParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
|
||||
oneMTR.PulsesMeter = (isAux == 0 && compoundTestParams.SupressTrills) ? 0 : Convert.ToDouble(regReader.WMPulses);
|
||||
oneMTR.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses);
|
||||
oneMTR.TestTime = cBrd.TestTime;
|
||||
oneMTR.VolumeStart = 0;
|
||||
oneMTR.VolumeEnd = 0;
|
||||
oneMTR.VolumeRef = tstRslt.VolumeCTV;
|
||||
|
||||
meterRslt.TestTime = cBrd.TestTimeWM(regReader.Position);
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
if (oneMTR.PulsesMaster != 0)
|
||||
{
|
||||
oneMTR.PulsesMeter *= (tstRslt.PulsesMaster / oneMTR.PulsesMaster);
|
||||
oneMTR.PulsesMaster = tstRslt.PulsesMaster;
|
||||
}
|
||||
|
||||
if (meterRslt.PulsesMaster != 0)
|
||||
{
|
||||
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
|
||||
}
|
||||
oneMTR.VolumeMeter = oneMTR.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||
oneMTR.Error = Formulas.ErrorFromVolumes(oneMTR.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||
}
|
||||
}
|
||||
|
||||
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Common.CompoundMeterId.Compound);
|
||||
var compoundMTR = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Compound);
|
||||
|
||||
if (compoundMeterRslt != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||
if (compoundMTR != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||
{
|
||||
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.GetErrLimLo(tstRslt.VolumeCTV, tstRslt.TestTime) + test.Uncertainty)
|
||||
&& (compoundMeterRslt.Error <= test.GetErrLimHi(tstRslt.VolumeCTV, tstRslt.TestTime) - test.Uncertainty)
|
||||
compoundMTR.VolumeRef = tstRslt.VolumeCTV;
|
||||
compoundMTR.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||
compoundMTR.PulsesMaster = tstRslt.PulsesMaster;
|
||||
compoundMTR.TestTime = tstRslt.TestTime;
|
||||
compoundMTR.Error = Formulas.ErrorFromVolumes(compoundMTR.VolumeMeter, compoundMTR.VolumeRef);
|
||||
compoundMTR.Passed = (compoundMTR.Error >= test.GetErrLimLo(tstRslt.VolumeCTV, tstRslt.TestTime) + test.Uncertainty)
|
||||
&& (compoundMTR.Error <= test.GetErrLimHi(tstRslt.VolumeCTV, tstRslt.TestTime) - test.Uncertainty)
|
||||
&& (tstRslt.ErrorFlags == 0);
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMTR.Passed;
|
||||
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMTR.TestDone = true;
|
||||
tstRslt.TestDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user