Saving ResultCode with RFID and OptoData error code for iPerls implemented, ver. 2.16.646
This commit is contained in:
parent
35b62520c9
commit
df42ec3d3a
@ -9,13 +9,35 @@ using Config.Entities;
|
||||
namespace Results.Entities
|
||||
{
|
||||
|
||||
public enum ResultCodeBit
|
||||
public enum ResultCode
|
||||
{
|
||||
None = 0,
|
||||
OptoComPort = (1 << 16),
|
||||
RfidCommFailed = (1 << 17),
|
||||
None = 0,
|
||||
|
||||
Bit16 = (1 << 16),
|
||||
Bit17 = (1 << 17),
|
||||
Bit18 = (1 << 18),
|
||||
Bit19 = (1 << 19),
|
||||
RfidErrorCodeMask = (Bit16 | Bit17 | Bit18 | Bit19), /// RFID comm. err. (the first encounetered error is stored)
|
||||
|
||||
Bit20 = (1 << 20),
|
||||
Bit21 = (1 << 21),
|
||||
Bit22 = (1 << 22),
|
||||
Bit23 = (1 << 23),
|
||||
RfidErrorTestIdMask = (Bit20 | Bit21 | Bit22 | Bit23), /// RFID comm. err. (the first encounetered error is stored)
|
||||
|
||||
MissingOptoData = (1 << 24),
|
||||
OptoDataWithZeroFlow = (1 << 25),
|
||||
OptoErrorCodeMask = (MissingOptoData | OptoDataWithZeroFlow), /// Opto comm. err. (the first encounetered error is stored)
|
||||
|
||||
Bit26 = (1 << 26),
|
||||
Bit27 = (1 << 27),
|
||||
Bit28 = (1 << 28),
|
||||
Bit29 = (1 << 29),
|
||||
Bit30 = (1 << 30),
|
||||
Bit31 = (1 << 31),
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class WaterMeter
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.16.645.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.645.1")]
|
||||
[assembly: AssemblyVersion("2.16.646.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.646.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user