调整编码格式和乱码

This commit is contained in:
yangjiaxuan 2023-11-23 11:09:31 +08:00
parent 8c5cba338c
commit a65e1455b5
1 changed files with 17 additions and 17 deletions

View File

@ -1,4 +1,4 @@
#include "hg_scanner_239.h" #include "hg_scanner_239.h"
#include "../wrapper/hg_log.h" #include "../wrapper/hg_log.h"
#include "filetools.h" #include "filetools.h"
@ -109,7 +109,7 @@ namespace settings
{200.0f, 1}, {200.0f, 1},
{240.0f, 1}, {240.0f, 1},
{300.0f, 0}, {300.0f, 0},
{600.0f, 1} //临时版本å<EFBFBD>? 原æ<C5B8>¥å<C2A5>? {600.0f, 1} //临时版本发1 原来发2
}; };
bool is_equal(float l, float r) bool is_equal(float l, float r)
{ {
@ -331,7 +331,7 @@ int hg_scanner_239::set_auto_flat(int data)
} }
if ((fw[5] == 'A' && atoi(fw.substr(6, 4).c_str()) <= 9999)) if ((fw[5] == 'A' && atoi(fw.substr(6, 4).c_str()) <= 9999))
{ {
data = data == 1 ? 1 : 0; //暂时没有用ã€? data = data == 1 ? 1 : 0; //暂时没有用。
} }
if (!wait_usb_.is_waiting()) if (!wait_usb_.is_waiting())
{ {
@ -569,7 +569,7 @@ void hg_scanner_239::init_version(void)
{ {
firmware_sup_wait_paper_ = year_date.compare("3B0629") >= 0 ? true : false; firmware_sup_wait_paper_ = year_date.compare("3B0629") >= 0 ? true : false;
firmware_sup_log_export_ = true; firmware_sup_log_export_ = true;
firmware_sup_pick_strength_ = false; //ä¸<EFBFBD>支æŒ? firmware_sup_pick_strength_ = false; //不支持
firmware_sup_wake_device_ = year_date.compare("3C0518") >= 0 ? true : false; firmware_sup_wake_device_ = year_date.compare("3C0518") >= 0 ? true : false;
firmware_sup_color_corr_ = year.compare("3C") >= 0 ? true : false; firmware_sup_color_corr_ = year.compare("3C") >= 0 ? true : false;
firmware_sup_double_img = year_date.compare("3C1021") >= 0 ? true : false; firmware_sup_double_img = year_date.compare("3C1021") >= 0 ? true : false;
@ -601,7 +601,7 @@ int hg_scanner_239::writedown_device_configuration(bool type, setting_hardware:
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
if (!type) if (!type)
return ret; return ret;
setting_hardware::HGSCANCONF_3399 p = dev_conf_; //ä¸<EFBFBD>得改å<EFBFBD>˜å¤éƒ¨çš„å€? setting_hardware::HGSCANCONF_3399 p = dev_conf_; //不得改变外部的值
p.params_3399.is_autopaper = is_auto_scan(); p.params_3399.is_autopaper = is_auto_scan();
if (!dev_conf) if (!dev_conf)
dev_conf = &p; dev_conf = &p;
@ -622,7 +622,7 @@ int hg_scanner_239::writedown_device_configuration(bool type, setting_hardware:
dev_conf->params_3399.is_fixedpaper = false; dev_conf->params_3399.is_fixedpaper = false;
dev_conf->params_3399.en_autosize = true; dev_conf->params_3399.en_autosize = true;
} }
if (!firmware_sup_auto_speed_ && image_prc_param_.bits.paper == PAPER_AUTO_MATCH)//3399 ,åœ?Cä¹å‰<C3A5>的版æœ?匹é…<C3A9>原å§å°ºå¯¸è®¾ç½® 12 if (!firmware_sup_auto_speed_ && image_prc_param_.bits.paper == PAPER_AUTO_MATCH)//3399 ,在3C之前的版本 匹配原始尺寸设置 12
{ {
dev_conf->params_3399.paper = 12; dev_conf->params_3399.paper = 12;
} }
@ -918,7 +918,7 @@ int hg_scanner_239::on_resolution_changed(int& dpi)
else else
dev_conf_.params_3399.dpi = dpi >= 500 ? 3 : (dpi < 500 && dpi> 299) ? 2 : 1; dev_conf_.params_3399.dpi = dpi >= 500 ? 3 : (dpi < 500 && dpi> 299) ? 2 : 1;
//dev_conf_.params_3399.dpi = 1; //dpi å<EFBFBD>Žå‡ŒcisåŒæ•¦å<EFBFBD>—cis 默认å<C2A4>?无需改å<C2B9>˜ //dev_conf_.params_3399.dpi = 1; //dpi 华凌cis和敦南cis 默认发1无需改变
int ret = writedown_device_configuration(); int ret = writedown_device_configuration();
return ret; return ret;
} }
@ -976,7 +976,7 @@ int hg_scanner_239::on_skew_check_changed(bool& check)
int hg_scanner_239::on_skew_check_level_changed(int& check) int hg_scanner_239::on_skew_check_level_changed(int& check)
{ {
int ret = SCANNER_ERR_OK, int ret = SCANNER_ERR_OK,
val = check - 1,//上é<EFBFBD>¢è®¾ç½®çš„是1 - 5 ,接å<C2A5>—范å´å€¼ä¸º0 - 4,默è®? val = check - 1,//涓婇潰璁剧疆鐨勬槸1 - 5 锛屾帴鍙楄寖鍥村€间负0 - 4锛岄粯璁?
old = dev_conf_.params_3399.screw_detect_level; old = dev_conf_.params_3399.screw_detect_level;
setting_hardware::HGSCANCONF_3399 cf; setting_hardware::HGSCANCONF_3399 cf;
@ -1413,7 +1413,7 @@ void hg_scanner_239::thread_get_dves_image(void)
} }
//break; //break;
//æ<EFBFBD>©æ¬Žé‡œé<EFBFBD>ƒè·ºâ¬æ¬“â¬â¬é<EFBFBD>虹æ®ç‡æ¿‡ç§·éŽ­îˆšæ°¨æ<EFBFBD>©æ¨»ç—…ç‡è¯²ç•¬é”岄敊ç‡îˆ™ä¿ŠéŽ­îˆšåŽæ·‡æ¿†ç“¨æ¶“嬫潵é”屽彧é<EFBFBD>ˆå¤Žå¹<EFBFBD>é<EFBFBD>™æ §åŸŒstopé<EFBFBD>ƒèˆµå¢ é«â¬é<EFBFBD>猴ç´<EFBFBD>æ¿¡åç<EFBFBD>‰å¨ŒÂ¤å¹<EFBFBD>é<EFBFBD>™æ §ç•¬é«â¬é<EFBFBD>猴ç´<EFBFBD>é<EFBFBD>™îˆ<EFBFBD>兘浼氬é·å¯¸îƒ‡æµœå±¾î¼éŽµî£å¼¿é<EFBFBD>©å­˜å¸´æ<EFBFBD>©æ¿æ´éŽµî£å¼¿ç€¹å±¾åž? //杩欎釜鏃跺€欓€€鍑虹殑璇濇秷鎭氨杩樻病璇诲畬锛岄敊璇俊鎭厛淇濆瓨涓嬫潵锛屽彧鏈夎幏鍙栧埌stop鏃舵墠閫€鍑猴紝濡傛灉娌¤幏鍙栧畬閫€鍑猴紝鍙兘浼氬鑷寸浜屾鎵弿鐩存帴杩斿洖鎵弿瀹屾垚
} }
if (info->From == setting3399::IMG) if (info->From == setting3399::IMG)
{ {
@ -1436,8 +1436,8 @@ void hg_scanner_239::thread_get_dves_image(void)
//else //else
// VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "status(0x%x) is not accept in usb thread\n", status); // VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "status(0x%x) is not accept in usb thread\n", status);
} }
else if (info->From == setting3399::STOPSCAN)//é<EFBFBD>¥è½°æ¬¢é<EFBFBD>—å Ÿæ¹°:3B0326é¾å³°å½‡é<E280A1>ƒçŠµç„Šé<C5A0>ƒè®¹ç´<C3A7>涓嬮潰涓柇淇℃伅浼氬åŽé<E280BA>™æˆžæ£¤ç»¾ç¨¿æ¹ªé<C2AA>滄î„鎵î£å¼?é<>è·ºæ—é<E28094>¦ã„¥å½é<E2809A>ƒçŠµç„? else if (info->From == setting3399::STOPSCAN)//鍥轰欢鐗堟湰:3B0326鑾峰彇鏃犵焊鏃讹紝涓嬮潰涓柇淇℃伅浼氬厛鍙戞棤绾稿湪鍋滄鎵弿,鐒跺悗鍦ㄥ彂鏃犵焊
{ //å§<EFBFBD>ã†æ¤int绔å<EFBFBD>£æ<EFBFBD>©æ¨¿î¦æ·‡â„ƒä¼…娌℃æ¹<EFBFBD>ç‡è¯²å½‡ç€¹å²ç´<EFBFBD>é°å±¼ç¬é«â¬é<EFBFBD>虹å<EFBFBD>£é<EFBFBD>è<EFBFBD>¤æˆ·ç¼<EFBFBD>î…Ÿå£éŽ»å¿¥ç´<EFBFBD>涓嬮潰ç<EFBFBD>惧æ<EFBFBD>©æ¨»æ¹­ç¼<EFBFBD>æ´æ½«éŽµî£å¼? { //姝ゆ椂int绔偣杩樿淇℃伅娌℃湁璇诲彇瀹岋紝鑰屼笖閫€鍑虹偣鍑荤户缁壂鎻忥紝涓嬮潰璁惧杩樻湭缁撴潫鎵弿
if (!svdevs_err_.empty()) if (!svdevs_err_.empty())
{ {
status_ = svdevs_err_.front(); status_ = svdevs_err_.front();
@ -1563,7 +1563,7 @@ int hg_scanner_239::do_start(void)
reset(); reset();
//211220åºä»¶ç‰ˆæœ¬ä¸<EFBFBD>支æŒ<EFBFBD>è¿”å? //211220固件版本不支持返回
ret = get_scan_is_sleep(val); ret = get_scan_is_sleep(val);
if (!val && ret == SCANNER_ERR_OK) if (!val && ret == SCANNER_ERR_OK)
{ {
@ -1853,7 +1853,7 @@ int hg_scanner_239::get_scan_is_sleep(SANE_Bool& type)
std::lock_guard<std::mutex> lock(io_lock_); std::lock_guard<std::mutex> lock(io_lock_);
int ret = 0,val; int ret = 0,val;
ret = read_register(setting3399::SR_GET_SLEEP_STAUTUS, &val); //0休眠 1唤é†çŠ¶æ€? ret = read_register(setting3399::SR_GET_SLEEP_STAUTUS, &val); //0休眠 1唤醒状态
if (ret == SCANNER_ERR_OK) if (ret == SCANNER_ERR_OK)
{ {
type = val == 1 ? true : false; type = val == 1 ? true : false;
@ -2025,7 +2025,7 @@ int hg_scanner_239::set_scan_lock_check_val(string check_str)
{ {
return SCANNER_ERR_INVALID_PARAMETER; return SCANNER_ERR_INVALID_PARAMETER;
} }
int num = 32 - keys.size(); //ä¿<EFBFBD>æŒ<EFBFBD>32ä½<EFBFBD>ä¸å<EFBFBD>? int num = 32 - keys.size(); //保持32位下发
if (num > 0) if (num > 0)
{ {
std::string str(num, '0'); std::string str(num, '0');
@ -2085,7 +2085,7 @@ int hg_scanner_239::set_firmware_upgrade(std::string filename)
return SCANNER_ERR_OPEN_FILE_FAILED; return SCANNER_ERR_OPEN_FILE_FAILED;
} }
fwname.seekg(0, std::ios::end); fwname.seekg(0, std::ios::end);
int total = fwname.tellg();//记录总长åº? int total = fwname.tellg();//记录总长度
fwname.seekg(0, std::ios::beg); fwname.seekg(0, std::ios::beg);
int pos = fwname.tellg();//记录pos位置 int pos = fwname.tellg();//记录pos位置
@ -2124,7 +2124,7 @@ int hg_scanner_239::set_firmware_upgrade(std::string filename)
return SCANNER_ERR_DEVICE_UPGRADE_FAIL; return SCANNER_ERR_DEVICE_UPGRADE_FAIL;
int to_cnt = 0; int to_cnt = 0;
// 到这个ä½<EFBFBD>置已ç»<EFBFBD>能够å<EFBFBD>‡çº§æˆ<EFBFBD>功了 å<>Žé<C5BD>¢å¯¹å<C2B9>‡çº§ç»“æžœå<C593>šä¸åˆ¤æ? // 到这个位置已经能够升级成功了 后面对升级结果做下判断
auto now = std::chrono::steady_clock::now(); auto now = std::chrono::steady_clock::now();
while (std::chrono::duration<double>(std::chrono::steady_clock::now() - now).count() < 70) while (std::chrono::duration<double>(std::chrono::steady_clock::now() - now).count() < 70)
{ {
@ -2195,7 +2195,7 @@ int hg_scanner_239::set_dev_islock_file(int islockfile)
} }
if (islockfile != 0 && islockfile != 1) if (islockfile != 0 && islockfile != 1)
{ {
return SCANNER_ERR_INVALID_PARAMETER; //这个地æ¹è®¾ç½®çš„å<EFBFBD>æ•°å¿…é¡»ä¿<EFBFBD>è¯<EFBFBD>æ­£ç¡? return SCANNER_ERR_INVALID_PARAMETER; //这个地方设置的参数必须保证正确
} }
string device_log_path = "/var/log/black_list_file.txt"; string device_log_path = "/var/log/black_list_file.txt";
string str = std::to_string(islockfile); string str = std::to_string(islockfile);