From 4dbfade00eb862d3b82fe1210d6eac886d9bb76d Mon Sep 17 00:00:00 2001 From: masayume <1936714878@qq.com> Date: Thu, 20 May 2021 18:17:37 +0800 Subject: [PATCH] =?UTF-8?q?2021.5.19=09=E5=B1=8F=E8=94=BD8=E5=BC=8016?= =?UTF-8?q?=E5=BC=80=E5=B0=BA=E5=AF=B8=E6=A3=80=E6=B5=8B=20=09=E5=9C=A8?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E5=88=B0stopscan=E4=B9=8B=E5=90=8E=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BB=B6=E6=97=B6=EF=BC=8C=E9=98=B2=E6=AD=A2=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=BB=9A=E8=BD=B4=E6=95=B0=E5=B9=B2=E6=89=B0dsp?= =?UTF-8?q?=E8=AF=BB=E5=86=99flash=202021.5.20=09=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E6=B2=B3=E5=8D=97=E5=A4=A9=E4=B8=80=E9=98=85=E5=8D=B7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=EF=BC=8C=E4=BF=AE=E6=94=B9DeviceOnline=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=EF=BC=8C=E7=94=B1enum=E4=BF=AE=E6=94=B9=E4=B8=BAoneva?= =?UTF-8?q?lue=EF=BC=8C=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=94=B9=E4=B8=BAbool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huagao/Device/GScanO200.cpp | 2 +- huagao/ImageProcess/ImageApplyAutoCrop.cpp | 4 ---- huagao/ImageProcess/ImageApplyRotation.cpp | 6 +++--- huagao/huagaods.cpp | 14 ++++++++++++-- huagao/stdafx.h | Bin 12040 -> 12044 bytes 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/huagao/Device/GScanO200.cpp b/huagao/Device/GScanO200.cpp index 1de02f7b..7a419161 100644 --- a/huagao/Device/GScanO200.cpp +++ b/huagao/Device/GScanO200.cpp @@ -713,7 +713,7 @@ std::shared_ptr> GScanO200::Get_Img_Data(int bufferSize) int startindex = 0; while (totalength > 0) { - int dstlength = 1024 * 1024; + int dstlength = 512 * 1024; if (totalength <= dstlength) { dstlength = totalength; diff --git a/huagao/ImageProcess/ImageApplyAutoCrop.cpp b/huagao/ImageProcess/ImageApplyAutoCrop.cpp index b929ab0e..8df60464 100644 --- a/huagao/ImageProcess/ImageApplyAutoCrop.cpp +++ b/huagao/ImageProcess/ImageApplyAutoCrop.cpp @@ -54,10 +54,6 @@ void CImageApplyAutoCrop::apply(cv::Mat& pDib, int side) if (m_maxContour.size() == 0) { - thre.release(); -#ifdef LOG - FileTools::write_log("imgprc.txt", "exit CImageApplyAutoCrop apply"); -#endif // LOG return; } thre.release(); diff --git a/huagao/ImageProcess/ImageApplyRotation.cpp b/huagao/ImageProcess/ImageApplyRotation.cpp index 8e8db5aa..801fcc02 100644 --- a/huagao/ImageProcess/ImageApplyRotation.cpp +++ b/huagao/ImageProcess/ImageApplyRotation.cpp @@ -91,12 +91,12 @@ void CImageApplyRotation::apply(cv::Mat & pDib, int side) if (m_rotation == RotationType::Rotate_90_clockwise || m_rotation == RotationType::Rotate_90_anti_clockwise) //90�� -90�� { transpose(pDib, pDib); - flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 1 : 0); + flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 0 : 1); } else { - flip(pDib, pDib, 0); flip(pDib, pDib, 1); + flip(pDib, pDib, 0); } } } @@ -105,7 +105,7 @@ void CImageApplyRotation::apply(cv::Mat & pDib, int side) if (m_rotation == RotationType::Rotate_90_clockwise || m_rotation == RotationType::Rotate_90_anti_clockwise) //90�� -90�� { transpose(pDib, pDib); - flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 0 : 1); + flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 1 : 0); } else if (m_rotation == RotationType::Rotate_180) { diff --git a/huagao/huagaods.cpp b/huagao/huagaods.cpp index 6d2b07c8..9d55c516 100644 --- a/huagao/huagaods.cpp +++ b/huagao/huagaods.cpp @@ -850,9 +850,19 @@ Result HuagaoDs::identityOpenDs(const Identity&) { m_caps[CapType::UiControllable] = std::bind(oneValGet, _1, _2, Bool(true)); m_query[CapType::DeviceOnline] = msgSupportGetAll; - m_caps[CapType::DeviceOnline] = std::bind(enmGet, _1, _2, Bool(scanner->IsConnected())); - + //m_caps[CapType::DeviceOnline] = std::bind(enmGet, _1, _2, Bool(scanner->IsConnected())); + m_caps[CapType::DeviceOnline] = [this](Msg msg, Capability& data) -> Result { + switch (msg) { + case Msg::Get: + case Msg::GetCurrent: + case Msg::GetDefault: + data = Capability::createOneValue((Twpp::Bool)scanner->IsConnected()); + return {}; + default: + return { ReturnCode::Failure, ConditionCode::CapBadOperation }; + } + }; m_query[CapType::XferCount] = msgSupportGetAllSetReset; m_caps[CapType::XferCount] = [this](Msg msg, Capability& data) -> Result { diff --git a/huagao/stdafx.h b/huagao/stdafx.h index 4d5a64b6bace6268f4e8171984e3bf1d2a93466d..e93aee20f3e0028c7c3539fd2775668f4fdd14f3 100644 GIT binary patch delta 15 WcmeB(>xtX&fn&0Ys>miz4mAKX)&)`k delta 16 XcmeB)>xkR%fn&0Vy1-@@P7XByIwS>o