Saving ResultCode with RFID and OptoData error code for iPerls implemented, ver. 2.16.646
This commit is contained in:
@@ -381,6 +381,11 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
if (iPerl != null)
|
||||
{
|
||||
if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0)
|
||||
{
|
||||
meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode;
|
||||
}
|
||||
|
||||
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||
meterRslt.TimestampEnd = iPerl.NoSamples ? (iPerl.TimestampSecStart + tstRslt.TestTime) : iPerl.TimestampSecEnd;
|
||||
meterRslt.TestTime = iPerl.NoSamples ? tstRslt.TestTime : (meterRslt.TimestampEnd - meterRslt.TimestampStart);
|
||||
@@ -408,7 +413,12 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
|
||||
if (iPerl != null)
|
||||
{
|
||||
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
|
||||
if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0)
|
||||
{
|
||||
meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -569,7 +569,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
|
||||
if (iPerl != null)
|
||||
{
|
||||
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||
if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0)
|
||||
{
|
||||
meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode;
|
||||
}
|
||||
|
||||
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||
meterRslt.TimestampEnd = iPerl.NoSamples ? (iPerl.TimestampSecStart + tstRslt.TestTime) : iPerl.TimestampSecEnd;
|
||||
meterRslt.TestTime = iPerl.NoSamples ? tstRslt.TestTime : (meterRslt.TimestampEnd - meterRslt.TimestampStart);
|
||||
meterRslt.VolumeStart = iPerl.VolumeLtrStart; /// liter
|
||||
|
||||
+6
-1
@@ -79,7 +79,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
||||
: null;
|
||||
if (iPerl != null)
|
||||
if (iPerl != null)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||
@@ -941,6 +941,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
|
||||
if (iPerl != null)
|
||||
{
|
||||
if (iPerl.ResultCode != 0 && (meterRslt.WaterMeter.ResultCode & (int)Results.Entities.ResultCode.OptoErrorCodeMask) == 0)
|
||||
{
|
||||
meterRslt.WaterMeter.ResultCode |= iPerl.ResultCode;
|
||||
}
|
||||
|
||||
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||
meterRslt.TimestampEnd = iPerl.NoSamples ? (iPerl.TimestampSecStart + tstRslt.TestTime) : iPerl.TimestampSecEnd;
|
||||
meterRslt.TestTime = iPerl.NoSamples ? tstRslt.TestTime : (meterRslt.TimestampEnd - meterRslt.TimestampStart);
|
||||
|
||||
+11
-1
@@ -702,10 +702,20 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else if (ihead.CommFailed || error == CommErr.CommFailed)
|
||||
{
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr, "Watermeter is disabled"));
|
||||
if ((wm.ResultCode & (int)Results.Entities.ResultCode.RfidErrorCodeMask) == 0)
|
||||
{
|
||||
wm.ResultCode |= (((int)error << 16) | ((int)tests[i].ItemNr << 20));
|
||||
}
|
||||
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr, "Watermeter is disabled"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((wm.ResultCode & (int)Results.Entities.ResultCode.RfidErrorCodeMask) == 0)
|
||||
{
|
||||
wm.ResultCode |= (((int)error << 16) | ((int)tests[i].ItemNr << 20));
|
||||
}
|
||||
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr, string.Format("{0} failed ({1}) !!!", activity, error)));
|
||||
rfidDataLogger.ErrorFormat("Group={0}, Board={1}, {2} failed ({3}) !!!", currentGroup, ihead.MuxBoardNrOrGroup14, activity, error);
|
||||
ihead.CommFailed = true;
|
||||
|
||||
+19
-2
@@ -79,6 +79,11 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
}
|
||||
bool commFailed;
|
||||
|
||||
public int ResultCode
|
||||
{
|
||||
get { return resultCode; }
|
||||
}
|
||||
int resultCode;
|
||||
|
||||
/// <summary>
|
||||
/// Passed to OptoTelegramRaw.UpdateFromString(...)
|
||||
@@ -345,7 +350,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
|
||||
public IperlHead()
|
||||
{
|
||||
ClearData();
|
||||
}
|
||||
|
||||
public IperlHead(Generic.IComponentCfg cfg)
|
||||
@@ -363,6 +367,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
/// </summary>
|
||||
public void ClearData()
|
||||
{
|
||||
resultCode = 0;
|
||||
|
||||
disabled = false;
|
||||
commFailed = false;
|
||||
endState = string.Empty;
|
||||
@@ -470,7 +476,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
sampleNr = 0;
|
||||
resultCode = 0;
|
||||
|
||||
sampleNr = 0;
|
||||
|
||||
volumeLtr = 0;
|
||||
volumeLtr0 = 0;
|
||||
@@ -565,6 +573,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
StopParsingOptoSerialPort();
|
||||
OptoTelegramRaw.FIRFilterFlow(optoData, optoDataCount);
|
||||
SaveOptoData();
|
||||
|
||||
if (TestStartTelegramIx == 0 || optoDataCount < 100)
|
||||
{
|
||||
resultCode |= (int)Results.Entities.ResultCode.MissingOptoData;
|
||||
}
|
||||
else if (VolumeLtrEnd == VolumeLtrStart)
|
||||
{
|
||||
resultCode |= (int)Results.Entities.ResultCode.OptoDataWithZeroFlow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user