mirror of http://192.168.1.51:8099/lmh188/twain3.0
parent
2e08abac89
commit
c6c27637bf
|
@ -84,4 +84,6 @@
|
||||||
5.UI开放色偏校正,增加色偏校正协议 --23.01.05
|
5.UI开放色偏校正,增加色偏校正协议 --23.01.05
|
||||||
6.除背景色二值化阈值调整为50(100-50) --23.02.21
|
6.除背景色二值化阈值调整为50(100-50) --23.02.21
|
||||||
7.添加3288 linux待纸扫描功能 --23.03.08
|
7.添加3288 linux待纸扫描功能 --23.03.08
|
||||||
8.添加安卓设备锁定协议支持 --23.03.13
|
8.添加安卓设备锁定协议支持 --23.03.13
|
||||||
|
9.适配卓育云ODM厂商 --23.04.24
|
||||||
|
10.对接爱云校做协议适配 --23.04.24
|
|
@ -65,12 +65,14 @@ BOOL CAboutDlg::OnInitDialog()
|
||||||
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP5));
|
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP5));
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP7));
|
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP7));
|
||||||
|
#elif defined ZHUOYUYUN
|
||||||
|
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP8));
|
||||||
#else
|
#else
|
||||||
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BMPABOUTDLG));
|
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BMPABOUTDLG));
|
||||||
#endif
|
#endif
|
||||||
pStatic->ModifyStyle(0xF, SS_BITMAP | SS_CENTERIMAGE);
|
pStatic->ModifyStyle(0xF, SS_BITMAP | SS_CENTERIMAGE);
|
||||||
pStatic->SetBitmap(hBitmap);
|
pStatic->SetBitmap(hBitmap);
|
||||||
#if defined MAKEHUAGAO || defined LANXUM || defined HANVON || defined AUGE ||defined MAKERIGHTWAY || defined CUMTENN
|
#if defined MAKEHUAGAO || defined LANXUM || defined HANVON || defined AUGE ||defined MAKERIGHTWAY || defined CUMTENN || defined ZHUOYUYUN
|
||||||
GetDlgItem(IDC_PICABOUTHUAGO)->ShowWindow(TRUE);
|
GetDlgItem(IDC_PICABOUTHUAGO)->ShowWindow(TRUE);
|
||||||
#else
|
#else
|
||||||
GetDlgItem(IDC_PICABOUTHUAGO)->ShowWindow(FALSE);
|
GetDlgItem(IDC_PICABOUTHUAGO)->ShowWindow(FALSE);
|
||||||
|
|
|
@ -42,7 +42,7 @@ BOOL CAdvancedDLG::OnInitDialog()
|
||||||
|
|
||||||
CTabPageSSL::OnInitDialog();
|
CTabPageSSL::OnInitDialog();
|
||||||
m_Edit_noise.SetSlideLink(this, IDC_SLIDER_NOISE);
|
m_Edit_noise.SetSlideLink(this, IDC_SLIDER_NOISE);
|
||||||
m_Edit_noise.SetParams(1, 20, 1);
|
m_Edit_noise.SetParams(2, 20, 1);
|
||||||
m_Edit_noise.SetValue(noise);
|
m_Edit_noise.SetValue(noise);
|
||||||
|
|
||||||
m_Edit_indent.SetSlideLink(this, IDC_SLIDER_INDENT);
|
m_Edit_indent.SetSlideLink(this, IDC_SLIDER_INDENT);
|
||||||
|
|
|
@ -116,7 +116,7 @@ BOOL CTwainMutex::CloseTwainMutex()
|
||||||
|
|
||||||
if (!b_ret)
|
if (!b_ret)
|
||||||
{
|
{
|
||||||
MessageBox(NULL, TEXT("ÊÍ·Å×ÊԴʧ°Ü"), 0, MB_ICONWARNING);
|
MessageBox(NULL, TEXT("×ÊÔ´ÊÍ·Åʧ°Ü"), 0, MB_ICONWARNING);
|
||||||
}
|
}
|
||||||
m_hTwainMutex=NULL;
|
m_hTwainMutex=NULL;
|
||||||
return b_ret;
|
return b_ret;
|
||||||
|
|
|
@ -135,7 +135,7 @@ BOOL CTwainUI::OnInitDialog()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (atoi(m_hardwareVersion.substr(4, 6).c_str()) >= 220401)
|
if (atoi(m_hardwareVersion.substr(4, 6).c_str()) >= 230130)
|
||||||
{
|
{
|
||||||
setvisable_size(true);
|
setvisable_size(true);
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ BOOL CTwainUI::OnInitDialog()
|
||||||
((CButton*)m_pageBasic->GetDlgItem(IDC_RDSPEEDPRIORITY))->ShowWindow(SW_SHOW);
|
((CButton*)m_pageBasic->GetDlgItem(IDC_RDSPEEDPRIORITY))->ShowWindow(SW_SHOW);
|
||||||
}
|
}
|
||||||
#elif defined(G300)
|
#elif defined(G300)
|
||||||
if (atoi(m_hardwareVersion.substr(4, 6).c_str()) >= 221106)
|
if (atoi(m_hardwareVersion.substr(4, 6).c_str()) >= 230130)
|
||||||
{
|
{
|
||||||
((CButton*)m_pageBasic->GetDlgItem(IDC_RDQUALITYPRIORITY))->ShowWindow(SW_SHOW);
|
((CButton*)m_pageBasic->GetDlgItem(IDC_RDQUALITYPRIORITY))->ShowWindow(SW_SHOW);
|
||||||
((CButton*)m_pageBasic->GetDlgItem(IDC_RDSPEEDPRIORITY))->ShowWindow(SW_SHOW);
|
((CButton*)m_pageBasic->GetDlgItem(IDC_RDSPEEDPRIORITY))->ShowWindow(SW_SHOW);
|
||||||
|
|
|
@ -894,6 +894,8 @@ void GScanO1003399::imgproce(std::shared_ptr<std::vector<char>>& buff)
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\CumTennScan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\CumTennScan\\tessdata\\osd.traineddata"));
|
||||||
#elif defined NOLOGO
|
#elif defined NOLOGO
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\Scan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\Scan\\tessdata\\osd.traineddata"));
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
_tcscat(szIniFile, _T("\\twain_32\\ZhuoYuYunScan\\tessdata\\osd.traineddata"));
|
||||||
#else
|
#else
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata\\osd.traineddata"));
|
||||||
#endif //
|
#endif //
|
||||||
|
|
|
@ -414,7 +414,7 @@ void GScanO400::config_params(GScanCap& params)
|
||||||
else
|
else
|
||||||
params.resolution_native = 200.0f;
|
params.resolution_native = 200.0f;
|
||||||
#elif defined(G300)
|
#elif defined(G300)
|
||||||
if (atoi(fw.substr(4, 6).c_str()) >= 221106)
|
if (atoi(fw.substr(4, 6).c_str()) >= 230130)
|
||||||
{
|
{
|
||||||
int dpi = 1;
|
int dpi = 1;
|
||||||
if (params.is_high_imagequality)
|
if (params.is_high_imagequality)
|
||||||
|
|
|
@ -312,6 +312,8 @@ void ImageMatQueue::setparam(const GScanCap& param)
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\Scan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\Scan\\tessdata\\osd.traineddata"));
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\CumTennScan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\CumTennScan\\tessdata\\osd.traineddata"));
|
||||||
|
#elif defined ZHUOYUYUN
|
||||||
|
_tcscat(szIniFile, _T("\\twain_32\\ZhuoYuYunScan\\tessdata\\osd.traineddata"));
|
||||||
#else
|
#else
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata\\osd.traineddata"));
|
_tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata\\osd.traineddata"));
|
||||||
#endif //
|
#endif //
|
||||||
|
|
|
@ -473,6 +473,8 @@ CString GetHidedlgPath()
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\RIGHTWAYSCAN\\hidedlg.exe"));
|
_tcscat(szIniFile, _T("\\twain_32\\RIGHTWAYSCAN\\hidedlg.exe"));
|
||||||
#elif defined NOLOGO
|
#elif defined NOLOGO
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\Scan\\hidedlg.exe"));
|
_tcscat(szIniFile, _T("\\twain_32\\Scan\\hidedlg.exe"));
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
_tcscat(szIniFile, _T("\\twain_32\\ZhuoYuYunScan\\hidedlg.exe"));
|
||||||
#else // MAKEHUAGAO
|
#else // MAKEHUAGAO
|
||||||
_tcscat(szIniFile, _T("\\twain_32\\ZhibenScan\\hidedlg.exe"));
|
_tcscat(szIniFile, _T("\\twain_32\\ZhibenScan\\hidedlg.exe"));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -107,6 +107,7 @@ const std::string ANSWERSHEETFILTER = "iAnswersheetFilter";
|
||||||
//twain 弹框配置等参数
|
//twain 弹框配置等参数
|
||||||
const std::string ROLLERMSGDATE = "RollerMsgDate";
|
const std::string ROLLERMSGDATE = "RollerMsgDate";
|
||||||
const std::string PRINTFCAPABILITY = "PrintfCapability";
|
const std::string PRINTFCAPABILITY = "PrintfCapability";
|
||||||
|
const std::string CONFIG_DOUBLEFEEDDETECTION = "Config_DoubleFeedDetection";
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
/******************
|
/******************
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include <timeapi.h>
|
#include <timeapi.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <codecvt>
|
||||||
|
#include <locale>
|
||||||
#include <log4cplus/log4cplus.h>
|
#include <log4cplus/log4cplus.h>
|
||||||
#include "PublicFunc.h"
|
#include "PublicFunc.h"
|
||||||
|
|
||||||
|
@ -25,6 +27,17 @@ enum log_lv :int {
|
||||||
class FileTools
|
class FileTools
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
static std::string GetProcessName()
|
||||||
|
{
|
||||||
|
char Path[_MAX_PATH]{ 0 };
|
||||||
|
char name[_MAX_PATH]{ 0 };
|
||||||
|
::GetModuleFileNameA(NULL, Path, _MAX_PATH);
|
||||||
|
::_splitpath(Path, NULL, NULL, name, NULL);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
static std::vector<std::string> getFiles(std::string path)
|
static std::vector<std::string> getFiles(std::string path)
|
||||||
{
|
{
|
||||||
std::vector<std::string> files;
|
std::vector<std::string> files;
|
||||||
|
@ -235,6 +248,62 @@ public:
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
static std::string to_web_utf(const std::wstring& unic)
|
||||||
|
{
|
||||||
|
std::string webu("");
|
||||||
|
char buf[20] = { 0 };
|
||||||
|
|
||||||
|
for (size_t i = 0; i < unic.length(); ++i)
|
||||||
|
{
|
||||||
|
wchar_t v = unic[i];
|
||||||
|
//if (v <= 0x7f)
|
||||||
|
// webu.append(1, (char)v);
|
||||||
|
//else
|
||||||
|
{
|
||||||
|
sprintf_s(buf, _countof(buf) - 1, "%04X", v);
|
||||||
|
webu += buf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return webu;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::wstring String2Wstring(std::string wstr)
|
||||||
|
{
|
||||||
|
std::wstring res;
|
||||||
|
int len = MultiByteToWideChar(CP_ACP, 0, wstr.c_str(), wstr.size(), nullptr, 0);
|
||||||
|
if (len < 0) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
wchar_t* buffer = new wchar_t[len + 1];
|
||||||
|
if (buffer == nullptr) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, wstr.c_str(), wstr.size(), buffer, len);
|
||||||
|
buffer[len] = '\0';
|
||||||
|
res.append(buffer);
|
||||||
|
delete[] buffer;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static std::string utf82str(std::string str)
|
||||||
|
{
|
||||||
|
std::string u8;
|
||||||
|
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
|
||||||
|
for (size_t i = 0; i < str.length();)
|
||||||
|
{
|
||||||
|
char32_t c = strtol(str.substr(i, 4).c_str(), nullptr, 16);
|
||||||
|
u8 += converter.to_bytes(c);
|
||||||
|
i += 4;
|
||||||
|
}
|
||||||
|
return u8;
|
||||||
|
}
|
||||||
|
|
||||||
|
//½«stringת»»³Éwstring
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void getFiles(std::string path, std::vector<std::string>& files)
|
static void getFiles(std::string path, std::vector<std::string>& files)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1257,6 +1257,24 @@ void Twain_config::GetOrSetPintfCapability(int& value,bool is_get)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Twain_config::GetOrSetDoubleNames(std::vector<std::string>& v, bool is_get)
|
||||||
|
{
|
||||||
|
loadjson(GetTwainInIPath() + TCHAR2STRING(TWAIN_CONFIG_JSON));
|
||||||
|
if (is_get) {
|
||||||
|
if (!m_json[CONFIG_DOUBLEFEEDDETECTION].is_array()) {
|
||||||
|
savejson(defaultjson(), GetTwainInIPath() + TCHAR2STRING(TWAIN_CONFIG_JSON));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_json[CONFIG_DOUBLEFEEDDETECTION].get_to(v);
|
||||||
|
//for (auto& node : v)
|
||||||
|
// node = FileTools::utf82str(node);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_json[CONFIG_DOUBLEFEEDDETECTION] = v;
|
||||||
|
savejson(m_json, GetTwainInIPath() + TCHAR2STRING(TWAIN_CONFIG_JSON));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Twain_config::setrollermsgdata(int value)
|
void Twain_config::setrollermsgdata(int value)
|
||||||
{
|
{
|
||||||
loadjson(GetTwainInIPath() + TCHAR2STRING(TWAIN_CONFIG_JSON));
|
loadjson(GetTwainInIPath() + TCHAR2STRING(TWAIN_CONFIG_JSON));
|
||||||
|
@ -1315,5 +1333,7 @@ json Twain_config::defaultjson()
|
||||||
json tmp;
|
json tmp;
|
||||||
tmp[ROLLERMSGDATE] = 0;
|
tmp[ROLLERMSGDATE] = 0;
|
||||||
tmp[PRINTFCAPABILITY] = 0;
|
tmp[PRINTFCAPABILITY] = 0;
|
||||||
|
std::string str = FileTools::to_web_utf(FileTools::String2Wstring("ºÃ·ÖÊýÔľíɨÃè¶Ë"));
|
||||||
|
tmp[CONFIG_DOUBLEFEEDDETECTION] = {str};
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
|
@ -108,6 +108,7 @@ public:
|
||||||
int getrollermsgdate();
|
int getrollermsgdate();
|
||||||
void setrollermsgdata(int value);
|
void setrollermsgdata(int value);
|
||||||
void GetOrSetPintfCapability(int& value,bool is_get);
|
void GetOrSetPintfCapability(int& value,bool is_get);
|
||||||
|
void GetOrSetDoubleNames(std::vector<std::string>& v, bool is_get);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string GetTwainInIPath();
|
std::string GetTwainInIPath();
|
||||||
|
|
|
@ -176,7 +176,7 @@ void autoCrop_desaskew_fillBlank(const cv::Mat& src, cv::Mat& dst, bool isAutoCr
|
||||||
hg::threshold_Mat(resizeMat, thre, threshold);
|
hg::threshold_Mat(resizeMat, thre, threshold);
|
||||||
|
|
||||||
if (noise > 0)
|
if (noise > 0)
|
||||||
cv::morphologyEx(thre, thre, cv::MORPH_OPEN, getStructuringElement(cv::MORPH_RECT, cv::Size(noise * FX_FY, 1)),
|
cv::morphologyEx(thre, thre, cv::MORPH_OPEN, getStructuringElement(cv::MORPH_RECT, cv::Size(std::ceil(noise * FX_FY), 1)),
|
||||||
cv::Point(-1, -1), 1, cv::BORDER_CONSTANT, cv::Scalar::all(0));
|
cv::Point(-1, -1), 1, cv::BORDER_CONSTANT, cv::Scalar::all(0));
|
||||||
|
|
||||||
std::vector<cv::Vec4i> hierarchy;
|
std::vector<cv::Vec4i> hierarchy;
|
||||||
|
|
|
@ -113,6 +113,8 @@ static constexpr const Identity srcIdent(
|
||||||
"AUGE",
|
"AUGE",
|
||||||
#elif defined LANXUM
|
#elif defined LANXUM
|
||||||
"LANXUM",
|
"LANXUM",
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZHUOYUYUN",
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
"CUMTENN",
|
"CUMTENN",
|
||||||
#elif defined MAKERIGHTWAY
|
#elif defined MAKERIGHTWAY
|
||||||
|
@ -129,6 +131,8 @@ static constexpr const Identity srcIdent(
|
||||||
"G62S Series",
|
"G62S Series",
|
||||||
#elif defined HANVON
|
#elif defined HANVON
|
||||||
"HW-8000",
|
"HW-8000",
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZY-2100S",
|
||||||
#else // ISG100
|
#else // ISG100
|
||||||
"G100 Series",
|
"G100 Series",
|
||||||
#endif
|
#endif
|
||||||
|
@ -137,6 +141,8 @@ static constexpr const Identity srcIdent(
|
||||||
"G73S Series",
|
"G73S Series",
|
||||||
#elif defined HANVON
|
#elif defined HANVON
|
||||||
"HW-9000",
|
"HW-9000",
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZY-2100S",
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
"CTS A3",
|
"CTS A3",
|
||||||
#else // ISG100
|
#else // ISG100
|
||||||
|
@ -148,6 +154,8 @@ static constexpr const Identity srcIdent(
|
||||||
"G42S Series",
|
"G42S Series",
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
"CTS A4",
|
"CTS A4",
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZY-2100S",
|
||||||
#elif defined HANVON
|
#elif defined HANVON
|
||||||
#ifdef ANDROIDSERIAL
|
#ifdef ANDROIDSERIAL
|
||||||
"HW-1000",
|
"HW-1000",
|
||||||
|
@ -161,6 +169,8 @@ static constexpr const Identity srcIdent(
|
||||||
#elif defined(G400) // G200
|
#elif defined(G400) // G200
|
||||||
#ifdef LANXUM
|
#ifdef LANXUM
|
||||||
"G52S Series",
|
"G52S Series",
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZY-2100S",
|
||||||
#elif defined HANVON
|
#elif defined HANVON
|
||||||
#ifdef ANDROIDSERIAL
|
#ifdef ANDROIDSERIAL
|
||||||
"HW-7000",
|
"HW-7000",
|
||||||
|
@ -181,6 +191,8 @@ static constexpr const Identity srcIdent(
|
||||||
"Scan G100 TWAIN"
|
"Scan G100 TWAIN"
|
||||||
#elif defined AUGE
|
#elif defined AUGE
|
||||||
"AUGESCAN G100 TWAIN"
|
"AUGESCAN G100 TWAIN"
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZHUOYUYUNSCAN G100 TWAIN"
|
||||||
#elif defined HANVON
|
#elif defined HANVON
|
||||||
"Hanvon HW-8000 TAWIN"
|
"Hanvon HW-8000 TAWIN"
|
||||||
#elif defined LANXUM //!LANXUM
|
#elif defined LANXUM //!LANXUM
|
||||||
|
@ -191,6 +203,8 @@ static constexpr const Identity srcIdent(
|
||||||
#else // ISG100
|
#else // ISG100
|
||||||
#ifdef MAKEHUAGAO
|
#ifdef MAKEHUAGAO
|
||||||
"HUAGOSCAN G200 TWAIN"
|
"HUAGOSCAN G200 TWAIN"
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZHUOYUYUNSCAN G200 TWAIN"
|
||||||
#elif defined NOLOGO
|
#elif defined NOLOGO
|
||||||
"Scan G200 TWAIN"
|
"Scan G200 TWAIN"
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
|
@ -222,6 +236,8 @@ static constexpr const Identity srcIdent(
|
||||||
#endif // ANDROIDSERIES
|
#endif // ANDROIDSERIES
|
||||||
#elif defined NOLOGO
|
#elif defined NOLOGO
|
||||||
"Scan G300 TWAIN"
|
"Scan G300 TWAIN"
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZHUOYUYUNSCAN G300 TWAIN"
|
||||||
#elif defined CUMTENN
|
#elif defined CUMTENN
|
||||||
"CUMTENN CTS A4 TWAIN"
|
"CUMTENN CTS A4 TWAIN"
|
||||||
#elif defined LANXUM //!LANXUM
|
#elif defined LANXUM //!LANXUM
|
||||||
|
@ -244,6 +260,8 @@ static constexpr const Identity srcIdent(
|
||||||
#endif // ANDROIDSERIES
|
#endif // ANDROIDSERIES
|
||||||
#elif defined LANXUM //!LANXUM
|
#elif defined LANXUM //!LANXUM
|
||||||
"LANXUMSCAN G52S TWAIN"
|
"LANXUMSCAN G52S TWAIN"
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
"ZHUOYUYUNSCAN G400 TWAIN"
|
||||||
#elif defined NOLOGO
|
#elif defined NOLOGO
|
||||||
"Scan G400 TWAIN"
|
"Scan G400 TWAIN"
|
||||||
#else // !MAKEHUAGAO
|
#else // !MAKEHUAGAO
|
||||||
|
@ -351,6 +369,11 @@ static std::vector<Vid_pid> DeviceID{
|
||||||
#endif // ISG100
|
#endif // ISG100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#elif defiend ZHUOYUYUN
|
||||||
|
static std::vector<Vid_pid> DeviceID{
|
||||||
|
{0x3072,0x2100},
|
||||||
|
};
|
||||||
|
|
||||||
#elif defined AUGE
|
#elif defined AUGE
|
||||||
static std::vector<Vid_pid> DeviceID{
|
static std::vector<Vid_pid> DeviceID{
|
||||||
{0x3072,0x0130},
|
{0x3072,0x0130},
|
||||||
|
@ -966,7 +989,7 @@ void HuagaoDs::dogear_callback(int indexpaper)
|
||||||
onDeviceEvent(DOG_EAR);
|
onDeviceEvent(DOG_EAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result HuagaoDs::identityOpenDs(const Identity&) {
|
Result HuagaoDs::identityOpenDs(const Identity& origin) {
|
||||||
#ifdef G400
|
#ifdef G400
|
||||||
hMutex = CreateMutex(NULL, FALSE, _T("LookitApp_4"));
|
hMutex = CreateMutex(NULL, FALSE, _T("LookitApp_4"));
|
||||||
#elif defined G300
|
#elif defined G300
|
||||||
|
@ -984,6 +1007,7 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
|
||||||
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
|
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
|
||||||
}
|
}
|
||||||
Twain_config().GetOrSetPintfCapability(is_printfcapability, true);
|
Twain_config().GetOrSetPintfCapability(is_printfcapability, true);
|
||||||
|
|
||||||
auto usblist = UsbScan_List::find_all_usb();
|
auto usblist = UsbScan_List::find_all_usb();
|
||||||
if (!usblist.empty())
|
if (!usblist.empty())
|
||||||
{
|
{
|
||||||
|
@ -998,7 +1022,7 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
|
||||||
if (!scanner.get()) {
|
if (!scanner.get()) {
|
||||||
#ifdef G200
|
#ifdef G200
|
||||||
if (pid == 0x139 || pid == 0x239 || pid == 0x8739 || pid == 0x8629 || pid == 0x130 ||pid == 0x8000 || pid == 0x9000 ||
|
if (pid == 0x139 || pid == 0x239 || pid == 0x8739 || pid == 0x8629 || pid == 0x130 ||pid == 0x8000 || pid == 0x9000 ||
|
||||||
pid == 0x138 || pid == 0x238)
|
pid == 0x138 || pid == 0x238 || pid == 0x2100)
|
||||||
scanner.reset(new GScanO1003399());
|
scanner.reset(new GScanO1003399());
|
||||||
else
|
else
|
||||||
scanner.reset(new GScanO200());
|
scanner.reset(new GScanO200());
|
||||||
|
@ -1828,7 +1852,7 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
|
||||||
CapabilityPrintf(msg, enum2str(CapTypeEx::TwEx_CropNoise), msg == Msg::Set ? to_string((int)data.currentItem<UInt32>()) : "");
|
CapabilityPrintf(msg, enum2str(CapTypeEx::TwEx_CropNoise), msg == Msg::Set ? to_string((int)data.currentItem<UInt32>()) : "");
|
||||||
if (Msg::Set == msg) {
|
if (Msg::Set == msg) {
|
||||||
auto mech = data.currentItem<UInt32>();
|
auto mech = data.currentItem<UInt32>();
|
||||||
if ((mech > 20 || mech < 0) && ((bool)m_scanparam->is_autocrop == true))
|
if ((mech > 20 || mech < 1) && ((bool)m_scanparam->is_autocrop == true))
|
||||||
return badValue();
|
return badValue();
|
||||||
m_scanparam->noise = mech;
|
m_scanparam->noise = mech;
|
||||||
return success();
|
return success();
|
||||||
|
@ -2219,38 +2243,46 @@ Result HuagaoDs::identityOpenDs(const Identity&) {
|
||||||
}
|
}
|
||||||
return CapSupGetAllResetEx<UInt32, UInt32, (CapType)CapTypeEx::TwEx_DogEarDistance>(msg, data, m_scanparam->dogeardistance, 70);
|
return CapSupGetAllResetEx<UInt32, UInt32, (CapType)CapTypeEx::TwEx_DogEarDistance>(msg, data, m_scanparam->dogeardistance, 70);
|
||||||
};
|
};
|
||||||
|
|
||||||
//双张检测 与官方标准定义有所差异 此协议修改为bool型 爱云校使用bool类型,其余使用标准twain协议
|
//双张检测 与官方标准定义有所差异 此协议修改为bool型 爱云校使用bool类型,其余使用标准twain协议
|
||||||
m_query[CapType::DoubleFeedDetection] = msgSupportGetAllSetReset;
|
m_query[CapType::DoubleFeedDetection] = msgSupportGetAllSetReset;
|
||||||
m_caps[CapType::DoubleFeedDetection] = [this](Msg msg, Capability& data)->Result {
|
m_caps[CapType::DoubleFeedDetection] = [this](Msg msg, Capability& data)->Result {
|
||||||
CapabilityPrintf(msg, enum2str(CapType::DoubleFeedDetection), msg == Msg::Set ? to_string((float)data.currentItem<UInt16>()) : "");
|
CapabilityPrintf(msg, enum2str(CapType::DoubleFeedDetection), msg == Msg::Set ? to_string((float)data.currentItem<UInt16>()) : "");
|
||||||
switch (msg) {
|
std::vector<std::string> names;
|
||||||
case Msg::Get:
|
Twain_config().GetOrSetDoubleNames(names,true);
|
||||||
data = Capability::createEnumeration<UInt16>(CapType::DoubleFeedDetection, { 0 ,1}, m_scanparam->hardwarecaps.en_doublefeed ? 0 : 1, 0);
|
FileTools::writelog(log_INFO, " DoubleFeedDetection "+ FileTools::GetProcessName());
|
||||||
return { ReturnCode::Success, ConditionCode::Success };
|
if (std::find(names.begin(), names.end(), FileTools::to_web_utf(FileTools::String2Wstring(FileTools::GetProcessName()))) == names.end()) {
|
||||||
case Msg::GetCurrent:
|
FileTools::writelog(log_INFO, " DoubleFeedDetection 11111 ");
|
||||||
data = Capability::createOneValue<UInt16>(CapType::DoubleFeedDetection, (UInt16)m_scanparam->hardwarecaps.en_doublefeed ? 0 : 1);
|
switch (msg) {
|
||||||
return { ReturnCode::Success, ConditionCode::Success };
|
case Msg::Get:
|
||||||
case Msg::Reset:
|
data = Capability::createEnumeration<UInt16>(CapType::DoubleFeedDetection, { 0 ,1 }, m_scanparam->hardwarecaps.en_doublefeed ? 0 : 1, 0);
|
||||||
case Msg::GetDefault:
|
return { ReturnCode::Success, ConditionCode::Success };
|
||||||
m_scanparam->hardwarecaps.en_doublefeed = 1;
|
case Msg::GetCurrent:
|
||||||
data = Capability::createOneValue<UInt16>(CapType::DoubleFeedDetection, 0);
|
data = Capability::createOneValue<UInt16>(CapType::DoubleFeedDetection, (UInt16)m_scanparam->hardwarecaps.en_doublefeed ? 0 : 1);
|
||||||
return { ReturnCode::Success, ConditionCode::Success };
|
return { ReturnCode::Success, ConditionCode::Success };
|
||||||
case Msg::Set: {
|
case Msg::Reset:
|
||||||
auto mech = data.currentItem<UInt16>();
|
case Msg::GetDefault:
|
||||||
m_scanparam->hardwarecaps.en_doublefeed = mech ? 0 : 1;
|
m_scanparam->hardwarecaps.en_doublefeed = 1;
|
||||||
return success();
|
data = Capability::createOneValue<UInt16>(CapType::DoubleFeedDetection, 0);
|
||||||
}
|
return { ReturnCode::Success, ConditionCode::Success };
|
||||||
|
case Msg::Set: {
|
||||||
|
auto mech = data.currentItem<UInt16>();
|
||||||
|
m_scanparam->hardwarecaps.en_doublefeed = mech ? 0 : 1;
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
|
return { ReturnCode::Failure, ConditionCode::CapBadOperation };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
FileTools::writelog(log_INFO, " DoubleFeedDetection 22222 ");
|
||||||
|
if (Msg::Set == msg) {
|
||||||
|
auto mech = data.currentItem<UInt16>();
|
||||||
|
m_scanparam->hardwarecaps.en_doublefeed = mech ? 1 : 0;
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
return CapSupGetAllResetEx<BYTE, UInt16, CapType::DoubleFeedDetection>(msg, data, m_scanparam->hardwarecaps.en_doublefeed, TRUE);
|
||||||
}
|
}
|
||||||
//if (Msg::Set == msg) {
|
|
||||||
// auto mech = data.currentItem<UInt16>();
|
|
||||||
// m_scanparam->hardwarecaps.en_doublefeed = mech ? 1 : 0;
|
|
||||||
// return success();
|
|
||||||
//}
|
|
||||||
//return CapSupGetAllResetEx<BYTE, UInt16, CapType::DoubleFeedDetection>(msg, data, m_scanparam->hardwarecaps.en_doublefeed, TRUE);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef G200
|
#ifdef G200
|
||||||
|
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
Binary file not shown.
BIN
huagao/stdafx.h
BIN
huagao/stdafx.h
Binary file not shown.
Loading…
Reference in New Issue