diff --git a/Doc/bug/新建文本文档 (2).txt b/Doc/bug/新建文本文档 (2).txt new file mode 100644 index 00000000..b101a996 --- /dev/null +++ b/Doc/bug/新建文本文档 (2).txt @@ -0,0 +1,103 @@ +QObject::startTimer: Timers can only be used with threads started with QThread +Could not open the file - +Could not open the file - .//config//communicateConfig +Could not open the file - +Could not open the file - +Could not open the file - +init IP:192.168.1.200 Host:502 Sta:100007FFC4E324370SQL runing Init... +sleepname:sleeptime sleepvalue:20 readname:readnum readvalue:300 write_type:writetype write_value:ushort m_host:50200007FFC4E324370CreatePtr +[2024-06-25 16:35:45.397] [Info] [DetModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:35:45.398] [Info] [ClsModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:35:45.399] [Info] [DetModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:35:45.399] [Info] [SegModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:35:45.399] [Info] HanddleAI4.1-cls +[2024-06-25 16:35:45.399] [Info] HanddleAI4.1-seg +SQL init end +[2024-06-25 16:35:45.833] [Info] [SegModule] ./HandleAiModels/ASR-Seg.BHD has been successfully loaded. +[2024-06-25 16:35:45.848] [Info] [SegModule] runtime batch size is 1 +[2024-06-25 16:35:45.848] [Info] [SegModule] seg model init success. +[2024-06-25 16:35:46.554] [Info] [ClsModule] ./HandleAiModels/ASR-Cls.BHD has been successfully loaded. +[2024-06-25 16:35:46.554] [Info] [DetModule] ./HandleAiModels/connectorDet.BHD has been successfully loaded. +[2024-06-25 16:35:46.555] [Info] [ClsModule] runtime batch size is 1 +[2024-06-25 16:35:46.556] [Info] [ClsModule] cls model init success. +[2024-06-25 16:35:46.568] [Info] [DetModule] det model init success. +Range Message batch count: 1 + pointZ:-73.686600 +Range Message batch count: 1 + pointZ:-73.686600 +Range Message batch count: 1 + pointZ:-73.694400 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-73.6892 +Range Message batch count: 1 + pointZ:-76.416600 +Range Message batch count: 1 + pointZ:-76.416600 +Range Message batch count: 1 + pointZ:-76.389300 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-76.4075 +Range Message batch count: 1 + pointZ:-75.652200 +Range Message batch count: 1 + pointZ:-75.648300 +Range Message batch count: 1 + pointZ:-75.648300 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-75.6496 +Range Message batch count: 1 + pointZ:-61.713600 +Range Message batch count: 1 + pointZ:-61.721400 +Range Message batch count: 1 + pointZ:-61.713600 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-61.7162 +Range Message batch count: 1 + pointZ:-61.928100 +Range Message batch count: 1 + pointZ:-61.928100 +Range Message batch count: 1 + pointZ:-61.932000 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-61.9294 +Range Message batch count: 1 + pointZ:-67.158000 +Range Message batch count: 1 + pointZ:-67.158000 +Range Message batch count: 1 + pointZ:-67.158000 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-67.158 +Range Message batch count: 1 + pointZ:16.068000 +Range Message batch count: 1 + pointZ:16.056300 +Range Message batch count: 1 + pointZ:16.064100 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:16.0628 +Range Message batch count: 1 + pointZ:15.982200 +Range Message batch count: 1 + pointZ:15.993900 +Range Message batch count: 1 + pointZ:15.986100 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:15.9874 +Range Message batch count: 1 + pointZ:14.874600 +Range Message batch count: 1 + pointZ:14.874600 +Range Message batch count: 1 + pointZ:14.878500 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:14.8759 +error修改数组为空 +arm @Pos:1修改数组为空 +arm @Pos:2修改数组为空 +arm @Pos:3修改数组为空 +arm @Pos:4修改数组为空 +arm @Pos:5修改数组为空 +arm @Pos:6修改数组为空 +arm @Pos:7修改数组为空 +arm @Pos:8修改数组为空 +arm @Pos:9修改数组为空 +arm @Pos:10修改数组为空 +arm @Pos:11修改数组为空 +arm @Pos:12修改数组为空 + +D:\ciscoAoiUi\bin\HandleAiUi-new.exe (进程 18796)已退出,代ç �为 -1。 +è¦�在调试å�œæ­¢æ—¶è‡ªåŠ¨å…³é—­æŽ§åˆ¶å�°ï¼Œè¯·å�¯ç”¨â€œå·¥å…·â€�->“选项â€�->“调试â€�->“调试å�œæ­¢æ—¶è‡ªåŠ¨å…³é—­æŽ§åˆ¶å�°â€�。 +按任æ„�键关闭此窗å�£. . . \ No newline at end of file diff --git a/Doc/bug/新建文本文档.txt b/Doc/bug/新建文本文档.txt new file mode 100644 index 00000000..637d2bfc --- /dev/null +++ b/Doc/bug/新建文本文档.txt @@ -0,0 +1,87 @@ +QObject::startTimer: Timers can only be used with threads started with QThread +Could not open the file - +Could not open the file - .//config//communicateConfig +Could not open the file - +Could not open the file - +Could not open the file - +init IP:192.168.1.200 Host:502 Sta:100007FFC4D414370sleepname:SQL runing Init... +sleeptime sleepvalue:20 readname:readnum readvalue:300 write_type:writetype write_value:ushort m_host:50200007FFC4D414370CreatePtr +[2024-06-25 16:18:33.468] [Info] [DetModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:18:33.469] [Info] [DetModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:18:33.469] [Info] [ClsModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:18:33.469] [Info] [SegModule] GPU: NVIDIA GeForce RTX 3090 +[2024-06-25 16:18:33.469] [Info] HanddleAI4.1-cls +[2024-06-25 16:18:33.469] [Info] HanddleAI4.1-seg +SQL init end +[2024-06-25 16:18:33.933] [Info] [SegModule] ./HandleAiModels/ASR-Seg.BHD has been successfully loaded. +[2024-06-25 16:18:33.952] [Info] [SegModule] runtime batch size is 1 +[2024-06-25 16:18:33.953] [Info] [SegModule] seg model init success. +[2024-06-25 16:18:34.655] [Info] [ClsModule] ./HandleAiModels/ASR-Cls.BHD has been successfully loaded. +[2024-06-25 16:18:34.656] [Info] [DetModule] ./HandleAiModels/connectorDet.BHD has been successfully loaded. +[2024-06-25 16:18:34.657] [Info] [ClsModule] runtime batch size is 1 +[2024-06-25 16:18:34.657] [Info] [ClsModule] cls model init success. +[2024-06-25 16:18:34.677] [Info] [DetModule] det model init success. +Range Message batch count: 1 + pointZ:-73.710000 +Range Message batch count: 1 + pointZ:-73.710000 +Range Message batch count: 1 + pointZ:-73.706100 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-73.7087 +Range Message batch count: 1 + pointZ:-76.385400 +Range Message batch count: 1 + pointZ:-76.401000 +Range Message batch count: 1 + pointZ:-76.393200 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-76.3932 +Range Message batch count: 1 + pointZ:-75.679500 +Range Message batch count: 1 + pointZ:-75.656100 +Range Message batch count: 1 + pointZ:-75.667800 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-75.6678 +Range Message batch count: 1 + pointZ:-61.701900 +Range Message batch count: 1 + pointZ:-61.694100 +Range Message batch count: 1 + pointZ:-61.686300 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-61.6941 +Range Message batch count: 1 + pointZ:-61.951500 +Range Message batch count: 1 + pointZ:-61.951500 +Range Message batch count: 1 + pointZ:-61.955400 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-61.9528 +Range Message batch count: 1 + pointZ:-67.169700 +Range Message batch count: 1 + pointZ:-67.161900 +Range Message batch count: 1 + pointZ:-67.158000 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:-67.1632 +Range Message batch count: 1 + pointZ:16.130400 +Range Message batch count: 1 + pointZ:16.161600 +Range Message batch count: 1 + pointZ:16.157700 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:16.1499 +Range Message batch count: 1 + pointZ:15.954900 +Range Message batch count: 1 + pointZ:15.939300 +Range Message batch count: 1 + pointZ:15.931500 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:15.9419 +Range Message batch count: 1 + pointZ:14.894100 +Range Message batch count: 1 + pointZ:14.905800 +Range Message batch count: 1 + pointZ:14.894100 +jiaozhun xValue:462.22 yValue:-427.5 zValue:108.17 rangeData:14.898 +errorox: \ No newline at end of file diff --git a/HanddleAI/HandleAiUi-new/FrontendBackendBridge.cpp b/HanddleAI/HandleAiUi-new/FrontendBackendBridge.cpp index 2bc26e72..ad0cc2bd 100644 --- a/HanddleAI/HandleAiUi-new/FrontendBackendBridge.cpp +++ b/HanddleAI/HandleAiUi-new/FrontendBackendBridge.cpp @@ -1,6 +1,7 @@ #include #include #include +#include fbBridge bridge; //INIT backEnd::backEnd(QObject* parent) @@ -9,27 +10,6 @@ backEnd::backEnd(QObject* parent) } void backEnd::Init() { - - // - for (auto data : json.LightSources.LightSourceList) - { - //QSerialPort* serialPort = new QSerialPort;//¹âÔ´´®¿Ú - ////serialPort->clear(); - //serialPort->close(); - //serialPort->setPortName(data.comPort); - //serialPort->open(QIODevice::ReadWrite); - //serialPort->setBaudRate(data.baudRate); - //serialPort->setDataBits(QSerialPort::Data8); - //serialPort->setParity(QSerialPort::NoParity); - //serialPort->setStopBits(QSerialPort::OneStop); - //serialPort->setFlowControl(QSerialPort::NoFlowControl); - //serialPort->write(data.initStr.toUtf8()); - //serialPort->waitForBytesWritten(); - //if (serialPort->isOpen() != true) - // qDebug() << data.comPort << "open failure!!"; - //QSerialPorts.append(serialPort); - //QSerialPortsName.append(data.name); - } } diff --git a/HanddleAI/HandleAiUi-new/FrontendBackendBridge.h b/HanddleAI/HandleAiUi-new/FrontendBackendBridge.h index 9cf787a3..eec496c4 100644 --- a/HanddleAI/HandleAiUi-new/FrontendBackendBridge.h +++ b/HanddleAI/HandleAiUi-new/FrontendBackendBridge.h @@ -8,6 +8,7 @@ #include #include #include +#include //æ•°æ�®æŒ‡é’ˆ struct productDataStruct; class appConfig; @@ -61,6 +62,7 @@ public: { } + lightSourceManager _lightSourceManager; appConfig* _appConfig = nullptr; private: diff --git a/HanddleAI/HandleAiUi-new/algo/ALGO_Correction.h b/HanddleAI/HandleAiUi-new/algo/ALGO_Correction.h index 7371b449..e46f0567 100644 --- a/HanddleAI/HandleAiUi-new/algo/ALGO_Correction.h +++ b/HanddleAI/HandleAiUi-new/algo/ALGO_Correction.h @@ -306,7 +306,11 @@ void ALGO_Correction(std::shared_ptr data) return; CorrectionPoints resultPoints; - HalconCorrection(data->correctionData, resultPoints); + if (HalconCorrection(data->correctionData, resultPoints) == false) + { + data->writeBack("short", 274, "1"); + return; + } Point3d point = getRPY(resultPoints); std::cout << "ox:" << resultPoints.Origin[0] << "oy:" << resultPoints.Origin[1] << "oz:" << resultPoints.Origin[2] << std::endl; diff --git a/HanddleAI/HandleAiUi-new/algo/ALGO_Inspection.h b/HanddleAI/HandleAiUi-new/algo/ALGO_Inspection.h index 291291c8..f64fd8a4 100644 --- a/HanddleAI/HandleAiUi-new/algo/ALGO_Inspection.h +++ b/HanddleAI/HandleAiUi-new/algo/ALGO_Inspection.h @@ -5,7 +5,7 @@ #include cv::Mat pinHandleAiEvaluate(std::shared_ptr data, cv::Mat& src, handleAiModelSeg* segPtr, handleAiModelCls* clsPtr); -bool pinHalconEvaluate(cv::Rect& Result, cv::Mat& src, cv::Mat& out, int productType); +bool pinHalconEvaluate(std::shared_ptr data, cv::Rect& Result, cv::Mat& src, cv::Mat& out, int productType); //¹«Í·¶¨Î» std::vector pinDetEvaluate(std::shared_ptr data ,cv::Mat& src, handleAiModelManager* _handleAiModelManager) @@ -44,12 +44,12 @@ void halconEvaluate(std::shared_ptr data, std::vector for (auto& box : connectorPos) { cv::Mat halconMatResult; - bool halconBoolResult = pinHalconEvaluate(BboxToRect(box), src, halconMatResult, box.classes); + bool halconBoolResult = pinHalconEvaluate(data,BboxToRect(box), src, halconMatResult, box.classes); if (halconBoolResult == true) halconImgResult.push_back(halconMatResult);//HALCON¼ì²â½á¹û } } -bool pinHalconEvaluate(cv::Rect& Result, cv::Mat& src,cv::Mat& out,int productType) +bool pinHalconEvaluate(std::shared_ptr data, cv::Rect& Result, cv::Mat& src,cv::Mat& out,int productType) { #pragma region halcon±äÁ¿¶¨Òå //²âÁ¿ @@ -107,6 +107,8 @@ bool pinHalconEvaluate(cv::Rect& Result, cv::Mat& src,cv::Mat& out,int productTy out = HObject2Mat(hv_out_Img_INS); return true; } + if (hv_out_Pings_X.Length() > 0) + data->halconOK = false; out = HObject2Mat(hv_out_Img_INS); return false; //Pings_ROI(ho_in_Image, hv_in_ShapePath, hv_in_Parameter, &hv_out_ROI_Value, &hv_out_Flag_ROI); @@ -160,9 +162,11 @@ cv::Mat pinHandleAiEvaluate(std::shared_ptr data, cv::Mat& src, case 1: color = cv::Scalar(0, 0, 255, 30); clsFileName = "NG1"; + data->aiDetOK = false; break; default: clsFileName = std::to_string(clsRes); + data->aiDetOK = false; } data->clsOriginImgs.push_back(std::make_pair(clsFileName, clsImg)); cv::rectangle(Paint, originRect, color, 2); diff --git a/HanddleAI/HandleAiUi-new/back/backEndManager.cpp b/HanddleAI/HandleAiUi-new/back/backEndManager.cpp index f431dfcd..7e8d4e03 100644 --- a/HanddleAI/HandleAiUi-new/back/backEndManager.cpp +++ b/HanddleAI/HandleAiUi-new/back/backEndManager.cpp @@ -93,7 +93,7 @@ void backEndManager::writeArmStartSignal(int productTypeIn) _appConfig->productDatasMutex.lock(); productTypeStr = _appConfig->productDatas[productTypeIn].name; _appConfig->productDatasMutex.unlock(); - productType = productTypeIn; - _triggerManager->sendFinsMsg("write_short_350_"+QString::number(productTypeIn)); + productType = _appConfig->productDatas[productTypeIn].indexOfArm; + _triggerManager->sendFinsMsg("write_short_350_"+QString::number(productType)); _triggerManager->sendFinsMsg("write_short_351_1"); } \ No newline at end of file diff --git a/HanddleAI/HandleAiUi-new/back/detData.h b/HanddleAI/HandleAiUi-new/back/detData.h index 963074ac..1f5c1394 100644 --- a/HanddleAI/HandleAiUi-new/back/detData.h +++ b/HanddleAI/HandleAiUi-new/back/detData.h @@ -68,8 +68,8 @@ public: } productDataStruct _productDataStruct; //½á¹û - bool aiDetOK = false; - bool halconOK = false; + bool aiDetOK = true; + bool halconOK = true; //´æÍ¼Ïà¹Ø QMutex resultMutex;//½á¹ûÍ¼Ëø std::vector resultImgs;//½á¹ûͼ diff --git a/HanddleAI/HandleAiUi-new/back/lightSource.hpp b/HanddleAI/HandleAiUi-new/back/lightSource.hpp index e69de29b..8a06c410 100644 --- a/HanddleAI/HandleAiUi-new/back/lightSource.hpp +++ b/HanddleAI/HandleAiUi-new/back/lightSource.hpp @@ -0,0 +1,74 @@ +#include +#include +enum lightSourceChannel +{ + AChannel, BChannel, CChannel, DChannel +}; +class lightSource +{ +public: + QSerialPort* serialPort = new QSerialPort(); + lightSource(std::string comName, int baudRate, std::string initStr) + { + serialPort->close(); + serialPort->setPortName(QString::fromStdString(comName)); + serialPort->open(QIODevice::ReadWrite); + serialPort->setBaudRate(baudRate); + serialPort->setDataBits(QSerialPort::Data8); + serialPort->setParity(QSerialPort::NoParity); + serialPort->setStopBits(QSerialPort::OneStop); + serialPort->setFlowControl(QSerialPort::NoFlowControl); + serialPort->write(initStr.c_str()); + serialPort->waitForBytesWritten(); + if (serialPort->isOpen() != true) + qDebug() << comName.c_str() << "open failure!!"; + } + void setValue(lightSourceChannel channelIn,unsigned char value) + { + std::string controlStr; + switch (channelIn) + { + case lightSourceChannel::AChannel: + controlStr = "SA0"; + break; + case lightSourceChannel::BChannel: + controlStr = "SB0"; + break; + case lightSourceChannel::CChannel: + controlStr = "SC0"; + break; + case lightSourceChannel::DChannel: + controlStr = "SD0"; + break; + } + std::string valueStr = std::to_string(value); + if (valueStr.length() < 3) + for (int i = 0; i < 3 - valueStr.length(); i++) + controlStr += "0"; + controlStr += valueStr + "#"; + serialPort->write(controlStr.c_str()); + serialPort->waitForBytesWritten(); + } +}; +class lightSourceManager +{ +public: + lightSourceManager() + { + insertLightSource("COM8", 19200, "SA0000#SB0000#SC0000#SD0000#"); + } + std::unordered_maplightSources; + void insertLightSource(std::string comName ,int baudRate,std::string initStr) + { + lightSource* newLigthSource = new lightSource(comName, baudRate, initStr); + lightSources.insert(std::make_pair(comName, newLigthSource)); + } + lightSource* getLightSourcePtr(std::string comName) + { + auto ptr = lightSources.find(comName); + if (ptr != lightSources.end()) + return ptr->second; + return nullptr; + } +}; +#pragma once \ No newline at end of file diff --git a/HanddleAI/HandleAiUi-new/back/threadPoolManager.cpp b/HanddleAI/HandleAiUi-new/back/threadPoolManager.cpp index d9cbfb35..23888a86 100644 --- a/HanddleAI/HandleAiUi-new/back/threadPoolManager.cpp +++ b/HanddleAI/HandleAiUi-new/back/threadPoolManager.cpp @@ -109,7 +109,7 @@ void threadManager::resultHandle(std::shared_ptr data) cnt++; } } - emit _backEndManager->addDashBoardData(0, data->aiDetOK); + emit _backEndManager->addDashBoardData(1, data->aiDetOK); emit _backEndManager->addDashBoardData(0, data->halconOK); //SQL std::vector sqlDatas; diff --git a/HanddleAI/HandleAiUi-new/back/triggerManager.cpp b/HanddleAI/HandleAiUi-new/back/triggerManager.cpp index 0732aa94..b5fd336a 100644 --- a/HanddleAI/HandleAiUi-new/back/triggerManager.cpp +++ b/HanddleAI/HandleAiUi-new/back/triggerManager.cpp @@ -295,11 +295,9 @@ void triggerManager::decodeCameraCMD(QByteArray byte) correctionData->in_Z_Y0Z.push_back(zValue); correctionData->in_X_Y0Z_Value.push_back(rangeData); } - sendFinsMsg("write_short_261_0");//ÇåÁã sendFinsMsg("write_short_262_1"); sendFinsMsg("write_short_263_1"); - //ÉÏλ»úУÕýÍê³É£¬½«¼Ä´æÆ÷274ÖÃΪ1£¬²¢½«½á¹û°´ÕÕ¶¨ÒåXYZ¹æÔò·ÅÈë310~336ÖÐ if (armPos == 9) { @@ -317,6 +315,7 @@ void triggerManager::decodeCameraCMD(QByteArray byte) if (checkTrigger(300, 1, byte) == true) { + bridge._lightSourceManager.getLightSourcePtr("COM8")->setValue(lightSourceChannel::DChannel, 255); QThread::msleep(1500);//ÑÓʱһÃëµÈ´ý»úе±ÛÍ£ÎÈ sendFinsMsg("write_short_300_0");//´¥·¢ÐźÅÇåÁã sendFinsMsg("write_short_301_1");//¿ªÊ¼¼ì²âÐźŠ@@ -339,6 +338,7 @@ void triggerManager::decodeCameraCMD(QByteArray byte) QThread::msleep(1000);//ÑÓʱһÃëÍê³ÉÅÄÕÕ£¬ºóÐø¸Ä³ÉÅÄÍêÖ±½Ó·¢ËÍ sendFinsMsg("write_short_302_1");//¿ªÊ¼¼ì²âÐźŠ+ bridge._lightSourceManager.getLightSourcePtr("COM8")->setValue(lightSourceChannel::DChannel, 0); } if (checkTrigger(361, 1, byte) == true && armIsRunning == false) diff --git a/HanddleAI/HandleAiUi-new/globalStruct.h b/HanddleAI/HandleAiUi-new/globalStruct.h index bf917186..f00fb967 100644 --- a/HanddleAI/HandleAiUi-new/globalStruct.h +++ b/HanddleAI/HandleAiUi-new/globalStruct.h @@ -17,8 +17,8 @@ #define sColor_Black "22, 22, 22" #define sColor_BlackWithWhite "45, 45, 45" -#define enableHandleAiModel 0 -#define disableBackEndCheck 1 +#define enableHandleAiModel 1 +#define disableBackEndCheck 0 #define disableeAlgo 0 //窗å�£è®¾ç½® diff --git a/HanddleAI/HandleAiUi-new/mainwindow.cpp b/HanddleAI/HandleAiUi-new/mainwindow.cpp index eafee4cd..27965934 100644 --- a/HanddleAI/HandleAiUi-new/mainwindow.cpp +++ b/HanddleAI/HandleAiUi-new/mainwindow.cpp @@ -59,6 +59,7 @@ MainWindow::MainWindow(appConfig* appData, QWidget* parent) showMaximized(); QObject::connect(_loadingWidget.manualBtn, &QPushButton::clicked, this, &MainWindow::switchToManulMode); + //addDashBoardData(0, false); } MainWindow::~MainWindow() diff --git a/HanddleAI/HandleAiUi-new/uiModule/components/dashBoard.h b/HanddleAI/HandleAiUi-new/uiModule/components/dashBoard.h index 1f70f494..54764f1b 100644 --- a/HanddleAI/HandleAiUi-new/uiModule/components/dashBoard.h +++ b/HanddleAI/HandleAiUi-new/uiModule/components/dashBoard.h @@ -3,7 +3,7 @@ class DashboardWidget : public QWidget { public: DashboardWidget(QWidget *parent = nullptr) : QWidget(parent) { - currentValue = 0; + currentValue = 0;//NGå� æ¯” showText = "100%"; setMinimumSize(80, 80); setMaximumSize(100, 100); @@ -16,13 +16,13 @@ public: update(); } } - void setCurrentValue(int value) { - if (value != currentValue) { - currentValue = value; - showText = QString::number((360-value)/360)+ "%"; - update(); - } - } + //void setCurrentValue(int value) { + // if (value != currentValue) { + // currentValue = value; + // showText = QString::number((360-value)/360)+ "%"; + // update(); + // } + //} protected: void paintEvent(QPaintEvent* event) override { diff --git a/HanddleAI/HandleAiUi-new/uiModule/uiModule_summaryDataManager.h b/HanddleAI/HandleAiUi-new/uiModule/uiModule_summaryDataManager.h index 01a78b80..fb0dbf3a 100644 --- a/HanddleAI/HandleAiUi-new/uiModule/uiModule_summaryDataManager.h +++ b/HanddleAI/HandleAiUi-new/uiModule/uiModule_summaryDataManager.h @@ -103,8 +103,12 @@ public: totalLabel->setText(QString::number(OKCount + NGCount)); if(OKCount + NGCount == 0) dashBoard->setCurrentPercentage(0); + else if (NGCount == 0 && OKCount > 0) + dashBoard->setCurrentPercentage(0); + else if (OKCount == 0 && NGCount > 0) + dashBoard->setCurrentPercentage(100); else - dashBoard->setCurrentPercentage(((OKCount * 100) / ((OKCount + NGCount)))); + dashBoard->setCurrentPercentage(((NGCount * 100) / ((OKCount + NGCount)))); } };