IperlHead : TestEndTelegramIx obtained in a correct way.
This commit is contained in:
@@ -343,6 +343,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
double timestampSecEnd2;
|
||||
double timestampSecEnd3;
|
||||
|
||||
int endTelegramIdx1;
|
||||
int endTelegramIdx2;
|
||||
int endTelegramIdx3;
|
||||
|
||||
int currentTelegramIx;
|
||||
bool startSampleAcquired;
|
||||
public int TestStartTelegramIx;
|
||||
@@ -523,8 +527,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
public void Clear()
|
||||
{
|
||||
resultCode = 0;
|
||||
|
||||
sampleNr = 0;
|
||||
|
||||
volumeLtr = 0;
|
||||
volumeLtr0 = 0;
|
||||
@@ -540,18 +542,22 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
}
|
||||
|
||||
|
||||
int sampleNr; /// This is to determine when the test start sample should be taken
|
||||
int timeFromStart; /// [s] Time from test start to determine when the test start sample should be taken
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
Clear();
|
||||
|
||||
/// Reset opto data
|
||||
optoDataCount = 0;
|
||||
/// Reset opto data, etc.
|
||||
timeFromStart = 0;
|
||||
optoDataCount = 0;
|
||||
currentTelegramIx = -1;
|
||||
startSampleAcquired = false;
|
||||
TestStartTelegramIx = 0;
|
||||
endTelegramIdx1 = 0;
|
||||
endTelegramIdx2 = 0;
|
||||
endTelegramIdx3 = 0;
|
||||
TestEndTelegramIx = 0;
|
||||
|
||||
/// File name is: PCB_AA_BB_HH_MI_SS..txt
|
||||
@@ -585,9 +591,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
/// <returns>eventDone</returns>
|
||||
public Event Run()
|
||||
{
|
||||
sampleNr++;
|
||||
timeFromStart += StateMachine.Period;
|
||||
ReadPulses();
|
||||
if (!startSampleAcquired && (sampleNr >= 4) && (currentTelegramIx >= 0))
|
||||
|
||||
if (!startSampleAcquired && (timeFromStart >= 8) && (currentTelegramIx >= 0))
|
||||
{
|
||||
/// Take the test start sample
|
||||
startSampleAcquired = true;
|
||||
@@ -595,21 +602,23 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
|
||||
timestampSecStart = timestampSec;
|
||||
TestStartTelegramIx = currentTelegramIx;
|
||||
}
|
||||
|
||||
/// Shift data in pipelines
|
||||
volumeLtrEnd = volumeLtrEnd3;
|
||||
volumeLtrEnd3 = volumeLtrEnd2;
|
||||
volumeLtrEnd2 = volumeLtrEnd1;
|
||||
volumeLtrEnd1 = volumeLtr;
|
||||
|
||||
timestampSecEnd = timestampSecEnd3;
|
||||
timestampSecEnd3 = timestampSecEnd2;
|
||||
timestampSecEnd2 = timestampSecEnd1;
|
||||
timestampSecEnd1 = timestampSec;
|
||||
|
||||
if (startSampleAcquired && (currentTelegramIx >= 3))
|
||||
else if (startSampleAcquired)
|
||||
{
|
||||
TestEndTelegramIx = currentTelegramIx - 3;
|
||||
/// Shift data in pipelines
|
||||
volumeLtrEnd = volumeLtrEnd3;
|
||||
volumeLtrEnd3 = volumeLtrEnd2;
|
||||
volumeLtrEnd2 = volumeLtrEnd1;
|
||||
volumeLtrEnd1 = volumeLtr;
|
||||
|
||||
timestampSecEnd = timestampSecEnd3;
|
||||
timestampSecEnd3 = timestampSecEnd2;
|
||||
timestampSecEnd2 = timestampSecEnd1;
|
||||
timestampSecEnd1 = timestampSec;
|
||||
|
||||
TestEndTelegramIx = endTelegramIdx3;
|
||||
endTelegramIdx3 = endTelegramIdx2;
|
||||
endTelegramIdx2 = endTelegramIdx1;
|
||||
endTelegramIdx1 = currentTelegramIx;
|
||||
}
|
||||
|
||||
return Event.ReadRegisterDone;
|
||||
|
||||
Reference in New Issue
Block a user