iPerlHead modification : 'nominalTestFlowLph' calculated from q2adjTestData, test method sequences simplified, ver. 2.18.1021
This commit is contained in:
parent
86b47cb434
commit
0fc63655e9
@ -56,19 +56,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("Simulating {0}", test.Name));
|
||||
//------------------------------------------------
|
||||
|
||||
@ -448,7 +448,6 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,19 +60,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("{0} simulation", test.Name));
|
||||
//------------------------------------------------------------------
|
||||
@ -679,8 +666,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
{
|
||||
|
||||
@ -72,19 +72,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name));
|
||||
//-------------------------------------------------------------------
|
||||
@ -1055,7 +1042,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
|
||||
@ -73,19 +73,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name));
|
||||
//-------------------------------------------------------------------
|
||||
@ -1027,7 +1014,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
|
||||
@ -68,19 +68,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name));
|
||||
//-------------------------------------------------------------------
|
||||
@ -1074,7 +1061,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
#endif
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
iPerl.LastTestResult = meterRslt; /// Save this test result
|
||||
iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
else if (cameraRoi != null)
|
||||
|
||||
@ -729,7 +729,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
for (int wmNr0 = 0; wmNr0 < iperlHeads.Count; wmNr0++)
|
||||
{
|
||||
IperlHead ihead = iperlHeads[wmNr0];
|
||||
if (ihead.Group == group && ihead.MuxBoardNrOrGroup14 == muxBrdOrGroup14Nrs[threadIx])
|
||||
if ((ihead.Group == group) && (threadIx < muxBrdOrGroup14Nrs.Count) && (ihead.MuxBoardNrOrGroup14 == muxBrdOrGroup14Nrs[threadIx]))
|
||||
{
|
||||
wmFound = true;
|
||||
Results.Entities.WaterMeter wm = ProcessData.BatchRslts.WaterMeters[waterMeterPositions0[wmNr0]];
|
||||
@ -1819,7 +1819,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
Byte q2CorrRFlow = 0;
|
||||
Byte q2CorrLFlow = 0;
|
||||
|
||||
if (q2CorrType == Q2CorrType.Standard)
|
||||
///
|
||||
/// Calculate Q2 correction form an error measured at Q2 (q2adjResult.Error)
|
||||
///
|
||||
if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
if (q2CorrType == Q2CorrType.Standard)
|
||||
{
|
||||
///
|
||||
/// Standard process
|
||||
@ -1830,11 +1838,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
q2CorrRFlow = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
q2CorrLFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF);
|
||||
}
|
||||
@ -1849,11 +1852,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
if (ihead.Q2ErrWOCorrection < 0)
|
||||
{
|
||||
q2CorrRFlow = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
|
||||
@ -1867,14 +1865,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else if (q2CorrType == Q2CorrType.Greece)
|
||||
{
|
||||
///
|
||||
/// Process for Greece
|
||||
///
|
||||
if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction))
|
||||
{
|
||||
return CommErr.None; /// Q2 error is too large, water meter failed anyhow
|
||||
}
|
||||
|
||||
q2CorrRFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF);
|
||||
q2CorrLFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF);
|
||||
}
|
||||
|
||||
@ -122,19 +122,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
||||
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, testParams.Activity);
|
||||
//------------------------------------------------
|
||||
|
||||
@ -161,7 +161,6 @@ 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 double NominalTestFlowLph; /// in liter per hour
|
||||
|
||||
|
||||
///
|
||||
@ -244,6 +243,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
double errLimitLo = q2adjTestData.ErrLimLo + q2adjTestData.Uncertainty;
|
||||
double errLimitHi = q2adjTestData.ErrLimHi - q2adjTestData.Uncertainty;
|
||||
|
||||
double nominalTestFlowLph = 500.0 * (q2adjTestData.Qfrom + q2adjTestData.Qto); /// in lph => 500.0 * ...
|
||||
//double nominalTestFlowLph = 1000.0 * q2adjTestData.Qfrom; /// in lph => 1000.0 * ...
|
||||
|
||||
double volumeRefShiftedToTarget = q2adjResult.VolumeRef * (1.0f + CalibTarget / 100.0f);
|
||||
double q2adjErrorShiftedToTarget = Config.Formulas.ErrorFromVolumes(q2adjResult.VolumeMeter, volumeRefShiftedToTarget);
|
||||
|
||||
@ -256,16 +258,17 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
const double B = 8.0; /// Raw units per minute, 8
|
||||
const double C = B * 60.0; /// Raw units per hour, 480
|
||||
double D = C / A; /// ml correction per hour
|
||||
double F = D / (NominalTestFlowLph * 10.0); /// Error corrected with 8 Raw Units per minute [%]
|
||||
double F = D / (nominalTestFlowLph * 10.0); /// Error corrected with 8 Raw Units per minute [%]
|
||||
double G = F / B; /// Error corrected with 1 Raw Unit per minute [%]
|
||||
|
||||
q2CorrectionFactor = (-1) * (q2adjErrorShiftedToTarget / G) * (volumeRefShiftedToTarget / q2adjResult.VolumeMeter);
|
||||
|
||||
log.WarnFormat("Q2 correction: Pos={0}, PCB#={1}, corrFactor={2}, Q2adjError={3}%, shftdError={4}%, [Lo={5}%, Hi={6}%]",
|
||||
log.WarnFormat("Q2 correction: Pos={0}, PCB#={1}, corrFactor={2}, Q2adjError={3}%, CalTarget={4}%, shftdError={5}%, [Lo={6}%, Hi={7}%]",
|
||||
Name,
|
||||
SerialNr,
|
||||
q2CorrectionFactor.ToString("F1"),
|
||||
q2adjResult.Error.ToString("F2"),
|
||||
CalibTarget.ToString("F1"),
|
||||
q2adjErrorShiftedToTarget.ToString("F2"),
|
||||
errLimitLo.ToString("F1"),
|
||||
errLimitHi.ToString("F1"));
|
||||
@ -426,7 +429,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
calibrationStructV4 = null;
|
||||
|
||||
LastTestResult = null;
|
||||
NominalTestFlowLph = 0;
|
||||
LastTestResult2 = null;
|
||||
|
||||
OrigCalibFactor = 0;
|
||||
OrigCalibFactorLNA = 0;
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1020.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1020.0")]
|
||||
[assembly: AssemblyVersion("2.18.1021.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1021.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user