调整部分宏定义结构
This commit is contained in:
parent
c3685f7a87
commit
ddfe9132e0
|
@ -249,8 +249,8 @@ hg_scanner::~hg_scanner()
|
|||
delete custom_gamma_val_;
|
||||
hg_imgproc::release(ImagePrc_pHandle_);
|
||||
|
||||
name_.insert(0, "\350\256\276\345\244\207\342\200\234");
|
||||
name_ += "\342\200\235\345\267\262\347\273\217\345\205\263\351\227\255\343\200\202";
|
||||
name_.insert(0, STATU_DESC_SCANNER_ERR_DEVICE_DEVS);
|
||||
name_ += STATU_DESC_SCANNER_ERR_DEVICE_IS_CLOSE;
|
||||
notify_ui_working_status(name_.c_str(), SANE_EVENT_SCANNER_CLOSED);
|
||||
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "%s(%s) destroyed.\n", name_.c_str(), hg_log::format_ptr(this).c_str());
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ static struct
|
|||
hg_scanner* (* create_scanner)(const char*, usb_io*, scanner_handle*);
|
||||
}
|
||||
g_supporting_devices[] = {
|
||||
//#ifdef OEM_LISICHENG
|
||||
#ifdef OEM_LISICHENG
|
||||
{0x31c9, PID_AND_NAME(8200, SCANNER_NAME_LSC_G42S), "G42S", "", &hg_scanner_mgr::create_scanner_g300}
|
||||
, {0x31c9, PID_AND_NAME(8420, SCANNER_NAME_LSC_G42S), "G42S", "", &hg_scanner_mgr::create_scanner_g300}
|
||||
, {0x31c9, PID_AND_NAME(8429, SCANNER_NAME_LSC_G42S), "G42S", "", &hg_scanner_mgr::create_scanner_empty}
|
||||
|
@ -45,22 +45,22 @@ g_supporting_devices[] = {
|
|||
, {0x31c9, PID_AND_NAME(8730, SCANNER_NAME_LSC_G73S), "G73S", "", &hg_scanner_mgr::create_scanner_g100}
|
||||
, {0x31c9, PID_AND_NAME(8739, SCANNER_NAME_LSC_G73S), "G73S", "", &hg_scanner_mgr::create_scanner_g239}
|
||||
|
||||
//#elif defined(OEM_HANWANG)
|
||||
, {0x2903, 0x1000, SCANNER_NAME_HW_1000, SCANNER_NAME_HW_1000, "", &hg_scanner_mgr::create_scanner_g300} // "HW-1060A"
|
||||
#elif defined(OEM_HANWANG)
|
||||
{0x2903, 0x1000, SCANNER_NAME_HW_1000, SCANNER_NAME_HW_1000, "", &hg_scanner_mgr::create_scanner_g300} // "HW-1060A"
|
||||
, {0x2903, 0x1002, SCANNER_NAME_HW_1002, SCANNER_NAME_HW_1002, "", &hg_scanner_mgr::create_scanner_g302} // "HW-1060A"
|
||||
, {0x2903, 0x7000, SCANNER_NAME_HW_7000, SCANNER_NAME_HW_7000, "", &hg_scanner_mgr::create_scanner_g400} // "HW-74x0WA"
|
||||
, {0x2903, 0x7002, SCANNER_NAME_HW_7002, SCANNER_NAME_HW_7002, "", &hg_scanner_mgr::create_scanner_g402} // "HW-7002"
|
||||
, {0x2903, 0x7039, SCANNER_NAME_HW_7039, SCANNER_NAME_HW_7039, "", &hg_scanner_mgr::create_scanner_g239} // "HW-7039F"
|
||||
, {0x2903, 0x8000, SCANNER_NAME_HW_8000, SCANNER_NAME_HW_8000, "", &hg_scanner_mgr::create_scanner_g239} // "HW-8090F"
|
||||
, {0x2903, 0x9000, SCANNER_NAME_HW_9000, SCANNER_NAME_HW_9000, "", &hg_scanner_mgr::create_scanner_g239} // "HW-9110E"
|
||||
//#elif defined(OEM_CANGTIAN)
|
||||
, {0x3308, 0x6006, SCANNER_NAME_CT_9020, SCANNER_NAME_CT_9020, "", &hg_scanner_mgr::create_scanner_g239}
|
||||
#elif defined(OEM_CANGTIAN)
|
||||
{0x3308, 0x6006, SCANNER_NAME_CT_9020, SCANNER_NAME_CT_9020, "", &hg_scanner_mgr::create_scanner_g239}
|
||||
, {0x3308, 0x6005, SCANNER_NAME_CT_4520, SCANNER_NAME_CT_4520, "", &hg_scanner_mgr::create_scanner_g300}
|
||||
|
||||
, {0x3308, 0x0238, SCANNER_NAME_CT_138, SCANNER_NAME_CT_138, "", &hg_scanner_mgr::create_scanner_g239}
|
||||
, {0x3308, 0x0138, SCANNER_NAME_CT_238, SCANNER_NAME_CT_238, "", &hg_scanner_mgr::create_scanner_g239}
|
||||
//#else
|
||||
, {0x3072, PID_AND_NAME(100, SCANNER_NAME_HG_G100), "G100", "", &hg_scanner_mgr::create_scanner_g100}
|
||||
#else
|
||||
{0x3072, PID_AND_NAME(100, SCANNER_NAME_HG_G100), "G100", "", &hg_scanner_mgr::create_scanner_g100}
|
||||
, {0x3072, PID_AND_NAME(139, SCANNER_NAME_HG_G100), "G100", "", &hg_scanner_mgr::create_scanner_g239}
|
||||
, {0x3072, PID_AND_NAME(200, SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g239}
|
||||
, {0x3072, PID_AND_NAME(239, SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g239}
|
||||
|
@ -71,7 +71,7 @@ g_supporting_devices[] = {
|
|||
, {0x3072, PID_AND_NAME(402, SCANNER_NAME_HG_G400), "G400", "", &hg_scanner_mgr::create_scanner_g402}
|
||||
, {0x3072, PID_AND_NAME(439, SCANNER_NAME_HG_G400), "G400", "", &hg_scanner_mgr::create_scanner_g439}
|
||||
, {0x064B, PID_AND_NAME(7823,SCANNER_NAME_HG_G200), "G200", "", &hg_scanner_mgr::create_scanner_g100}
|
||||
//#endif
|
||||
#endif
|
||||
};
|
||||
static std::string g_vendor = COMPANY_NAME;
|
||||
|
||||
|
@ -156,10 +156,7 @@ void hg_scanner_mgr::set_exe_name(const char* path, const char* name)
|
|||
hg_scanner_mgr::pe_name_ = name ? name : "";
|
||||
std::string str = hg_log::get_scanimage_ver();
|
||||
bool is_scanimg =false;
|
||||
if(str >= "1.0.29" )
|
||||
is_scanimg =true;
|
||||
else
|
||||
is_scanimg =false;
|
||||
is_scanimg = str >= "1.0.29" ? true : false;
|
||||
VLOG_MINI_2(LOG_LEVEL_ALL, "imgascan ver is: %s is_scanimg is:%d\n", str.c_str(),is_scanimg);
|
||||
if (name && *name)
|
||||
{
|
||||
|
|
|
@ -347,21 +347,21 @@ extern "C"
|
|||
std::string get_scanimage_ver()
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN64)
|
||||
return "";
|
||||
return "";
|
||||
#else
|
||||
FILE* fp = NULL;
|
||||
char buf[128] = { 0 };
|
||||
fp = popen("scanimage -V", "r");
|
||||
if (!fp)
|
||||
return "";
|
||||
FILE* fp = NULL;
|
||||
char buf[128] = { 0 };
|
||||
fp = popen("scanimage -V", "r");
|
||||
if (!fp)
|
||||
return "";
|
||||
|
||||
int ret = fread(buf, 1, sizeof(buf) - 1, fp);
|
||||
if(ret<1)
|
||||
return "";
|
||||
int ret = fread(buf, 1, sizeof(buf) - 1, fp);
|
||||
if(ret<1)
|
||||
return "";
|
||||
|
||||
pclose(fp);
|
||||
std::string str = buf;
|
||||
return str.substr(str.size()-7);
|
||||
pclose(fp);
|
||||
std::string str = buf;
|
||||
return str.substr(str.size()-7);
|
||||
#endif
|
||||
}
|
||||
//static std::string get_scanimage_ver()
|
||||
|
|
|
@ -297,7 +297,8 @@ extern "C"
|
|||
|
||||
// NOTE: multi-thread unsafe here
|
||||
static char g_unk_err[80] = { 0 };
|
||||
sprintf(g_unk_err, "\346\234\252\347\237\245\351\224\231\350\257\257\357\274\2320x%X", err);
|
||||
strcpy(g_unk_err, STATU_DESC_SCANNER_ERR_DEVICE_UNKNOWN_ERROR);
|
||||
sprintf(g_unk_err + strlen(g_unk_err), ":0x%x", err);
|
||||
|
||||
return g_unk_err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue