diff --git a/src/Data/AScanData.cpp b/src/Data/AScanData.cpp index 249ba09..4bb2627 100644 --- a/src/Data/AScanData.cpp +++ b/src/Data/AScanData.cpp @@ -37,7 +37,7 @@ double* AScanData::getAmplification() bool AScanData::isNull() { - return mHeader || mData || mCrc || mAmplification; + return !mHeader || !mData || !mCrc || !mAmplification; } unsigned long long AScanData::getAscanDataLength() diff --git a/src/Data/OneTasAScanData.cpp b/src/Data/OneTasAScanData.cpp index ca93f64..61e7b7e 100644 --- a/src/Data/OneTasAScanData.cpp +++ b/src/Data/OneTasAScanData.cpp @@ -44,7 +44,7 @@ double* OneTasAScanData::getAmplification() bool OneTasAScanData::isNull() { - return mHeader || mData || mCrc || mAmplification; + return !mHeader || !mData || !mCrc || !mAmplification; } unsigned long long OneTasAScanData::getOneTasAScanDataLength() diff --git a/src/DataReader/MovementDataReader.cpp b/src/DataReader/MovementDataReader.cpp index 602b603..156c468 100644 --- a/src/DataReader/MovementDataReader.cpp +++ b/src/DataReader/MovementDataReader.cpp @@ -80,8 +80,8 @@ MovementData MovementDataReader::getMovementDataFromHJ(const std::string& aConfi std::shared_ptr rotationMatrixArray(new float[16]{0},std::default_delete()); float rotation = rotationMatrixInfo.at(i); rotationMatrixArray.get()[0] = cos(rotation*PI/180); - rotationMatrixArray.get()[1] = -sin(rotation*PI/180); - rotationMatrixArray.get()[4] = sin(rotation*PI/180); + rotationMatrixArray.get()[1] = sin(rotation*PI/180); + rotationMatrixArray.get()[4] = -sin(rotation*PI/180); rotationMatrixArray.get()[5] = cos(rotation*PI/180); rotationMatrixArray.get()[10] = 1; rotationMatrixArray.get()[14] = rotationMatrixInfo.at(i+1); diff --git a/src/DataReader/TemperatureDataReader.cpp b/src/DataReader/TemperatureDataReader.cpp index 6aff48a..7ca0a10 100644 --- a/src/DataReader/TemperatureDataReader.cpp +++ b/src/DataReader/TemperatureDataReader.cpp @@ -87,8 +87,16 @@ namespace std::shared_ptr tasTampRawData = std::shared_ptr(new float[tasTempLength], std::default_delete()); TasTemperatureRawdataPointer rawDataPointer(tasTampRawData,tasTempLength); subTasTempRawDatas.push_back(rawDataPointer); - float* startIndex = reinterpret_cast(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength; - std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get()); + if(tasTemperatureRawDataVar->data_size == 1) + { + uint8_t* startIndex = reinterpret_cast(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength; + std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get()); + } + else + { + float* startIndex = reinterpret_cast(tasTemperatureRawDataVar->data) + (i*tasTemperatureRawDataVar->dims[2]+j)*tasTempLength; + std::copy(startIndex,startIndex+TAS_COUNT * 2,tasTampRawData.get()); + } } tasTempRawDatas.push_back(subTasTempRawDatas); } diff --git a/src/ParserPrivate.cpp b/src/ParserPrivate.cpp index f8eb41f..45781c1 100644 --- a/src/ParserPrivate.cpp +++ b/src/ParserPrivate.cpp @@ -287,7 +287,7 @@ AScanData ParserPrivate::getAscanDataOfMotorPosition(const TasElementIndex& aSen { aShotList = mShotList.get(); } - if (!aShotList->isValid()) + if (!aShotList->isValid() || !aShotList->hasTasNum(aSenderIndex.getTasIndex())) { return AScanData(); } @@ -345,7 +345,7 @@ OneTasAScanData ParserPrivate::getOneTasAscanDataOfMotorPosition(unsigned short { aShotList = mShotList.get(); } - if (!aShotList->isValid()) + if (!aShotList->isValid()|| !aShotList->hasTasNum(aTasNum)) { return OneTasAScanData(); } @@ -428,7 +428,7 @@ AScanData ParserPrivate::getAscanDataOfCEMeasured(unsigned short aTasNum,const T { aShotList = mShotList.get(); } - if (!aShotList->isValid()) + if (!aShotList->isValid() || !aShotList->hasTasNum(aTasNum)) { return AScanData(); } @@ -485,7 +485,7 @@ OneTasAScanData ParserPrivate::getOneTasAscanDataOfCEMeasured(unsigned short aTa { aShotList = mShotList.get(); } - if (!aShotList->isValid()) + if (!aShotList->isValid() || !aShotList->hasTasNum(aTasNum)) { return OneTasAScanData(); } @@ -629,7 +629,7 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfMP(OneTasAScanData { aShotList = mShotList.get(); } - if(!aOneTasAscanData.isNull() || !aShotList->isValid() || !aShotList->hasMotorPosition(static_cast(aMotorPosition))) + if(aOneTasAscanData.isNull() || !aShotList->isValid() || !aShotList->hasMotorPosition(static_cast(aMotorPosition))) { return AScanData(); } @@ -672,7 +672,7 @@ AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfMP(OneTasAScanData AScanData ParserPrivate::searchAscanDataFromOneTasAscanDataOfCE(OneTasAScanData aOneTasAscanData, const TasElementIndex& aReceiverTasElementIndex) { - if(!aOneTasAscanData.isNull()) + if(aOneTasAscanData.isNull()) { return AScanData(); } diff --git a/src/ShotList/ShotList.cpp b/src/ShotList/ShotList.cpp index c2b9eeb..796a51a 100644 --- a/src/ShotList/ShotList.cpp +++ b/src/ShotList/ShotList.cpp @@ -63,6 +63,11 @@ bool ShotList::hasMotorPosition(unsigned short aMotorPosition) return mPrivate->hasMotorPosition(aMotorPosition); } +bool ShotList::hasTasNum(unsigned short aTasNum) +{ + return mPrivate->hasTasNum(aTasNum); +} + unsigned short ShotList::getMotoPositionIndex(unsigned short aMotorPosition) { return mPrivate->getMotoPositionIndex(aMotorPosition); diff --git a/src/ShotList/ShotList.h b/src/ShotList/ShotList.h index 4789685..5565816 100644 --- a/src/ShotList/ShotList.h +++ b/src/ShotList/ShotList.h @@ -57,6 +57,7 @@ public: bool isValid(); bool hasCEMeasured(); bool hasMotorPosition(unsigned short aMotorPosition); + bool hasTasNum(unsigned short aTasNum); unsigned short getMotoPositionIndex(unsigned short aMotorPosition); void restCurrentLoopIndex(size_t aIndex); void restAllCurrentLoopIndex(); diff --git a/src/ShotList/ShotListPrivate.cpp b/src/ShotList/ShotListPrivate.cpp index a230c4d..e4ccb0f 100644 --- a/src/ShotList/ShotListPrivate.cpp +++ b/src/ShotList/ShotListPrivate.cpp @@ -389,6 +389,18 @@ bool ShotListPrivate::hasMotorPosition(unsigned short aMotorPosition) 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 index = 0; diff --git a/src/ShotList/ShotListPrivate.h b/src/ShotList/ShotListPrivate.h index d794ed8..3f8dd1d 100644 --- a/src/ShotList/ShotListPrivate.h +++ b/src/ShotList/ShotListPrivate.h @@ -34,6 +34,7 @@ public: bool isValid(); bool hasCEMeasured(); bool hasMotorPosition(unsigned short aMotorPosition); + bool hasTasNum(unsigned short aTasNum); unsigned short getMotoPositionIndex(unsigned short aMotorPosition); void restCurrentLoopIndex(size_t aIndex); void restAllCurrentLoopIndex();