Speed up searchAscanDataFromOneTasAscanDataOfMP and searchAscanDataFromOneTasAscanDataOfCE.
This commit is contained in:
@@ -690,28 +690,31 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfMP(OneTasAScanData
|
|||||||
unsigned int skipReceiverIndex = (aReceiverTasElementIndex.getTasIndex()-1)*18+aReceiverTasElementIndex.getElementGeometryIndex() - 1;
|
unsigned int skipReceiverIndex = (aReceiverTasElementIndex.getTasIndex()-1)*18+aReceiverTasElementIndex.getElementGeometryIndex() - 1;
|
||||||
|
|
||||||
//Header
|
//Header
|
||||||
for(unsigned int i=0; i<HEADER_SIZE; ++i)
|
unsigned long long offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * HEADER_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getHeader() + offset,
|
||||||
result.getHeader()[i] = aOneTasAscanData.getHeader()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * HEADER_SIZE + i];
|
aOneTasAscanData.getHeader() + offset + HEADER_SIZE,
|
||||||
}
|
result.getHeader());
|
||||||
|
|
||||||
//Ascan
|
//Ascan
|
||||||
for(unsigned int i=0; i<mDataLength; ++i)
|
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * mDataLength;
|
||||||
{
|
std::copy(aOneTasAscanData.get() + offset,
|
||||||
result.get()[i] = aOneTasAscanData.get()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * mDataLength + i];
|
aOneTasAscanData.get() + offset + mDataLength,
|
||||||
}
|
result.get());
|
||||||
|
|
||||||
|
|
||||||
//CRC
|
//CRC
|
||||||
for(unsigned int i=0; i<CRC_SIZE; ++i)
|
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * CRC_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getCrc() + offset,
|
||||||
result.getCrc()[i] = aOneTasAscanData.getCrc()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * CRC_SIZE + i];
|
aOneTasAscanData.getCrc() + offset + CRC_SIZE,
|
||||||
}
|
result.getCrc());
|
||||||
|
|
||||||
|
|
||||||
//Amplification
|
//Amplification
|
||||||
for(unsigned int i=0; i<AMPLFICATION_SIZE; ++i)
|
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * AMPLFICATION_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getAmplification() + offset,
|
||||||
result.getAmplification()[i] = aOneTasAscanData.getAmplification()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * AMPLFICATION_SIZE + i];
|
aOneTasAscanData.getAmplification() + offset + AMPLFICATION_SIZE,
|
||||||
}
|
result.getAmplification());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -729,28 +732,29 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfCE(OneTasAScanData
|
|||||||
AScanData result(TasElementIndex(aOneTasAscanData.getSenderTasNumber(),ElementIndex(GeometryIndex(0))),aReceiverTasElementIndex,MotorPosition::CEMeasured,mDataLength);
|
AScanData result(TasElementIndex(aOneTasAscanData.getSenderTasNumber(),ElementIndex(GeometryIndex(0))),aReceiverTasElementIndex,MotorPosition::CEMeasured,mDataLength);
|
||||||
|
|
||||||
//Header
|
//Header
|
||||||
for(unsigned int i=0; i<HEADER_SIZE; ++i)
|
unsigned long long offset = skipReceiverIndex * HEADER_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getHeader() + offset,
|
||||||
result.getHeader()[i] = aOneTasAscanData.getHeader()[skipReceiverIndex * HEADER_SIZE + i];
|
aOneTasAscanData.getHeader() + offset + HEADER_SIZE,
|
||||||
}
|
result.getHeader());
|
||||||
|
|
||||||
//Ascan
|
//Ascan
|
||||||
for(unsigned int i=0; i<mDataLength; ++i)
|
offset = skipReceiverIndex * mDataLength;
|
||||||
{
|
std::copy(aOneTasAscanData.get() + offset,
|
||||||
result.get()[i] = aOneTasAscanData.get()[skipReceiverIndex * mDataLength + i];
|
aOneTasAscanData.get() + offset + mDataLength,
|
||||||
}
|
result.get());
|
||||||
|
|
||||||
//CRC
|
//CRC
|
||||||
for(unsigned int i=0; i<CRC_SIZE; ++i)
|
offset = skipReceiverIndex * CRC_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getCrc() + offset,
|
||||||
result.getCrc()[i] = aOneTasAscanData.getCrc()[skipReceiverIndex * CRC_SIZE + i];
|
aOneTasAscanData.getCrc() + offset + CRC_SIZE,
|
||||||
}
|
result.getCrc());
|
||||||
|
|
||||||
//Amplification
|
//Amplification
|
||||||
for(unsigned int i=0; i<AMPLFICATION_SIZE; ++i)
|
offset = skipReceiverIndex * AMPLFICATION_SIZE;
|
||||||
{
|
std::copy(aOneTasAscanData.getAmplification() + offset,
|
||||||
result.getAmplification()[i] = aOneTasAscanData.getAmplification()[skipReceiverIndex * AMPLFICATION_SIZE + i];
|
aOneTasAscanData.getAmplification() + offset + AMPLFICATION_SIZE,
|
||||||
}
|
result.getAmplification());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user