mirror of http://192.168.1.51:8099/lmh188/twain3.0
1.调整usb通信,加长readbulk超时时间
2.屏蔽3288 自适应幅面功能 3.修复显示UI时通过协议reset停止扫描时按钮未正常复位问题 4.更新除穿孔以及跳过空白页算法 5.新增待纸扫描超时设置 -- 22.10.20
This commit is contained in:
parent
6d233d10be
commit
dfa2da91d0
|
@ -64,3 +64,4 @@
|
|||
2.屏蔽3288 自适应幅面功能
|
||||
3.修复显示UI时通过协议reset停止扫描时按钮未正常复位问题
|
||||
4.更新除穿孔以及跳过空白页算法
|
||||
5.新增待纸扫描超时设置 -- 22.10.20
|
|
@ -29,6 +29,14 @@ static std::vector<CString> lowpowermode
|
|||
_T("240分钟"),
|
||||
};
|
||||
|
||||
static std::vector<CString> autopapertimeout
|
||||
{
|
||||
_T("10秒"),
|
||||
_T("15秒"),
|
||||
_T("30秒"),
|
||||
_T("60秒"),
|
||||
};
|
||||
|
||||
// CFeedPaperPage 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CFeedPaperPage, CTabPageSSL)
|
||||
|
@ -89,6 +97,11 @@ BOOL CFeedPaperPage::OnInitDialog()
|
|||
for (int i = 0; i < lowpowermode.size(); i++)
|
||||
((CComboBox*)GetDlgItem(IDC_CBLOWPOWERMODE))->InsertString(i, lowpowermode[i]);
|
||||
((CComboBox*)GetDlgItem(IDC_CBLOWPOWERMODE))->SetCurSel(0);
|
||||
|
||||
for (int i = 0; i < autopapertimeout.size(); i++)
|
||||
((CComboBox*)GetDlgItem(IDC_CMBAUTOPAPER))->InsertString(i, autopapertimeout[i]);
|
||||
((CComboBox*)GetDlgItem(IDC_CMBAUTOPAPER))->SetCurSel(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -212,8 +225,13 @@ void CFeedPaperPage::OnBnClickedCkautopaper()
|
|||
((CButton*)GetDlgItem(IDC_RDSPECIFYSCANNUM))->SetCheck(FALSE);
|
||||
GetDlgItem(IDC_RDSPECIFYSCANNUM)->EnableWindow(FALSE);
|
||||
m_editNum.EnableWindow(m_radioGroupScanMode);
|
||||
GetDlgItem(IDC_CMBAUTOPAPER)->EnableWindow(TRUE);
|
||||
GetDlgItem(IDC_STATICAUTOPAPER)->EnableWindow(TRUE);
|
||||
}
|
||||
else
|
||||
else {
|
||||
((CComboBox*)GetDlgItem(IDC_CMBAUTOPAPER))->SetCurSel(0);
|
||||
GetDlgItem(IDC_RDSPECIFYSCANNUM)->EnableWindow(TRUE);
|
||||
|
||||
GetDlgItem(IDC_CMBAUTOPAPER)->EnableWindow(FALSE);
|
||||
GetDlgItem(IDC_STATICAUTOPAPER)->EnableWindow(FALSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,13 @@ void CSaveConfigDlg::DoDataExchange(CDataExchange* pDX)
|
|||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BOOL CSaveConfigDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
GetDlgItem(IDC_EDITSAVENAME)->SetFocus();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CSaveConfigDlg, CDialog)
|
||||
ON_BN_CLICKED(IDOK, &CSaveConfigDlg::OnBnClickedOk)
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö
|
||||
|
||||
virtual BOOL OnInitDialog();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedOk();
|
||||
|
|
|
@ -236,7 +236,7 @@ void CTwainUI::UpdateUI()
|
|||
m_pageBasic->m_Edit_Dpi.SetValue((int)settings->resolution_dst);
|
||||
m_pageBasic->m_cmBoxDuplex->SetCurSel(getCmbDuplexIndex());//!< 单双面
|
||||
m_pageBasic->m_cmBoxSS->SetCurSel(getPaparSizeIndex(settings->papertype, settings->paperAlign)); //!< 纸张类型
|
||||
m_pageBasic->m_enableSizeCheck = settings->en_sizecheck==1?TRUE:FALSE;//!< 尺寸检测
|
||||
m_pageBasic->m_enableSizeCheck = settings->en_sizecheck == 1 ? TRUE : FALSE;//!< 尺寸检测
|
||||
m_pageBasic->m_bswitchfrontback = settings->is_switchfrontback ? TRUE : FALSE; //!< 交换正反面
|
||||
((CButton*)m_pageBasic->GetDlgItem(IDC_RDQUALITYPRIORITY))->SetCheck(settings->is_high_imagequality);
|
||||
((CButton*)m_pageBasic->GetDlgItem(IDC_RDSPEEDPRIORITY))->SetCheck(!settings->is_high_imagequality);
|
||||
|
@ -246,13 +246,13 @@ void CTwainUI::UpdateUI()
|
|||
m_pageBasic->m_bUV = settings->hardwarecaps.en_uv == 1 ? TRUE : FALSE;
|
||||
#endif
|
||||
m_pageBasic->UpdateData(FALSE);
|
||||
if(getCmbDuplexIndex()==2|| getCmbDuplexIndex()==3)
|
||||
if (getCmbDuplexIndex() == 2 || getCmbDuplexIndex() == 3)
|
||||
m_pageBasic->GetDlgItem(IDC_BTNDISCARDSETTING)->EnableWindow(true);
|
||||
else
|
||||
m_pageBasic->GetDlgItem(IDC_BTNDISCARDSETTING)->EnableWindow(false);
|
||||
//!< Page Breghtness
|
||||
|
||||
m_pageBrightness->m_cbAutoContrast = settings->is_autocontrast==TRUE?TRUE:FALSE; //!< 自动亮度对比度
|
||||
m_pageBrightness->m_cbAutoContrast = settings->is_autocontrast == TRUE ? TRUE : FALSE; //!< 自动亮度对比度
|
||||
int brt = GetMappingBrightnessValue(settings->brightness);
|
||||
m_pageBrightness->m_Edit_Brightness.SetValue(brt); //!< 亮度
|
||||
int crt = GetContrastLevel(settings->contrast);
|
||||
|
@ -269,7 +269,7 @@ void CTwainUI::UpdateUI()
|
|||
m_pageBasic->discardblank_percent = settings->discardblank_percent;
|
||||
|
||||
((CButton*)m_pageImageProc->GetDlgItem(IDC_CKCROPMODEL))->SetCheck(settings->normalCrop);
|
||||
m_pageImageProc->m_ckbFillBlack = settings->fillbackground==TRUE ? TRUE : FALSE;//填充黑框
|
||||
m_pageImageProc->m_ckbFillBlack = settings->fillbackground == TRUE ? TRUE : FALSE;//填充黑框
|
||||
m_pageImageProc->m_ckbAutoDeskrew = settings->autodescrew ? TRUE : FALSE;//自动纠偏
|
||||
UpdateFilterCmbx();
|
||||
if (settings->fillbackground || settings->autodescrew || settings->is_autocrop) {
|
||||
|
@ -280,8 +280,8 @@ void CTwainUI::UpdateUI()
|
|||
}
|
||||
m_pageImageProc->m_cmBoxSharpen.SetCurSel(settings->sharpen);
|
||||
//UpdateSharpenCmbx();
|
||||
m_pageImageProc->m_ckbRemoveHole = settings->fillhole.is_fillhole==TRUE?TRUE:FALSE;//除穿孔可用性
|
||||
m_pageImageProc->m_edit_hole.SetValue(settings->fillhole.fillholeratio/ 100.0);//穿孔搜索范围比例系数
|
||||
m_pageImageProc->m_ckbRemoveHole = settings->fillhole.is_fillhole == TRUE ? TRUE : FALSE;//除穿孔可用性
|
||||
m_pageImageProc->m_edit_hole.SetValue(settings->fillhole.fillholeratio / 100.0);//穿孔搜索范围比例系数
|
||||
m_pageImageProc->m_edit_hole.EnableWindow(settings->fillhole.is_fillhole == TRUE ? TRUE : FALSE);
|
||||
m_pageImageProc->GetDlgItem(IDC_BTNHOLE)->EnableWindow(settings->fillhole.is_fillhole == TRUE ? TRUE : FALSE);
|
||||
m_pageImageProc->m_fillhole_up = settings->fillholeratio_up;
|
||||
|
@ -303,10 +303,10 @@ void CTwainUI::UpdateUI()
|
|||
m_pageImageProc->m_ckbDetachNoise = settings->detachnoise.is_detachnoise == TRUE ? TRUE : FALSE;//黑白降噪是否启用
|
||||
((CButton*)m_pageImageProc->GetDlgItem(IDC_CHECKDETACHNOISE))->SetCheck(m_pageImageProc->m_ckbDetachNoise);
|
||||
((CButton*)m_pageImageProc->GetDlgItem(IDC_CHECKDETACHNOISE))->EnableWindow(settings->pixtype != 2);
|
||||
((CButton*)m_pageImageProc->GetDlgItem(IDC_CHMULTIPUT))->SetCheck(settings->pixtype != 2 ? FALSE:settings->en_multi_output); // 多流输出
|
||||
((CButton*)m_pageImageProc->GetDlgItem(IDC_CHMULTIPUT))->SetCheck(settings->pixtype != 2 ? FALSE : settings->en_multi_output); // 多流输出
|
||||
m_pageImageProc->GetDlgItem(IDC_CHMULTIPUT)->EnableWindow(settings->pixtype != 2);
|
||||
|
||||
((CComboBox*)m_pageImageProc->GetDlgItem(IDC_CMBMULTIOUT))->SetCurSel(settings->pixtype != 2 ? 0 : (settings->en_multi_output?(settings->multioutput<0?0:settings->multioutput):0));
|
||||
((CComboBox*)m_pageImageProc->GetDlgItem(IDC_CMBMULTIOUT))->SetCurSel(settings->pixtype != 2 ? 0 : (settings->en_multi_output ? (settings->multioutput < 0 ? 0 : settings->multioutput) : 0));
|
||||
m_pageImageProc->GetDlgItem(IDC_CMBMULTIOUT)->EnableWindow(settings->pixtype != 2 ? FALSE : settings->en_multi_output);
|
||||
m_pageImageProc->m_edit_detachnoise.SetValue(settings->detachnoise.detachnoise);
|
||||
m_pageImageProc->m_slider_detachnoise.EnableWindow(settings->detachnoise.is_detachnoise == TRUE ? TRUE : FALSE);
|
||||
|
@ -321,7 +321,7 @@ void CTwainUI::UpdateUI()
|
|||
m_pageImageProc->UpdateData(FALSE);
|
||||
m_pageFeedPaper->dogear.SetCheck(settings->is_dogeardetection);
|
||||
//!< Page feed paper
|
||||
if (settings->is_duplex || settings->is_autodiscradblank_normal ||settings->is_autodiscradblank_vince)
|
||||
if (settings->is_duplex || settings->is_autodiscradblank_normal || settings->is_autodiscradblank_vince)
|
||||
{
|
||||
m_pageFeedPaper->m_cbRotation = settings->is_backrotate180 == TRUE ? TRUE : FALSE;//背面旋转180
|
||||
m_pageFeedPaper->GetDlgItem(IDC_CKBACKROTATION)->EnableWindow(settings->is_autotext ? FALSE : TRUE);
|
||||
|
@ -331,10 +331,14 @@ void CTwainUI::UpdateUI()
|
|||
m_pageFeedPaper->GetDlgItem(IDC_CKBACKROTATION)->EnableWindow(FALSE);
|
||||
m_pageFeedPaper->m_cbRotation = FALSE;
|
||||
}
|
||||
m_pageFeedPaper->m_cbStaple = settings->hardwarecaps.en_stapledetect==TRUE ? TRUE : FALSE;//装订检测
|
||||
m_pageFeedPaper->m_cbDoublePaper = settings->hardwarecaps.en_doublefeed==TRUE ? TRUE : FALSE;//双张检测
|
||||
m_pageFeedPaper->m_cbSkew = settings->hardwarecaps.en_skrewdetect==TRUE ? TRUE : FALSE;//歪斜检测
|
||||
m_pageFeedPaper->m_cbStaple = settings->hardwarecaps.en_stapledetect == TRUE ? TRUE : FALSE;//装订检测
|
||||
m_pageFeedPaper->m_cbDoublePaper = settings->hardwarecaps.en_doublefeed == TRUE ? TRUE : FALSE;//双张检测
|
||||
m_pageFeedPaper->m_cbSkew = settings->hardwarecaps.en_skrewdetect == TRUE ? TRUE : FALSE;//歪斜检测
|
||||
((CButton*)m_pageFeedPaper->GetDlgItem(IDC_CKAUTOPAPER))->SetCheck(settings->hardwarecaps.is_autopaper);
|
||||
auto tmp_init_autopaper_timeout = {10,15,30,60};
|
||||
auto tmp_autopaper_cmbindex = std::distance(tmp_init_autopaper_timeout.begin(),
|
||||
std::find(tmp_init_autopaper_timeout.begin(), tmp_init_autopaper_timeout.end(), settings->autopaper_timeout));
|
||||
((CComboBox*)m_pageFeedPaper->GetDlgItem(IDC_CMBAUTOPAPER))->SetCurSel(tmp_autopaper_cmbindex == tmp_init_autopaper_timeout.size() ? 0 : tmp_autopaper_cmbindex);
|
||||
m_pageFeedPaper->m_cmBoxOrentation.SetCurSel(settings->is_autotext?4:getRotateCmbIndex(settings->imageRotateDegree));//旋转方向;
|
||||
m_pageFeedPaper->m_sldSkrewDetecttion.SetPos(m_pageFeedPaper->m_cbSkew?settings->hardwarecaps.skrewdetectlevel:3);//歪斜检测等级
|
||||
m_pageFeedPaper->m_sldSkrewDetecttion.EnableWindow(m_pageFeedPaper->m_cbSkew);
|
||||
|
@ -356,6 +360,16 @@ void CTwainUI::UpdateUI()
|
|||
csCount.Format(_T("%d"), settings->is_duplex==TRUE?tempcount/2: tempcount);
|
||||
m_pageFeedPaper->GetDlgItem(IDC_EDSCANNUM)->SetWindowText(csCount);
|
||||
}
|
||||
if (settings->hardwarecaps.is_autopaper)
|
||||
{
|
||||
m_pageFeedPaper->GetDlgItem(IDC_CMBAUTOPAPER)->EnableWindow(TRUE);
|
||||
m_pageFeedPaper->GetDlgItem(IDC_STATICAUTOPAPER)->EnableWindow(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pageFeedPaper->GetDlgItem(IDC_CMBAUTOPAPER)->EnableWindow(FALSE);
|
||||
m_pageFeedPaper->GetDlgItem(IDC_STATICAUTOPAPER)->EnableWindow(FALSE);
|
||||
}
|
||||
|
||||
m_pageFeedPaper->UpdateData(FALSE);
|
||||
m_pageBasic->updateCmbDuplex(TRUE);
|
||||
|
@ -624,6 +638,9 @@ void CTwainUI::UpDateScanParam(PCONFIGPARAMS configItem, bool updateDs)
|
|||
settings->hardwarecaps.skrewdetectlevel = (int)configItem->ScrewDetectLevel;
|
||||
settings->hardwarecaps.en_stapledetect = configItem->EnBindingDetect;
|
||||
settings->hardwarecaps.is_autopaper = ((CButton*)m_pageFeedPaper->GetDlgItem(IDC_CKAUTOPAPER))->GetCheck();
|
||||
CString tmp_autopaper_timeout;
|
||||
m_pageFeedPaper->GetDlgItem(IDC_CMBAUTOPAPER)->GetWindowTextW(tmp_autopaper_timeout);
|
||||
settings->autopaper_timeout = _wtoi(tmp_autopaper_timeout);
|
||||
settings->hardwarecaps.en_doublefeed = configItem->EnUltrasonicDetect;
|
||||
settings->dogeardistance = m_pageFeedPaper->m_slider_dogear.GetPos();
|
||||
settings->en_fold = configItem->EnFlod ? 1 : 0;
|
||||
|
@ -774,6 +791,8 @@ void CTwainUI::setvisable_dogear(bool flag)
|
|||
void CTwainUI::setvisable_autopaper(bool flag)
|
||||
{
|
||||
((CButton*)m_pageFeedPaper->GetDlgItem(IDC_CKAUTOPAPER))->ShowWindow(flag ? SW_SHOW : SW_HIDE);
|
||||
m_pageFeedPaper->GetDlgItem(IDC_STATICAUTOPAPER)->ShowWindow(flag ? SW_SHOW : SW_HIDE);
|
||||
m_pageFeedPaper->GetDlgItem(IDC_CMBAUTOPAPER)->ShowWindow(flag ? SW_SHOW : SW_HIDE);
|
||||
if (!flag)
|
||||
((CButton*)m_pageFeedPaper->GetDlgItem(IDC_CKAUTOPAPER))->SetCheck(false);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,8 @@ typedef enum tagUsbSupported {
|
|||
AUTO_FLAT_FINISHED = 202,
|
||||
//usb 已连接
|
||||
USB_CONNECTED,
|
||||
HAVE_PAPER
|
||||
HAVE_PAPER,
|
||||
DEVICE_LOCKED,
|
||||
} UsbSupported, * PUsbSupported;
|
||||
|
||||
static map<UsbSupported, string> msgs = {
|
||||
|
@ -132,6 +133,7 @@ static map<UsbSupported, string> msgs = {
|
|||
{UsbSupported::HAVE_DOGEAR,"检测到有折角,停止扫描!"},
|
||||
{UsbSupported::MLTOP_TIMEOUT,"升降台抬升未到达指定位置!"},
|
||||
{UsbSupported::PAPER_HOLE,"纸张疑是有孔,请使用带孔模式扫描!"},
|
||||
{UsbSupported::DEVICE_LOCKED,"设备已锁定!"},
|
||||
};
|
||||
|
||||
enum tagEventIndex
|
||||
|
|
|
@ -61,7 +61,9 @@ GScanO1003399::~GScanO1003399()
|
|||
scanflag = false;
|
||||
b_imgprothread = false;
|
||||
imgs.ShutDown();
|
||||
|
||||
m_autopaper_timeout = false;
|
||||
if (m_autopaper_ft.valid())
|
||||
m_autopaper_ft.get();
|
||||
while (m_paths.Size() > 0)
|
||||
{
|
||||
remove(m_paths.Take().c_str());
|
||||
|
@ -434,6 +436,7 @@ void GScanO1003399::Stop_scan()
|
|||
stop();
|
||||
if (m_param.hardwarecaps.is_autopaper)
|
||||
{
|
||||
m_autopaper_timeout = false;
|
||||
autopaperstop = true;
|
||||
if (!is_scan() && imagecount == 0)
|
||||
scanflag = false;
|
||||
|
@ -518,9 +521,14 @@ void GScanO1003399::usb_run()
|
|||
switch (info.From)
|
||||
{
|
||||
case IMG:
|
||||
if (is_runing() && (im_dev_count()>0))
|
||||
{
|
||||
if (m_param.hardwarecaps.is_autopaper) {
|
||||
m_autopaper_timeout = false;
|
||||
}
|
||||
if (is_runing() && (im_dev_count() > 0))
|
||||
im_rx();
|
||||
break;
|
||||
}
|
||||
case MtBoard:
|
||||
FileTools::writelog(log_ERROR, "Got MotorBoard error code = " + to_string(info.Code));
|
||||
break;
|
||||
|
@ -576,10 +584,26 @@ void GScanO1003399::usb_run()
|
|||
}
|
||||
else
|
||||
scanflag = false;
|
||||
|
||||
if (m_param.hardwarecaps.is_autopaper) {
|
||||
if ((devState != DEV_WRONG) && (!autopaperstop))
|
||||
{
|
||||
m_autopaper_ft = std::async(std::launch::async, [this] {
|
||||
m_autopaper_timeout = true;
|
||||
StopWatch sw;
|
||||
while (sw.elapsed_s() < m_param.autopaper_timeout)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
if (m_autopaper_timeout == false)
|
||||
return;
|
||||
}
|
||||
if ((m_autopaper_timeout == false) || scanner_read_reg(m_usb, SR_STATUS))
|
||||
return;
|
||||
else
|
||||
Stop_scan();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this_thread::sleep_for(chrono::microseconds(10));
|
||||
}
|
||||
|
||||
|
@ -588,6 +612,7 @@ void GScanO1003399::usb_run()
|
|||
|
||||
void GScanO1003399::start()
|
||||
{
|
||||
|
||||
scanner_cmd(m_usb, SC_START);
|
||||
}
|
||||
|
||||
|
@ -660,10 +685,18 @@ void GScanO1003399::im_rx()
|
|||
std::shared_ptr<std::vector<char>> buffi(new std::vector<char>);
|
||||
//auto& buffi = im_data;
|
||||
int count = front_datasize();
|
||||
int recv_count = 0;
|
||||
buffi->resize(count);
|
||||
rx_cmd();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
count = read_data(buffi->data(), count, count / (0.005 * 1024 * 1024)); //
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
recv_count = read_data(buffi->data(), count, count / (0.005 * 1024 * 1024)); //
|
||||
if (count != recv_count)
|
||||
{
|
||||
FileTools::writelog(log_INFO, "SR_IM_ABORT ");
|
||||
scanner_write_reg(m_usb, SR_IM_ABORT, 0);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
return;
|
||||
}
|
||||
pop_dev_im();
|
||||
//vector<cv::Mat> mats;
|
||||
//m_param.multi_output_red? imagecount += 2: imagecount++;
|
||||
|
@ -693,10 +726,10 @@ int GScanO1003399::read_data(void* data, int length, int timeout)
|
|||
{
|
||||
if (!m_usb.get() && !m_usb->is_connected())
|
||||
{
|
||||
FileTools::writelog(log_INFO, "if (!m_usb.get() && !m_usb->is_connected())");
|
||||
FileTools::writelog(log_INFO, "!m_usb->is_connected");
|
||||
return 0;
|
||||
}
|
||||
timeout = std::max(1000, timeout);
|
||||
timeout = std::max(1500, timeout);
|
||||
|
||||
int readed = 0;
|
||||
int reading = 0;
|
||||
|
@ -956,6 +989,8 @@ int GScanO1003399::codeconvter(HGEIntInfo code)
|
|||
return DETECT_STAPLE;
|
||||
case 0x00080:
|
||||
return PAPER_SKEW;
|
||||
case 0x00100:
|
||||
return DEVICE_LOCKED;
|
||||
case 0x10000:
|
||||
return AQUIRE_IMAGE_TIMEOUT;
|
||||
case 0x20000:
|
||||
|
@ -999,7 +1034,9 @@ int GScanO1003399::codeconvter(HGEIntInfo code)
|
|||
switch (code.Code)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
case 1:
|
||||
if (m_param.hardwarecaps.is_autopaper)
|
||||
{
|
||||
|
|
|
@ -104,6 +104,8 @@ private:
|
|||
volatile bool keeplastimg;
|
||||
volatile bool autopaperstop;
|
||||
volatile bool is_kernelsnap_211209;
|
||||
volatile bool m_autopaper_timeout;
|
||||
std::future<void> m_autopaper_ft;
|
||||
GScanCap m_param;
|
||||
std::shared_ptr<IUsb> m_usb;
|
||||
volatile bool b_imgprothread;
|
||||
|
|
|
@ -199,6 +199,12 @@ enum Scanner_Reg_Defs
|
|||
SR_SET_AUTOMATICCONTROLFEEDMODE_THRESHOLD,
|
||||
SR_GET_TRAYPOSITION,
|
||||
SR_SET_TRAYPOSITION,
|
||||
SR_GET_LOCK_STATES,
|
||||
SR_SET_LOCK_STATES,
|
||||
SR_GET_TOKEN,
|
||||
SR_SET_TOKEN,
|
||||
SR_GET_TOKEN_LENGHT,
|
||||
SR_DECODE_TOKEN,
|
||||
SR_GET_CUO_ERROR = 0x50,
|
||||
SR_GET_DOU_ERROR,
|
||||
SR_GET_JAM_ERROR,
|
||||
|
|
|
@ -85,6 +85,7 @@ const std::string HSVCORRECT = "bHsvCorrect";
|
|||
const std::string ULTRADETECT = "bUltrasonicDetect";
|
||||
const std::string BINDINGDETECT = "bBindingDetect";
|
||||
const std::string AUTOPAPER = "bautopaper";
|
||||
const std::string AUTOPAPERTIMEOUT = "iautopapertimeout";
|
||||
const std::string SCANCOUNT = "ScanCount";
|
||||
const std::string DOCORIENTATION = "bOrientation";
|
||||
const std::string AUTO_TEXT = "bAutoText";
|
||||
|
@ -298,6 +299,7 @@ struct GScanCap
|
|||
bool en_fillholeratio_down;
|
||||
bool en_fillholeratio_left;
|
||||
bool en_fillholeratio_right;
|
||||
int autopaper_timeout;
|
||||
std::string Caption;
|
||||
std::string SavePath;
|
||||
};
|
||||
|
|
|
@ -144,6 +144,7 @@ void GscanJsonConfig::SaveGscanCapConfig(const GScanCap & gcap, const std::strin
|
|||
outJson["Config"].Add(ULTRADETECT, (bool)(gcap.hardwarecaps.en_doublefeed), false);
|
||||
outJson["Config"].Add(BINDINGDETECT, (bool)(gcap.hardwarecaps.en_stapledetect), false);
|
||||
outJson["Config"].Add(AUTOPAPER, (bool)(gcap.hardwarecaps.is_autopaper), false);
|
||||
outJson["Config"].Add(AUTOPAPERTIMEOUT, (int)(gcap.autopaper_timeout));
|
||||
outJson["Config"].Add(SCANCOUNT, (int)(gcap.scannum));
|
||||
outJson["Config"].Add(DOCORIENTATION, (int)(gcap.imageRotateDegree));
|
||||
outJson["Config"].Add(AUTO_TEXT, (bool)(gcap.is_autotext),false);
|
||||
|
@ -293,6 +294,7 @@ void GscanJsonConfig::WriteJsonArrayToFile(std::vector<GScanCap> cfgArray, const
|
|||
root["Config"][ULTRADETECT].Add(i, (bool)cfgArray[i].hardwarecaps.en_doublefeed);
|
||||
root["Config"][BINDINGDETECT].Add(i, (bool)cfgArray[i].hardwarecaps.en_stapledetect);
|
||||
root["Config"][AUTOPAPER].Add(i, (bool)cfgArray[i].hardwarecaps.is_autopaper);
|
||||
root["Config"][AUTOPAPERTIMEOUT].Add((int)cfgArray[i].autopaper_timeout);
|
||||
root["Config"][SCANCOUNT].Add((int)cfgArray[i].scannum);
|
||||
root["Config"][DOCORIENTATION].Add((int)cfgArray[i].imageRotateDegree);
|
||||
root["Config"][AUTO_TEXT].Add(i, (bool)cfgArray[i].is_autotext);
|
||||
|
@ -513,6 +515,8 @@ std::vector<GScanCap> GscanJsonConfig::parseJsonFromString(const std::string str
|
|||
root["Config"].Get(BINDINGDETECT, itmBingdingDetect);
|
||||
neb::CJsonObject itmAutoPaper;
|
||||
root["Config"].Get(AUTOPAPER, itmAutoPaper);
|
||||
neb::CJsonObject itmAutoPaperTimeOut;
|
||||
root["Config"].Get(AUTOPAPERTIMEOUT, itmAutoPaperTimeOut);
|
||||
neb::CJsonObject itmScanCount;
|
||||
root["Config"].Get(SCANCOUNT, itmScanCount);
|
||||
neb::CJsonObject itmDocOrientation;
|
||||
|
@ -661,6 +665,8 @@ std::vector<GScanCap> GscanJsonConfig::parseJsonFromString(const std::string str
|
|||
cfp.hardwarecaps.en_stapledetect = b_value ? 1 : 0;
|
||||
itmAutoPaper.Get(i, b_value);
|
||||
cfp.hardwarecaps.is_autopaper = b_value ? 1 : 0;
|
||||
itmAutoPaperTimeOut.Get(i, i_value);
|
||||
cfp.autopaper_timeout = i_value;
|
||||
itmScanCount.Get(i, i_value);
|
||||
cfp.scannum = i_value;
|
||||
itmDocOrientation.Get(i, i_value);
|
||||
|
@ -814,6 +820,8 @@ std::vector<GScanCap> GscanJsonConfig::parseJsonFromString(const std::string str
|
|||
cfp.hardwarecaps.en_stapledetect = bvalue ? 1 : 0;
|
||||
root["Config"].Get(AUTOPAPER, bvalue);
|
||||
cfp.hardwarecaps.is_autopaper = bvalue ? 1 : 0;
|
||||
root["Config"].Get(AUTOPAPERTIMEOUT, index);
|
||||
cfp.autopaper_timeout = index;
|
||||
root["Config"].Get(SCANCOUNT, index);
|
||||
cfp.scannum = index;
|
||||
root["Config"].Get(DOCORIENTATION, index);
|
||||
|
@ -921,6 +929,7 @@ json GscanJsonConfig::GscancapToJson(GScanCap& cap)
|
|||
js[CONFIG][ULTRADETECT] = cap.hardwarecaps.en_doublefeed;
|
||||
js[CONFIG][BINDINGDETECT] = cap.hardwarecaps.en_stapledetect;
|
||||
js[CONFIG][AUTOPAPER] = cap.hardwarecaps.is_autopaper;
|
||||
js[CONFIG][AUTOPAPERTIMEOUT] = cap.autopaper_timeout;
|
||||
js[CONFIG][SCANCOUNT] = cap.scannum;
|
||||
js[CONFIG][DOCORIENTATION] = cap.imageRotateDegree;
|
||||
js[CONFIG][AUTO_TEXT] = cap.is_autotext;
|
||||
|
@ -997,6 +1006,7 @@ GScanCap GscanJsonConfig::JsonToGscancap(json& js)
|
|||
cap.hardwarecaps.en_doublefeed = json_cast(js[CONFIG][ULTRADETECT]).to_int();
|
||||
cap.hardwarecaps.en_stapledetect = json_cast(js[CONFIG][BINDINGDETECT]).to_int();
|
||||
cap.hardwarecaps.is_autopaper = json_cast(js[CONFIG][AUTOPAPER]).to_int();
|
||||
cap.autopaper_timeout = json_cast(js[CONFIG][AUTOPAPERTIMEOUT]).to_int();
|
||||
cap.scannum = json_cast(js[CONFIG][SCANCOUNT]).to_int();
|
||||
cap.imageRotateDegree = json_cast(js[CONFIG][DOCORIENTATION]).to_int();
|
||||
cap.is_autotext = json_cast(js[CONFIG][AUTO_TEXT]).to_int();
|
||||
|
@ -1068,6 +1078,7 @@ json GscanJsonConfig::GetDefaultJson()
|
|||
"bUltrasonicDetect": true ,
|
||||
"bBindingDetect": false ,
|
||||
"bautopaper": false ,
|
||||
"iautopapertimeout" : 15 ,
|
||||
"ScanCount": 65535 ,
|
||||
"bOrientation": 0 ,
|
||||
"bAutoText": false ,
|
||||
|
@ -1136,6 +1147,7 @@ json GscanJsonConfig::GetDefaultJson()
|
|||
"bUltrasonicDetect": true ,
|
||||
"bBindingDetect": false ,
|
||||
"bautopaper": false ,
|
||||
"iautopapertimeout" : 15 ,
|
||||
"ScanCount": 65535 ,
|
||||
"bOrientation": 0 ,
|
||||
"bAutoText": false ,
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 40 KiB |
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue