diff --git a/src/SmokeBoxIdentification.cpp b/src/SmokeBoxIdentification.cpp index a9d55d7..4a4c2f6 100644 --- a/src/SmokeBoxIdentification.cpp +++ b/src/SmokeBoxIdentification.cpp @@ -83,7 +83,7 @@ SmokeBoxIdentification::SmokeBoxIdentification(QWidget *parent) SmokeBoxIdentification::~SmokeBoxIdentification() { - emit sgControlSideLight(lightCtrl::emTurnOffLight); + //emit sgControlSideLight(lightCtrl::emTurnOffLight); DELETE_POINTER(m_pCategoryMatcher); DELETE_POINTER(m_pNetControl); if (m_pTcpClientThread) @@ -505,7 +505,10 @@ bool SmokeBoxIdentification::decodeSmokeInfoCsv(const QString& filePath) { QString smokeCode = wsheet->read(i, colStart).toString(); QString smokeName = wsheet->read(i, colStart + 1).toString(); + if (smokeCode.isEmpty() || smokeName.isEmpty()) + continue; m_mapSmokeCode2Name.insert(smokeCode, smokeName); + //qDebug() << "insert: " << smokeCode << " and " << smokeName; } qDebug() << "Decode smokeInfo from " << filePath << " successed"; return true; @@ -542,6 +545,8 @@ bool SmokeBoxIdentification::matchSmokeNameAndTemplateFolderName(const QString& if (typeFolderName.contains(smokeCNName)) { m_mapSmokeName2TemplateFolderName.insert(smokeCNName, typeFolderName); + //qDebug() << "find " << typeFolderName << " in excel"; + //qDebug() << "insert " << smokeCNName << " and " << typeFolderName; smokeCNNameList.removeAt(i); bFind = true; break; @@ -549,7 +554,7 @@ bool SmokeBoxIdentification::matchSmokeNameAndTemplateFolderName(const QString& } if (!bFind) { - qDebug() << "Not find: " << typeFolderName << "in excel"; + qDebug() << "Not find: " << typeFolderName << " in excel"; } } qDebug() << "match smokeName and templateFolderName successed"; diff --git a/src/numStatisticAlgo/dataPreProcessing.cpp b/src/numStatisticAlgo/dataPreProcessing.cpp index 054fbbb..aa31c0e 100644 --- a/src/numStatisticAlgo/dataPreProcessing.cpp +++ b/src/numStatisticAlgo/dataPreProcessing.cpp @@ -525,18 +525,19 @@ int dataPreProcessing::dataRepeatMatch(int mBoundary, if (dataVec[0].size() <= 0) return -1; int startIndex = 20; int step = 1; - int win = mBoundary + startIndex; + int endIndex = mBoundary + startIndex; qWarning() << "I print mBoundary:" << mBoundary; - qWarning() << "I print winSize:" << win; + qWarning() << "I print endIndex:" << endIndex; qWarning() << "I print sensor data size:" << dataVec[0].size(); - while (win < dataVec[0].size()) + endIndex = endIndex <= dataVec[0].size() ? endIndex : dataVec[0].size(); + while (endIndex <= dataVec[0].size()) { QVector> mLocalData; mLocalData.resize(4); for (int i = 0; i < dataVec.size(); ++i) { - for (int j = startIndex; j < win; ++j) + for (int j = startIndex; j < endIndex; ++j) { mLocalData[i].push_back(dataVec[i][j]); } @@ -544,7 +545,7 @@ int dataPreProcessing::dataRepeatMatch(int mBoundary, int val = modelPrediction(mLocalData, typeSerial, leftRightJudge); if (val < 0) return -1; startIndex+=step; - win+=step; + endIndex +=step; } int label = -1; if (mComparedValMapLabel.size() > 0)