From 9053cedda4056237274851fe42b85d56d283305b Mon Sep 17 00:00:00 2001 From: lovelyyoung <1002639516@qq.com> Date: Tue, 17 Mar 2020 21:04:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E6=95=88=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huagao/Device/GScanO200.cpp | 6 +++--- huagao/Device/ImageMatQueue.cpp | 8 -------- huagao/Device/ImageMatQueue.h | 33 +-------------------------------- 3 files changed, 4 insertions(+), 43 deletions(-) diff --git a/huagao/Device/GScanO200.cpp b/huagao/Device/GScanO200.cpp index d3cb5ad1..3fbed4ea 100644 --- a/huagao/Device/GScanO200.cpp +++ b/huagao/Device/GScanO200.cpp @@ -292,9 +292,9 @@ void GScanO200::usbhotplug_callback(bool isconnect, void* userdata) void GScanO200::usbhotplug(bool isleft) { if (isleft) { - devState = DEV_WRONG; - Error_Code = USB_DISCONNECTED; - m_pImages->setscanflags(false); + //devState = DEV_WRONG; + //Error_Code = USB_DISCONNECTED; + //m_pImages->setscanflags(false); } } diff --git a/huagao/Device/ImageMatQueue.cpp b/huagao/Device/ImageMatQueue.cpp index 661bad66..e7543af3 100644 --- a/huagao/Device/ImageMatQueue.cpp +++ b/huagao/Device/ImageMatQueue.cpp @@ -198,14 +198,6 @@ void ImageMatQueue::PaniusCount() atm_orgin_image_remains--; } -double ImageMatQueue::round_to_n_digits(double x, int n) -{ - double scale = pow(10.0, ceil(log10(fabs(x))) + n); - - return round(x * scale) / scale; -} - - bool ImageMatQueue::empty() { return atm_orgin_image_remains == 0 && m_imagedata.Size() == 0 && !is_scanning; diff --git a/huagao/Device/ImageMatQueue.h b/huagao/Device/ImageMatQueue.h index f50f18f8..5d9cbcf4 100644 --- a/huagao/Device/ImageMatQueue.h +++ b/huagao/Device/ImageMatQueue.h @@ -71,11 +71,6 @@ public: } } } - //FILE* fout = fopen("afterBW.bmp", "wb"); - //if (fout) { - // fwrite(m_data.data(), 1, m_data.size(), fout); - // fclose(fout); - //} } private: void setBmpFileHeader(const cv::Mat& mat,const int bmpDataLen) { @@ -146,10 +141,6 @@ private: void proc(); void EnqueueBmpBuffer(std::vector& bmpdata); void PaniusCount(); - - double round_to_n_digits(double x, int n); - //template - //T round(T, int bits); BlockingQueue> m_imagedata; std::mutex m_Locker; std::mutex m_mtxJB; @@ -163,26 +154,4 @@ private: Device::PaperSize papersize; std::vector> m_iaList; BlockingQueue> m_rawBuffs; -}; -// -//template -//inline T ImageMatQueue::round(T src, int bits) -//{ -// if (0 > bits) -// return 0; -// T retVal = 0.0; -// int tmp = 0; -// -// if (0 > src) { -// src *= -1; -// tmp = (int)((src + 0.5 / pow(10.0, bits)) * pow(10.0, bits)); -// retVal = ((T)tmp) / pow(10.0, bits); -// src *= -1; -// } -// else -// { -// tmp = (int)((src + 0.5 / pow(10.0, bits)) * pow(10.0, bits)); -// retVal = ((T)tmp) / pow(10.0, bits); -// } -// return retVal; -//} +}; \ No newline at end of file