海云天专版

This commit is contained in:
masayume 2022-08-23 16:03:04 +08:00
parent e964c60148
commit 085cdcc9a3
10 changed files with 57 additions and 16 deletions

View File

@ -132,7 +132,7 @@ void CFeedPaperPage::OnBnClickedScanMode()
m_editNum.EnableWindow(m_radioGroupScanMode); m_editNum.EnableWindow(m_radioGroupScanMode);
} }
void CFeedPaperPage::FeedPaperPageUpdate(int val) void CFeedPaperPage::FeedPaperPageUpdate(int duplux,int papersize)
{ {
//CButton* m_tempBtn = (CButton*)(GetDlgItem(IDC_CKBACKROTATION)); //CButton* m_tempBtn = (CButton*)(GetDlgItem(IDC_CKBACKROTATION));
////int ival = val; ////int ival = val;
@ -140,10 +140,17 @@ void CFeedPaperPage::FeedPaperPageUpdate(int val)
// m_tempBtn->SetCheck(0); // m_tempBtn->SetCheck(0);
//BOOL enable = (val == 0 || val == 4); //BOOL enable = (val == 0 || val == 4);
//m_tempBtn->EnableWindow(!enable); //m_tempBtn->EnableWindow(!enable);
comboxduplux = val; comboxduplux = duplux;
if ((val > 0) && (val < 4) && (m_cmBoxOrentation.GetCurSel() != 4)) comboxpapersize = papersize;
if ((duplux > 0) && (duplux < 4) && (m_cmBoxOrentation.GetCurSel() != 4))
{ {
((CButton*)(GetDlgItem(IDC_CKBACKROTATION)))->EnableWindow(TRUE); ((CButton*)(GetDlgItem(IDC_CKBACKROTATION)))->EnableWindow(TRUE);
#ifndef G300
if (duplux == 1 && (papersize == 3 || papersize == 5 || papersize == 7 || papersize == 9 || papersize == 12 || papersize == 14 || papersize == 16))
{
((CButton*)(GetDlgItem(IDC_CKBACKROTATION)))->SetCheck(TRUE);
}
#endif // G300
} }
else else
{ {
@ -184,7 +191,7 @@ void CFeedPaperPage::OnBnClickedCkskewdetect()
void CFeedPaperPage::OnCbnSelchangeCmborentation() void CFeedPaperPage::OnCbnSelchangeCmborentation()
{ {
// TODO: 在此添加控件通知处理程序代码 // TODO: 在此添加控件通知处理程序代码
FeedPaperPageUpdate(comboxduplux); FeedPaperPageUpdate(comboxduplux,comboxpapersize);
} }

View File

@ -13,7 +13,7 @@ public:
CFeedPaperPage(/*std::function<void()> datachange,*/CWnd* pParent = nullptr); // 标准构造函数 CFeedPaperPage(/*std::function<void()> datachange,*/CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFeedPaperPage(); virtual ~CFeedPaperPage();
void FeedPaperPageUpdate(int val); void FeedPaperPageUpdate(int duplux, int papersize);
void FeedAutoDescrewUpdate(int val); void FeedAutoDescrewUpdate(int val);
void OnInitcmBoxOrentation(int selectIndex); void OnInitcmBoxOrentation(int selectIndex);
CButton dogear; CButton dogear;
@ -44,6 +44,7 @@ protected:
private: private:
virtual BOOL PreTranslateMessage(MSG* pMsg); virtual BOOL PreTranslateMessage(MSG* pMsg);
int comboxduplux; int comboxduplux;
int comboxpapersize;
/*std::function<void()> m_datachange;*/ /*std::function<void()> m_datachange;*/
public: public:

View File

@ -57,7 +57,7 @@ BOOL CTwainUI::OnInitDialog()
if (m_pageBasic.get() && m_pageImageProc.get() && m_pageBrightness.get() && m_pageFeedPaper.get()) { if (m_pageBasic.get() && m_pageImageProc.get() && m_pageBrightness.get() && m_pageFeedPaper.get()) {
m_pageImageProc->ImageProcPageUpdate(m_pageBasic->m_cmBoxColorMode->GetCurSel(), m_pageBasic->m_cmBoxSS->GetCurSel(), m_pageBasic->m_cmBoxDuplex->GetCurSel(), m_pageImageProc->ImageProcPageUpdate(m_pageBasic->m_cmBoxColorMode->GetCurSel(), m_pageBasic->m_cmBoxSS->GetCurSel(), m_pageBasic->m_cmBoxDuplex->GetCurSel(),
(getcombox_ss(m_pageBasic->m_cmBoxSS->GetCurSel()) == TwSS::USStatement) || (getcombox_ss(m_pageBasic->m_cmBoxSS->GetCurSel()) == TwSS::None), m_pageBasic->m_Slider_Dpi.m_iPosition); (getcombox_ss(m_pageBasic->m_cmBoxSS->GetCurSel()) == TwSS::USStatement) || (getcombox_ss(m_pageBasic->m_cmBoxSS->GetCurSel()) == TwSS::None), m_pageBasic->m_Slider_Dpi.m_iPosition);
m_pageFeedPaper->FeedPaperPageUpdate(m_pageBasic->m_cmBoxDuplex->GetCurSel()); m_pageFeedPaper->FeedPaperPageUpdate(m_pageBasic->m_cmBoxDuplex->GetCurSel(),m_pageBasic->m_cmBoxSS->GetCurSel());
m_pageImageProc->ImageAutoDescrewUpdate(m_pageBasic->m_cmBoxSS->GetCurSel()); m_pageImageProc->ImageAutoDescrewUpdate(m_pageBasic->m_cmBoxSS->GetCurSel());
//m_pageFeedPaper->FeedAutoDescrewUpdate(m_pageBasic->m_cmBoxSS->GetCurSel()); //m_pageFeedPaper->FeedAutoDescrewUpdate(m_pageBasic->m_cmBoxSS->GetCurSel());
UpdateUi(); UpdateUi();

View File

@ -59,7 +59,14 @@ GScanO1003399::~GScanO1003399()
m_usb.reset(); m_usb.reset();
scanflag = false; scanflag = false;
b_imgprothread = false; b_imgprothread = false;
if (m_aquirethread.get() && m_aquirethread->joinable())
{
m_aquirethread->join();
m_aquirethread.reset();
}
imgs.ShutDown(); imgs.ShutDown();
while (m_paths.Size() > 0) while (m_paths.Size() > 0)
@ -412,7 +419,26 @@ void GScanO1003399::Scanner_StartScan(UINT16 count)
scanflag = false; scanflag = false;
return; return;
} }
if (m_aquirethread.get() && m_aquirethread->joinable())
{
scanflag = false;
m_aquirethread->join();
}
scanflag = true;
m_aquirethread.reset(new std::thread([this] {
while (scanflag)
{
if (im_dev_count() > 0)
{
im_rx();
}
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
while (im_dev_count() > 0)
{
im_rx();
}
}));
start(); start();
bool procmode = (m_param.resolution_dst > 200.0f || m_param.papertype == 52 || m_param.papertype == 54 || m_param.papertype == 131); bool procmode = (m_param.resolution_dst > 200.0f || m_param.papertype == 52 || m_param.papertype == 54 || m_param.papertype == 131);
if (m_imgprocthread.get() && m_imgprocthread->joinable()) if (m_imgprocthread.get() && m_imgprocthread->joinable())
@ -513,8 +539,8 @@ void GScanO1003399::usb_run()
switch (info.From) switch (info.From)
{ {
case IMG: case IMG:
if (is_runing() && (im_dev_count()>0)) /*if (is_runing() && (im_dev_count()>0))
im_rx(); im_rx();*/
break; break;
case MtBoard: case MtBoard:
FileTools::writelog(log_ERROR, "Got MotorBoard error code = " + to_string(info.Code)); FileTools::writelog(log_ERROR, "Got MotorBoard error code = " + to_string(info.Code));
@ -546,7 +572,9 @@ void GScanO1003399::usb_run()
FileTools::writelog(log_ERROR, "keep last paper true"); FileTools::writelog(log_ERROR, "keep last paper true");
this_thread::sleep_for(chrono::milliseconds(100)); this_thread::sleep_for(chrono::milliseconds(100));
while (im_dev_count() > ((m_param.is_duplex && !m_param.en_fold) ? 2 : 1)) while (im_dev_count() > ((m_param.is_duplex && !m_param.en_fold) ? 2 : 1))
im_rx(); {
std::this_thread::sleep_for(std::chrono::milliseconds(100));//im_rx();
}
if (!is_kernelsnap_211209) { if (!is_kernelsnap_211209) {
if (m_param.is_duplex && !m_param.en_fold) if (m_param.is_duplex && !m_param.en_fold)
pop_dev_im(); pop_dev_im();
@ -556,8 +584,8 @@ void GScanO1003399::usb_run()
else else
{ {
keeplastimg = false; keeplastimg = false;
while (im_dev_count()) /*while (im_dev_count())
im_rx(); im_rx();*/
} }
if ((devState != DEV_WRONG) && (get_ErrorCode()<=0)) if ((devState != DEV_WRONG) && (get_ErrorCode()<=0))
devState = DEV_STOP; devState = DEV_STOP;

View File

@ -113,6 +113,7 @@ private:
//std::shared_ptr<CImageApplyRotation> m_autotext; //std::shared_ptr<CImageApplyRotation> m_autotext;
std::shared_ptr <std::thread> m_imgprocthread; std::shared_ptr <std::thread> m_imgprocthread;
std::shared_ptr<std::thread> m_usbthread; std::shared_ptr<std::thread> m_usbthread;
std::unique_ptr<std::thread> m_aquirethread;
std::shared_ptr<std::vector<char>> im_data; std::shared_ptr<std::vector<char>> im_data;
BlockingQueue<std::shared_ptr<std::vector<unsigned char>>> m_imagedata; BlockingQueue<std::shared_ptr<std::vector<unsigned char>>> m_imagedata;
std::string fwversion; std::string fwversion;

View File

@ -520,7 +520,7 @@ int UsbScanEx::write_bulk(void* data, int len)
#ifdef ANDROIDSERIAL #ifdef ANDROIDSERIAL
GetOverlappedResult(h_pipe, lp_overlap, &dw_size, TRUE); GetOverlappedResult(h_pipe, lp_overlap, &dw_size, TRUE);
#else #else
WaitForSingleObject(lp_overlap->hEvent, 500); WaitForSingleObject(lp_overlap->hEvent, 1000);
GetOverlappedResult(h_pipe, lp_overlap, &dw_size, FALSE); GetOverlappedResult(h_pipe, lp_overlap, &dw_size, FALSE);
#endif // ANDROIDSERIAL #endif // ANDROIDSERIAL
return dw_size; return dw_size;

View File

@ -1017,7 +1017,7 @@ json GscanJsonConfig::GetDefaultJson()
"iEnhance": 0 , "iEnhance": 0 ,
"iSharpen": 0 , "iSharpen": 0 ,
"bAutoDescrew": true , "bAutoDescrew": true ,
"bFillBlcak": true , "bFillBlcak": false ,
"iMultiOutPut": false , "iMultiOutPut": false ,
"bMultiOut": false , "bMultiOut": false ,
"iMultiOut": 0 , "iMultiOut": 0 ,

View File

@ -1411,6 +1411,10 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
return badValue(); return badValue();
if (mech == Orientation::Landscape || mech == Orientation::Portrait) { if (mech == Orientation::Landscape || mech == Orientation::Portrait) {
m_scanparam->paperAlign = (PaperAlign)mech; m_scanparam->paperAlign = (PaperAlign)mech;
if (mech == Orientation::Landscape && m_scanparam->is_duplex)
{
m_scanparam->is_backrotate180 = 1;
}
return success(); return success();
} }
return badValue(); return badValue();
@ -1779,7 +1783,7 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
m_scanparam->fillbackground = mech; m_scanparam->fillbackground = mech;
return success(); return success();
} }
return CapSupGetAllResetEx<BYTE, Bool, (CapType)CapTypeEx::TwEx_IFillBackground>(msg, data, m_scanparam->fillbackground, true); return CapSupGetAllResetEx<BYTE, Bool, (CapType)CapTypeEx::TwEx_IFillBackground>(msg, data, m_scanparam->fillbackground, false);
//return CapSupGetAllResetEx<BYTE, Bool, (CapType)CapTypeEx::TwEx_IFillBackground>(msg, data, { FALSE,TRUE }, m_scanparam->fillbackground, Bool(true), m_scanparam->fillbackground ? 1 : 0, 1); //return CapSupGetAllResetEx<BYTE, Bool, (CapType)CapTypeEx::TwEx_IFillBackground>(msg, data, { FALSE,TRUE }, m_scanparam->fillbackground, Bool(true), m_scanparam->fillbackground ? 1 : 0, 1);
}; };

View File

@ -113,7 +113,7 @@ private://field
Twpp::PixelType m_capPixelType = Twpp::PixelType::Rgb; Twpp::PixelType m_capPixelType = Twpp::PixelType::Rgb;
unsigned short m_jpegQuality = 80; unsigned short m_jpegQuality = 80;
Twpp::Compression m_compression= Twpp::Compression::None; Twpp::Compression m_compression= Twpp::Compression::None;
bool m_bIndicator = true; bool m_bIndicator = false;
bool m_bCustomDsData = true; bool m_bCustomDsData = true;
bool m_bFeederEnabled = true; bool m_bFeederEnabled = true;
bool m_bAutoFeed = true; bool m_bAutoFeed = true;

Binary file not shown.