diff --git a/doc/偏距数据.png b/doc/偏距数据.png new file mode 100644 index 0000000..10d1fa3 Binary files /dev/null and b/doc/偏距数据.png differ diff --git a/doc/旧抠图算法.txt b/doc/旧抠图算法.txt new file mode 100644 index 0000000..7897aa6 --- /dev/null +++ b/doc/旧抠图算法.txt @@ -0,0 +1,574 @@ +老算法 准确率低 +cv::Mat ImageProcess::findCircleObject(const Mat &src, const Mat& backgroundImg, bool useBackgroundFlag, int nThres /*= 20*/, luffy_base::luffyCircle *pCircle /*= NULL*/) +{ +#ifdef MOTO_DETECT//摩轮型号识别抠图算法 + if (!useBackgroundFlag) + { + Mat detectImg; + cv::resize(src, detectImg, cv::Size(src.cols / REAIZE, src.rows / REAIZE)); + int bBaseX = detectImg.cols; + int bBaseY = detectImg.rows; + equalizeHist(detectImg, detectImg); + detectImg = _EnhanImg_sharpen(detectImg); + + EDCircles edcircles(detectImg); + vector EDCircle = edcircles.getCircles(); + double maxR = 0; + int nIndex = -1; + for (int i = 0; i < EDCircle.size(); i++) + { + int startX = EDCircle[i].center.x - EDCircle[i].r; + int startY = EDCircle[i].center.y - EDCircle[i].r; + if (startX < 0 || startY < 0) + continue; + if (EDCircle[i].center.x + EDCircle[i].r > bBaseX || EDCircle[i].center.y + EDCircle[i].r > bBaseY) + continue; + if (EDCircle[i].r > maxR) + { + maxR = EDCircle[i].r; + nIndex = i; + } + } + if (nIndex != -1) + { + int startX = EDCircle[nIndex].center.x * REAIZE - EDCircle[nIndex].r * REAIZE; + int startY = EDCircle[nIndex].center.y * REAIZE - EDCircle[nIndex].r* REAIZE; + double radius = EDCircle[nIndex].r; + int hight = 2 * radius * REAIZE; + + if (startX > 0 && startY > 0 && hight > 0 \ + && startX < src.cols &&startY < src.rows \ + &&hight < src.cols&&hight < src.rows \ + && startX + hight < src.cols && startY + hight < src.rows) + { + Mat cutMat = src(Rect(startX, startY, hight, hight)); + if (cutMat.data != NULL) + { + //Mat dst; + //double rate = src.cols*1.0 / ALG_RESIZE_IMAGE_WIDTH; + //const cv::Size cSize = cv::Size(cutMat.cols*1.0 / rate, cutMat.rows*1.0 / rate); + //cv::resize(cutMat, dst, cSize); + if (hight < 50) + return Mat(); + cv::Point2d center; + center.x = EDCircle[nIndex].center.x * REAIZE; + center.y = EDCircle[nIndex].center.y * REAIZE; + pCircle->ptCenter = center; + + //float fScale = src.cols / ALG_RESIZE_IMAGE_WIDTH; + //pCircle->fRadius = hight*1.0 / fScale; + pCircle->fRadius = radius * REAIZE; + + //2021-05-10 增加图像大小判断 对超过900像素的图像进行再一次压缩 + if (cutMat.cols >= 900 || cutMat.rows >= 900) + { + Mat newCutImg; + cv::resize(cutMat, newCutImg, cv::Size(cutMat.cols / REAIZE, cutMat.rows / REAIZE)); + pCircle->fRadius = pCircle->fRadius / REAIZE; + return newCutImg; + } + return cutMat; + } + } + } + return Mat(); + } + else + { + if (src.empty() || backgroundImg.empty() || src.rows < 500) { + return Mat(); + } + + assert(backgroundImg.type() == CV_8UC1); + + Mat imgTmp, imgBinary; + const cv::Size cSize = cv::Size(ALG_RESIZE_IMAGE_WIDTH, floorf(ALG_RESIZE_IMAGE_WIDTH / (float)src.cols*(float)src.rows)); + cv::resize(src, imgTmp, cSize); + Mat foregroundImg = getForeImage(imgTmp, backgroundImg);// 0421 + + cv::resize(foregroundImg, foregroundImg, cv::Size(src.cols / REAIZE, src.rows / REAIZE)); + + using namespace luffy_base; + luffy_threshold::Threshold(foregroundImg, imgBinary, nThres);//0421 + + Mat dilatedImgBin; + dilate(imgBinary, dilatedImgBin, Mat::ones(21, 21, CV_32FC1)); + erode(dilatedImgBin, imgBinary, Mat::ones(21, 21, CV_32FC1)); + openOper(imgBinary, Mat::ones(1, 11, CV_32FC1)); + + vector> conts; + cv::findContours(imgBinary, conts, RETR_EXTERNAL, CHAIN_APPROX_NONE); + imgBinary.setTo(0); + + for (int i = 0; i < conts.size(); i++) { + const vector &pt = conts.at(i); + if (pt.size() < 20) { + continue; + } + Rect rt = boundingRect(pt); + if (rt.width < 5 || rt.height < 5) { + continue; + } + drawContours(imgBinary, conts, i, Scalar::all(255), -1); + } + + Mat hit; vector pts; + luffy_hit::firstHit4Circle(imgBinary, hit, pts, Point(cSize.width / 2, cSize.height / 2), 0, cSize.width / 2, 360, luffy_hit::emHitOut2In); + + int nMinFitNum = 100; + luffy_imageProc::RansacParam rs(0.01, 3, 150, nMinFitNum, 240); + vector pts2 = luffy_imageProc::fitModelbyRansac(pts, luffy_imageProc::emModelCircle, &rs); + + float fRadius; + Point2f ptCenter; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius, ptCenter); + + if (!bFind) { + return Mat(); + } + Mat dst; + const int nOffset = 1; + fRadius += nOffset; + Rect rt(ptCenter.x - fRadius + nOffset, ptCenter.y - fRadius + nOffset, 2 * fRadius, 2 * fRadius); + rt &= Rect(0, 0, imgTmp.cols, imgTmp.rows); + imgTmp(rt).copyTo(dst); + static int nCount = cv::getTickCount(); + if (pCircle) { + /*float fScale = src.cols / ALG_RESIZE_IMAGE_WIDTH; + Mat matBig = src - backgroundImg; + pCircle->fRadius = fRadius * fScale; + pCircle->ptCenter = Point(ptCenter.x * fScale, ptCenter.y * fScale); + Rect rt(pCircle->ptCenter.x - pCircle->fRadius + nOffset, pCircle->ptCenter.y - pCircle->fRadius + nOffset, 2 * pCircle->fRadius, 2 * pCircle->fRadius); + rt &= Rect(0, 0, matBig.cols, matBig.rows); + src(rt).copyTo(dst);*/ + float fScale = src.cols / ALG_RESIZE_IMAGE_WIDTH; + Mat matBig = src - backgroundImg; + pCircle->fRadius = fRadius * fScale; + pCircle->ptCenter = Point(ptCenter.x * fScale, ptCenter.y * fScale); + + Mat matBinary; + luffy_threshold::Threshold(matBig, matBinary, nThres); + // add + openOper(matBinary, Mat::ones(3, 3, CV_32FC1)); + Mat hit; vector pts; + luffy_hit::firstHit4Circle(matBinary, hit, pts, pCircle->ptCenter, 0, pCircle->fRadius + 20, 360, luffy_hit::emHitOut2In);//luffy_hit::emHitOut2In + std::map mp; + std::for_each(pts.begin(), pts.end(), [&](Point p) { + double dis = fabs(luffy_math::disofPoints(pCircle->ptCenter, p)); + mp[dis] = p; + }); + + const int bound = 200; + //int startIndex = mp.size() - bound; + std::map::iterator it = mp.begin(); + //std::advance(it, startIndex); + std::vector ppts; + int i = 0; + for (it; it != mp.end(); ++it, ++i) + { + if (i == bound) break; + ppts.push_back(it->second); + } + luffy_imageProc::RansacParam rs(0.01, 5.0, 300, 70, 120); + vector pts2 = luffy_imageProc::fitModelbyRansac(ppts, luffy_imageProc::emModelCircle, &rs); + float fRadius2; + Point2f ptCenter2; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius2, ptCenter2); + if (bFind) { + pCircle->fRadius = fRadius2; + pCircle->ptCenter = ptCenter2; + Rect rt(ptCenter2.x - fRadius2 + nOffset, ptCenter2.y - fRadius2 + nOffset, 2 * fRadius2, 2 * fRadius2); + + if (rt.x < 0 || rt.y < 0 || rt.x + rt.width > matBinary.cols || rt.y + rt.height > matBinary.rows) { + return Mat(); + } + rt &= Rect(0, 0, matBinary.cols, matBinary.rows); + src(rt).copyTo(dst); + } + else + { + return Mat(); + } + } + return dst; + } + + +#else//汽轮型号识别抠图算法 +/* +2020-06-19 使用三种预防措施找圆 +第一阶梯 使用EDCircle算法,图像经过2.5倍增亮找圆 +如若在第一阶梯没有找到圆(找到的圆不符合条件),进入第二阶梯 +第二阶梯 使用EDCircle算法,图像改为原图 +如若在第二阶梯还没找到圆,进入第三阶梯使用传统找圆算法(结合监测背景图) +第三阶梯不管怎样都会找出一个最佳圆 +*/ + + if (src.empty() || backgroundImg.empty() || src.rows < 500) { + return Mat(); + } + bool findFlag = false; + /*第一阶梯找圆*/ + assert(backgroundImg.type() == CV_8UC1); + Mat detectImg; + cv::resize(src, detectImg, cv::Size(src.cols / REAIZE, src.rows / REAIZE)); + int bBaseX = detectImg.cols; + int bBaseY = detectImg.rows; + Mat upLight_Img = detectImg + 1.5 * detectImg;//20200423 修改 对图像进行叠加,增强目标亮度 + blur(upLight_Img, upLight_Img, Size(3, 3)); + EDCircles edcircles(upLight_Img); + vector EDCircle = edcircles.getCircles(); + double maxR = 0; + int nIndex = -1; + for (int i = 0; i < EDCircle.size(); i++) + { + int startX = EDCircle[i].center.x - EDCircle[i].r; + int startY = EDCircle[i].center.y - EDCircle[i].r; + if (startX < 0 || startY <0) + continue; + if (EDCircle[i].center.x + EDCircle[i].r> bBaseX || EDCircle[i].center.y + EDCircle[i].r>bBaseY) + continue; + if (EDCircle[i].r > maxR) + { + maxR = EDCircle[i].r; + nIndex = i; + } + } + if (nIndex != -1) + { + int startX = EDCircle[nIndex].center.x * REAIZE - EDCircle[nIndex].r * REAIZE; + int startY = EDCircle[nIndex].center.y * REAIZE - EDCircle[nIndex].r* REAIZE; + double centerX = EDCircle[nIndex].center.x * REAIZE; + double centerY = EDCircle[nIndex].center.y * REAIZE; + double radius = EDCircle[nIndex].r; + + + if (radius < 50)//小于阈值 进行二次查找 radius一般大于100,小于50像素的基本是其他小圆 + {/*第二阶梯找圆 2020 - 06 - 19 添加 原图查找圆*/ + blur(detectImg, detectImg, Size(3,3)); + EDCircles edcircles2(detectImg); + vector EDCircle2 = edcircles2.getCircles(); + double maxR = 0; + int mIndex = -1; + for (int i = 0; i < EDCircle2.size(); i++) + { + int startX = EDCircle2[i].center.x - EDCircle2[i].r; + int startY = EDCircle2[i].center.y - EDCircle2[i].r; + if (startX < 0 || startY < 0) + continue; + if (EDCircle2[i].center.x + EDCircle2[i].r > bBaseX || EDCircle2[i].center.y + EDCircle2[i].r > bBaseY) + continue; + if (EDCircle2[i].r > maxR) + { + maxR = EDCircle2[i].r; + mIndex = i; + } + } + if (mIndex == -1) + return Mat(); + startX = EDCircle2[nIndex].center.x * REAIZE - EDCircle2[nIndex].r * REAIZE; + startY = EDCircle2[nIndex].center.y * REAIZE - EDCircle2[nIndex].r* REAIZE; + centerX = EDCircle2[nIndex].center.x * REAIZE; + centerY = EDCircle2[nIndex].center.y * REAIZE; + radius = EDCircle2[nIndex].r; + + if (radius < 50)/*第三阶梯找圆*/ + { + if (src.empty() || backgroundImg.empty() || src.rows < 500) { + return Mat(); + } + assert(backgroundImg.type() == CV_8UC1); + Mat imgTmp, imgBinary; + const cv::Size cSize = cv::Size(ALG_RESIZE_IMAGE_WIDTH, floorf(ALG_RESIZE_IMAGE_WIDTH / (float)src.cols*(float)src.rows)); + cv::resize(src, imgTmp, cSize); + Mat foregroundImg = getForeImage(imgTmp, backgroundImg);// 0421 + using namespace luffy_base; //nThres = 90; + luffy_threshold::Threshold(foregroundImg, imgBinary, nThres);//0421 + + Mat dilatedImgBin; + closeOper(imgBinary, 7); + vector> conts; + cv::findContours(imgBinary, conts, RETR_EXTERNAL, CHAIN_APPROX_NONE); + imgBinary.setTo(0); + //筛选最大轮廓的作为圆拟合区域 + int maxsize = 0; + int nbestIndex = 0; + for (int i = 0; i < conts.size(); i++) + { + if (conts.at(i).size()>maxsize) + { + maxsize = conts.at(i).size(); + nbestIndex = i; + } + } + if (conts.size() > 0) + { + drawContours(imgBinary, vector>(1, conts.at(nbestIndex)), -1, Scalar::all(255), -1); + } + Mat hit; vector pts; + luffy_hit::firstHit4Circle(imgBinary, hit, pts, Point(cSize.width / 2, cSize.height / 2), 0, cSize.width / 2, 360, luffy_hit::emHitOut2In); + int nMinFitNum = 150; + if (pts.size() < nMinFitNum)//解决检测目标在图像边缘导致的抠图识别问题 + { + if (conts.size()>0) + pts = conts.at(nbestIndex); + } + + luffy_imageProc::RansacParam rs(0.01, 2, 150, nMinFitNum, 240); + vector pts2 = luffy_imageProc::fitModelbyRansac(pts, luffy_imageProc::emModelCircle, &rs); + float fRadius; + Point2f ptCenter; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius, ptCenter); + + if (!bFind) { + return Mat(); + } + Mat dst; + const int nOffset = 1; + fRadius += nOffset; + Rect rt(ptCenter.x - fRadius + nOffset, ptCenter.y - fRadius + nOffset, 2 * fRadius, 2 * fRadius); + rt &= Rect(0, 0, imgTmp.cols, imgTmp.rows); + imgTmp(rt).copyTo(dst); + static int nCount = cv::getTickCount(); + if (pCircle) { + float fScale = src.cols / ALG_RESIZE_IMAGE_WIDTH; + Mat matBig = src - backgroundImg; + pCircle->fRadius = fRadius * fScale; + pCircle->ptCenter = Point(ptCenter.x * fScale, ptCenter.y * fScale); + + Mat matBinary; + luffy_threshold::Threshold(matBig, matBinary, nThres); + Mat hit; vector pts; + luffy_hit::firstHit4Circle(matBinary, hit, pts, pCircle->ptCenter, 0, pCircle->fRadius + 10, 360, luffy_hit::emHitOut2In);//luffy_hit::emHitOut2In + luffy_imageProc::RansacParam rs(0.01, 2.5, 200, 150, 220); + vector pts2 = luffy_imageProc::fitModelbyRansac(pts, luffy_imageProc::emModelCircle, &rs); + float fRadius2; + Point2f ptCenter2; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius2, ptCenter2); + if (bFind) { + pCircle->fRadius = fRadius2; + pCircle->ptCenter = ptCenter2; + Rect rt(ptCenter2.x - fRadius2 + nOffset, ptCenter2.y - fRadius2 + nOffset, 2 * fRadius2, 2 * fRadius2); + + if (rt.x < 0 || rt.y < 0 || rt.x + rt.width > matBinary.cols || rt.y + rt.height > matBinary.rows) { + return Mat(); + } + rt &= Rect(0, 0, matBinary.cols, matBinary.rows); + src(rt).copyTo(dst); + int nWidth = ((int)((double)dst.cols / fScale / 4)) * 4; + cv::resize(dst, dst, cv::Size(nWidth, nWidth)); + } + } + + return dst; + } + } + + + int hight = 2 * radius * REAIZE; + + if (startX > 0 && startY > 0 && hight > 0 \ + && startX < src.cols &&startY < src.rows \ + &&hight < src.cols&&hight < src.rows \ + && startX+hightptCenter = center; + pCircle->fRadius = radius * REAIZE / rate; + return dst; + } + } + } + return Mat(); + + /*以下为旧代码 目前不使用*/ + if (src.empty() || backgroundImg.empty() || src.rows < 500) { + return Mat(); + } + + assert(backgroundImg.type() == CV_8UC1); + + Mat imgTmp, imgBinary; + const cv::Size cSize = cv::Size(ALG_RESIZE_IMAGE_WIDTH, floorf(ALG_RESIZE_IMAGE_WIDTH / (float)src.cols*(float)src.rows)); + cv::resize(src, imgTmp, cSize); + + Mat foregroundImg = getForeImage(imgTmp, backgroundImg);// 0421 + + using namespace luffy_base; //nThres = 90; + luffy_threshold::Threshold(foregroundImg, imgBinary, nThres);//0421 + + Mat dilatedImgBin; + closeOper(imgBinary, 7); + //dilate(imgBinary, dilatedImgBin, Mat::ones(7, 7, CV_32FC1));// + //erode(dilatedImgBin, imgBinary, Mat::ones(7, 7, CV_32FC1)); + //openOper(imgBinary, Mat::ones(1, 13, CV_32FC1));//集智抠图问题修改 20190329 + + vector> conts; + cv::findContours(imgBinary, conts, RETR_EXTERNAL, CHAIN_APPROX_NONE); + imgBinary.setTo(0); + + /* + for (int i = 0; i < conts.size(); i++) { + const vector &pt = conts.at(i); + if (pt.size() < 20) { + continue; + } + Rect rt = boundingRect(pt); + if (rt.width < 5 || rt.height < 5) { + continue; + } + drawContours(imgBinary, conts, i, Scalar::all(255), -1); + } + */ + +//筛选最大轮廓的作为圆拟合区域 + int maxsize = 0; + int nbestIndex = 0; + for (int i = 0; i < conts.size(); i++) + { + if (conts.at(i).size()>maxsize) + { + maxsize = conts.at(i).size(); + nbestIndex = i; + } + } + if (conts.size() > 0) + { + drawContours(imgBinary, vector>(1,conts.at(nbestIndex)), -1, Scalar::all(255), -1); + } + //openOper(imgBinary, 17);//集智抠图问题修改 20190329 + + + Mat hit; vector pts; + luffy_hit::firstHit4Circle(imgBinary, hit, pts, Point(cSize.width / 2, cSize.height / 2), 0, cSize.width/ 2, 360, luffy_hit::emHitOut2In); + + //luffy_imageProc::RansacParam rs(0.02, 2.5, 70, 100, 220); + //luffy_imageProc::RansacParam rs(0.01, 2, 150, 150, 240);//20190117 + + int nMinFitNum = 150; + + if (pts.size() < nMinFitNum)//解决检测目标在图像边缘导致的抠图识别问题 + { + if (conts.size()>0) + pts = conts.at(nbestIndex); + } + + luffy_imageProc::RansacParam rs(0.01, 2, 150, nMinFitNum, 240); + vector pts2 = luffy_imageProc::fitModelbyRansac(pts, luffy_imageProc::emModelCircle, &rs); +#ifdef _DEBUG + Mat imgColor; + cv::cvtColor(imgTmp, imgColor, CV_GRAY2BGR); + for (int i = 0; i < pts.size(); i++) { + imgColor.at(pts.at(i))[0] = 255;//B + imgColor.at< cv::Vec3b >(pts.at(i))[1] = 0;//G + imgColor.at< cv::Vec3b >(pts.at(i))[2] = 0;//R + } + for (int i = 0; i < pts2.size(); i++) { + imgColor.at(pts2.at(i))[0] = 0;//B + imgColor.at< cv::Vec3b >(pts2.at(i))[1] = 0;//G + imgColor.at< cv::Vec3b >(pts2.at(i))[2] = 255;//R + } +#endif + + float fRadius; + Point2f ptCenter; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius, ptCenter); + + if (!bFind) { + return Mat(); + } + Mat dst; + const int nOffset = 1; + fRadius += nOffset; + Rect rt(ptCenter.x - fRadius + nOffset, ptCenter.y - fRadius + nOffset, 2 * fRadius, 2 * fRadius); + rt &= Rect(0, 0, imgTmp.cols, imgTmp.rows); + imgTmp(rt).copyTo(dst); + static int nCount = cv::getTickCount(); + if (pCircle) { + float fScale = src.cols / ALG_RESIZE_IMAGE_WIDTH; + Mat matBig = src - backgroundImg; + pCircle->fRadius = fRadius * fScale; + pCircle->ptCenter = Point(ptCenter.x * fScale, ptCenter.y * fScale); + + Mat matBinary; + luffy_threshold::Threshold(matBig, matBinary, nThres); + Mat hit; vector pts; + luffy_hit::firstHit4Circle(matBinary, hit, pts, pCircle->ptCenter, 0, pCircle->fRadius + 10, 360, luffy_hit::emHitOut2In);//luffy_hit::emHitOut2In + luffy_imageProc::RansacParam rs(0.01, 2.5, 200, 150, 220); + vector pts2 = luffy_imageProc::fitModelbyRansac(pts, luffy_imageProc::emModelCircle, &rs); + float fRadius2; + Point2f ptCenter2; + bool bFind = luffy_imageProc::lsCircleFit(pts2, fRadius2, ptCenter2); + if (bFind) { + pCircle->fRadius = fRadius2; + pCircle->ptCenter = ptCenter2; + Rect rt(ptCenter2.x - fRadius2 + nOffset, ptCenter2.y - fRadius2 + nOffset, 2 * fRadius2, 2 * fRadius2); + + if (rt.x < 0 || rt.y < 0 || rt.x + rt.width > matBinary.cols || rt.y + rt.height > matBinary.rows ) { + return Mat(); + } + rt &= Rect(0, 0, matBinary.cols, matBinary.rows); + src(rt).copyTo(dst); + int nWidth = ((int)((double)dst.cols / fScale / 4)) * 4; + cv::resize(dst, dst, cv::Size(nWidth, nWidth)); + } + } + +return dst; + +#endif +} + + + +// CircleDetector cd; +// cd.setAlgoType(CircleDetector::PeakCircle); +// cd.setEdgeWidth(cParam.CircleEdgeWidth); +// +// if (cParam.CirclePolarity == 0) +// cd.setPolarity(Polarity::Black2White); +// else +// cd.setPolarity(Polarity::White2Black); +// +// cd.setFindBy(FindBy::Best); +// double difRadiusMin = 0; +// double difRadiusMax = (foregroundImg.cols>foregroundImg.rows? foregroundImg.rows/2 : foregroundImg.cols/2)-50; +// cd.setRadii(difRadiusMin, difRadiusMax); +// cd.setACThres(cParam.CircleACThres); +// vector allScores; +// Vec3f bestCircle; +// float bestScore = cd.detectBest(foregroundImg, Point2f(imgTmp.cols/2, imgTmp.rows/2), bestCircle, &allScores); +// if (abs(bestScore) <= FLT_EPSILON || bestCircle == Vec3f::zeros()) { +// return Mat(); +// } +// +// Point2f cen(bestCircle[0], bestCircle[1]); +// double r = bestCircle[2]; +// Rect rect; +// rect.x = cen.x - r; +// rect.y = cen.y - r; +// if (rect.x < 0) +// rect.x = 0; +// if (rect.y < 0) +// rect.y = 0; +// rect.width = 2 * r; +// rect.height = 2 * r; +// Mat rltMat = src(rect); +// if (pCircle) +// { +// pCircle->fRadius = r; +// pCircle->ptCenter = cen; +// } +// return rltMat; diff --git a/runner17/language/English/lpmain_en.qm b/runner17/language/English/lpmain_en.qm index 72aaea6..33a4b0d 100644 Binary files a/runner17/language/English/lpmain_en.qm and b/runner17/language/English/lpmain_en.qm differ diff --git a/src/algorithm/ImageProcess.cpp b/src/algorithm/ImageProcess.cpp index 00c8bd0..843ad12 100644 --- a/src/algorithm/ImageProcess.cpp +++ b/src/algorithm/ImageProcess.cpp @@ -77,6 +77,8 @@ cv::Mat ImageProcess::findCircle(const Mat &srcImg, Point2f& center, double &rad { int startX = EDCircle[i].center.x - EDCircle[i].r; int startY = EDCircle[i].center.y - EDCircle[i].r; + centerX = EDCircle[i].center.x * REAIZE; + centerY = EDCircle[i].center.y * REAIZE; if (startX < 0 || startY < 0) continue; if (EDCircle[i].center.x + EDCircle[i].r > bBaseX || EDCircle[i].center.y + EDCircle[i].r > bBaseY) @@ -209,6 +211,8 @@ cv::Mat ImageProcess::findCircleByBackground(const Mat &srcImg, const Mat& backg float centerY = 0; for (int i = 0; i < EDCircle.size(); i++) { + centerX = EDCircle[i].center.x * REAIZE; + centerY = EDCircle[i].center.y * REAIZE; int startX = EDCircle[i].center.x - EDCircle[i].r; int startY = EDCircle[i].center.y - EDCircle[i].r; if (startX < 0 || startY < 0) diff --git a/src/tpMain/DetectState.cpp b/src/tpMain/DetectState.cpp index 1418fb2..84433a3 100644 --- a/src/tpMain/DetectState.cpp +++ b/src/tpMain/DetectState.cpp @@ -31,7 +31,6 @@ DetectState::DetectState() DetectState::~DetectState() { - //save(); } void DetectState::init(QString strPath) diff --git a/src/tpMain/WheelModel.cpp b/src/tpMain/WheelModel.cpp index 2454dcc..3b28118 100644 --- a/src/tpMain/WheelModel.cpp +++ b/src/tpMain/WheelModel.cpp @@ -70,12 +70,11 @@ bool WheelModel::initComModel(const QString&strBase) m_pDetectModel = new ImageCompareModel; } QString str = strBase + "template\\" + m_strModelID + "\\model.yml"; - //QString str = strBase + "模板\\" + m_strModelID + "\\model.yml"; std::string strs = str.toLocal8Bit().toStdString(); - bool bFlags = m_pDetectModel->readFromFile(strs/*str.toLatin1().data()*/); + bool bFlags = m_pDetectModel->readFromFile(strs); if (!bFlags) { m_pDetectModel->train(m_pTempImage->getImgVector()); - bFlags = m_pDetectModel->save2file(strs/*string((const char *)str.toLocal8Bit())*/); + bFlags = m_pDetectModel->save2file(strs); } return bFlags; } @@ -161,15 +160,10 @@ void WheelModel::setRepeatNum(int nValue) int WheelModel::getRepeatNum() const { return m_pDetectModel->getRepeatNum(); - //return m_nRotate; } ICompareModel * WheelModel::getImageComModel() const { -// if (!m_pDetectModel) -// { -// m_pDetectModel = new ImageCompareModel; -// } return m_pDetectModel; } diff --git a/src/tpMain/WheelNet.cpp b/src/tpMain/WheelNet.cpp index 8aae5f7..5786f83 100644 --- a/src/tpMain/WheelNet.cpp +++ b/src/tpMain/WheelNet.cpp @@ -2,15 +2,15 @@ #include "InfoFile.h" #include "..\NetWheel\net4wheel_global.h" #include "QZkJsonParser.h" -#include "qlibrary.h" -#include "qhostaddress.h" -#include "QDebug" +#include +#include +#include #include "qipconfigdlg.h" -#include "qdebug.h" +#include "lpGlobalData.h" + #define JSONG_MYSELF_FILE "\\user\\selfdefine.json" #pragma execution_character_set("utf-8") - //emTypeResultChannel 结果通道 0x16 //emTypeTriger 设置触发延时相关参数 CWheelNet::CWheelNet(QString strRoot) @@ -99,11 +99,8 @@ bool CWheelNet::loadNet() #endif if (lib.load()){ _Net4WheelCreate func = (_Net4WheelCreate)lib.resolve("Net4WheelCreate"); - //QHostAddress *pAdd = new QHostAddress; - QHostAddress pAdd;// = new QHostAddress; + QHostAddress pAdd; pAdd.setAddress(m_pIpConfig->m_TcpAddress); - //pAdd->setAddress(m_pIpConfig->m_TcpAddress); - //m_pNet4Wheel = func(*pAdd, m_pIpConfig->m_TcpPort); m_pNet4Wheel = func(pAdd, m_pIpConfig->m_TcpPort); connect(m_pNet4Wheel, SIGNAL(RecvDatas(QByteArray)), this, SLOT(DataRecvByte(QByteArray))); connect(m_pNet4Wheel, SIGNAL(SignalConnect(QVariantMap)), this, SLOT(onConnect(QVariantMap))); @@ -121,7 +118,6 @@ void CWheelNet::sendData(QString strData) arr.append(strData); if (m_pIpConfig){ QString strTarget = genAddressPort(m_pIpConfig->m_ClientAddress, QString::number(m_pIpConfig->m_ClientPort)); - //m_pNet4Wheel->sendDatas(strTarget, arr); emit sgSendData2Dv(strTarget, arr); } } @@ -129,7 +125,6 @@ void CWheelNet::sendData(QString strData) bool CWheelNet::sendDataFrame(QString strData) { /*调用框架接口 发送网络数据*/ - //m_pCallBack return true; } @@ -318,6 +313,19 @@ Q_SLOT void CWheelNet::onConnect(QVariantMap vMap) if (client_State == "Disconnect" || client_State == "close listen ") { bConnect = false; } + + if (m_type == "client") + { + QString state = vMap.value("client_state").toString(); + if (state == "connect") + { + lpGlobalData::instance()->m_plcConnect = true; + } + else { + lpGlobalData::instance()->m_plcConnect = false; + } + } + QString str = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); str.append(":\n"); str.append("type=" + m_type + " " + "address:" + address + " sourcePort:" + port + " is " + client_State); diff --git a/src/tpMain/cryptokey/QCryptokeyUI.cpp b/src/tpMain/cryptokey/QCryptokeyUI.cpp index 00c274b..6d00f64 100644 --- a/src/tpMain/cryptokey/QCryptokeyUI.cpp +++ b/src/tpMain/cryptokey/QCryptokeyUI.cpp @@ -38,7 +38,7 @@ Q_SLOT void QCryptokeyUI::onButtonClicked() QString strKey = ui.textEdit->toPlainText(); if (strKey.isEmpty()) { - QMessageBox::information(this, tr("提示"), "请输入注册码"); + QMessageBox::information(this, tr("提示"), tr("请输入注册码")); return; } QString strSerialNo = ui.m_lineEdit_Serial->text(); @@ -46,15 +46,15 @@ Q_SLOT void QCryptokeyUI::onButtonClicked() if (check == false) { - QMessageBox::information(this, tr("提示"), "注册码不匹配,请重新输入"); + QMessageBox::information(this, tr("提示"), tr("注册码不匹配,请重新输入")); return; } else { - ui.m_label_Active->setText("已激活"); + ui.m_label_Active->setText(tr("已激活")); ui.m_label_Active->setStyleSheet("color:rgb(10, 201, 10)"); emit sgRegisterFinish(true); - QMessageBox::information(this, tr("提示"), "系统激活完成"); + QMessageBox::information(this, tr("提示"), tr("系统激活完成")); } } else if (strObj == "pushButton_2") diff --git a/src/tpMain/qaddchanneldlg.cpp b/src/tpMain/qaddchanneldlg.cpp index 61d7556..764ca02 100644 --- a/src/tpMain/qaddchanneldlg.cpp +++ b/src/tpMain/qaddchanneldlg.cpp @@ -44,3 +44,11 @@ Q_SLOT void QAddChannelDlg::SlotFunc() QDialog::close(); } } + +void QAddChannelDlg::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} \ No newline at end of file diff --git a/src/tpMain/qaddchanneldlg.h b/src/tpMain/qaddchanneldlg.h index d055d85..63ebe20 100644 --- a/src/tpMain/qaddchanneldlg.h +++ b/src/tpMain/qaddchanneldlg.h @@ -11,8 +11,10 @@ public: QAddChannelDlg(QWidget *parent = 0); ~QAddChannelDlg(); Q_SLOT void SlotFunc(); - QString GetData(QString &Channelname,int &m_value); - + + QString GetData(QString &Channelname, int &m_value); +protected: + virtual void changeEvent(QEvent *event); private: Ui::QAddChannelDlg ui; QString m_Channelname; diff --git a/src/tpMain/qaddmodel.cpp b/src/tpMain/qaddmodel.cpp index 00388d0..620f060 100644 --- a/src/tpMain/qaddmodel.cpp +++ b/src/tpMain/qaddmodel.cpp @@ -56,4 +56,10 @@ void QAddModel::SetClearData() ui.wf_model_edit_ply->setText(""); } - +void QAddModel::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qaddmodel.h b/src/tpMain/qaddmodel.h index 9c75b99..530aeef 100644 --- a/src/tpMain/qaddmodel.h +++ b/src/tpMain/qaddmodel.h @@ -25,6 +25,8 @@ public: QMap getData(); void SetClearData(); +protected: + virtual void changeEvent(QEvent *event); }; #endif // QADDMODEL_H diff --git a/src/tpMain/qaddtimedlg.cpp b/src/tpMain/qaddtimedlg.cpp index 60f8e5d..1a8ed96 100644 --- a/src/tpMain/qaddtimedlg.cpp +++ b/src/tpMain/qaddtimedlg.cpp @@ -59,3 +59,11 @@ Q_SLOT void QAddTimeDlg::SlotCancle() { QDialog::close(); } + +void QAddTimeDlg::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qaddtimedlg.h b/src/tpMain/qaddtimedlg.h index 7aedc73..689eb48 100644 --- a/src/tpMain/qaddtimedlg.h +++ b/src/tpMain/qaddtimedlg.h @@ -13,8 +13,11 @@ public: ~QAddTimeDlg(); Q_SLOT void SlotOK(); Q_SLOT void SlotCancle(); - void SetInfo(TimeStruct m_timeStruct, int model=0); + + void SetInfo(TimeStruct m_timeStruct, int model = 0); void GetInfo(TimeStruct &m_timeStruct); +protected: + virtual void changeEvent(QEvent *event); private: Ui::QAddTimeDlg ui; }; diff --git a/src/tpMain/qchannelmanager.cpp b/src/tpMain/qchannelmanager.cpp index ed0a4bc..e24ac5d 100644 --- a/src/tpMain/qchannelmanager.cpp +++ b/src/tpMain/qchannelmanager.cpp @@ -136,4 +136,12 @@ void QChannelManager::updateShow() nIndex++; } } -} \ No newline at end of file +} + +void QChannelManager::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qchannelmanager.h b/src/tpMain/qchannelmanager.h index fbefa9e..ae5504e 100644 --- a/src/tpMain/qchannelmanager.h +++ b/src/tpMain/qchannelmanager.h @@ -16,6 +16,8 @@ public: Q_SLOT void SlotcellClicked(const QModelIndex & index); Q_SLOT void onOkMody(); void updateShow(); +protected: + virtual void changeEvent(QEvent *event); private: Ui::QChannelManager ui; class QTableView *channelMgr_tableView; diff --git a/src/tpMain/qdia2thsetting.cpp b/src/tpMain/qdia2thsetting.cpp index dff00c8..848a2ec 100644 --- a/src/tpMain/qdia2thsetting.cpp +++ b/src/tpMain/qdia2thsetting.cpp @@ -33,3 +33,10 @@ Q_SLOT void QDia2ThSetting::onChangeValue() infobox.exec(); emit sgSavePara(); } +void QDia2ThSetting::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} \ No newline at end of file diff --git a/src/tpMain/qdia2thsetting.h b/src/tpMain/qdia2thsetting.h index a3db031..acaafe8 100644 --- a/src/tpMain/qdia2thsetting.h +++ b/src/tpMain/qdia2thsetting.h @@ -13,6 +13,8 @@ public: ~QDia2ThSetting(); void SetValue(float *m_B, float *m_K); Q_SLOT void onChangeValue(); +protected: + virtual void changeEvent(QEvent *event); signals: void sgSavePara(); private: diff --git a/src/tpMain/qipconfigdlg.cpp b/src/tpMain/qipconfigdlg.cpp index c706338..d8e5802 100644 --- a/src/tpMain/qipconfigdlg.cpp +++ b/src/tpMain/qipconfigdlg.cpp @@ -71,3 +71,11 @@ Q_SLOT void QIPConfigDlg::SlotOK() { QDialog::accept(); } + +void QIPConfigDlg::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qipconfigdlg.h b/src/tpMain/qipconfigdlg.h index 7b381eb..fedd11a 100644 --- a/src/tpMain/qipconfigdlg.h +++ b/src/tpMain/qipconfigdlg.h @@ -30,6 +30,8 @@ public: Q_SLOT void SlotCloseServer(); Q_SLOT void SlotOpenServer(); Q_SLOT void SlotOK(); +protected: + virtual void changeEvent(QEvent *event); private: Ui::QIPConfigDlg ui; signals: diff --git a/src/tpMain/qshowimg.cpp b/src/tpMain/qshowimg.cpp index 783e8aa..cf70e58 100644 --- a/src/tpMain/qshowimg.cpp +++ b/src/tpMain/qshowimg.cpp @@ -31,3 +31,11 @@ void QShowImg::setPicPath(QString m_filePath /*= QString()*/) ui.label->setPixmap(m_pix.scaled(nwidth,370)); } } + +void QShowImg::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qshowimg.h b/src/tpMain/qshowimg.h index f656a62..4945ed8 100644 --- a/src/tpMain/qshowimg.h +++ b/src/tpMain/qshowimg.h @@ -12,7 +12,10 @@ public: QShowImg(QWidget *parent = 0); ~QShowImg(); Q_SLOT void setPicPath(QString m_filePath); + Q_SLOT void showImg(); +protected: + virtual void changeEvent(QEvent *event); signals: void sgChangeImg(); private: diff --git a/src/tpMain/qworkItemdlg.cpp b/src/tpMain/qworkItemdlg.cpp index dc67f34..dbe037f 100644 --- a/src/tpMain/qworkItemdlg.cpp +++ b/src/tpMain/qworkItemdlg.cpp @@ -50,3 +50,12 @@ Q_SLOT void QWorkItemDlg::onOk() QDialog::accept(); } +void QWorkItemDlg::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} + + diff --git a/src/tpMain/qworkItemdlg.h b/src/tpMain/qworkItemdlg.h index 94bd5f7..3f3f739 100644 --- a/src/tpMain/qworkItemdlg.h +++ b/src/tpMain/qworkItemdlg.h @@ -19,7 +19,8 @@ public: }; private: Q_SLOT void onOk(); - +protected: + virtual void changeEvent(QEvent *event); private: Ui::QWorkItemUI ui; diff --git a/src/tpMain/qworkmgrui.cpp b/src/tpMain/qworkmgrui.cpp index 0e01a55..d76fac8 100644 --- a/src/tpMain/qworkmgrui.cpp +++ b/src/tpMain/qworkmgrui.cpp @@ -683,4 +683,10 @@ void QWorkMgrUI::UpdateTabView(QString strName, TypeSelect enTymodel) } } - +void QWorkMgrUI::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} diff --git a/src/tpMain/qworkmgrui.h b/src/tpMain/qworkmgrui.h index f48b16a..0080f59 100644 --- a/src/tpMain/qworkmgrui.h +++ b/src/tpMain/qworkmgrui.h @@ -47,6 +47,8 @@ public: void UpTableModel(); void UpdateTableView(QString str); void UpdateTabView(QString strName, TypeSelect enTymodel); +protected: + virtual void changeEvent(QEvent *event); protected: virtual void closeEvent(QCloseEvent *event); signals: diff --git a/tpvs17/lpReport/lpreport_en.ts b/tpvs17/lpReport/lpreport_en.ts new file mode 100644 index 0000000..f65da97 --- /dev/null +++ b/tpvs17/lpReport/lpreport_en.ts @@ -0,0 +1,897 @@ + + + + + QReportWidget + + + + 型号 + + + + + + 数量 + + + + + 编号 + + + + + 请选择对应时间并查询数据! + + + + + QTimeDlg + + + 时间设置 + + + + + + 0 + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + 13 + + + + + + 14 + + + + + + 15 + + + + + + 16 + + + + + + 17 + + + + + + 18 + + + + + + 19 + + + + + + 20 + + + + + + 21 + + + + + + 22 + + + + + + 23 + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 27 + + + + + 28 + + + + + 29 + + + + + 30 + + + + + 31 + + + + + 32 + + + + + 33 + + + + + 34 + + + + + 35 + + + + + 36 + + + + + 37 + + + + + 38 + + + + + 39 + + + + + 40 + + + + + 41 + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 45 + + + + + 46 + + + + + 47 + + + + + 48 + + + + + 49 + + + + + 50 + + + + + 51 + + + + + 52 + + + + + 53 + + + + + 54 + + + + + 55 + + + + + 56 + + + + + 57 + + + + + 58 + + + + + 59 + + + + + 小时 + + + + + 分钟 + + + + + 2017/00/00 00:00 + + + + + 确定 + + + + + TestWidget + + + TestWidget + + + + + lpReport + + + 数据记录查看 + + + + + + + + + + + 共显示%1条记录 + + + + + + + + + + + + + + 第%1页 共%2页 + + + + + + + + + + + + + + + + + + + + + 提示 + + + + + + 您选择的班次时间是隔夜的,请您重新选择一下当前查询的日期,再查询 + + + + + + + 您选择的日期不合理,请您重新选择一下当前查询的日期,再查询 + + + + + 查询了%1-%2的生产数据 + + + + + + 起始时间:%1 到 结束时间:%2 的历史记录 + + + + + + + 全部 + + + + + + + 正在查询数据,请稍后 + + + + + + + + 没有数据,请重新查询 + + + + + + + 请选择保存文件的路径 + + + + + + 正在导出数据,请稍等 + + + + + 导出了%1-%2的生产数据 + + + + + + + 数据导出完成 + + + + + 查询了%1-%2的日志数据 + + + + + + + 使用记录查询 + + + + + + + 报警记录查询 + + + + + + + 运行状态查询 + + + + + 导出了%1-%2的日志数据 + + + + + 您选择的日期不合理,请您重新起始日期,再查询 + + + + + 查询了%1-%2的统计数据 + + + + + 导出了%1-%2的统计数据 + + + + + 确认 + + + + + 取消 + + + + + 从%1到%2统计的数据如下 + + + + + 序号 + + + + + 型号 + + + + + 数量 + + + + + + 总数 + + + + + 时间: + + + + + 用户: + + + + + 查询进度 + + + + + 数据查询中,请稍后..... + + + + + 系统自动进行清理完成 + + + + + 正在查询数据 + + + + + 起始时间:%1 到 结束时间:%2 的历史记录 共%3条 + + + + + 数据查询完成 + + + + + 操作已生效 + + + + + 统计结果 + + + + + 统计完成 + + + + + 日期时间 + + + + + 匹配型号 + + + + + 相似度 + + + + + 消耗时间s + + + + + 直径mm + + + + + 厚度mm + + + + + 缩略图 + + + + + uid + + + + + 正在查询记录,请稍等 + + + + + 从%1 到 %2 的记录 共%3条 + + + + + 时间 + + + + + 信息 + + + + + + + + 全天 + + + + + 生产数据查询 + + + + + NG + + + + + lpReportClass + + + lpReport + + + + + + 生产数据查询 + + + + + 生产数据统计 + + + + + 日志记录 + + + + + + 显示数据数(条) + + + + + + 50 + + + + + + 上一页 + + + + + + + + TextLabel + + + + + + 下一页 + + + + + 标题 + + + + + 双击单条记录显示图片 + + + + + + 开始日期时间: + + + + + + + + + + 2017-11-11 11:11:11 + + + + + + 设置开始时间 + + + + + + + 结束日期时间: + + + + + + + 设置结束时间 + + + + + 筛选型号 + + + + + + 所有 + + + + + + 生产班次 + + + + + 全天 + + + + + 查询数量 + + + + + 0 + + + + + + + 查询 + + + + + + + 导出CSV + + + + + 数据类型查询 + + + + + 起始日期时间: + + + + + 设置起始时间 + + + + + 报警记录查询 + + + + diff --git a/tpvs17/lpReport/lpreport_zh.ts b/tpvs17/lpReport/lpreport_zh.ts new file mode 100644 index 0000000..1ab3e4e --- /dev/null +++ b/tpvs17/lpReport/lpreport_zh.ts @@ -0,0 +1,897 @@ + + + + + QReportWidget + + + + 型号 + + + + + + 数量 + + + + + 编号 + + + + + 请选择对应时间并查询数据! + + + + + QTimeDlg + + + 时间设置 + + + + + + 0 + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + 13 + + + + + + 14 + + + + + + 15 + + + + + + 16 + + + + + + 17 + + + + + + 18 + + + + + + 19 + + + + + + 20 + + + + + + 21 + + + + + + 22 + + + + + + 23 + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 27 + + + + + 28 + + + + + 29 + + + + + 30 + + + + + 31 + + + + + 32 + + + + + 33 + + + + + 34 + + + + + 35 + + + + + 36 + + + + + 37 + + + + + 38 + + + + + 39 + + + + + 40 + + + + + 41 + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 45 + + + + + 46 + + + + + 47 + + + + + 48 + + + + + 49 + + + + + 50 + + + + + 51 + + + + + 52 + + + + + 53 + + + + + 54 + + + + + 55 + + + + + 56 + + + + + 57 + + + + + 58 + + + + + 59 + + + + + 小时 + + + + + 分钟 + + + + + 2017/00/00 00:00 + + + + + 确定 + + + + + TestWidget + + + TestWidget + + + + + lpReport + + + 数据记录查看 + + + + + + + + + + + 共显示%1条记录 + + + + + + + + + + + + + + 第%1页 共%2页 + + + + + + + + + + + + + + + + + + + + + 提示 + + + + + + 您选择的班次时间是隔夜的,请您重新选择一下当前查询的日期,再查询 + + + + + + + 您选择的日期不合理,请您重新选择一下当前查询的日期,再查询 + + + + + 查询了%1-%2的生产数据 + + + + + + 起始时间:%1 到 结束时间:%2 的历史记录 + + + + + + + 全部 + + + + + + + 正在查询数据,请稍后 + + + + + + + + 没有数据,请重新查询 + + + + + + + 请选择保存文件的路径 + + + + + + 正在导出数据,请稍等 + + + + + 导出了%1-%2的生产数据 + + + + + + + 数据导出完成 + + + + + 查询了%1-%2的日志数据 + + + + + + + 使用记录查询 + + + + + + + 报警记录查询 + + + + + + + 运行状态查询 + + + + + 导出了%1-%2的日志数据 + + + + + 您选择的日期不合理,请您重新起始日期,再查询 + + + + + 查询了%1-%2的统计数据 + + + + + 导出了%1-%2的统计数据 + + + + + 确认 + + + + + 取消 + + + + + 从%1到%2统计的数据如下 + + + + + 序号 + + + + + 型号 + + + + + 数量 + + + + + + 总数 + + + + + 时间: + + + + + 用户: + + + + + 查询进度 + + + + + 数据查询中,请稍后..... + + + + + 系统自动进行清理完成 + + + + + 正在查询数据 + + + + + 起始时间:%1 到 结束时间:%2 的历史记录 共%3条 + + + + + 数据查询完成 + + + + + 操作已生效 + + + + + 统计结果 + + + + + 统计完成 + + + + + 日期时间 + + + + + 匹配型号 + + + + + 相似度 + + + + + 消耗时间s + + + + + 直径mm + + + + + 厚度mm + + + + + 缩略图 + + + + + uid + + + + + 正在查询记录,请稍等 + + + + + 从%1 到 %2 的记录 共%3条 + + + + + 时间 + + + + + 信息 + + + + + + + + 全天 + + + + + 生产数据查询 + + + + + NG + + + + + lpReportClass + + + lpReport + + + + + + 生产数据查询 + + + + + 生产数据统计 + + + + + 日志记录 + + + + + + 显示数据数(条) + + + + + + 50 + + + + + + 上一页 + + + + + + + + TextLabel + + + + + + 下一页 + + + + + 标题 + + + + + 双击单条记录显示图片 + + + + + + 开始日期时间: + + + + + + + + + + 2017-11-11 11:11:11 + + + + + + 设置开始时间 + + + + + + + 结束日期时间: + + + + + + + 设置结束时间 + + + + + 筛选型号 + + + + + + 所有 + + + + + + 生产班次 + + + + + 全天 + + + + + 查询数量 + + + + + 0 + + + + + + + 查询 + + + + + + + 导出CSV + + + + + 数据类型查询 + + + + + 起始日期时间: + + + + + 设置起始时间 + + + + + 报警记录查询 + + + + diff --git a/tpvs17/tpMain/QAlgParamDlg.cpp b/tpvs17/tpMain/QAlgParamDlg.cpp index 7d36047..05ad981 100644 --- a/tpvs17/tpMain/QAlgParamDlg.cpp +++ b/tpvs17/tpMain/QAlgParamDlg.cpp @@ -1,4 +1,4 @@ -#include "QAlgParamDlg.h" +#include "QAlgParamDlg.h" #include "DetectState.h" #include "qshowimg.h" #include @@ -94,7 +94,7 @@ void QAlgParamDlg::getParam() Q_SLOT void QAlgParamDlg::onChangeBG() { QFileDialog fileDialog; - fileDialog.setWindowTitle(tr("ѡıͼ")); + fileDialog.setWindowTitle(tr("请选择您的背景图")); fileDialog.setNameFilter("Picture(*.bmp *.jpg *.png)"); fileDialog.setFileMode(QFileDialog::ExistingFiles); if (fileDialog.exec() == QDialog::Accepted) @@ -123,9 +123,9 @@ Q_SLOT void QAlgParamDlg::onChangeBG() //return false; } //emit sgChangeBG(DstPath); - QMessageBox infobox(QMessageBox::Information, tr("ʾ"), tr("ͼɣ."), QMessageBox::Yes, NULL); + QMessageBox infobox(QMessageBox::Information, tr("提示"), tr("背景图更新完成,请重启本软件."), QMessageBox::Yes, NULL); infobox.setWindowIcon(QIcon(":/image/leaper")); - infobox.setButtonText(QMessageBox::Yes, tr("ȷ")); + infobox.setButtonText(QMessageBox::Yes, tr("确认")); infobox.exec(); } } diff --git a/tpvs17/tpMain/QAlgParamDlg.h b/tpvs17/tpMain/QAlgParamDlg.h index 9f75a2c..da91588 100644 --- a/tpvs17/tpMain/QAlgParamDlg.h +++ b/tpvs17/tpMain/QAlgParamDlg.h @@ -1,4 +1,4 @@ -#ifndef _QALGPARAMDLG_H_ +#ifndef _QALGPARAMDLG_H_ #define _QALGPARAMDLG_H_ #include diff --git a/tpvs17/tpMain/QModelMgrDlg.cpp b/tpvs17/tpMain/QModelMgrDlg.cpp index 8f5f381..60fdc3d 100644 --- a/tpvs17/tpMain/QModelMgrDlg.cpp +++ b/tpvs17/tpMain/QModelMgrDlg.cpp @@ -509,7 +509,7 @@ Q_SLOT void QModelMgrDlg::onTextChanged(const QString& str) else { QStringList strFilter = models.filter(str); m_pModelLists->setModelList(strFilter); - QString m_str = QString("%1 %2 个型号").arg(tr("共")).arg(strFilter.size()).arg(tr("个型号")); + QString m_str = QString("%1 %2 %3").arg(tr("共")).arg(strFilter.size()).arg(tr("个型号")); ui.ModelMgr_label_Model_number->setText(m_str); } } @@ -1070,7 +1070,7 @@ void QModelMgrDlg::showEvent(QShowEvent *event) strModels.removeAll("NG"); m_pModelLists->setModelList(strModels); - QString m_str = QString("%1 %2 个型号").arg(tr("共")).arg(strModels.size()).arg(tr("个型号")); + QString m_str = QString("%1 %2 %3").arg(tr("共")).arg(strModels.size()).arg(tr("个型号")); ui.ModelMgr_label_Model_number->setText(m_str); } } diff --git a/tpvs17/tpMain/lpGlobalData.h b/tpvs17/tpMain/lpGlobalData.h index aff2305..75ebbb1 100644 --- a/tpvs17/tpMain/lpGlobalData.h +++ b/tpvs17/tpMain/lpGlobalData.h @@ -22,7 +22,7 @@ public: int m_level{ 0 }; QString m_curUser{ "" }; bool m_bCheckLinese{ false };//ע֤ true ʾעᣬfalse ʾδע - + bool m_plcConnect{ false }; }; #endif diff --git a/tpvs17/tpMain/lpMainWin.cpp b/tpvs17/tpMain/lpMainWin.cpp index 7f552cc..b92ef60 100644 --- a/tpvs17/tpMain/lpMainWin.cpp +++ b/tpvs17/tpMain/lpMainWin.cpp @@ -23,14 +23,15 @@ #include #include "lpCryptokey.h" -#define VERSION_HUB "3.0.1.5" +#define VERSION_HUB "3.0.1.6" #define VERSION_ALG "3.0.1.4" -#define UPDATE_TIME "2021-09-28" +#define UPDATE_TIME "2021-10-08" #pragma execution_character_set("utf-8") lpMainWin::lpMainWin(QWidget *parent) : QMainWindow(parent) { + ui.setupUi(this); {//加载语言设置 QSettings languageSetting("hubdetect.ini", QSettings::IniFormat); QString strLanguage = languageSetting.value("language", "Chinese").toString(); @@ -42,7 +43,7 @@ lpMainWin::lpMainWin(QWidget *parent) qRegisterMetaType("TimeStruct"); m_screen.ShowMsg(tr("加载必要模块.....")); onInitCoreCtrl(); - ui.setupUi(this); + onInitAbout(); { QGridLayout *pLayout = new QGridLayout(ui.cam_win_1); @@ -52,38 +53,34 @@ lpMainWin::lpMainWin(QWidget *parent) ui.cam_win_1->setLayout(pLayout); } { - connect(ui.action_userManager, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_Login, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_about, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_setting_ip, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_cali_raster, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_setting_ban, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_debug, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_connect_mode, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_checkdata, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_modelmgr, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_algParam, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.action_register, SIGNAL(triggered()), this, SLOT(onActionClicked())); - - connect(ui.actionSystemSeting, SIGNAL(triggered()), this, SLOT(onActionClicked())); - connect(ui.actioncamSetting, SIGNAL(triggered()), this, SLOT(onActionClicked())); - - connect(ui.btn_start_detect, SIGNAL(clicked()), this, SLOT(onButtonClicked())); - connect(ui.btn_clear_data, SIGNAL(clicked()), this, SLOT(onButtonClicked())); + connect(ui.action_userManager, SIGNAL(triggered()), this, SLOT(onActionClicked()));//用户管理 + connect(ui.action_Login, SIGNAL(triggered()), this, SLOT(onActionClicked()));//用户登录 + connect(ui.action_about, SIGNAL(triggered()), this, SLOT(onActionClicked()));//关于 + connect(ui.action_setting_ip, SIGNAL(triggered()), this, SLOT(onActionClicked()));//IP设置 + connect(ui.action_cali_raster, SIGNAL(triggered()), this, SLOT(onActionClicked()));//光栅尺 + connect(ui.action_setting_ban, SIGNAL(triggered()), this, SLOT(onActionClicked()));//班次设置 + connect(ui.action_debug, SIGNAL(triggered()), this, SLOT(onActionClicked()));//调试助手 + connect(ui.action_connect_mode, SIGNAL(triggered()), this, SLOT(onActionClicked()));//连接模式 + connect(ui.action_checkdata, SIGNAL(triggered()), this, SLOT(onActionClicked()));//历史数据查看页面 + connect(ui.action_modelmgr, SIGNAL(triggered()), this, SLOT(onActionClicked()));//模板管理 + connect(ui.action_algParam, SIGNAL(triggered()), this, SLOT(onActionClicked()));//算法参数设置 + connect(ui.action_register, SIGNAL(triggered()), this, SLOT(onActionClicked()));//注册页面 + connect(ui.actionSystemSeting, SIGNAL(triggered()), this, SLOT(onActionClicked()));//系统参数设置 + connect(ui.actioncamSetting, SIGNAL(triggered()), this, SLOT(onActionClicked()));//相机设置 + + connect(ui.btn_start_detect, SIGNAL(clicked()), this, SLOT(onButtonClicked()));//开始检测 停止检测 + connect(ui.btn_clear_data, SIGNAL(clicked()), this, SLOT(onButtonClicked()));//清空统计 - ui.action_userManager->setVisible(false); + ui.action_userManager->setVisible(false);//默认用户管理菜单隐藏 只有相应权限才能显示 + //下拉菜单 布局 工具菜单 配置相关系统设置菜单 QMenu *pToolMenu = new QMenu(this); -// QFont font; -// font.setPixelSize(24); -// pToolMenu->setFont(font); - pToolMenu->addAction(ui.action_cali_raster); pToolMenu->addAction(ui.action_setting_ban); pToolMenu->addAction(ui.action_setting_ip); - pToolMenu->addAction(ui.action_debug); - pToolMenu->addAction(ui.actionSystemSeting); pToolMenu->addAction(ui.actioncamSetting); + pToolMenu->addAction(ui.actionSystemSeting); pToolMenu->addAction(ui.action_algParam); + pToolMenu->addAction(ui.action_debug); QToolButton* pbutton = new QToolButton(this); pbutton->setMenu(pToolMenu); @@ -93,6 +90,8 @@ lpMainWin::lpMainWin(QWidget *parent) pbutton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); pbutton->setPopupMode(QToolButton::InstantPopup); ui.mainToolBar->addWidget(pbutton); + + //帮助 下拉菜单 QMenu *pHelpMenu = new QMenu(this); pHelpMenu->addAction(ui.action_about); pHelpMenu->addAction(ui.action_register); @@ -106,17 +105,19 @@ lpMainWin::lpMainWin(QWidget *parent) pHelptool->setPopupMode(QToolButton::InstantPopup); ui.mainToolBar->addWidget(pHelptool); ui.mainToolBar->addSeparator(); + m_pLabelInfo = new QLabel(this); m_pLabelInfo->setText(tr("本系统未注册激活")); m_pLabelInfo->setStyleSheet("font: bold 14px; color: red;"); - ui.mainToolBar->addWidget(m_pLabelInfo);; + ui.mainToolBar->addWidget(m_pLabelInfo); } - { + {//状态栏初始化配置 m_pLbCurrentTime = new QLabel(tr("系统时间")); m_pLbBanci = new QLabel(tr("班次信息")); m_pLbDetectState = new QLabel(tr("检测状态")); - m_pLbUser = new QLabel(tr("用户:")); + m_pLbUser = new QLabel(tr("用户:")); + m_pLbPLCConnect = new QLabel(tr("PLC连接")); QFont m_font; m_font.setBold(true); @@ -135,13 +136,15 @@ lpMainWin::lpMainWin(QWidget *parent) m_pLbDetectState->setFont(m_font); m_pLbDetectState->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - //m_pLbOnLine = new class QLabel("模式:"); - //m_pLbOnLine->setMinimumWidth(c_nWidth); + m_pLbPLCConnect->setMinimumWidth(200); + m_pLbPLCConnect->setFont(m_font); + m_pLbPLCConnect->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_pLbUser->setFont(m_font); m_pLbUser->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); ui.statusBar->addWidget(m_pLbDetectState, 1); + ui.statusBar->addWidget(m_pLbPLCConnect, 1); ui.statusBar->addWidget(m_pLbUser, 1); ui.statusBar->addWidget(m_pLbBanci,1); ui.statusBar->addPermanentWidget(m_pLbCurrentTime); @@ -149,15 +152,15 @@ lpMainWin::lpMainWin(QWidget *parent) //加载用户管理模块 loadUserModel(); //初始化模型管理模块 - { + {//总逻辑处理模块 核心管理 m_pCtrl = new WheelCtrl(QCoreApplication::applicationDirPath(), &m_screen); - pWorkCtrl = new QWorkMgrCtlr(m_pCtrl); + pWorkCtrl = new QWorkMgrCtlr(m_pCtrl);//工单管理模块 pWorkCtrl->readManageFile(); - m_pworkUI = new QWorkMgrUI(pWorkCtrl, m_pCtrl); + m_pworkUI = new QWorkMgrUI(pWorkCtrl, m_pCtrl);//工单管理UI模块 m_pworkUI->InitUI(); connect(m_pworkUI, SIGNAL(sgUpdatedefect()), this, SLOT(onUpdateDefect())); - m_pModelMgrDlg = new QModelMgrDlg(m_pCtrl);//模板管理 + m_pModelMgrDlg = new QModelMgrDlg(m_pCtrl);//模板管理UI //当某个模板加入训练或者不加入训练时修改原来工作单中的模板信息 connect(m_pModelMgrDlg, SIGNAL(sgModifyModel(QString)), this, SLOT(modWorkMgr(QString))); connect(m_pModelMgrDlg, SIGNAL(sgUpdatedefect()), this, SLOT(onUpdateDefect())); @@ -174,11 +177,12 @@ lpMainWin::lpMainWin(QWidget *parent) connect(m_pSystemSettingDlg, SIGNAL(sgChangeLanguage(QString)), this, SLOT(onLanguageChange(QString))); connect(m_pSystemSettingDlg, SIGNAL(sgChangePLCParam()), this, SLOT(onChangePLCParam())); connect(m_pSystemSettingDlg, SIGNAL(sgParamChange()), this, SLOT(onUpdateUI())); + //历史检测图像缩略图 m_pixMapList = new QPixmapListBar(ui.tp_main_tabWidget); ui.tp_main_tabWidget->insertTab(0, m_pixMapList, tr("历史")); ui.tp_main_tabWidget->setCurrentIndex(0); - m_pAlgParamDlg = new QAlgParamDlg(); + m_pAlgParamDlg = new QAlgParamDlg();//算法参数设置页面 connect(m_pAlgParamDlg, SIGNAL(sgParamChange()), this, SLOT(onUpdateUI())); } { @@ -191,9 +195,7 @@ lpMainWin::lpMainWin(QWidget *parent) SendTiskTsk = new QMyThread(); TaskFunc TickFunc = std::bind(&lpMainWin::SendTickTskFun, this); SendTiskTsk->loadfunc(TickFunc); - m_screen.ShowMsg(tr("系统初始化完成...")); - } { onSetModel(); @@ -216,8 +218,6 @@ lpMainWin::lpMainWin(QWidget *parent) connect(m_pNet, SIGNAL(sgLibRev(bool)), SendModelLibTask, SLOT(WaitSingleIn(bool)));//xy lib // connect(m_pNet, SIGNAL(sgChangeOnlineState(int)), m_pUi, SLOT(onSwitchOnlineModel(int)));//强制在线 离线 - - QTimer::singleShot(500, m_pNet, SLOT(onOpenServer()));//延迟2s打开网络TCP服务 } { connect(&m_PulseTimer, SIGNAL(timeout()), this, SLOT(onPulseTimer()));//心跳包 @@ -239,25 +239,7 @@ lpMainWin::lpMainWin(QWidget *parent) connect(this, SIGNAL(sgShowChannelRes(QString)), this, SLOT(onShowChannel(QString))); } { - /*启动之后就一直发送心跳包和厚度查询*/ - if (DetectState::instance()->m_AutoSendTick2Net) - { - SendTiskTsk->setSleepTime(1000); - SendTiskTsk->start(); - } - - //if (DetectState::instance()->m_StartAndDetect == 1)//m_sysType 表示万丰科技的 - { - QTimer::singleShot(3000, [&](){ - ui.btn_start_detect->setText(tr("停止检测")); - DetectState::instance()->IsDetect = true; - m_pCtrl->onStart(); - }); - } - if (DetectState::instance()->m_AutoSendTick2COM) - m_wfPulseTimer.start(1000); - - + //???做什么用的 pTickThread = new QThread(this); QNetTickThread *pNetTick = new QNetTickThread; pNetTick->setNetPtr(m_pNet); @@ -277,21 +259,40 @@ lpMainWin::lpMainWin(QWidget *parent) m_pTableCheck->setModelList(strList); } - m_timerID = startTimer(1000); //m_PulseTimer.start(1000); - connect(this, SIGNAL(sgAutoExposure()), this, SLOT(onAutoExposure())); connect(this, SIGNAL(sgShowRatioVal(double)), this, SLOT(onShowRatioVal(double))); + //自动曝光参数 QString strPath = QApplication::applicationDirPath(); readExposureTimeConfig(strPath); - onUpdateUI(); + //注册码相关 lpGlobalData::instance()->m_bCheckLinese = lpCheckKey::instance()->checkLinese(); m_pCheckLineseUI = new QCryptokeyUI(); connect(m_pCheckLineseUI, SIGNAL(sgRegisterFinish(bool)), this, SLOT(onLineseCheck(bool))); - onLineseCheck(lpGlobalData::instance()->m_bCheckLinese); + + + /*启动之后就一直发送心跳包和厚度查询*/ + if (DetectState::instance()->m_AutoSendTick2Net) + { + SendTiskTsk->setSleepTime(1000); + SendTiskTsk->start(); + } + //if (DetectState::instance()->m_StartAndDetect == 1)//m_sysType 表示万丰科技的 + { + QTimer::singleShot(3000, [&]() { + ui.btn_start_detect->setText(tr("停止检测")); + DetectState::instance()->IsDetect = true; + m_pCtrl->onStart(); + }); + } + + if (DetectState::instance()->m_AutoSendTick2COM) + m_wfPulseTimer.start(1000); + m_timerID = startTimer(1000); + QTimer::singleShot(1000, m_pNet, SLOT(onOpenServer()));//延迟2s打开网络TCP服务 } lpMainWin::~lpMainWin() @@ -361,6 +362,11 @@ lpMainWin::~lpMainWin() delete m_pLbUser; m_pLbUser = nullptr; } + if (m_pLbPLCConnect) + { + delete m_pLbPLCConnect; + m_pLbPLCConnect = nullptr; + } } if (m_pCtrl) { @@ -430,7 +436,7 @@ lpMainWin::~lpMainWin() } } - +//核心corctrl模块 包括相机算法等相关模块 bool lpMainWin::onInitCoreCtrl() { //load coretrl @@ -473,7 +479,7 @@ void lpMainWin::loadUserModel() connect(m_pUserCtrl, SIGNAL(sgCurrentUserInfo(QString, int, int)), this, SLOT(onLogInOut(QString, int, int))); } } - +/*****************************系统语言设置*****************************/ void lpMainWin::SearchQmFile(const QString & strDir) { QDir dir(strDir); @@ -496,12 +502,10 @@ void lpMainWin::SearchQmFile(const QString & strDir) QString tt = fileInfo.fileName(); // 如果是文件夹 bool bisDir = fileInfo.isDir(); - if (bisDir) - { + if (bisDir) { SearchQmFile(fileInfo.filePath()); } - else - { + else { bool bQm = fileInfo.fileName().endsWith(".qm"); SetTranslator(fileInfo.filePath()); } @@ -511,18 +515,16 @@ void lpMainWin::SearchQmFile(const QString & strDir) void lpMainWin::SetTranslator(const QString strPath) { - if (strPath.isEmpty()) - { + if (strPath.isEmpty()) { return; } QTranslator *pTrans = new QTranslator; - if (pTrans->load(strPath)) // 如果加载成功 - { + // 如果加载成功 + if (pTrans->load(strPath)) { qApp->installTranslator(pTrans); m_VecTranPtr.append(pTrans); } - else - { + else { delete pTrans; pTrans = NULL; } @@ -532,10 +534,8 @@ void lpMainWin::SetLanguage(QString strLangage) { QString strDirPath = QString(QCoreApplication::applicationDirPath() + "/language/"); QString translatorFileName = strLangage; - if (!translatorFileName.isEmpty()) - { - if (m_VecTranPtr.size() > 0) - { + if (!translatorFileName.isEmpty()) { + if (m_VecTranPtr.size() > 0) { while (m_VecTranPtr.size()) { QTranslator *pVa = m_VecTranPtr.takeFirst(); @@ -544,14 +544,13 @@ void lpMainWin::SetLanguage(QString strLangage) pVa = NULL; } } - //if (strLangage == "Chinese") - // return; QLocale::setDefault(QLocale(translatorFileName)); QString transDir = strDirPath + translatorFileName; SearchQmFile(transDir); } } +/*****************************系统语言设置 END*****************************/ /*主线程接收图像*/ void lpMainWin::INewCameraImage(const QString& camKey, QImage img) { @@ -779,7 +778,7 @@ Q_SLOT void lpMainWin::onLogInOut(QString strName, int level, int state) m_pModelMgrDlg->onUserLevel(level); } } - +/*菜单栏所有事件*/ Q_SLOT void lpMainWin::onActionClicked() { QString strObj = sender()->objectName(); @@ -860,8 +859,8 @@ Q_SLOT void lpMainWin::onActionClicked() m_pDebugDlg->setWindowTitle(tr("调试工具")); m_pDebugDlg->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); m_pDebugDlg->setWindowIcon(QIcon(":/image/leaper")); - m_pDebugDlg->setWindowModality(Qt::ApplicationModal); - m_pDebugDlg->setAttribute(Qt::WA_ShowModal, true); + //m_pDebugDlg->setWindowModality(Qt::ApplicationModal); + //m_pDebugDlg->setAttribute(Qt::WA_ShowModal, true); m_pDebugDlg->show(); } } @@ -869,7 +868,7 @@ Q_SLOT void lpMainWin::onActionClicked() if (m_pworkUI) { m_pworkUI->setParent(this); - m_pworkUI->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); + m_pworkUI->setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint); m_pworkUI->setWindowIcon(QIcon(":/image/leaper")); m_pworkUI->setWindowModality(Qt::ApplicationModal); m_pworkUI->setAttribute(Qt::WA_ShowModal, true); @@ -884,8 +883,8 @@ Q_SLOT void lpMainWin::onActionClicked() m_pAlgParamDlg->setWindowTitle(tr("算法参数")); m_pAlgParamDlg->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); m_pAlgParamDlg->setWindowIcon(QIcon(":/image/leaper")); - m_pAlgParamDlg->setWindowModality(Qt::ApplicationModal); - m_pAlgParamDlg->setAttribute(Qt::WA_ShowModal, true); + //m_pAlgParamDlg->setWindowModality(Qt::ApplicationModal); + //m_pAlgParamDlg->setAttribute(Qt::WA_ShowModal, true); m_pAlgParamDlg->show(); } } @@ -904,7 +903,7 @@ Q_SLOT void lpMainWin::onActionClicked() { m_pModelMgrDlg->setParent(this); m_pModelMgrDlg->setWindowTitle(tr("模板管理")); - m_pModelMgrDlg->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); + m_pModelMgrDlg->setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint); m_pModelMgrDlg->setWindowIcon(QIcon(":/image/leaper")); m_pModelMgrDlg->setWindowModality(Qt::ApplicationModal); m_pModelMgrDlg->setAttribute(Qt::WA_ShowModal, true); @@ -939,16 +938,16 @@ Q_SLOT void lpMainWin::onActionClicked() } } else if ("action_register" == strObj) { - if (m_pCheckLineseUI) { - m_pCheckLineseUI->setInfo(lpCheckKey::instance()->getSerialNo(), lpGlobalData::instance()->m_bCheckLinese); - m_pCheckLineseUI->setParent(this); - m_pCheckLineseUI->setWindowTitle(tr("注册")); - m_pCheckLineseUI->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); - m_pCheckLineseUI->setWindowIcon(QIcon(":/image/leaper")); - m_pCheckLineseUI->setWindowModality(Qt::ApplicationModal); - m_pCheckLineseUI->setAttribute(Qt::WA_ShowModal, true); - m_pCheckLineseUI->show(); - } + if (m_pCheckLineseUI) { + m_pCheckLineseUI->setInfo(lpCheckKey::instance()->getSerialNo(), lpGlobalData::instance()->m_bCheckLinese); + m_pCheckLineseUI->setParent(this); + m_pCheckLineseUI->setWindowTitle(tr("注册")); + m_pCheckLineseUI->setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); + m_pCheckLineseUI->setWindowIcon(QIcon(":/image/leaper")); + m_pCheckLineseUI->setWindowModality(Qt::ApplicationModal); + m_pCheckLineseUI->setAttribute(Qt::WA_ShowModal, true); + m_pCheckLineseUI->show(); + } } } @@ -1015,7 +1014,9 @@ QString lpMainWin::SecondTimeString(quint64 value) void lpMainWin::timerEvent(QTimerEvent *event) { - if (event->timerId() == m_timerID) { + if (event->timerId() == m_timerID) + { + //定时刷新系统信息 m_runTimeCount++; if (m_pLbCurrentTime) { @@ -1024,17 +1025,17 @@ void lpMainWin::timerEvent(QTimerEvent *event) QString strTimeTitle = tr("运行时长:"); QString strShow = QString("%1 %2 %3").arg(m_currentTime).arg(strTimeTitle).arg(strlong); m_pLbCurrentTime->setText(strShow); - m_pLbCurrentTime->setStyleSheet("font: 14px;"); + m_pLbCurrentTime->setStyleSheet("font: 18px;"); } // state if (m_pLbDetectState) { - QString strDetectState = tr("检测状态:") + (DetectState::instance()->IsDetect == true ? tr("检测中...") : tr("未检测...")); + QString strDetectState = DetectState::instance()->IsDetect == true ? tr("检测中...") : tr("未检测..."); m_pLbDetectState->setText(strDetectState); if (DetectState::instance()->IsDetect) { - m_pLbDetectState->setStyleSheet("font: bold 14px;background-color: green;"); + m_pLbDetectState->setStyleSheet("font: bold 18px;background-color: green;"); } else { - m_pLbDetectState->setStyleSheet("font: bold 14px;background-color: red;"); + m_pLbDetectState->setStyleSheet("font: bold 18px;background-color: red;"); } } @@ -1043,22 +1044,34 @@ void lpMainWin::timerEvent(QTimerEvent *event) if (m_pCtrl) show_label = m_pCtrl->getCurrentBan(); - QString strMsg = tr("班次信息:") + (show_label.isEmpty() == true ? tr("该时间段未设置班次") : show_label); + QString strMsg = tr("班次信息:") + (show_label.isEmpty() == true ? tr("该时间段未设置班次") : show_label); // if (strLanguage != "Chinese") // { // strMsg = tr("Classes:") // + (show_label.isEmpty() == true ? tr("No set Times") : show_label); // } m_pLbBanci->setText(strMsg); - m_pLbBanci->setStyleSheet("font: 14px;"); + m_pLbBanci->setStyleSheet("font: 18px;"); } if (m_pLbUser) { QString show_label = m_pCtrl->getUserName(); // if (strLanguage != "Chinese") // m_pLbUser->setText(tr("User:") + show_label); // else - m_pLbUser->setText(tr("当前用户:") + show_label); - m_pLbUser->setStyleSheet("font: 14px;"); + m_pLbUser->setText(tr("当前用户:") + show_label); + m_pLbUser->setStyleSheet("font: 18px;"); + } + if (m_pLbPLCConnect) + { + if (lpGlobalData::instance()->m_plcConnect == true) + { + m_pLbPLCConnect->setText(tr("PLC已连接")); + m_pLbPLCConnect->setStyleSheet("font: bold 18px;background-color: green;"); + } + else { + m_pLbPLCConnect->setText(tr("PLC未连接")); + m_pLbPLCConnect->setStyleSheet("font: bold 18px;background-color: red;"); + } } } } @@ -1076,9 +1089,25 @@ void lpMainWin::closeEvent(QCloseEvent *event) { return event->ignore(); } + if (m_pDebugDlg) + { + if (!m_pDebugDlg->isHidden()) + { + m_pDebugDlg->close(); + } + } + return event->accept(); } +void lpMainWin::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui.retranslateUi(this); + } +} + void lpMainWin::SendModelKuTskFun() { /* @@ -1120,7 +1149,6 @@ void lpMainWin::SendModelKuTskFun() } emit(sgShowMsgdlg(tr("模板库发送完成"))); - } void lpMainWin::SendTickTskFun() @@ -1287,7 +1315,8 @@ Q_SLOT void lpMainWin::onReadDetectState(int nIndex, QString strModel) QMap *ptr = m_pCtrl->getAllModelMapPtr(); if (ptr) { QList lst = ptr->keys(); - /*if (nIndex < lst.size() && nIndex >= 0)*/ { + /*if (nIndex < lst.size() && nIndex >= 0)*/ + { IWheelModel*pModel = ptr->value(strModel); if (pModel) { pModel->setDetectState(1); @@ -1325,7 +1354,6 @@ Q_SLOT void lpMainWin::onTrigRecv(int m_value,double dRatio) // { // m_pCoreCtrl->ISetExposureTime(m_camKey, m_exposureTimeArray[m_exposureTimeCount]); // } - onTriggerCam(); qWarning() << "soft ctrol camera :" << "(" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss zzz") << ")"; } @@ -1848,7 +1876,6 @@ Q_SLOT void lpMainWin::onLineseCheck(bool bFlag) ui.action_modelmgr->setDisabled(!bFlag); ui.action_checkdata->setDisabled(!bFlag); ui.action_connect_mode->setDisabled(!bFlag); - ui.action_connect_mode->setDisabled(!bFlag); ui.action_debug->setDisabled(!bFlag); ui.action_algParam->setDisabled(!bFlag); ui.actioncamSetting->setDisabled(!bFlag); diff --git a/tpvs17/tpMain/lpMainWin.h b/tpvs17/tpMain/lpMainWin.h index 39f4cbc..5c300ea 100644 --- a/tpvs17/tpMain/lpMainWin.h +++ b/tpvs17/tpMain/lpMainWin.h @@ -137,7 +137,7 @@ private: protected: virtual void timerEvent(QTimerEvent *event); virtual void closeEvent(QCloseEvent *event); - + virtual void changeEvent(QEvent *event); private: Ui::lpMainWin ui; @@ -152,7 +152,8 @@ private: class QLabel* m_pLbCurrentTime{ nullptr };//显示系统时间 class QLabel* m_pLbBanci{ nullptr };//显示班次 class QLabel* m_pLbDetectState{ nullptr };//显示检测状态 - class QLabel *m_pLbUser{ nullptr };//显示登陆用户信息 + class QLabel* m_pLbUser{ nullptr };//显示登陆用户信息 + class QLabel* m_pLbPLCConnect{ nullptr };//PLC连接状态 private: CDllCoreCtrl* m_pDllCoreCtrl{ nullptr }; ICoreCtrl* m_pCoreCtrl{ nullptr }; diff --git a/tpvs17/tpMain/lpmain_en.ts b/tpvs17/tpMain/lpmain_en.ts index 2a15cf7..931c671 100644 --- a/tpvs17/tpMain/lpmain_en.ts +++ b/tpvs17/tpMain/lpmain_en.ts @@ -17,10 +17,10 @@ CWheelNet - + IP参数设置 - IP Config - IP Config + IP Setting + IP Setting @@ -116,8 +116,8 @@ 轮毂型号 - Name: - Name: + Name + Name @@ -129,20 +129,18 @@ 直径(mm) - Diameter(mm): - Diameter(mm): + Diameter 厚度(mm) - Thickness(mm): - Thickness(mm): + Thickness + Thickness 旋转次数 - Rotations: - Rotations: + Rotate @@ -194,7 +192,7 @@ 起始时间 - Start: + Start @@ -210,7 +208,7 @@ 结束时间 - End : + End @@ -225,6 +223,114 @@ Text day + + QAlgParamDlg + + + 算法参数设置 + Algo Setting + + + + 二级圆定位: + Circle Param: + + + + 边缘宽度: + Edge Width: + + + + 从深到浅 + Dark to Write + + + + 从浅到深 + Write to Dark + + + + 边缘对比度: + AC Thres: + + + + 边缘转换: + Polarity: + + + + 圆半径大小过滤: + Circle Filter Size: + + + + 检测背景图更换: + Background Image: + + + + 查看检测背景 + Check Background + + + + 是否使用图像增强 + Use Image Enhancement + + + + 是否使用背景图找圆算法 + Use Background Algo + + + + 型号匹配: + Model Match: + + + + 是否使用偏距过滤模板 + Use Offset to Filter Model + + + + 应用 + Apply + + + + 退出 + Close + + + + 参数已生效!!! + Apply Success!!! + + + + 请选择您的背景图 + Please select your background map + + + + 提示 + Info + + + + 背景图更新完成,请重启本软件. + Background image updated, please restart this software. + + + + 确认 + OK + + QCamSettingDlg @@ -235,7 +341,7 @@ 序列号: - Serial Number: + Serial: @@ -245,12 +351,12 @@ 相机类型: - Camera Type: + Type: 虚拟相机 - Virtual Camera + Virtual @@ -275,7 +381,7 @@ 图像高度: - Image Height: + Height: @@ -290,7 +396,7 @@ 图像宽度: - Image Width: + Width: @@ -302,7 +408,7 @@ 图像格式: - Image Format + Format: @@ -317,17 +423,17 @@ 内触发 - Internal trigger + Internal 外触发 - External trigger + External 软触发 - Soft trigger + Soft @@ -498,6 +604,72 @@ Channel management + + QCryptokeyUI + + + 注册 + Register + + + + 退出 + Close + + + + 机器码: + MachineID: + + + + 注册码: + License: + + + + 激活 + Active + + + + + 请输入注册码 + Please input Licese + + + + 激活状态: + State: + + + + 未激活 + No Active + + + + + + 提示 + Info + + + + 注册码不匹配,请重新输入 + No Match,Please Input the New One + + + + 已激活 + Active + + + + 系统激活完成 + the System Active Finish + + QDebugDlg @@ -542,19 +714,19 @@ p, li { white-space: pre-wrap; } 直径mm: - diameter(mm): + Diameter(mm): 开始模拟检测 - Start simulation test + Continus 采集一张 - Collect one + Signal @@ -669,7 +841,7 @@ p, li { white-space: pre-wrap; } 确认修改 - Cancel + Apply @@ -680,7 +852,7 @@ p, li { white-space: pre-wrap; } 缩略图: - Thumbnail: + Image: @@ -727,146 +899,156 @@ p, li { white-space: pre-wrap; } QModelMgrDlg - + 轮毂信息: - Wheel information: + Model Info: - + 型号 - Model + Name - + 0% 0% - + 阈值调节 Threshold - + 严格 Strict - + 旋转次数 - Rotations + Rotate - + 缩略图 Thumbnail - + 宽松 Easy - + 厚度(mm) Thickness(mm) - + 直径(mm) Diameter(mm) - + 加入训练 Add to train - + + 最小偏距 + Min Offset + + + + 最大偏距 + Max Offset + + + 基本操作 Basic operation - - + + 删除模板 Delete - + 训练当前模板 Training - + 训练模板 Train - + 添加新的模板 Add new - + 新建模板 New - + 训练所有模板,消耗时间会较长 Training all templates will take longer - + 训练全部 Train all - + 确认修改,每次修改模板的参数后都要确认修改才有效 Confirm the modification, every time you modify the parameters of the template, you must confirm the modification to be effective - + 修改确认 - Confirm + Modify - + 修改型号名 - Modify name + Modify Name - + 图片显示: - Image display: + Images: TextLabel TextLabel - - + + 添加已裁剪的轮毂图片 Add cropped wheel image - + 追加 Add - - + + 删除所有模板 - Delete all + Del All 模板型号查询 - Template + Models @@ -879,296 +1061,297 @@ p, li { white-space: pre-wrap; } Quantity - + modelID modelID - - - - - + + + + - - - - - - - + + + + + + + + 提示 Prompt - - + + 请选择一个您要追加图像的型号! Please select a model you want to add an image to! - + 加载图像 Load image - + 图像加载中,请稍后..... The image is loading, please wait... - + 添加失败,不能添加带检测背景的图片作为模板!!! Failed to add, you cannot add a picture with a detection background as a template! ! ! - + 加载完成 Download finished - - - + + + 请选择一个您要修改的型号! Please select a model you want to modify! - + 修改了模板 Modified template - + 的参数 The parameters of the - + 修改成功! - Successfully modified! + Modified Successfully! - + 请选择一个您要删除的型号 Please select a model you want to delete - + 按下了删除模板按钮 Press the Delete Template button - + 是否删除型号 Whether to delete the model - + 产品模板 Product template - + 删除了模板 Template deleted - - - - - - - - + + + + + + + + 共 - common + with - - - - - + + + + + 个型号 - Model number + Models + number - + 按下了添加模板按钮 Press the Add Template button - + 产品信息设置 Product information settings - + 添加了一个新的模型 Added a new model - + 请选择一个您要训练的型号! Please select a model you want to train! - - + + 训练模板线程未退出,请稍等 The training template thread did not exit, please wait - + 将对所有型号模板进行重新训练,期间系统的检测功能将不能正常运行直到模板训练完成,全部重新训练模板将需要很长时间,期间将不能进行其他工作,是否继续执行? All model templates will be retrained. During this period, the system's detection function will not operate normally until the template training is completed. It will take a long time for all templates to be retrained, during which other work will not be possible. Do you want to continue? - + 确定删除该图像? Determine to delete the image? - + 模板图片删除 Template picture deletion - - - + + + 个图像 - Image + Images - + 警告 Warning - + 即将删除模板库里的所有模板,是否继续? All templates in the template library will be deleted. Do you want to continue? - + 再次确认,是否全部删除? Confirm again, delete all? - + 没有模板!!! - No template!!! + No Model!!! - + 全部删除完成!!! Complete deletion!!! - + 图像数量少于 The number of images is less than - + 个,请及时补充训练样本 - , please add training samples in time + please supplement Images - - - - - - + + + + + + 模板更新进度 Template update progress - + 正在初始化所有模板 共需要训练%1个模板,请稍后..... All templates are being initialized. A total of%1 templates need to be trained. Please wait a moment... - + 正在训练%1的模板 已完成%2/%3,请稍后..... The template training %1 is complete %2/%3, please wait... - + %1的模板获取特征 已完成%2/%3,请稍后..... Template capture feature for %1 is complete for %2/%3, please wait... - + %1的模板训练完成 已完成%2/%3,请稍后..... Template training for %1 completed %2/%3, please wait... - + 全部模板更新完成!%1s All templates updated!The %1 s - + 对全部模板进行了重新训练,共%1个模板 All templates were retrained, with a total of%1 template - + 模板正在准备请稍后..... - The template is being prepared Please wait a moment..... - - - - - - - - - - - - - - + The Model is being prepared Please wait a moment..... + + + + + + + + + + + + + + 模板训练进度 - Template training progress + Training progress - - + + %1型号没有图片不能训练! - %1 Model can not be trained without pictures! + %1 can not be trained without images! - + %1的模板 正在获取特征值,请稍后.... - The%1 template is getting the characteristic value. Please wait... + The %1 is getting the feater value. Please wait... - + 训练完成!%1s Training completed! %1s - + 训练了模板:%1 Model training:%1 - + 确认 OK - + 取消 Cancel @@ -1186,12 +1369,12 @@ p, li { white-space: pre-wrap; } 虚拟相机触发 - Virtual camera trigger + Virtual Camera 硬件相机触发 - Hardware camera trigger + Hardware Camera @@ -1216,12 +1399,32 @@ p, li { white-space: pre-wrap; } 下降沿触发 - Falling edge trigger + Falling 上升沿触发 - Rising edge trigger + Rising + + + + 警告 + Warning + + + + 本检测系统正在运行,您真的要关闭? + Are you sure quit the System? + + + + 确定 + OK + + + + 取消 + NO @@ -1269,19 +1472,19 @@ p, li { white-space: pre-wrap; } - + 检测图像设置 Image Settings - + PLC相关设置 PLC Settings - + 报警灯测试 Alarm Test @@ -1301,362 +1504,358 @@ p, li { white-space: pre-wrap; } Value - + 语言 Language - 检测背景更换 - Background + Background - - + + 抠图后 After cutout - - + + 原图 SourceImage - 背景图 - Background + Background - + 检测结果 Result - + 图像保存路径 Image Save Path - - + + 设置保存路径 Save path - - + + 打开图像路径 Open Image Path - + 保存当前设置 Save current settings - - + + 保存已匹配图 Save matched Image - - + + 保存无匹配图 Save Unmatched Image - 使用背景图 - Use background + Use background - + 轮毂全去A通道 Hub All-to-A Channel - 查看检测背景 - Check Background + Check Background - + 保存参数 Save Parameters - - + + 保存设置 Save Settings - + 传感器触发滤波(ms) Sensor filtering (ms) - + 相机触发延时(ms) Sensor filtering (ms) - + 相机触发脉宽(ms) Camera width (ms) - + 光源熄灭延时时间(ms) Light delay time (ms) - + 传感器触发类型 Sensor trigger type - + 保持结果时长(ms) Result hold Times (ms) - + 连接超时次数 Connection timeouts - + 超时是否显示信息 Display information - - + + 是否自动重启服务器 Auto restart servering - + 是否保存超时日志 Save timeout log - + 发送并保存 Send and save - + 超时提醒n次后自动重启服务 Automatically restart service after n timeout reminders - + 是否显示提示 Display Warning - + 勾选后通信超时时会显示提醒信息 Reminder message will be displayed when communication timeout occurs after checking - + 勾选后通信超时次数达到后,系统将自动重启服务,PLC会自动重新连接 After checking the number of communication timeouts reached, the system will automatically restart the service, and the PLC will automatically reconnect - + 保存信息到系统日志 Save information to system log - + 勾选后表示超时信息将自动保存到系统日志中,便于查询 Check to indicate that the timeout information will be automatically saved to the system log for easy query - + 红灯 Red light - + 绿灯 Green light - + 黄灯 Yellow light - + 蜂鸣 Buzzing - + 红灯闪一下 Red light flashed - + 绿灯闪一下 Green light flashed - + 黄灯闪一下 Yellow light flashed - + 蜂鸣响一下 Bee rings - + 开发者使用 Developers use - + 相机模式 Camera mode - + 虚拟相机触发时间 Trigger times - + 系统模式 System mode - + 相机触发模式 Trigger mode - - + + 串口发送心跳包 Serial Port - - + + 网络发送心跳包 Network - - + + 串口发送通道结果 Serial Port - - + + 网络发送检测结果 Network - - + + 网络发送通道结果 Network - + 光栅使用标志 Rester - + 保存高度厚度数据 Data - + 通道分配 Channel allocate - + 启动时是否检测 Whether to detect at startup - + 显示厚度数据 Display thickness data - + 显示厚度采样数据 Display thickness sampling data - + 使用光栅获取厚度 Acquiring Thickness by Grating - + 保存数据用于测试 Save data for testing - + 是否使用通道分配 Whether to use channel allocation or not - + 是否启动就开始检测 Start checking if it's started - - + + 是否显示 Whether to display - + 保存 Save - + 请选择您的背景图 Please select your background map - + 提示 Info Warning - + 背景图更新完成,请重启本软件. Background image updated, please restart this software. - + 确认 OK - + 打开文件夹 Open folder @@ -1668,6 +1867,11 @@ p, li { white-space: pre-wrap; } 系统设置 System settings + + + 参数设置已生效!!! + Apply Successful!!! + QTimeMgrDlg @@ -1677,24 +1881,24 @@ p, li { white-space: pre-wrap; } Classes management - + 未选中 UnSelect - + 添加时间 Add - + 删除时间 Delete - + 修改时间 Modify @@ -1801,22 +2005,22 @@ p, li { white-space: pre-wrap; } Information setup - + 确定 Ok - + 取消 Cancel - + 备注信息: Note information: - + 名称: Name: @@ -1824,204 +2028,208 @@ p, li { white-space: pre-wrap; } QWorkMgrUI - QWorkMgrUI - QWorkMgrUI + QWorkMgrUI + + + + 检测配置任务表 + Model Check - + 工作任务表 Table List - + 添加任务单 Add Table - + 添加 Add - + 删除任务单 Delete Table List - + 删除 Del - + 修改任务单名称或备注信息 Modify Table List Name or Note Information - + 修改 Mod - + 使用任务单 Set Use - + 应用 Use - + 当前选择的任务表: Current Table: - - + + 数量 Num - + 添加型号到检测列表 Add model to table - + <<< <<< - + 从检测列表移除所选型号 Remove the selected model from the table - + >>> >>> - + 缩略图 Image - + 只看已选 Selected - + 只看未选 Unselected - + 显示全部 Show all - + 查找: Find: - + 其他 Others - + 按照直径检测 By diameter - + 按照厚度检测 By thickness - + 手动发送模板库 Send Models - + 检测模板管理 Detection Model Management - - + + 共 %1 个 Total of: %1 - + 当前使用的工单为 %1 The current Table is%1 - + 以下型号为重复添加: %1已被忽略. The models are added repeatedly:%1, And They have been ignored. - + 提醒 Warning - - - + + + 确定 OK - + 工单 %1 被设为应用 Table %1 is seted to Using - + 发送模板库 Send Template Library - - + + 警告 Warning - + %1任务单正在使用不能被删除,请先切换到其他任务单,再删除该任务单? %1 Table is Using and cannot be deleted. Please switch to another Table before deleting the Table? - - + + 取消 Cancel - + 是否要删除 %1 模型? Do you want to delete the%1 model? - + 序号 Num - + 内容 About @@ -2103,7 +2311,7 @@ p, li { white-space: pre-wrap; } 轮毂型号识别 - Wheel model identification + Model Detector Application @@ -2113,13 +2321,13 @@ p, li { white-space: pre-wrap; } 状态信息 - Status information + Status - + 开始检测 - Start testing + Start @@ -2127,461 +2335,525 @@ p, li { white-space: pre-wrap; } Results - + 无匹配(个) No match - + 已检测(个) Detected - + 匹配值 - Match value + Score - + 直径(mm) - Diameter (mm) + Diameter - + 时间(s) Time(s) - + 通道 Channel - - - - - - - + + + + + + + + 0 0 - + --------- --------- - + None None - - + + 检测状态 - Detection status + Detect State - + 厚度(mm) - Thickness(mm) + Thickness - + + 偏距 + Offset + + + 统计结果 - Statistical results + Static - + modelID_detect modelID_detect - + count count - + 交换班清零 - Exchange class reset + Clear - + 型号数量 - Model number + Number - - + + 模板管理 - Template management + Model Manager - + 数据查询 History - + 模板勾选 - Template selection + Model Check - + 辅助工具 - Auxiliary tools + Test Tool - + 班次设置 - Classes setting + Class Setting - + 光栅标定 - Raster calibration + Raster Setting - + IP设置 - IP settings + IP Setting - - + + 关于 About - + 登录 Login - + 用户管理 - User Management + User Manager - + 系统设置 - System settings + System Setting - - + + 相机配置 - Camera configuration + Cam Setting + + + + 算法设置 + Algo Setting + + + + + 注册产品 + Registerer - + 加载必要模块..... Load the necessary modules..... - - + + 工具 Tool - + + + 帮助 + Help + + + + + 本系统未注册激活 + The system is not activated + + + 系统时间 - System time + Time - + 班次信息 - Classes information + Class Info - 用户: - User: + User: - + 历史 History - + 系统初始化完成... System initialization complete... - + 显示识别结果 - Display recognition results + Display Result - + 相机图像和背景图不一样,请更换检测背景! The camera image is different from the background image, please change the detection background! - + 警告!!!连续出现%1个未识别型号 Warning!!! %1 unidentified models appear continuously - + ,未开启检测功能造成的 , Caused by not opening the detection function - + 获得图像,正在计算中... - Get the image, is calculating... + Calculating... - + 注 销 Logout - + 登 录 Login - - + + 该功能未启用. The feature is not enabled. - - - + + + 确认 Ok - + 你确定要注销 Are you sure you want to log out - + 班次管理 - Classes management + Classes Manager - + 调试工具 - DebugTool + Test Tool + + + + 算法参数 + Algo Setting - + 系统参数设置 - System parameter setting + System Setting - - + + 停止检测 - Stop detecting + Stop - + 按下了开始检测按钮,检测功能开启 Press the start detection button, the detection function is turned on - + 按下了停止检测按钮,检测功能关闭 Press the stop detection button, the detection function is closed - - - - + + + + 提示 - Prompt + Info - + 将清空所有数据 - All data will be cleared + Are you sure Clear the Static - + 确定 - Ok + OK - - + + 取消 - Cancel + NO + + + + 用户: + User: + + + + PLC连接 + PLC State - - - - + + + + 当前曝光时间未识别到轮毂! The current exposure time does not recognize the hub! - - + + 调整5次曝光时间后依然未能识别到轮毂! After adjusting the exposure time for 5 times, the wheel hub is still not recognized! - + + 注册 + Register + + + 按下了清零按钮,数据全部清零 Press the reset button, all data are cleared - + 天 - d + D - + 时 - h + H - + 分 - m + M - + 秒 - s + S - 系统时间: - System time: + System time: - + 运行时长: - Running time: + Time: - 检测状态: - Status: + Status: - + 检测中... Detecting... - + 未检测... - Not detected... + Not Detected... - 班次信息: - Classes info: + Classes info: - + 该时间段未设置班次 - No classes + No Classes - 当前用户: - Current user: + Current user: + + + + 班次信息: + Class: + + + + 当前用户: + User: - + + PLC已连接 + PLC Connect + + + + PLC未连接 + PLC Disconnect + + + 模板库发送完成 Template library sending completed - - + + 正在检测型号数 Number of models - + 已连接 Connected - + 已断开 Disconnected - + PLC已收到相关设置参数! The PLC has received the relevant setting parameters! - + 已打开 Opened - + 已关闭 Closed - + 轮毂型号识别系统 - Wheel Type Identification System + Wheel Model Identification System - + 本软件由杭州利珀科技开发,用于轮毂型号识别和分类,可搭配流水线运输系统使用 This software is developed by Leaper in Hangzhou. It is used for hub type identification and classification. It can be used with pipeline transportation system - + 若需要进一步了解该产品的相关信息,请访问我们的网站 For more information about this product, please visit our website - + 软件版本 Software Version - + 算法版本 - Algorithm version + Algorithm Version - + 最后更新时间 Last update time - + 版权 (c) 属 杭州利珀科技有限公司 所有 - Copyright(C) belongs to Hangzhou Lipper Technology Co., Ltd. + Copyright(C) belongs to Hangzhou Leaper Technology company - + 关闭 Shut down - + (默认) (Default) - + 默认通道 值1000 1000 (Default) diff --git a/tpvs17/tpMain/lpmain_zh.ts b/tpvs17/tpMain/lpmain_zh.ts index c3dff8b..b0b9c4c 100644 --- a/tpvs17/tpMain/lpmain_zh.ts +++ b/tpvs17/tpMain/lpmain_zh.ts @@ -6,20 +6,20 @@ 开始读取json文件数据... - + 数据读取完成... - + CWheelNet - + IP参数设置 - + @@ -28,12 +28,12 @@ 型号 - + 数量 - + @@ -41,7 +41,7 @@ 取消 - + @@ -49,42 +49,42 @@ 新建通道 - + 发送结果: - + 通道名称: - + 备注: - + 确认 - + 取消 - + 警告 - + 数据不能为空,请输入 - + @@ -92,59 +92,59 @@ 新建模板 - + 轮毂信息: - + 轮毂型号 - + 0 - + 直径(mm) - + 厚度(mm) - + 旋转次数 - + 确定 - + 取消 - + 提醒 - + 信息不能为空! - + @@ -152,55 +152,163 @@ 时间参数设置 - + 确认 - + 取消 - + 时间参数: - + 起始时间 - + 班次名称: - + hh:mm - + 结束时间 - + 当天 - + 隔天 - + + + + + QAlgParamDlg + + + 算法参数设置 + + + + + 二级圆定位: + + + + + 边缘宽度: + + + + + 从深到浅 + + + + + 从浅到深 + + + + + 边缘对比度: + + + + + 边缘转换: + + + + + 圆半径大小过滤: + + + + + 检测背景图更换: + + + + + 查看检测背景 + + + + + 是否使用图像增强 + + + + + 是否使用背景图找圆算法 + + + + + 型号匹配: + + + + + 是否使用偏距过滤模板 + + + + + 应用 + + + + + 退出 + + + + + 参数已生效!!! + + + + + 请选择您的背景图 + + + + + 提示 + + + + + 背景图更新完成,请重启本软件. + + + + + 确认 + @@ -208,123 +316,123 @@ 相机配置 - + 内触发 - + 外触发 - + 软触发 - + 打开 - + 触发 - + 显示名称: - + 相机类型: - + 虚拟相机 - + 海康相机 - + 堡盟相机 - + 序列号: - + set - + 路径: - + 设置 - + 增益: - + 图像宽度: - + 曝光: - + 图像高度: - + 图像格式: - + Gray8 - + RGB32 - + 关闭 - + @@ -332,72 +440,72 @@ 通道信息管理 - + 所有通道数据 - + 发送结果: - + 通道名称: - + 备注: - + 是否设为默认(NG流向的通道) - + 确认修改 - + 退出 - + 编号 - + 通道名 - + 备注 - + 发送结果 - + 是否为默认 - + 默认 - + @@ -405,68 +513,134 @@ QChannelMgrDlg - + 所有型号及图像 - + 型号: - + 通道: - + 查找: - + 隐藏 - + 修改 - + 0 - + 通道分配: - + 删除通道 - + 增加通道 - + 刷新 - + 通道管理 - + + + + + QCryptokeyUI + + + 注册 + + + + + 退出 + + + + + 机器码: + + + + + 注册码: + + + + + 激活 + + + + + + 请输入注册码 + + + + + 激活状态: + + + + + 未激活 + + + + + + + 提示 + + + + + 注册码不匹配,请重新输入 + + + + + 已激活 + + + + + 系统激活完成 + @@ -474,7 +648,7 @@ QDebugDlg - + @@ -483,50 +657,50 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">右侧是算法裁剪后的图像、匹配的型号、算法匹配的最小阈值、匹配模板对应的直径和厚度(新建模板时输入的)</p></body></html> - + 000000 - + 0.0 - + 厚度mm: - + 0 - + 直径mm: - + 开始模拟检测 - + 采集一张 - + 停止 - + @@ -534,47 +708,47 @@ p, li { white-space: pre-wrap; } 直径标定 - + K:表示斜率,B:基准点,直径=高度*K+B - + 确认修改 - + 退出 - + B: - + K: - + 提示 - + 修改完成,参数已生效! - + 确定 - + @@ -582,48 +756,48 @@ p, li { white-space: pre-wrap; } QIPConfigDlg - + 本机服务器IP地址设置 - + IP 地址(I): - + 关闭服务 - + 开放端口: - + 打开服务 - + 目标客户端IP地址设置 - + 源端口: - + 确定 - + @@ -631,59 +805,59 @@ p, li { white-space: pre-wrap; } 模板名修改 - + 确认修改 - + 取消 - + 缩略图: - + TextLabel - + 旧型号名: - + 新型号名: - + 提示 - + 新型号名不能为空! - + 型号库中已包含该型号,请重新设置型号名! - + 确认 - + @@ -691,449 +865,459 @@ p, li { white-space: pre-wrap; } QModelMgrDlg - + - + 轮毂信息: - + - + 型号 - + - + 0% - + - + 阈值调节 - + - + 严格 - + - + 旋转次数 - + - + 缩略图 - + - + 宽松 - + - + 厚度(mm) - + - + 直径(mm) - + - + 加入训练 - + - + + 最小偏距 + + + + + 最大偏距 + + + + 基本操作 - + - - + + 删除模板 - + - + 训练当前模板 - + - + 训练模板 - + - + 添加新的模板 - + - + 新建模板 - + - + 训练所有模板,消耗时间会较长 - + - + 训练全部 - + - + 确认修改,每次修改模板的参数后都要确认修改才有效 - + - + 修改确认 - + - + 修改型号名 - + - + 图片显示: - + - - + + 添加已裁剪的轮毂图片 - + - + 追加 - + - - + + 删除所有模板 - + 模板型号查询 - + 查找: - + 数量 - + - + modelID - + - - - - - + + + + - - - - - - - + + + + + + + + 提示 - + - - + + 请选择一个您要追加图像的型号! - + - + 加载图像 - + - + 图像加载中,请稍后..... - + - + 添加失败,不能添加带检测背景的图片作为模板!!! - + - + 加载完成 - + - - - + + + 请选择一个您要修改的型号! - + - + 修改了模板 - + - + 的参数 - + - + 修改成功! - + - + 请选择一个您要删除的型号 - + - + 按下了删除模板按钮 - + - + 是否删除型号 - + - + 产品模板 - + - + 删除了模板 - + - - - - - - - - + + + + + + + + 共 - + - - - - - + + + + + 个型号 - + - + 按下了添加模板按钮 - + - + 产品信息设置 - + - + 添加了一个新的模型 - + - + 请选择一个您要训练的型号! - + - - + + 训练模板线程未退出,请稍等 - + - + 将对所有型号模板进行重新训练,期间系统的检测功能将不能正常运行直到模板训练完成,全部重新训练模板将需要很长时间,期间将不能进行其他工作,是否继续执行? - + - + 确定删除该图像? - + - + 模板图片删除 - + - - - + + + 个图像 - + - + 警告 - + - + 即将删除模板库里的所有模板,是否继续? - + - + 再次确认,是否全部删除? - + - + 没有模板!!! - + - + 全部删除完成!!! - + - + 图像数量少于 - + - + 个,请及时补充训练样本 - + - - - - - - + + + + + + 模板更新进度 - + - + 正在初始化所有模板 共需要训练%1个模板,请稍后..... - + - + 正在训练%1的模板 已完成%2/%3,请稍后..... - + - + %1的模板获取特征 已完成%2/%3,请稍后..... - + - + %1的模板训练完成 已完成%2/%3,请稍后..... - + - + 全部模板更新完成!%1s - + - + 对全部模板进行了重新训练,共%1个模板 - + - + 模板正在准备请稍后..... - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + 模板训练进度 - + - - + + %1型号没有图片不能训练! - + - + %1的模板 正在获取特征值,请稍后.... - + - + 训练完成!%1s - + - + 训练了模板:%1 - + - + 确认 - + - + 取消 - + @@ -1141,7 +1325,7 @@ p, li { white-space: pre-wrap; } 程序正在启动... - + @@ -1149,42 +1333,62 @@ p, li { white-space: pre-wrap; } 虚拟相机触发 - + 硬件相机触发 - + 调试免登陆 - + 正常工作模式 - + 传感器触发 - + 软件触发 - + 下降沿触发 - + 上升沿触发 - + + + + + 警告 + + + + + 本检测系统正在运行,您真的要关闭? + + + + + 确定 + + + + + 取消 + @@ -1192,7 +1396,7 @@ p, li { white-space: pre-wrap; } QSettingDlg - + @@ -1200,27 +1404,27 @@ p, li { white-space: pre-wrap; } 检测背景图像显示 - + 退出 - + 我要更换背景 - + pic - + 没有用于检测的背景图,请更换检测背景 - + @@ -1228,399 +1432,379 @@ p, li { white-space: pre-wrap; } 相关设备配置 - + - + 检测图像设置 - + - + PLC相关设置 - + - + 报警灯测试 - + 高级功能 - + 属性 - + 值 - + - + 语言 - + - - 检测背景更换 - - - - - + + 抠图后 - + - - + + 原图 - - - - - 背景图 - + - + 检测结果 - + - + 图像保存路径 - + - - + + 设置保存路径 - + - - + + 打开图像路径 - + - + 保存当前设置 - + - - + + 保存已匹配图 - + - - + + 保存无匹配图 - - - - - 使用背景图 - + - + 轮毂全去A通道 - + - - 查看检测背景 - - - - + 保存参数 - + - - + + 保存设置 - + - + 传感器触发滤波(ms) - + - + 相机触发延时(ms) - + - + 相机触发脉宽(ms) - + - + 光源熄灭延时时间(ms) - + - + 传感器触发类型 - + - + 保持结果时长(ms) - + - + 连接超时次数 - + - + 超时是否显示信息 - + - - + + 是否自动重启服务器 - + - + 是否保存超时日志 - + - + 发送并保存 - + - + 超时提醒n次后自动重启服务 - + - + 是否显示提示 - + - + 勾选后通信超时时会显示提醒信息 - + - + 勾选后通信超时次数达到后,系统将自动重启服务,PLC会自动重新连接 - + - + 保存信息到系统日志 - + - + 勾选后表示超时信息将自动保存到系统日志中,便于查询 - + - + 红灯 - + - + 绿灯 - + - + 黄灯 - + - + 蜂鸣 - + - + 红灯闪一下 - + - + 绿灯闪一下 - + - + 黄灯闪一下 - + - + 蜂鸣响一下 - + - + 开发者使用 - + - + 相机模式 - + - + 虚拟相机触发时间 - + - + 系统模式 - + - + 相机触发模式 - + - - + + 串口发送心跳包 - + - - + + 网络发送心跳包 - + - - + + 串口发送通道结果 - + - - + + 网络发送检测结果 - + - - + + 网络发送通道结果 - + - + 光栅使用标志 - + - + 保存高度厚度数据 - + - + 通道分配 - + - + 启动时是否检测 - + - + 显示厚度数据 - + - + 显示厚度采样数据 - + - + 使用光栅获取厚度 - + - + 保存数据用于测试 - + - + 是否使用通道分配 - + - + 是否启动就开始检测 - + - - + + 是否显示 - + - + 保存 - + - + 请选择您的背景图 - + - + 提示 - + - + 背景图更新完成,请重启本软件. - + - + 确认 - + - + 打开文件夹 - + @@ -1628,7 +1812,12 @@ p, li { white-space: pre-wrap; } 系统设置 - + + + + + 参数设置已生效!!! + @@ -1636,49 +1825,49 @@ p, li { white-space: pre-wrap; } 班次管理 - + - + 未选中 - + - + 添加时间 - + - + 删除时间 - + - + 修改时间 - + 班次 - + 起始时间 - + 结束时间 - + 设置参数 - + @@ -1688,7 +1877,7 @@ p, li { white-space: pre-wrap; } 当天 - + @@ -1698,37 +1887,37 @@ p, li { white-space: pre-wrap; } 隔天 - + 提示 - + 未选择班次,请选择进行修改。 - + 确认 - + 您确定要删除 %1 班次? - + 取消 - + @@ -1736,23 +1925,23 @@ p, li { white-space: pre-wrap; } 工单信息设置 - + 警告 - + 名称不能为空. - + 你输入的名称:%1 重复. - + @@ -1760,232 +1949,232 @@ p, li { white-space: pre-wrap; } 信息设置 - + - + 确定 - + - + 取消 - + - + 备注信息: - + - + 名称: - + QWorkMgrUI - QWorkMgrUI - + 检测配置任务表 + - + 工作任务表 - + - + 添加任务单 - + - + 添加 - + - + 删除任务单 - + - + 删除 - + - + 修改任务单名称或备注信息 - + - + 修改 - + - + 使用任务单 - + - + 应用 - + - + 当前选择的任务表: - + - - + + 数量 - + - + 添加型号到检测列表 - + - + <<< - + - + 从检测列表移除所选型号 - + - + >>> - + - + 缩略图 - + - + 只看已选 - + - + 只看未选 - + - + 显示全部 - + - + 查找: - + - + 其他 - + - + 按照直径检测 - + - + 按照厚度检测 - + - + 手动发送模板库 - + - + 检测模板管理 - + - - + + 共 %1 个 - + - + 当前使用的工单为 %1 - + - + 以下型号为重复添加: %1已被忽略. - + - + 提醒 - + - - - + + + 确定 - + - + 工单 %1 被设为应用 - + - + 发送模板库 - + - - + + 警告 - + - + %1任务单正在使用不能被删除,请先切换到其他任务单,再删除该任务单? - + - - + + 取消 - + - + 是否要删除 %1 模型? - + - + 序号 - + - + 内容 - + @@ -1994,17 +2183,17 @@ p, li { white-space: pre-wrap; } line item is not created - + line item is already created - + rect item is already created - + @@ -2012,52 +2201,52 @@ p, li { white-space: pre-wrap; } 加载通道模块 .... - + 加载模板库 .... - + 加载检测设置模块 .... - + 加载数据库 .... - + 加载班次管理模块 .... - + 加载其他模块 .... - + 创建子线程 .... - + 加载光栅通讯模块 .... - + 模块加载完成,启动线程 .... - + 未登录 - + @@ -2065,487 +2254,531 @@ p, li { white-space: pre-wrap; } 轮毂型号识别 - + image_zoom.ui - + 状态信息 - + - + 开始检测 - + 检测结果 - + - + 无匹配(个) - + - + 已检测(个) - + - + 匹配值 - + - + 直径(mm) - + - + 时间(s) - + - + 通道 - + - - - - - - - + + + + + + + + 0 - + - + --------- - + - + None - + - - + + 检测状态 - + - + 厚度(mm) - + - + + 偏距 + + + + 统计结果 - + - + modelID_detect - + - + count - + - + 交换班清零 - + - + 型号数量 - + - - + + 模板管理 - + - + 数据查询 - + - + 模板勾选 - + - + 辅助工具 - + - + 班次设置 - + - + 光栅标定 - + - + IP设置 - + - - + + 关于 - + - + 登录 - + - + 用户管理 - + - + 系统设置 - + - - + + 相机配置 - + + + + + 算法设置 + + + + + + 注册产品 + - + 加载必要模块..... - + - - + + 工具 - + + + + + + 帮助 + - + + + 本系统未注册激活 + + + + 系统时间 - + - + 班次信息 - + - - 用户: - + + 用户: + - + + PLC连接 + + + + 历史 - + - + 系统初始化完成... - + - - + + 停止检测 - + - + 显示识别结果 - + - - - - + + + + 当前曝光时间未识别到轮毂! - + - - + + 调整5次曝光时间后依然未能识别到轮毂! - + - + 相机图像和背景图不一样,请更换检测背景! - + - + 警告!!!连续出现%1个未识别型号 - + - + ,未开启检测功能造成的 - + - + 获得图像,正在计算中... - + - + 注 销 - + - + 登 录 - + - - - - + + + + 提示 - + - - + + 该功能未启用. - + - - - + + + 确认 - + - + 你确定要注销 - + - - + + 取消 - + - + 班次管理 - + - + 调试工具 - + + + + + 算法参数 + - + 系统参数设置 - + - + + 注册 + + + + 按下了开始检测按钮,检测功能开启 - + - + 按下了停止检测按钮,检测功能关闭 - + - + 将清空所有数据 - + - + 确定 - + - + 按下了清零按钮,数据全部清零 - + - + 天 - + - + 时 - + - + 分 - + - + 秒 - + - - 系统时间: - + + 运行时长: + - - 运行时长: - + + 班次信息: + - - 检测状态: - + + 当前用户: + - + 检测中... - + - + 未检测... - + - - 班次信息: - + + 该时间段未设置班次 + - - 该时间段未设置班次 - + + PLC已连接 + - - 当前用户: - + + PLC未连接 + - + 模板库发送完成 - + - - + + 正在检测型号数 - + - + 已连接 - + - + 已断开 - + - + PLC已收到相关设置参数! - + - + 已打开 - + - + 已关闭 - + - + 轮毂型号识别系统 - + - + 本软件由杭州利珀科技开发,用于轮毂型号识别和分类,可搭配流水线运输系统使用 - + - + 若需要进一步了解该产品的相关信息,请访问我们的网站 - + - + 软件版本 - + - + 算法版本 - + - + 最后更新时间 - + - + 版权 (c) 属 杭州利珀科技有限公司 所有 - + - + 关闭 - + - + (默认) - + - + 默认通道 值1000 - + diff --git a/tpvs17/wheel.sln b/tpvs17/wheel.sln index d3f3f0d..e0febb3 100644 --- a/tpvs17/wheel.sln +++ b/tpvs17/wheel.sln @@ -21,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lpReport", "lpReport\lpRepo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Net4Wheel", "Net4Wheel\Net4Wheel.vcxproj", "{9B718379-3719-4D4E-A903-EDE7EFB4DC65}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tpCamVirtual", "..\..\Valve\tpvs17\tpCamVirtual\tpCamVirtual.vcxproj", "{707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -85,12 +87,20 @@ Global {9B718379-3719-4D4E-A903-EDE7EFB4DC65}.Release|x64.ActiveCfg = Release|x64 {9B718379-3719-4D4E-A903-EDE7EFB4DC65}.Release|x64.Build.0 = Release|x64 {9B718379-3719-4D4E-A903-EDE7EFB4DC65}.Release|x86.ActiveCfg = Release|x64 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Debug|x64.ActiveCfg = Debug|x64 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Debug|x64.Build.0 = Debug|x64 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Debug|x86.ActiveCfg = Debug|Win32 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Debug|x86.Build.0 = Debug|Win32 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Release|x64.ActiveCfg = Release|x64 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Release|x64.Build.0 = Release|x64 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Release|x86.ActiveCfg = Release|Win32 + {707DDF6F-B78B-42F7-9EAD-E786C0FCD5FF}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - Qt5Version = qt5.9.4-msvc2017-x64 SolutionGuid = {CD365F32-5EAC-4A16-AD47-BFB1D8E5511A} + Qt5Version = qt5.9.4-msvc2017-x64 EndGlobalSection EndGlobal