(1) Auto. wmTypeRev (2) IperlCheck t.meth. (3) Pruefindex, Q2corr. read from Ora.on start (4) VolStart/VolEnd written to Ora. bounded, (5) iPerlCommForm.ReadQ2Corr() bug fix (6) LU logging cleanup, etc, ver. 2.18.1140

This commit is contained in:
Milan Hanajik
2019-02-13 09:27:22 +01:00
parent dd8273798a
commit 32873ee2b0
27 changed files with 883 additions and 293 deletions
@@ -38,11 +38,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
public float CalibTarget { get { return iperlHeadCfg.ProcParams.CalibTarget; } }
public ushort FactorLimitLo { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitLo; } }
public ushort FactorLimitHi { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitHi; } }
public FlowDir InitFlowDir { get { return (iperlHeadCfg != null && iperlHeadCfg.ProcParams != null) ? iperlHeadCfg.ProcParams.FlowDir : FlowDir.R_L; } }
public LogType LogType { get { return iperlHeadCfg.ProcParams.LogType; } }
public Counting InitFlowDir { get { return (iperlHeadCfg != null && iperlHeadCfg.ProcParams != null) ? iperlHeadCfg.ProcParams.Counting : Counting.Arbitrary; } }
#if ORACLE_DB
public int WMType_ID { get { return iperlHeadCfg.ProcParams.WMType_ID; } } /// Required by Oracle DB
public int WMType_Rev { get { return iperlHeadCfg.ProcParams.WMType_Rev; } } /// Required by Oracle DB
#endif
/// Properties set by the Begin and the End form
@@ -459,7 +457,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
}
FlowDir currentFlowDir;
Counting currentFlowDir;
///
public OptoHeadState CheckFlowDirection()
{
@@ -468,7 +466,22 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
///
public void ChangeFlowDirection()
{
currentFlowDir = (InitFlowDir == FlowDir.R_L) ? FlowDir.L_R : FlowDir.R_L;
switch (InitFlowDir)
{
case Counting.Positive:
currentFlowDir = Counting.Negative;
break;
case Counting.Negative:
currentFlowDir = Counting.Positive;
break;
case Counting.Arbitrary:
default:
currentFlowDir = Counting.Arbitrary;
break;
}
if (flowDirectionDetection != null) flowDirectionDetection.ClearFifo(); /// Clear FIFO for flow direction detection
}
@@ -567,20 +580,22 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
string wmPosition = Name.Substring(5);
if (wmPosition.Length == 1) wmPosition = "0" + wmPosition;
SensusTestInfo[] testInfos = SensusTestInfo.GetTestInfos(LogType);
SensusTestInfo[] testInfos = Sequences.ProcessData.TestInfos;
optoDataLogFileName = null;
///
foreach (var ti in testInfos)
if (testInfos != null)
{
if ((testName != null) && (testName == ti.TestName))
foreach (var ti in testInfos)
{
optoDataLogFileName = string.Format("{0}_{1}_{2}_{3}.txt",
(ConfigStruct != null) ? ConfigStruct.GetPcbNrString() : "UnknownPcbNr",
wmPosition,
ti.PruefungsNrStr,
StateMachine.CycleStartTimeStamp.ToString("HH_mm_ss"));
break;
if ((testName != null) && (testName == ti.TestName) && !string.IsNullOrEmpty(ti.PruefungsNrStr))
{
optoDataLogFileName = string.Format("{0}_{1}_{2}_{3}.txt",
(ConfigStruct != null) ? ConfigStruct.GetPcbNrString() : "UnknownPcbNr",
wmPosition,
ti.PruefungsNrStr,
StateMachine.CycleStartTimeStamp.ToString("HH_mm_ss"));
break;
}
}
}
@@ -620,37 +635,42 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
/// <summary>Stop this operation</summary>
public void Stop()
{
if ((TestStartTelegramIx > 0) && (TestStartTelegramIx < StartOptoDataCount) && (optoData[TestStartTelegramIx].Flags == OptoTelegramFlags.OK))
{
optoData[TestStartTelegramIx].Flags = OptoTelegramFlags.OK_TestStart;
OptoTelegramRaw.TestStartTimestampDec = optoData[TestStartTelegramIx].TimestampDec();
}
int startIx = OptoTelegramRaw.BufferIdx(TestStartTelegramIx);
int endIx = OptoTelegramRaw.BufferIdx(TestEndTelegramIx);
if (optoData[OptoTelegramRaw.BufferIdx(TestEndTelegramIx)].Flags == OptoTelegramFlags.OK)
{
optoData[OptoTelegramRaw.BufferIdx(TestEndTelegramIx)].Flags = OptoTelegramFlags.OK_TestEnd;
}
log.WarnFormat("IperlHeadd.Stop() startIx={0} endIx={1} optoData.Len={2} filename={3}", startIx, endIx, optoData.Length, !string.IsNullOrEmpty(optoDataLogFileName) ? optoDataLogFileName : "<null>");
StopParsingOptoSerialPort();
if (optoDataCount <= MaxOptoDataCount)
{
OptoTelegramRaw.FIRFilterFlow(optoData, 0, optoDataCount - 1);
}
else
{
OptoTelegramRaw.FIRFilterFlow(optoData, 0, StartOptoDataCount - 1);
OptoTelegramRaw.FIRFilterFlow(optoData, (optoDataCount - EndOptoDataCount), optoDataCount - 1);
}
if ((startIx > 0) && (startIx < StartOptoDataCount) && (optoData[startIx].Flags == OptoTelegramFlags.OK))
{
optoData[startIx].Flags = OptoTelegramFlags.OK_TestStart;
OptoTelegramRaw.TestStartTimestampDec = optoData[startIx].TimestampDec();
}
if ((endIx > 0) && (optoData[endIx].Flags == OptoTelegramFlags.OK))
{
optoData[endIx].Flags = OptoTelegramFlags.OK_TestEnd;
}
StopParsingOptoSerialPort();
if (optoDataCount <= MaxOptoDataCount)
{
OptoTelegramRaw.FIRFilterFlow(optoData, 0, optoDataCount - 1);
}
else
{
OptoTelegramRaw.FIRFilterFlow(optoData, 0, StartOptoDataCount - 1);
OptoTelegramRaw.FIRFilterFlow(optoData, (optoDataCount - EndOptoDataCount), optoDataCount - 1);
}
SaveOptoData();
if (TestStartTelegramIx == 0 || optoDataCount < 100)
{
resultCode |= (int)Results.Entities.ResultCode.MissingOptoData;
}
else if (volumeLtrEnd == volumeLtrStart)
{
resultCode |= (int)Results.Entities.ResultCode.OptoDataWithZeroFlow;
}
if (TestStartTelegramIx == 0 || optoDataCount < 100)
{
resultCode |= (int)Results.Entities.ResultCode.MissingOptoData;
}
else if (volumeLtrEnd == volumeLtrStart)
{
resultCode |= (int)Results.Entities.ResultCode.OptoDataWithZeroFlow;
}
}
/// <summary>
@@ -658,7 +678,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
/// </summary>
void SaveOptoData()
{
if (optoDataLogFileName != null)
if (!string.IsNullOrEmpty(optoDataLogFileName))
{
string directory = Path.Combine("C:\\TBF\\ProcessData", StateMachine.CycleStartTimeStamp.ToString("yy"),
StateMachine.CycleStartTimeStamp.ToString("MM"),