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;
|
||||
|
||||
//Header
|
||||
for(unsigned int i=0; i<HEADER_SIZE; ++i)
|
||||
{
|
||||
result.getHeader()[i] = aOneTasAscanData.getHeader()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * HEADER_SIZE + i];
|
||||
}
|
||||
unsigned long long offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * HEADER_SIZE;
|
||||
std::copy(aOneTasAscanData.getHeader() + offset,
|
||||
aOneTasAscanData.getHeader() + offset + HEADER_SIZE,
|
||||
result.getHeader());
|
||||
|
||||
//Ascan
|
||||
for(unsigned int i=0; i<mDataLength; ++i)
|
||||
{
|
||||
result.get()[i] = aOneTasAscanData.get()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * mDataLength + i];
|
||||
}
|
||||
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * mDataLength;
|
||||
std::copy(aOneTasAscanData.get() + offset,
|
||||
aOneTasAscanData.get() + offset + mDataLength,
|
||||
result.get());
|
||||
|
||||
|
||||
//CRC
|
||||
for(unsigned int i=0; i<CRC_SIZE; ++i)
|
||||
{
|
||||
result.getCrc()[i] = aOneTasAscanData.getCrc()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * CRC_SIZE + i];
|
||||
}
|
||||
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * CRC_SIZE;
|
||||
std::copy(aOneTasAscanData.getCrc() + offset,
|
||||
aOneTasAscanData.getCrc() + offset + CRC_SIZE,
|
||||
result.getCrc());
|
||||
|
||||
|
||||
//Amplification
|
||||
for(unsigned int i=0; i<AMPLFICATION_SIZE; ++i)
|
||||
{
|
||||
result.getAmplification()[i] = aOneTasAscanData.getAmplification()[(skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * AMPLFICATION_SIZE + i];
|
||||
}
|
||||
offset = (skipMotorPositionIndex + skipSenderIndex + skipReceiverIndex) * AMPLFICATION_SIZE;
|
||||
std::copy(aOneTasAscanData.getAmplification() + offset,
|
||||
aOneTasAscanData.getAmplification() + offset + AMPLFICATION_SIZE,
|
||||
result.getAmplification());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -729,28 +732,29 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfCE(OneTasAScanData
|
||||
AScanData result(TasElementIndex(aOneTasAscanData.getSenderTasNumber(),ElementIndex(GeometryIndex(0))),aReceiverTasElementIndex,MotorPosition::CEMeasured,mDataLength);
|
||||
|
||||
//Header
|
||||
for(unsigned int i=0; i<HEADER_SIZE; ++i)
|
||||
{
|
||||
result.getHeader()[i] = aOneTasAscanData.getHeader()[skipReceiverIndex * HEADER_SIZE + i];
|
||||
}
|
||||
unsigned long long offset = skipReceiverIndex * HEADER_SIZE;
|
||||
std::copy(aOneTasAscanData.getHeader() + offset,
|
||||
aOneTasAscanData.getHeader() + offset + HEADER_SIZE,
|
||||
result.getHeader());
|
||||
|
||||
//Ascan
|
||||
for(unsigned int i=0; i<mDataLength; ++i)
|
||||
{
|
||||
result.get()[i] = aOneTasAscanData.get()[skipReceiverIndex * mDataLength + i];
|
||||
}
|
||||
offset = skipReceiverIndex * mDataLength;
|
||||
std::copy(aOneTasAscanData.get() + offset,
|
||||
aOneTasAscanData.get() + offset + mDataLength,
|
||||
result.get());
|
||||
|
||||
//CRC
|
||||
for(unsigned int i=0; i<CRC_SIZE; ++i)
|
||||
{
|
||||
result.getCrc()[i] = aOneTasAscanData.getCrc()[skipReceiverIndex * CRC_SIZE + i];
|
||||
}
|
||||
offset = skipReceiverIndex * CRC_SIZE;
|
||||
std::copy(aOneTasAscanData.getCrc() + offset,
|
||||
aOneTasAscanData.getCrc() + offset + CRC_SIZE,
|
||||
result.getCrc());
|
||||
|
||||
//Amplification
|
||||
for(unsigned int i=0; i<AMPLFICATION_SIZE; ++i)
|
||||
{
|
||||
result.getAmplification()[i] = aOneTasAscanData.getAmplification()[skipReceiverIndex * AMPLFICATION_SIZE + i];
|
||||
}
|
||||
offset = skipReceiverIndex * AMPLFICATION_SIZE;
|
||||
std::copy(aOneTasAscanData.getAmplification() + offset,
|
||||
aOneTasAscanData.getAmplification() + offset + AMPLFICATION_SIZE,
|
||||
result.getAmplification());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user