Merge branch 'dev' of http://192.168.10.5:8099/sane/code_device into dev
This commit is contained in:
commit
d172dc3685
|
@ -615,6 +615,13 @@ typedef struct _scan_conf
|
||||||
uint8_t fold_concatmode; /**< 对折拼接模式 0左右,1上下,2自动对折>*/
|
uint8_t fold_concatmode; /**< 对折拼接模式 0左右,1上下,2自动对折>*/
|
||||||
int HsvFilterType; /**< 答题卡留红出杂色功能类型 暂定为0*/
|
int HsvFilterType; /**< 答题卡留红出杂色功能类型 暂定为0*/
|
||||||
bool is_colorcast; /**< 色偏校正*/
|
bool is_colorcast; /**< 色偏校正*/
|
||||||
|
int discare_edge; /**< 跳过空白页边缘缩进>*/
|
||||||
|
int discare_dilate; /**< 调过空白页纸张杂点阈值>*/
|
||||||
|
double discare_meanth; /**< 调过空白页文稿底色阈值>*/
|
||||||
|
bool en_contaminationdetection; /**< 脏污检测使能>*/
|
||||||
|
uint8_t contaminationdetection_threshold_1; /**< 脏污检测第一阈值,超过该阈值视为存在脏污>*/
|
||||||
|
uint8_t contaminationdetection_threshold_2; /**< 脏污检测第二阈值,配合width使用,超过该阈值且连续宽度达到width视为存在脏污>*/
|
||||||
|
uint32_t contaminationdetection_width; /**< 脏污检测宽度,配合threshold2使用>*/
|
||||||
uint32_t reserve[1024]; /**< 预留4096字节做协议扩展*/
|
uint32_t reserve[1024]; /**< 预留4096字节做协议扩展*/
|
||||||
}SCANCONF ,*LPSCANCONF;
|
}SCANCONF ,*LPSCANCONF;
|
||||||
//图像参数设置 -OVER
|
//图像参数设置 -OVER
|
||||||
|
@ -690,12 +697,13 @@ namespace setting_hardware
|
||||||
unsigned int isColor : 1;
|
unsigned int isColor : 1;
|
||||||
unsigned int dpi : 2;
|
unsigned int dpi : 2;
|
||||||
unsigned int doubleFeeded : 1;
|
unsigned int doubleFeeded : 1;
|
||||||
unsigned int enableStable : 1;
|
unsigned int en_doublefeed_check : 1;
|
||||||
unsigned int enableLed : 1;
|
unsigned int enableLed : 1;
|
||||||
unsigned int enableSizeDetect : 1;
|
unsigned int enableSizeDetect : 1;
|
||||||
unsigned int lutmode : 1; // 设置文本和照片模式, 0 - 文本;1 - 照片。默认值为“0”
|
unsigned int lutmode : 1; // 设置文本和照片模式, 0 - 文本;1 - 照片。默认值为“0”
|
||||||
unsigned int moire : 1;
|
unsigned int moire : 1;
|
||||||
unsigned int reversed1 : 3;
|
unsigned int dirty_detect : 1;
|
||||||
|
unsigned int reversed1 : 2;
|
||||||
unsigned int isCorrect : 1; //设置0 为原图,1为校正后的图
|
unsigned int isCorrect : 1; //设置0 为原图,1为校正后的图
|
||||||
unsigned int dstHeight : 8;
|
unsigned int dstHeight : 8;
|
||||||
unsigned int reversed2 : 6;
|
unsigned int reversed2 : 6;
|
||||||
|
@ -775,9 +783,11 @@ namespace setting3288dsp
|
||||||
USB_DISCONNECTED = 200, //USB 未连接
|
USB_DISCONNECTED = 200, //USB 未连接
|
||||||
USER_STOP = 201, //用户点击停止
|
USER_STOP = 201, //用户点击停止
|
||||||
AUTO_FLAT_FINISHED = 202, //自动校正完成
|
AUTO_FLAT_FINISHED = 202, //自动校正完成
|
||||||
USB_CONNECTED, //USB已连接
|
SCANNER_ACTIVED=0x10, //设备未休眠 休眠返回0x100 未休眠返回0x10
|
||||||
HAVE_PAPER,
|
DOUBLE_FEED_IMAGE=203,//双张校验图像
|
||||||
DEVICE_OFF_LINE, //USB链接断开
|
IMAGE_DIRTY_BAND=204,//图像脏污
|
||||||
|
IMAGE_DIRTY_CIS = 205
|
||||||
|
|
||||||
} UsbSupported, * PUsbSupported;
|
} UsbSupported, * PUsbSupported;
|
||||||
//
|
//
|
||||||
//设备状态 - OVER
|
//设备状态 - OVER
|
||||||
|
@ -940,6 +950,12 @@ namespace setting3288dsp
|
||||||
GETMOTORPARMLEN = 0x203,
|
GETMOTORPARMLEN = 0x203,
|
||||||
SETMOTORPARAM = 0x204,
|
SETMOTORPARAM = 0x204,
|
||||||
SETMOTORPARAMLEN = 0x205,
|
SETMOTORPARAMLEN = 0x205,
|
||||||
|
SET_BACKUP_CONFIG = 0x304,
|
||||||
|
SET_RECOVERY = 0x305,
|
||||||
|
GET_BACKUP_STATUS = 0x306,
|
||||||
|
GET_RECOVERY_STATUS = 0x307,
|
||||||
|
GET_DATETIME,
|
||||||
|
SET_DATETIME,
|
||||||
DEVICES_7010 = 0x7010
|
DEVICES_7010 = 0x7010
|
||||||
};
|
};
|
||||||
typedef enum tagUsbKeyWords UsbKeyWords, * PUsbKeyWords;
|
typedef enum tagUsbKeyWords UsbKeyWords, * PUsbKeyWords;
|
||||||
|
|
|
@ -670,6 +670,7 @@ void hg_scanner::init_setting_func_map(void)
|
||||||
setting_map_[SANE_STD_OPT_NAME_COLOR_CORRECTION] = &hg_scanner::setting_color_correction;
|
setting_map_[SANE_STD_OPT_NAME_COLOR_CORRECTION] = &hg_scanner::setting_color_correction;
|
||||||
setting_map_[SANE_STD_OPT_NAME_WAIT_SCAN_EXIT] = &hg_scanner::setting_auto_paper_scan_exit_time;
|
setting_map_[SANE_STD_OPT_NAME_WAIT_SCAN_EXIT] = &hg_scanner::setting_auto_paper_scan_exit_time;
|
||||||
setting_map_[SANE_STD_OPT_NAME_DISCARDBLANK] = &hg_scanner::setting_set_discardblank;
|
setting_map_[SANE_STD_OPT_NAME_DISCARDBLANK] = &hg_scanner::setting_set_discardblank;
|
||||||
|
setting_map_[SANE_STD_OPT_NAME_LENS_DIRTY] = &hg_scanner::setting_detect_lens_dirty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1220,6 +1221,9 @@ void hg_scanner::working_done(void*)
|
||||||
case SCANNER_ERR_DEVICE_DEVS_BOOTING:
|
case SCANNER_ERR_DEVICE_DEVS_BOOTING:
|
||||||
notify_ui_working_status(from_default_language(STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING), SANE_EVENT_SCAN_FINISHED, status_);
|
notify_ui_working_status(from_default_language(STATU_DESC_SCANNER_ERR_DEVICE_DEVS_BOOTING), SANE_EVENT_SCAN_FINISHED, status_);
|
||||||
break;
|
break;
|
||||||
|
case SCANNER_ERR_DEVICE_LENS_DIRTY:
|
||||||
|
notify_ui_working_status(from_default_language(STATU_DESC_SCANNER_ERR_DEVICE_LENS_DIRTY), SANE_EVENT_SCAN_FINISHED, status_);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
notify_ui_working_status(user_cancel_ ? hg_log::lang_load(ID_STATU_DESC_SCAN_CANCELED) : hg_log::lang_load(ID_STATU_DESC_SCAN_STOPPED), SANE_EVENT_SCAN_FINISHED, status_);
|
notify_ui_working_status(user_cancel_ ? hg_log::lang_load(ID_STATU_DESC_SCAN_CANCELED) : hg_log::lang_load(ID_STATU_DESC_SCAN_STOPPED), SANE_EVENT_SCAN_FINISHED, status_);
|
||||||
break;
|
break;
|
||||||
|
@ -2969,6 +2973,16 @@ int hg_scanner::setting_set_discardblank(void* data, long* len)
|
||||||
|
|
||||||
return SCANNER_ERR_RELOAD_OPT_PARAM;
|
return SCANNER_ERR_RELOAD_OPT_PARAM;
|
||||||
}
|
}
|
||||||
|
int hg_scanner::setting_detect_lens_dirty(void* data, long* len)
|
||||||
|
{
|
||||||
|
bool use = *((bool*)data);
|
||||||
|
int ret = on_detect_lens_dirty(use);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
*((bool*)data) = use;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
int hg_scanner::on_color_mode_changed(int& color_mode)
|
int hg_scanner::on_color_mode_changed(int& color_mode)
|
||||||
{
|
{
|
||||||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||||||
|
@ -3033,6 +3047,10 @@ int hg_scanner::on_process_double_paper(bool type)
|
||||||
{
|
{
|
||||||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||||||
}
|
}
|
||||||
|
int hg_scanner::on_detect_lens_dirty(bool type)
|
||||||
|
{
|
||||||
|
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||||||
|
}
|
||||||
void hg_scanner::on_device_reconnected(void)
|
void hg_scanner::on_device_reconnected(void)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(io_lock_);
|
std::lock_guard<std::mutex> lock(io_lock_);
|
||||||
|
@ -5366,6 +5384,7 @@ int hg_scanner::image_configuration(SCANCONF& ic)
|
||||||
{
|
{
|
||||||
ic.splitImage = false;
|
ic.splitImage = false;
|
||||||
}
|
}
|
||||||
|
ic.en_contaminationdetection = is_lens_dirty;
|
||||||
|
|
||||||
//多流输出优先级最高
|
//多流输出优先级最高
|
||||||
if (is_multiout)
|
if (is_multiout)
|
||||||
|
@ -5508,5 +5527,6 @@ int hg_scanner::image_configuration(SCANCONF& ic)
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.HsvFilterType=%d\r\n", ic.HsvFilterType);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.HsvFilterType=%d\r\n", ic.HsvFilterType);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.is_colorcast =%d\r\n", ic.is_colorcast);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.is_colorcast =%d\r\n", ic.is_colorcast);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.isuoloadexceptionimage=%d\r\n", ic.isuoloadexceptionimage);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.isuoloadexceptionimage=%d\r\n", ic.isuoloadexceptionimage);
|
||||||
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "ic.en_contaminationdetection=%d\r\n", ic.en_contaminationdetection);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,6 +242,7 @@ protected:
|
||||||
int setting_get_motor_ver(void* data, long* len);
|
int setting_get_motor_ver(void* data, long* len);
|
||||||
int setting_get_initial_boot_time(void* data, long* len);
|
int setting_get_initial_boot_time(void* data, long* len);
|
||||||
int setting_set_discardblank(void* data, long* len);
|
int setting_set_discardblank(void* data, long* len);
|
||||||
|
int setting_detect_lens_dirty(void* data, long* len);
|
||||||
|
|
||||||
virtual void on_device_reconnected(void);
|
virtual void on_device_reconnected(void);
|
||||||
virtual int on_scanner_closing(bool force);
|
virtual int on_scanner_closing(bool force);
|
||||||
|
@ -262,6 +263,7 @@ protected:
|
||||||
virtual int on_is_auto_paper(bool isautopaper) = 0; //待纸扫描
|
virtual int on_is_auto_paper(bool isautopaper) = 0; //待纸扫描
|
||||||
virtual int on_cis_get_image(bool type) = 0;
|
virtual int on_cis_get_image(bool type) = 0;
|
||||||
virtual int on_process_double_paper(bool type) = 0; //双张图像校验
|
virtual int on_process_double_paper(bool type) = 0; //双张图像校验
|
||||||
|
virtual int on_detect_lens_dirty(bool type); //检测镜头脏污
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual int set_setting_value(const char* name, void* data, long* len);
|
virtual int set_setting_value(const char* name, void* data, long* len);
|
||||||
|
@ -347,6 +349,7 @@ protected:
|
||||||
int is_auto_paper_scan_exit_time; //待纸扫描退出时间
|
int is_auto_paper_scan_exit_time; //待纸扫描退出时间
|
||||||
bool is_auto_feedmode_; //是否启用自动分纸强度
|
bool is_auto_feedmode_; //是否启用自动分纸强度
|
||||||
bool is_discardblank; //是否启动跳过空白页
|
bool is_discardblank; //是否启动跳过空白页
|
||||||
|
bool is_lens_dirty; //是否检测镜头脏污
|
||||||
|
|
||||||
SANE_DISTORTION_VAL distortion_val; //畸变修正结构体保存
|
SANE_DISTORTION_VAL distortion_val; //畸变修正结构体保存
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -73,7 +73,8 @@ protected:
|
||||||
virtual int on_pick_paper_threshold(double threshold)override;
|
virtual int on_pick_paper_threshold(double threshold)override;
|
||||||
virtual int on_is_auto_paper(bool isautopaper)override; //待纸扫描
|
virtual int on_is_auto_paper(bool isautopaper)override; //待纸扫描
|
||||||
virtual int on_cis_get_image(bool isautopaper) override; //cis 原图获取
|
virtual int on_cis_get_image(bool isautopaper) override; //cis 原图获取
|
||||||
virtual int on_process_double_paper(bool type) override;
|
virtual int on_process_double_paper(bool type) override; //双张图像校验
|
||||||
|
virtual int on_detect_lens_dirty(bool type); //检测镜头脏污
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -794,7 +794,6 @@ void hg_scanner_306::printf_devconfig(setting_hardware::HGSCANCONF_3288 *d)
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dpi:%d\r\n",d->params_3288.dpi);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dpi:%d\r\n",d->params_3288.dpi);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dstHeight:%d\r\n",d->params_3288.dstHeight);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dstHeight:%d\r\n",d->params_3288.dstHeight);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.enableLed:%d\r\n",d->params_3288.enableLed);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.enableLed:%d\r\n",d->params_3288.enableLed);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.enableStable:%d\r\n",d->params_3288.enableStable);
|
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.isColor:%d\r\n",d->params_3288.isColor);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.isColor:%d\r\n",d->params_3288.isColor);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.isCorrect:%d\r\n",d->params_3288.isCorrect);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.isCorrect:%d\r\n",d->params_3288.isCorrect);
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.pageSize:%d\r\n",d->params_3288.pageSize);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.pageSize:%d\r\n",d->params_3288.pageSize);
|
||||||
|
|
|
@ -258,6 +258,7 @@ extern "C"
|
||||||
RETURN_IF(err, SCANNER_ERR_DEVICE_MAYBE_IS_HOLE);
|
RETURN_IF(err, SCANNER_ERR_DEVICE_MAYBE_IS_HOLE);
|
||||||
RETURN_IF(err, SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
RETURN_IF(err, SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||||
RETURN_IF(err, SCANNER_ERR_DEVICE_UNKNOWN_STATUS);
|
RETURN_IF(err, SCANNER_ERR_DEVICE_UNKNOWN_STATUS);
|
||||||
|
RETURN_IF(err, SCANNER_ERR_DEVICE_LENS_DIRTY);
|
||||||
|
|
||||||
if (err == SCANNER_ERR_LANG_PAK_LOST)
|
if (err == SCANNER_ERR_LANG_PAK_LOST)
|
||||||
return "SCANNER_ERR_LANG_PAK_LOST";
|
return "SCANNER_ERR_LANG_PAK_LOST";
|
||||||
|
@ -334,6 +335,7 @@ extern "C"
|
||||||
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_MAYBE_IS_HOLE);
|
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_MAYBE_IS_HOLE);
|
||||||
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_DEVS_BOOTING);
|
||||||
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_UNKNOWN_STATUS);
|
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_UNKNOWN_STATUS);
|
||||||
|
RETURN_DESC_IF(err, SCANNER_ERR_DEVICE_LENS_DIRTY);
|
||||||
if (err == SCANNER_ERR_LANG_PAK_LOST)
|
if (err == SCANNER_ERR_LANG_PAK_LOST)
|
||||||
return "SCANNER_ERR_LANG_PAK_LOST";
|
return "SCANNER_ERR_LANG_PAK_LOST";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue