添加硬件属性:订书钉检测/歪斜检测/有纸状态/双张检测/电机速度

This commit is contained in:
gb 2023-12-20 16:44:39 +08:00
parent bb3ef5fc9a
commit 35c7cbe569
4 changed files with 137 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -56,6 +56,12 @@ class scanner_hw : public sane_opt_provider
int exposure_[SIDE_COUNT][COLOR_IND_COUNT];
int gain_[SIDE_COUNT];
int off_[SIDE_COUNT];
bool staple_chk_ = true;
bool screw_chk_ = true;
bool paper_on_ = false;
bool double_chk_ = true;
int motor_speed_ = /*SPEED_PPM_100*/0;
std::map<std::string, std::function<void(void*)>> opt_handler_;
@ -84,7 +90,7 @@ public:
// "cat": "none",
// "group": "CIS",
// "title": "颜色模式",
// "desc": "选择色彩模式",
// "desc": "选择镜头色彩工作模式",
// "type": "string",
// "fix-id": 34819,
// "ui-pos": 10,
@ -98,7 +104,7 @@ public:
// "cat": "none",
// "group": "CIS",
// "title": "分辨率",
// "desc": "设置扫描图像的分辨率",
// "desc": "设置镜头工作的分辨率",
// "type": "int",
// "fix-id": 34840,
// "ui-pos": 11,
@ -355,5 +361,73 @@ public:
// "max": 100,
// "step": 1
// }
// },
// "paper-on": {
// "cat": "none",
// "group": "feeder",
// "title": "纸张就绪",
// "desc": "纸张已经在进纸台上放置好",
// "type": "bool",
// "fix-id": 34912,
// "ui-pos": 15,
// "auth": 0,
// "readonly": true,
// "size": 4,
// "auto": false,
// "ownread": true,
// "cur": false,
// "default": false
// },
// "double-chk": {
// "cat": "none",
// "group": "feeder",
// "title": "双张检测",
// "desc": "检测是否有两张或者多张纸同时搓进",
// "type": "string",
// "ui-pos": 16,
// "auth": 0,
// "size": 16,
// "cur": "超声波",
// "default": "超声波",
// "range": ["超声波", "禁用"]
// },
// "is-staple": {
// "cat": "none",
// "group": "feeder",
// "title": "装订检测",
// "desc": "检测是否有订书钉存在",
// "type": "bool",
// "fix-id": 34861,
// "ui-pos": 17,
// "auth": 0,
// "size": 4,
// "cur": true,
// "default": true
// },
// "motor-speed": {
// "cat": "none",
// "group": "feeder",
// "title": "走纸速度",
// "desc": "设置走纸电机的速度,张\/分PPM",
// "type": "int",
// "ui-pos": 18,
// "auth": 0,
// "size": 4,
// "cur": 100,
// "default": 100,
// "range": [70, 100, 120, 150]
// },
// "is-check-askew": {
// "cat": "none",
// "group": "feeder",
// "title": "歪斜检测",
// "desc": "检测进纸是否歪斜",
// "type": "bool",
// "fix-id": 34868,
// "ui-pos": 19,
// "auth": 0,
// "size": 4,
// "cur": true,
// "default": true
// }
// }

View File

@ -100,6 +100,14 @@ struct MotorBoardGlue
std::function<void(unsigned int)> m_auto_paper;
};
enum
{
SPEED_PPM_100 = 0,
SPEED_PPM_70,
SPEED_PPM_120,
SPEED_PPM_150
};
class MotorBoard
{
public:

View File

@ -174,6 +174,7 @@ enum opt_visible_level // "visible" field
#define SANE_STD_OPT_NAME_SEARCH_HOLE_RANGE_B "search-hole-range-b" // OPTION_TITLE_XCCKSSFWZFMBL
#define SANE_STD_OPT_NAME_IS_FILL_COLOR "is-fill-color" // OPTION_TITLE_SCTC
#define SANE_STD_OPT_NAME_IS_ULTROSONIC_CHECK "is-ultrosonic" // OPTION_TITLE_CSBJC
#define SANE_STD_OPT_NAME_DOUBLE_CHECK "double-chk"
#define SANE_STD_OPT_NAME_DOUBLE_FEED_HANDLE "double-feed" // OPTION_TITLE_SZTPCL
#define SANE_STD_OPT_NAME_IS_CHECK_STAPLE "is-staple" // OPTION_TITLE_ZDJC
#define SANE_STD_OPT_NAME_SCAN_MODE "scan-mode" // OPTION_TITLE_SMZS
@ -253,6 +254,7 @@ enum opt_visible_level // "visible" field
#define SANE_STD_OPT_NAME_CIS_GAIN_BACK "gain-b"
#define SANE_STD_OPT_NAME_CIS_OFFSET_FRONT "off-f"
#define SANE_STD_OPT_NAME_CIS_OFFSET_BACK "off-b"
#define SANE_STD_OPT_NAME_MOTOR_SPEED "motor-speed"
//
// 借鉴TWAIN协议固定ID的做法定义SANE属性的固定ID - 这里与TWAIN中的ID保持一致以方便TWAIN的调用
enum sane_option_id