1.修正MovementDataReader中rotationMatrix矩阵计算问题。

2.添加没有tas时取该tas数据下的场景。
3.修改AscanData的isNull函数错误。
4.对TemperatureDataReader读取假四维数据做处理。
This commit is contained in:
sunwen
2023-05-06 16:26:31 +08:00
parent 5afffd143c
commit 22407e3564
9 changed files with 39 additions and 12 deletions

View File

@@ -37,7 +37,7 @@ double* AScanData::getAmplification()
bool AScanData::isNull() bool AScanData::isNull()
{ {
return mHeader || mData || mCrc || mAmplification; return !mHeader || !mData || !mCrc || !mAmplification;
} }
unsigned long long AScanData::getAscanDataLength() unsigned long long AScanData::getAscanDataLength()

View File

@@ -44,7 +44,7 @@ double* OneTasAScanData::getAmplification()
bool OneTasAScanData::isNull() bool OneTasAScanData::isNull()
{ {
return mHeader || mData || mCrc || mAmplification; return !mHeader || !mData || !mCrc || !mAmplification;
} }
unsigned long long OneTasAScanData::getOneTasAScanDataLength() unsigned long long OneTasAScanData::getOneTasAScanDataLength()

View File

@@ -80,8 +80,8 @@ MovementData MovementDataReader::getMovementDataFromHJ(const std::string& aConfi
std::shared_ptr<float> rotationMatrixArray(new float[16]{0},std::default_delete<float[]>()); std::shared_ptr<float> rotationMatrixArray(new float[16]{0},std::default_delete<float[]>());
float rotation = rotationMatrixInfo.at(i); float rotation = rotationMatrixInfo.at(i);
rotationMatrixArray.get()[0] = cos(rotation*PI/180); rotationMatrixArray.get()[0] = cos(rotation*PI/180);
rotationMatrixArray.get()[1] = -sin(rotation*PI/180); rotationMatrixArray.get()[1] = sin(rotation*PI/180);
rotationMatrixArray.get()[4] = sin(rotation*PI/180); rotationMatrixArray.get()[4] = -sin(rotation*PI/180);
rotationMatrixArray.get()[5] = cos(rotation*PI/180); rotationMatrixArray.get()[5] = cos(rotation*PI/180);
rotationMatrixArray.get()[10] = 1; rotationMatrixArray.get()[10] = 1;
rotationMatrixArray.get()[14] = rotationMatrixInfo.at(i+1); rotationMatrixArray.get()[14] = rotationMatrixInfo.at(i+1);

View File

@@ -87,8 +87,16 @@ namespace
std::shared_ptr<float> tasTampRawData = std::shared_ptr<float>(new float[tasTempLength], std::default_delete<float[]>()); std::shared_ptr<float> tasTampRawData = std::shared_ptr<float>(new float[tasTempLength], std::default_delete<float[]>());
TasTemperatureRawdataPointer rawDataPointer(tasTampRawData,tasTempLength); TasTemperatureRawdataPointer rawDataPointer(tasTampRawData,tasTempLength);
subTasTempRawDatas.push_back(rawDataPointer); subTasTempRawDatas.push_back(rawDataPointer);
float* startIndex = reinterpret_cast<float*>(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength; if(tasTemperatureRawDataVar->data_size == 1)
std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get()); {
uint8_t* startIndex = reinterpret_cast<uint8_t*>(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength;
std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get());
}
else
{
float* startIndex = reinterpret_cast<float*>(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength;
std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get());
}
} }
tasTempRawDatas.push_back(subTasTempRawDatas); tasTempRawDatas.push_back(subTasTempRawDatas);
} }

View File

@@ -287,7 +287,7 @@ AScanData ParserPrivate::getAscanDataOfMotorPosition(const TasElementIndex& aSen
{ {
aShotList = mShotList.get(); aShotList = mShotList.get();
} }
if (!aShotList->isValid()) if (!aShotList->isValid() || !aShotList->hasTasNum(aSenderIndex.getTasIndex()))
{ {
return AScanData(); return AScanData();
} }
@@ -345,7 +345,7 @@ OneTasAScanData ParserPrivate::getOneTasAscanDataOfMotorPosition(unsigned short
{ {
aShotList = mShotList.get(); aShotList = mShotList.get();
} }
if (!aShotList->isValid()) if (!aShotList->isValid()|| !aShotList->hasTasNum(aTasNum))
{ {
return OneTasAScanData(); return OneTasAScanData();
} }
@@ -428,7 +428,7 @@ AScanData ParserPrivate::getAscanDataOfCEMeasured(unsigned short aTasNum,const T
{ {
aShotList = mShotList.get(); aShotList = mShotList.get();
} }
if (!aShotList->isValid()) if (!aShotList->isValid() || !aShotList->hasTasNum(aTasNum))
{ {
return AScanData(); return AScanData();
} }
@@ -485,7 +485,7 @@ OneTasAScanData ParserPrivate::getOneTasAscanDataOfCEMeasured(unsigned short aTa
{ {
aShotList = mShotList.get(); aShotList = mShotList.get();
} }
if (!aShotList->isValid()) if (!aShotList->isValid() || !aShotList->hasTasNum(aTasNum))
{ {
return OneTasAScanData(); return OneTasAScanData();
} }
@@ -629,7 +629,7 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfMP(OneTasAScanData
{ {
aShotList = mShotList.get(); aShotList = mShotList.get();
} }
if(!aOneTasAscanData.isNull() || !aShotList->isValid() || !aShotList->hasMotorPosition(static_cast<unsigned short>(aMotorPosition))) if(aOneTasAscanData.isNull() || !aShotList->isValid() || !aShotList->hasMotorPosition(static_cast<unsigned short>(aMotorPosition)))
{ {
return AScanData(); return AScanData();
} }
@@ -672,7 +672,7 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfMP(OneTasAScanData
AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfCE(OneTasAScanData aOneTasAscanData, const TasElementIndex& aReceiverTasElementIndex) AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfCE(OneTasAScanData aOneTasAscanData, const TasElementIndex& aReceiverTasElementIndex)
{ {
if(!aOneTasAscanData.isNull()) if(aOneTasAscanData.isNull())
{ {
return AScanData(); return AScanData();
} }

View File

@@ -63,6 +63,11 @@ bool ShotList::hasMotorPosition(unsigned short aMotorPosition)
return mPrivate->hasMotorPosition(aMotorPosition); return mPrivate->hasMotorPosition(aMotorPosition);
} }
bool ShotList::hasTasNum(unsigned short aTasNum)
{
return mPrivate->hasTasNum(aTasNum);
}
unsigned short ShotList::getMotoPositionIndex(unsigned short aMotorPosition) unsigned short ShotList::getMotoPositionIndex(unsigned short aMotorPosition)
{ {
return mPrivate->getMotoPositionIndex(aMotorPosition); return mPrivate->getMotoPositionIndex(aMotorPosition);

View File

@@ -57,6 +57,7 @@ public:
bool isValid(); bool isValid();
bool hasCEMeasured(); bool hasCEMeasured();
bool hasMotorPosition(unsigned short aMotorPosition); bool hasMotorPosition(unsigned short aMotorPosition);
bool hasTasNum(unsigned short aTasNum);
unsigned short getMotoPositionIndex(unsigned short aMotorPosition); unsigned short getMotoPositionIndex(unsigned short aMotorPosition);
void restCurrentLoopIndex(size_t aIndex); void restCurrentLoopIndex(size_t aIndex);
void restAllCurrentLoopIndex(); void restAllCurrentLoopIndex();

View File

@@ -389,6 +389,18 @@ bool ShotListPrivate::hasMotorPosition(unsigned short aMotorPosition)
return false; return false;
} }
bool ShotListPrivate::hasTasNum(unsigned short aTasNum)
{
for(auto itr = mTasArray.begin(); itr != mTasArray.end(); ++itr )
{
if (aTasNum == *itr)
{
return true;
}
}
return false;
}
unsigned short ShotListPrivate::getMotoPositionIndex(unsigned short aMotorPosition) unsigned short ShotListPrivate::getMotoPositionIndex(unsigned short aMotorPosition)
{ {
unsigned short index = 0; unsigned short index = 0;

View File

@@ -34,6 +34,7 @@ public:
bool isValid(); bool isValid();
bool hasCEMeasured(); bool hasCEMeasured();
bool hasMotorPosition(unsigned short aMotorPosition); bool hasMotorPosition(unsigned short aMotorPosition);
bool hasTasNum(unsigned short aTasNum);
unsigned short getMotoPositionIndex(unsigned short aMotorPosition); unsigned short getMotoPositionIndex(unsigned short aMotorPosition);
void restCurrentLoopIndex(size_t aIndex); void restCurrentLoopIndex(size_t aIndex);
void restAllCurrentLoopIndex(); void restAllCurrentLoopIndex();