From 022467dc777dbe89a9bcce2e0192db483da5c9c2 Mon Sep 17 00:00:00 2001 From: QuShuailong Date: Sun, 5 Nov 2023 09:59:09 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=93=81=E8=A7=84=E4=BF=A1=E6=81=AFexcel=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9Bbug=E3=80=822=E3=80=81=E5=BD=93?= =?UTF-8?q?=E9=87=87=E9=9B=86=E5=88=B0=E7=9A=84=E6=95=B0=E9=87=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=8C=E6=95=B0=E5=B0=8F=E4=BA=8E=E8=AE=BE=E5=AE=9A?= =?UTF-8?q?=E7=9A=84=E7=AA=97=E5=8F=A3=E8=A1=8C=E6=95=B0=E6=97=B6=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=E8=83=BD=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SmokeBoxIdentification.cpp | 9 +++++++-- src/numStatisticAlgo/dataPreProcessing.cpp | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) 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)