admin
2023-01-02 954ead41d9391bca28a3cc4f9592f73f25b3bbc8
ConsoleApplication/CurrentPriceCapture.cpp
@@ -325,6 +325,11 @@
         int y = wrect.top + 50;
         PostMessage(win, WM_MOUSEWHEEL, 0, MAKEWORD(x, y));
         Sleep(1000);
         int re_try_count = 0;
         while (re_try_count < 3) {
            int invalid_price_count = 0;
            re_try_count++;
         cv::Mat oimg = CaptureUtil::capture(win);
         list<CurrentPriceData> codes = capture(oimg,openCLExcuter);
         for (list<CurrentPriceData>::iterator ele = codes.begin();ele != codes.end();ele++) {
@@ -333,8 +338,20 @@
               codesSet.insert(code);
               flist.push_back(*ele);
            }
               else if (stof((*ele).price) <= 0) {
                  // 获取的价格无效
                  invalid_price_count++;
               }
         }
         codes.clear();
            if (invalid_price_count <= 1) {
               // 无效价格代码数量小于1个就退出
               break;
            }
            else {
               Sleep(500);
            }
         }
         Sleep(50);
   }
   return flist;