841 lines
63 KiB
C++
841 lines
63 KiB
C++
#include "hg_scanner_400.h"
|
||
#include "../wrapper/hg_log.h"
|
||
|
||
#if defined(WIN32) || defined(_WIN64)
|
||
#include "scanner_manager.h"
|
||
#endif
|
||
|
||
//G400
|
||
static std::string jsontext1("{\"global\":{\"device_type\":\"G400\",\"option_count\":62},\"restore\":{\"category\":\"base\",\"title\":\"\\u6062\\u590d\\u9ed8\\u8ba4\\u8bbe\\u7f6e\",\"desc\":\"\\u6062\\u590d\\u9ed8\\u8ba4\\u8bbe\\u7f6e\",\"type\":\"button\",\"cur\":\"button\",\"default\":\"button\",\"size\":0},\"help\":{\"category\":\"advanced\",\"title\":\"\\u5e2e\\u52a9\",\"desc\":\"\\u663e\\u793a\\u8f6f\\u4ef6\\u5e2e\\u52a9\\u6587\\u6863\",\"type\":\"button\",\"cur\":\"true\",\"default\":\"true\",\"size\":4},\"grp-1\":{\"category\":\"base\",\"title\":\"\\u57fa\\u672c\\u8bbe\\u7f6e\",\"type\":\"group\"},\"is-multiout\":{\"category\":\"base\",\"title\":\"\\u591a\\u6d41\\u8f93\\u51fa\",\"desc\":\"\\u540c\\u65f6\\u8f93\\u51fa\\u591a\\u79cd\\u989c\\u8272\\u6a21\\u5f0f\\u7684\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"multiout-type\":{\"category\":\"base\",\"title\":\"\\u591a\\u6d41\\u8f93\\u51fa\\u7c7b\\u578b\",\"desc\":\"\\u9009\\u62e9\\u591a\\u6d41\\u8f93\\u51fa\\u7684\\u7c7b\\u578b\",\"type\":\"string\",\"cur\":\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"default\":\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"size\":32,\"range\":[\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"\\u5f69\\u8272+\\u7070\\u5ea6\",\"\\u5f69\\u8272+\\u9ed1\\u767d\",\"\\u7070\\u5ea6+\\u9ed1\\u767d\"],\"depend_or\":[\"is-multiout==true\"]},\"mode\":{\"category\":\"base\",\"title\":\"\\u989c\\u8272\\u6a21\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u8272\\u5f69\\u6a21\\u5f0f\",\"type\":\"string\",\"cur\":\"24\\u4f4d\\u5f69\\u8272\",\"default\":\"24\\u4f4d\\u5f69\\u8272\",\"size\":32,\"range\":[\"24\\u4f4d\\u5f69\\u8272\",\"256\\u7ea7\\u7070\\u5ea6\",\"\\u9ed1\\u767d\",\"\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"],\"depend_or\":[\"is-multiout==false\"]},\"binary-threshold\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u9608\\u503c\",\"desc\":\"\\u9ad8\\u4e8e\\u8be5\\u9608\\u503c\\u4e3a1\\uff08\\u767d\\uff09\\uff0c\\u4f4e\\u4e8e\\u8be5\\u9608\\u503c\\u4e3a0\\uff08\\u9ed1\\uff09\",\"type\":\"int\",\"cur\":127,\"default\":127,\"size\":4,\"range\":{\"min\":0,\"max\":255},\"depend_or\":[\"is-multiout==true\",\"mode==\\u9ed1\\u767d\"]},\"reverse-bw\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u53cd\\u8272\\u8f93\\u51fa\",\"desc\":\"\\u8f93\\u51fa\\u7684\\u9ed1\\u767d\\u56fe\\u50cf\\u4ee5\\u201c1\\u201d\\u4ee3\\u8868\\u9ed1\\u8272\\uff0c\\u201c0\\u201d\\u4ee3\\u8868\\u767d\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"is-multiout==true\",\"mode==\\u9ed1\\u767d\"]},\"filter\":{\"category\":\"base\",\"title\":\"\\u7070\\u5ea6\\u6216\\u9ed1\\u767d\\u56fe\\u50cf - \\u9664\\u8272\\u4e0e\\u589e\\u5f3a\",\"desc\":\"\\u6d88\\u9664\\u6216\\u589e\\u5f3a\\u6307\\u5b9a\\u8272\\u5f69\",\"type\":\"string\",\"cur\":\"\\u4e0d\\u9664\\u8272\",\"default\":\"\\u4e0d\\u9664\\u8272\",\"size\":24,\"range\":[\"\\u4e0d\\u9664\\u8272\",\"\\u9664\\u7ea2\\u8272\",\"\\u9664\\u7eff\\u8272\",\"\\u9664\\u84dd\\u8272\",\"\\u7ea2\\u8272\\u589e\\u5f3a\",\"\\u7eff\\u8272\\u589e\\u5f3a\",\"\\u84dd\\u8272\\u589e\\u5f3a\"],\"depend_and\":[\"is-multiout!=true\",\"mode!=24\\u4f4d\\u5f69\\u8272\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-multiout-red\":{\"category\":\"base\",\"title\":\"24\\u4f4d\\u5f69\\u8272\\u56fe\\u50cf - \\u591a\\u6d41\\u8f93\\u51fa\\u9664\\u7ea2\",\"desc\":\"\\u540c\\u65f6\\u8f93\\u51fa\\u5f69\\u8272\\u56fe\\u50cf\\u548c\\u7070\\u5ea6\\u9664\\u7ea2\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-answer-sheet-red\":{\"category\":\"base\",\"title\":\"24\\u4f4d\\u5f69\\u8272\\u56fe\\u50cf - \\u7b54\\u9898\\u5361\\u9664\\u7ea2\",\"desc\":\"\\u8f93\\u51fa\\u9664\\u7ea2\\u5f69\\u8272\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-erase-bkg\":{\"category\":\"base\",\"title\":\"\\u80cc\\u666f\\u79fb\\u9664\",\"desc\":\"\\u79fb\\u9664\\u6587\\u7a3f\\u80cc\\u666f\\u5e95\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"bkg-color-range\":{\"category\":\"base\",\"title\":\" \\u80cc\\u666f\\u8272\\u5f69\\u6d6e\\u52a8\\u8303\\u56f4\",\"desc\":\"\\u4e0e\\u80cc\\u666f\\u5e95\\u8272\\u504f\\u5dee\\u5728\\u8be5\\u503c\\u8303\\u56f4\\u5185\\u7684\\u989c\\u8272\\uff0c\\u90fd\\u5c06\\u88ab\\u79fb\\u9664\",\"type\":\"int\",\"cur\":20,\"default\":20,\"size\":4,\"range\":{\"min\":1,\"max\":128},\"depend_or\":[\"is-erase-bkg==true\"]},\"sharpen\":{\"category\":\"base\",\"title\":\"\\u9510\\u5316\\u4e0e\\u6a21\\u7cca\",\"desc\":\"\\u9009\\u62e9\\u9510\\u5316\\u6548\\u679c\\u6216\\u6a21\\u7cca\\u6548\\u679c\",\"type\":\"string\",\"cur\":\"\\u65e0\",\"default\":\"\\u65e0\",\"size\":24,\"range\":[\"\\u65e0\",\"\\u9510\\u5316\",\"\\u8fdb\\u4e00\\u6b65\\u9510\\u5316\",\"\\u6a21\\u7cca\",\"\\u8fdb\\u4e00\\u6b65\\u6a21\\u7cca\"],\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-morr\":{\"category\":\"base\",\"title\":\"\\u53bb\\u9664\\u6469\\u5c14\\u7eb9\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u6469\\u5c14\\u7eb9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-grid\":{\"category\":\"base\",\"title\":\"\\u9664\\u7f51\\u7eb9\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u7f51\\u7eb9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-err-extension\":{\"category\":\"base\",\"title\":\"\\u9519\\u8bef\\u6269\\u6563\",\"desc\":\"\\u4ee5\\u70b9\\u9635\\u5f62\\u5f0f\\u6784\\u5efa\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"mode==\\u9ed1\\u767d\"]},\"is-noise-optimize\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u566a\\u70b9\\u4f18\\u5316\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u5b64\\u7acb\\u9ed1\\u70b9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"mode==\\u9ed1\\u767d\"]},\"noise-size\":{\"category\":\"base\",\"title\":\" \\u566a\\u70b9\\u4f18\\u5316\\u5c3a\\u5bf8\",\"desc\":\"\\u8bbe\\u7f6e\\u9700\\u8981\\u53bb\\u9664\\u7684\\u9ed1\\u8272\\u5b64\\u7acb\\u70b9\\u7684\\u8fde\\u901a\\u4e2a\\u6570\",\"type\":\"int\",\"cur\":30,\"default\":30,\"size\":4,\"range\":{\"min\":10,\"max\":50},\"depend_or\":[\"is-noise-optimize==true\"]},\"paper\":{\"category\":\"base\",\"title\":\"\\u7eb8\\u5f20\\u5c3a\\u5bf8\",\"desc\":\"\\u8bbe\\u7f6e\\u51fa\\u56fe\\u5927\\u5c0f\",\"type\":\"string\",\"cur\":\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"default\":\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"size\":48,\"range\":[\"A3\",\"A4\",\"A4\\u6a2a\\u5411\",\"A5\",\"A5\\u6a2a\\u5411\",\"A6\",\"A6\\u6a2a\\u5411\",\"B4\",\"B5\",\"B5\\u6a2a\\u5411\",\"B6\",\"B6\\u6a2a\\u5411\",\"Letter\",\"Letter\\u6a2a\\u5411\",\"Double Letter\",\"LEGAL\",\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"\\u4e09\\u8054\\u8bd5\\u5377\"]},\"is-custom-area\":{\"category\":\"base\",\"title\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"paper!=\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"!=\\u4e09\\u8054\\u8bd5\\u5377\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\"]},\"tl-x\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4e0a\\u89d2x\\u5750\\u6807\",\"type\":\"float\",\"cur\":0.000000,\"default\":0.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":210.000000},\"depend_and\":[\"is-custom-area==true\"]},\"br-x\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u53f3\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u53f3\\u4e0b\\u89d2x\\u5750\\u6807\",\"type\":\"float\",\"cur\":210.000000,\"default\":210.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":210.000000},\"depend_and\":[\"is-custom-area==true\"]},\"tl-y\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u4e0a\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e4");
|
||
static std::string jsontext2("9\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4e0a\\u89d2y\\u5750\\u6807\",\"type\":\"float\",\"cur\":0.000000,\"default\":0.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":297.000000},\"depend_and\":[\"is-custom-area==true\"]},\"br-y\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u4e0b\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u53f3\\u4e0b\\u89d2y\\u5750\\u6807\",\"type\":\"float\",\"cur\":297.000000,\"default\":297.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":297.000000},\"depend_and\":[\"is-custom-area==true\"]},\"page\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u9875\\u9762\",\"desc\":\"\\u8bbe\\u7f6e\\u9875\\u9762\\u626b\\u63cf\\u65b9\\u5f0f\",\"type\":\"string\",\"cur\":\"\\u53cc\\u9762\",\"default\":\"\\u53cc\\u9762\",\"size\":50,\"range\":[\"\\u5355\\u9762\",\"\\u53cc\\u9762\",\"\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u901a\\u7528\\uff09\",\"\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u53d1\\u7968\\u7eb8\\uff09\",\"\\u5bf9\\u6298\"]},\"blank-sensitivity\":{\"category\":\"base\",\"title\":\" \\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\u7075\\u654f\\u5ea6\",\"desc\":\"\\u6570\\u503c\\u8d8a\\u5927\\uff0c\\u5219\\u8d8a\\u5bb9\\u6613\\u8df3\\u8fc7\",\"type\":\"int\",\"cur\":50,\"default\":50,\"size\":4,\"range\":{\"min\":1,\"max\":100},\"depend_or\":[\"page==\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u53d1\\u7968\\u7eb8\\uff09\",\"==\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u901a\\u7528\\uff09\"]},\"fold-type\":{\"category\":\"base\",\"title\":\"\\u5bf9\\u6298\\u6a21\\u5f0f\",\"desc\":\"\",\"type\":\"string\",\"cur\":\"\\u4e0a\\u4e0b\\u5bf9\\u6298\",\"default\":\"\\u4e0a\\u4e0b\\u5bf9\\u6298\",\"size\":200,\"range\":[\"\\u5de6\\u53f3\\u5bf9\\u6298\",\"\\u4e0a\\u4e0b\\u5bf9\\u6298\",\"\\u81ea\\u52a8\\u5bf9\\u6298\"],\"depend_or\":[\"page==\\u5bf9\\u6298\"]},\"resolution\":{\"category\":\"base\",\"title\":\"\\u5206\\u8fa8\\u7387\",\"desc\":\"\\u8bbe\\u7f6e\\u626b\\u63cf\\u56fe\\u50cf\\u7684\\u5206\\u8fa8\\u7387\",\"type\":\"int\",\"cur\":200,\"default\":200,\"size\":4,\"range\":{\"min\":1,\"max\":600}},\"is-exchange\":{\"category\":\"base\",\"title\":\"\\u4ea4\\u6362\\u6b63\\u53cd\\u9762\",\"desc\":\"\\u4ea4\\u6362\\u6bcf\\u5f20\\u6587\\u7a3f\\u7684\\u6b63\\u53cd\\u9762\\u51fa\\u56fe\\u987a\\u5e8f\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5355\\u9762\"]},\"grp-2\":{\"category\":\"base\",\"title\":\"\\u4eae\\u5ea6\",\"type\":\"group\"},\"is-custom-gamma\":{\"category\":\"base\",\"title\":\"\\u542f\\u7528\\u8272\\u8c03\\u66f2\\u7ebf\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u56fe\\u50cf\\u8272\\u8c03\\u6548\\u679c\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"brightness\":{\"category\":\"base\",\"title\":\"\\u4eae\\u5ea6\\u503c\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u4eae\\u5ea6\",\"type\":\"int\",\"cur\":128,\"default\":128,\"size\":4,\"range\":{\"min\":1,\"max\":255}},\"contrast\":{\"category\":\"base\",\"title\":\"\\u5bf9\\u6bd4\\u5ea6\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u5bf9\\u6bd4\\u5ea6\",\"type\":\"int\",\"cur\":4,\"default\":4,\"size\":4,\"range\":{\"min\":1,\"max\":7}},\"gamma\":{\"category\":\"base\",\"title\":\"\\u4f3d\\u9a6c\\u503c\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u4f3d\\u739b\\u503c\",\"type\":\"float\",\"cur\":1.000000,\"default\":1.000000,\"size\":4,\"range\":{\"min\":0.010000,\"max\":5.000000}},\"grp-3\":{\"category\":\"base\",\"title\":\"\\u56fe\\u50cf\\u5904\\u7406\",\"type\":\"group\"},\"is-anti-skew\":{\"category\":\"base\",\"title\":\"\\u81ea\\u52a8\\u7ea0\\u504f\",\"desc\":\"\\u81ea\\u52a8\\u7ea0\\u6b63\\u6b6a\\u659c\\u9001\\u5165\\u7684\\u6587\\u7a3f\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4,\"depend_or\":[\"page!=\\u5bf9\\u6298\"]},\"is-split\":{\"category\":\"base\",\"title\":\"\\u56fe\\u50cf\\u62c6\\u5206\",\"desc\":\"\\u81ea\\u52a8\\u62c6\\u5206\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"page!=\\u5bf9\\u6298\"]},\"is-erase-black-frame\":{\"category\":\"base\",\"title\":\"\\u6d88\\u9664\\u9ed1\\u6846\",\"desc\":\"\\u6d88\\u9664\\u6587\\u7a3f\\u8303\\u56f4\\u5916\\u7684\\u9ed1\\u8272\\u80cc\\u666f\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4},\"bkg-fill-mode\":{\"category\":\"advanced\",\"title\":\"\\u80cc\\u666f\\u586b\\u5145\\u65b9\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u80cc\\u666f\\u586b\\u5145\\u65b9\\u5f0f\",\"type\":\"string\",\"cur\":\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"default\":\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"size\":40,\"range\":[\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"\\u51f9\\u591a\\u8fb9\\u5f62\"],\"depend_or\":[\"is-erase-black-frame==true\"]},\"is-fill-color\":{\"category\":\"base\",\"title\":\"\\u8272\\u5f69\\u586b\\u5145\",\"desc\":\"\\u542f\\u7528\\u540e\\u9ed1\\u6846\\u90e8\\u5206\\u5c06\\u586b\\u5145\\u4e3a\\u6587\\u7a3f\\u5e95\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-erase-black-frame==true\"]},\"threshold\":{\"category\":\"advanced\",\"title\":\"\\u9608\\u503c\",\"desc\":\"\\u6587\\u7a3f\\u5e95\\u8272\\u4e0e\\u9ed1\\u8272\\u80cc\\u666f\\u7070\\u5ea6\\u503c\\u7684\\u5dee\\u503c\\u5927\\u4e8e\\u8be5\\u503c\\uff0c\\u624d\\u4f1a\\u88ab\\u8bc6\\u522b\\u4e3a\\u6587\\u7a3f\",\"type\":\"int\",\"cur\":40,\"default\":40,\"size\":4,\"range\":{\"min\":30,\"max\":50},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew==true\"]},\"anti-noise-level\":{\"category\":\"advanced\",\"title\":\"\\u80cc\\u666f\\u6297\\u566a\\u7b49\\u7ea7\",\"desc\":\"\\u80fd\\u591f\\u5bb9\\u5fcd\\u7684\\u80cc\\u666f\\u6742\\u8272\\u6761\\u7eb9\\u7684\\u5bbd\\u5ea6\",\"type\":\"int\",\"cur\":8,\"default\":8,\"size\":4,\"range\":{\"min\":1,\"max\":20},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew==true\"]},\"margin\":{\"category\":\"advanced\",\"title\":\"\\u8fb9\\u7f18\\u7f29\\u8fdb\",\"desc\":\"\\u5bfb\\u627e\\u6587\\u7a3f\\u8fb9\\u7f18\\u65f6\\u5bf9\\u8fb9\\u7f18\\u7684\\u4fb5\\u5165\\u7a0b\\u5ea6\",\"type\":\"int\",\"cur\":5,\"default\":5,\"size\":4,\"range\":{\"min\":5,\"max\":30},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"is-anti-skew==true\"]},\"is-dark-sample\":{\"category\":\"base\",\"title\":\"\\u6df1\\u8272\\u6837\\u5f20\",\"desc\":\"\\u542f\\u7528\\u8be5\\u6a21\\u5f0f\\u9632\\u6b62\\u6df1\\u8272\\u5e95\\u8272\\u7684\\u6587\\u7a3f\\u56fe\\u50cf\\u88ab\\u8bef\\u5904\\u7406\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5bf9\\u6298\",\"is-erase-black-frame!=true\",\"paper!=\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew!=true\"]},\"is-anti-permeate\":{\"category\":\"base\",\"title\":\"\\u9632\\u6b62\\u6e17\\u900f\",\"desc\":\"\\u9632\\u6b62\\u80cc\\u9762\\u56fe\\u6848\\u6e17\\u900f\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"permeate-level\":{\"category\":\"base\",\"title\":\" \\u9632\\u6b62\\u6e17\\u900f\\u7b49\\u7ea7\",\"desc\":\"\\u9009\\u62e9\\u9632\\u6b62\\u6e17\\u900f\\u7684\\u7b49\\u7ea7\",\"type\":\"string\",\"cur\":\"\\u8f83\\u5f31\",\"default\":\"\\u8f83\\u5f31\",\"size\":16,\"range\":[\"\\u5f31\",\"\\u8f83\\u5f31\",\"\\u4e00\\u822c\",\"\\u8f83\\u5f3a\",\"\\u5f3a\"],\"depend_or\":[\"is-anti-permeate==true\"]},\"is-rid-hole-l\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u5de6\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u4e0a\\u7684\\u5de6\\u4fa7\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-l\":{\"category\":\"base\",\"title\":\" \\u5de6\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-l==true\"]},\"is-rid-hole-r\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u53f3\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u4e0a\\u7684\\u53f3\\u4fa7\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-r\":{\"category\":\"base\",\"title\":\" \\u53f3\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-r==true\"]},\"is-rid-hole-t\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u4e0a\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u7684\\u4e0a\\u90e8\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-t\":{\"category\":\"base\",\"title\":\" \\u4e0a\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-t==true\"]},\"is-rid-hole-b\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u4e0b\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u7684\\u4e0b\\u90e8\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-b\":{\"category\":\"base\",\"title\":\" \\u4e0b\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-b==true\"]},\"grp-4\":{\"category\":\"base\",\"title\":\"\\u9001\\u7eb8\\u65b9\\u5f0f\\u8bbe\\u7f6e\",\"type\":\"group\"},\"scan-mode\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u5f20\\u6570\",\"desc\":\"\\u9009\\u62e9\\u6307\\u5b9a\\u6570\\u91cf\\u626b\\u63cf\\u6216\\u8fde\\u7eed\\u626b\\u63cf\",\"type\":\"string\",\"cur\":\"\\u8fde\\u7eed\\u626b\\u63cf\",\"default\":\"\\u8fde\\u7eed\\u626b\\u63cf\",\"size\":32,\"range\":[\"\\u8fde\\u7eed\\u626b\\u63cf\",\"\\u626b\\u63cf\\u6307\\u5b9a\\u5f20\\u6570\"]},\"scan-count\":{\"category\":\"base\",\"title\":\" \\u626b\\u63cf\\u6570\\u91cf\",\"desc\":\"\\u626b\\u63cf\\u6307\\u5b9a\\u6570\\u91cf\",\"type\":\"int\",\"cur\":1,\"default\":1,\"size\":4,\"depend_or\":[\"scan-mode==\\u626b\\u63cf\\u6307\\u5b9a\\u5f20\\u6570\"]},\"direction\":{\"category\":\"base\",\"title\":\"\\u6587\\u7a3f\\u65b9\\u5411\",\"desc\":\"\\u8bbe\\u7f6e\\u56fe\\u50cf\\u7684\\u65b9\\u5411\",\"type\":\"string\",\"cur\":\"0\\u00b0\",\"default\":\"0\\u00b0\",\"size\":40,\"range\":[\"0\\u00b0\",\"90\\u00b0\",\"180\\u00b0\",\"-90\\u00b0\",\"\\u81ea\\u52a8\\u6587\\u672c\\u65b9\\u5411\\u8bc6\\u522b\\u00b0\"]},\"is-rotate-bkg-180\":{\"category\":\"base\",\"title\":\"\\u80cc\\u9762\\u65cb\\u8f6c180\\u00b0\",\"desc\":\"\\u80cc\\u9762\\u626b\\u63cf\\u7684\\u56fe\\u50cf\\u65cb\\u8f6c180\\u00b0\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5355\\u9762\",\"!=\\u5bf9\\u6298\",\"direction!=\\u81ea\\u52a8\\u6587\\u672c\\u65b9\\u5411\\u8bc6\\u522b\\u00b0\"]},\"is-ultrosonic\":{\"category\":\"base\",\"title\":\"\\u8d85\\u58f0\\u6ce2\\u68c0\\u6d4b\",\"desc\":\"\\u68c0\\u6d4b\\u662f\\u5426\\u51fa\\u73b0\\u53cc\\u5f20\\u9001\\u5165\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4}}");
|
||
//G300
|
||
static std::string jsontext3("{\"global\":{\"device_type\":\"G300\",\"option_count\":63},\"restore\":{\"category\":\"base\",\"title\":\"\\u6062\\u590d\\u9ed8\\u8ba4\\u8bbe\\u7f6e\",\"desc\":\"\\u6062\\u590d\\u9ed8\\u8ba4\\u8bbe\\u7f6e\",\"type\":\"button\",\"cur\":\"button\",\"default\":\"button\",\"size\":0},\"help\":{\"category\":\"advanced\",\"title\":\"\\u5e2e\\u52a9\",\"desc\":\"\\u663e\\u793a\\u8f6f\\u4ef6\\u5e2e\\u52a9\\u6587\\u6863\",\"type\":\"button\",\"cur\":\"true\",\"default\":\"true\",\"size\":4},\"grp-1\":{\"category\":\"base\",\"title\":\"\\u57fa\\u672c\\u8bbe\\u7f6e\",\"type\":\"group\"},\"is-multiout\":{\"category\":\"base\",\"title\":\"\\u591a\\u6d41\\u8f93\\u51fa\",\"desc\":\"\\u540c\\u65f6\\u8f93\\u51fa\\u591a\\u79cd\\u989c\\u8272\\u6a21\\u5f0f\\u7684\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"multiout-type\":{\"category\":\"base\",\"title\":\"\\u591a\\u6d41\\u8f93\\u51fa\\u7c7b\\u578b\",\"desc\":\"\\u9009\\u62e9\\u591a\\u6d41\\u8f93\\u51fa\\u7684\\u7c7b\\u578b\",\"type\":\"string\",\"cur\":\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"default\":\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"size\":32,\"range\":[\"\\u5f69\\u8272+\\u7070\\u5ea6+\\u9ed1\\u767d\",\"\\u5f69\\u8272+\\u7070\\u5ea6\",\"\\u5f69\\u8272+\\u9ed1\\u767d\",\"\\u7070\\u5ea6+\\u9ed1\\u767d\"],\"depend_or\":[\"is-multiout==true\"]},\"mode\":{\"category\":\"base\",\"title\":\"\\u989c\\u8272\\u6a21\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u8272\\u5f69\\u6a21\\u5f0f\",\"type\":\"string\",\"cur\":\"24\\u4f4d\\u5f69\\u8272\",\"default\":\"24\\u4f4d\\u5f69\\u8272\",\"size\":32,\"range\":[\"24\\u4f4d\\u5f69\\u8272\",\"256\\u7ea7\\u7070\\u5ea6\",\"\\u9ed1\\u767d\",\"\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"],\"depend_or\":[\"is-multiout==false\"]},\"binary-threshold\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u9608\\u503c\",\"desc\":\"\\u9ad8\\u4e8e\\u8be5\\u9608\\u503c\\u4e3a1\\uff08\\u767d\\uff09\\uff0c\\u4f4e\\u4e8e\\u8be5\\u9608\\u503c\\u4e3a0\\uff08\\u9ed1\\uff09\",\"type\":\"int\",\"cur\":127,\"default\":127,\"size\":4,\"range\":{\"min\":0,\"max\":255},\"depend_or\":[\"is-multiout==true\",\"mode==\\u9ed1\\u767d\"]},\"reverse-bw\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u53cd\\u8272\\u8f93\\u51fa\",\"desc\":\"\\u8f93\\u51fa\\u7684\\u9ed1\\u767d\\u56fe\\u50cf\\u4ee5\\u201c1\\u201d\\u4ee3\\u8868\\u9ed1\\u8272\\uff0c\\u201c0\\u201d\\u4ee3\\u8868\\u767d\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"is-multiout==true\",\"mode==\\u9ed1\\u767d\"]},\"filter\":{\"category\":\"base\",\"title\":\"\\u7070\\u5ea6\\u6216\\u9ed1\\u767d\\u56fe\\u50cf - \\u9664\\u8272\\u4e0e\\u589e\\u5f3a\",\"desc\":\"\\u6d88\\u9664\\u6216\\u589e\\u5f3a\\u6307\\u5b9a\\u8272\\u5f69\",\"type\":\"string\",\"cur\":\"\\u4e0d\\u9664\\u8272\",\"default\":\"\\u4e0d\\u9664\\u8272\",\"size\":24,\"range\":[\"\\u4e0d\\u9664\\u8272\",\"\\u9664\\u7ea2\\u8272\",\"\\u9664\\u7eff\\u8272\",\"\\u9664\\u84dd\\u8272\",\"\\u7ea2\\u8272\\u589e\\u5f3a\",\"\\u7eff\\u8272\\u589e\\u5f3a\",\"\\u84dd\\u8272\\u589e\\u5f3a\"],\"depend_and\":[\"is-multiout!=true\",\"mode!=24\\u4f4d\\u5f69\\u8272\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-multiout-red\":{\"category\":\"base\",\"title\":\"24\\u4f4d\\u5f69\\u8272\\u56fe\\u50cf - \\u591a\\u6d41\\u8f93\\u51fa\\u9664\\u7ea2\",\"desc\":\"\\u540c\\u65f6\\u8f93\\u51fa\\u5f69\\u8272\\u56fe\\u50cf\\u548c\\u7070\\u5ea6\\u9664\\u7ea2\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-answer-sheet-red\":{\"category\":\"base\",\"title\":\"24\\u4f4d\\u5f69\\u8272\\u56fe\\u50cf - \\u7b54\\u9898\\u5361\\u9664\\u7ea2\",\"desc\":\"\\u8f93\\u51fa\\u9664\\u7ea2\\u5f69\\u8272\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-erase-bkg\":{\"category\":\"base\",\"title\":\"\\u80cc\\u666f\\u79fb\\u9664\",\"desc\":\"\\u79fb\\u9664\\u6587\\u7a3f\\u80cc\\u666f\\u5e95\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=256\\u7ea7\\u7070\\u5ea6\",\"!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"bkg-color-range\":{\"category\":\"base\",\"title\":\" \\u80cc\\u666f\\u8272\\u5f69\\u6d6e\\u52a8\\u8303\\u56f4\",\"desc\":\"\\u4e0e\\u80cc\\u666f\\u5e95\\u8272\\u504f\\u5dee\\u5728\\u8be5\\u503c\\u8303\\u56f4\\u5185\\u7684\\u989c\\u8272\\uff0c\\u90fd\\u5c06\\u88ab\\u79fb\\u9664\",\"type\":\"int\",\"cur\":20,\"default\":20,\"size\":4,\"range\":{\"min\":1,\"max\":128},\"depend_or\":[\"is-erase-bkg==true\"]},\"sharpen\":{\"category\":\"base\",\"title\":\"\\u9510\\u5316\\u4e0e\\u6a21\\u7cca\",\"desc\":\"\\u9009\\u62e9\\u9510\\u5316\\u6548\\u679c\\u6216\\u6a21\\u7cca\\u6548\\u679c\",\"type\":\"string\",\"cur\":\"\\u65e0\",\"default\":\"\\u65e0\",\"size\":24,\"range\":[\"\\u65e0\",\"\\u9510\\u5316\",\"\\u8fdb\\u4e00\\u6b65\\u9510\\u5316\",\"\\u6a21\\u7cca\",\"\\u8fdb\\u4e00\\u6b65\\u6a21\\u7cca\"],\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-morr\":{\"category\":\"base\",\"title\":\"\\u53bb\\u9664\\u6469\\u5c14\\u7eb9\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u6469\\u5c14\\u7eb9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-rid-grid\":{\"category\":\"base\",\"title\":\"\\u9664\\u7f51\\u7eb9\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u7f51\\u7eb9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-multiout!=true\",\"mode!=\\u9ed1\\u767d\",\"!=\\u989c\\u8272\\u81ea\\u52a8\\u8bc6\\u522b\"]},\"is-err-extension\":{\"category\":\"base\",\"title\":\"\\u9519\\u8bef\\u6269\\u6563\",\"desc\":\"\\u4ee5\\u70b9\\u9635\\u5f62\\u5f0f\\u6784\\u5efa\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"mode==\\u9ed1\\u767d\"]},\"is-noise-optimize\":{\"category\":\"base\",\"title\":\"\\u9ed1\\u767d\\u56fe\\u50cf\\u566a\\u70b9\\u4f18\\u5316\",\"desc\":\"\\u53bb\\u9664\\u56fe\\u50cf\\u4e2d\\u7684\\u5b64\\u7acb\\u9ed1\\u70b9\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"mode==\\u9ed1\\u767d\"]},\"noise-size\":{\"category\":\"base\",\"title\":\" \\u566a\\u70b9\\u4f18\\u5316\\u5c3a\\u5bf8\",\"desc\":\"\\u8bbe\\u7f6e\\u9700\\u8981\\u53bb\\u9664\\u7684\\u9ed1\\u8272\\u5b64\\u7acb\\u70b9\\u7684\\u8fde\\u901a\\u4e2a\\u6570\",\"type\":\"int\",\"cur\":30,\"default\":30,\"size\":4,\"range\":{\"min\":10,\"max\":50},\"depend_or\":[\"is-noise-optimize==true\"]},\"paper\":{\"category\":\"base\",\"title\":\"\\u7eb8\\u5f20\\u5c3a\\u5bf8\",\"desc\":\"\\u8bbe\\u7f6e\\u51fa\\u56fe\\u5927\\u5c0f\",\"type\":\"string\",\"cur\":\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"default\":\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"size\":40,\"range\":[\"A4\",\"A5\",\"A5\\u6a2a\\u5411\",\"A6\",\"A6\\u6a2a\\u5411\",\"B5\",\"B5\\u6a2a\\u5411\",\"B6\",\"B6\\u6a2a\\u5411\",\"\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\"]},\"is-custom-area\":{\"category\":\"base\",\"title\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"paper!=\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\"]},\"tl-x\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4e0a\\u89d2x\\u5750\\u6807\",\"type\":\"float\",\"cur\":0.000000,\"default\":0.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":210.000000},\"depend_and\":[\"is-custom-area==true\"]},\"br-x\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u53f3\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u53f3\\u4e0b\\u89d2x\\u5750\\u6807\",\"type\":\"float\",\"cur\":210.000000,\"default\":210.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":210.000000},\"depend_and\":[\"is-custom-area==true\"]},\"tl-y\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u4e0a\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u57df\\u5de6\\u4e0a\\u89d2y\\u5750\\u6807\",\"type\":\"float\",\"cur\":0.000000,\"default\":0.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":297.000000},\"depend_and\":[\"is-custom-area==true\"]},\"br-y\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u533a\\u57df\\u4e0b\\u4fa7\\uff08mm\\uff09\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u626b\\u63cf\\u533a\\u5");
|
||
static std::string jsontext4("7df\\u53f3\\u4e0b\\u89d2y\\u5750\\u6807\",\"type\":\"float\",\"cur\":297.000000,\"default\":297.000000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":297.000000},\"depend_and\":[\"is-custom-area==true\"]},\"page\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u9875\\u9762\",\"desc\":\"\\u8bbe\\u7f6e\\u9875\\u9762\\u626b\\u63cf\\u65b9\\u5f0f\",\"type\":\"string\",\"cur\":\"\\u53cc\\u9762\",\"default\":\"\\u53cc\\u9762\",\"size\":50,\"range\":[\"\\u5355\\u9762\",\"\\u53cc\\u9762\",\"\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u901a\\u7528\\uff09\",\"\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u53d1\\u7968\\u7eb8\\uff09\",\"\\u5bf9\\u6298\"]},\"blank-sensitivity\":{\"category\":\"base\",\"title\":\" \\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\u7075\\u654f\\u5ea6\",\"desc\":\"\\u6570\\u503c\\u8d8a\\u5927\\uff0c\\u5219\\u8d8a\\u5bb9\\u6613\\u8df3\\u8fc7\",\"type\":\"int\",\"cur\":50,\"default\":50,\"size\":4,\"range\":{\"min\":1,\"max\":100},\"depend_or\":[\"page==\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u901a\\u7528\\uff09\",\"==\\u8df3\\u8fc7\\u7a7a\\u767d\\u9875\\uff08\\u53d1\\u7968\\u7eb8\\uff09\"]},\"fold-type\":{\"category\":\"base\",\"title\":\"\\u5bf9\\u6298\\u6a21\\u5f0f\",\"desc\":\"\",\"type\":\"string\",\"cur\":\"\\u5de6\\u53f3\\u5bf9\\u6298\",\"default\":\"\\u5de6\\u53f3\\u5bf9\\u6298\",\"size\":50,\"range\":[\"\\u5de6\\u53f3\\u5bf9\\u6298\",\"\\u4e0a\\u4e0b\\u5bf9\\u6298\",\"\\u81ea\\u52a8\\u5bf9\\u6298\"],\"depend_or\":[\"page==\\u5bf9\\u6298\"]},\"resolution\":{\"category\":\"base\",\"title\":\"\\u5206\\u8fa8\\u7387\",\"desc\":\"\\u8bbe\\u7f6e\\u626b\\u63cf\\u56fe\\u50cf\\u7684\\u5206\\u8fa8\\u7387\",\"type\":\"int\",\"cur\":200,\"default\":200,\"size\":4,\"range\":{\"min\":1,\"max\":600}},\"is-exchange\":{\"category\":\"base\",\"title\":\"\\u4ea4\\u6362\\u6b63\\u53cd\\u9762\",\"desc\":\"\\u4ea4\\u6362\\u6bcf\\u5f20\\u6587\\u7a3f\\u7684\\u6b63\\u53cd\\u9762\\u51fa\\u56fe\\u987a\\u5e8f\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5355\\u9762\"]},\"grp-2\":{\"category\":\"base\",\"title\":\"\\u4eae\\u5ea6\",\"type\":\"group\"},\"is-custom-gamma\":{\"category\":\"base\",\"title\":\"\\u542f\\u7528\\u8272\\u8c03\\u66f2\\u7ebf\",\"desc\":\"\\u81ea\\u5b9a\\u4e49\\u56fe\\u50cf\\u8272\\u8c03\\u6548\\u679c\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"brightness\":{\"category\":\"base\",\"title\":\"\\u4eae\\u5ea6\\u503c\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u4eae\\u5ea6\",\"type\":\"int\",\"cur\":128,\"default\":128,\"size\":4,\"range\":{\"min\":1,\"max\":255},\"depend_and\":[\"is-custom-gamma==false\"]},\"contrast\":{\"category\":\"base\",\"title\":\"\\u5bf9\\u6bd4\\u5ea6\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u5bf9\\u6bd4\\u5ea6\",\"type\":\"int\",\"cur\":4,\"default\":4,\"size\":4,\"range\":{\"min\":1,\"max\":7},\"depend_and\":[\"is-custom-gamma==false\"]},\"gamma\":{\"category\":\"base\",\"title\":\"\\u4f3d\\u9a6c\\u503c\",\"desc\":\"\\u8c03\\u6574\\u56fe\\u50cf\\u4f3d\\u739b\\u503c\",\"type\":\"float\",\"cur\":1.000000,\"default\":1.000000,\"size\":4,\"range\":{\"min\":0.010000,\"max\":5.000000},\"depend_and\":[\"is-custom-gamma==false\"]},\"grp-3\":{\"category\":\"base\",\"title\":\"\\u56fe\\u50cf\\u5904\\u7406\",\"type\":\"group\"},\"is-anti-skew\":{\"category\":\"base\",\"title\":\"\\u81ea\\u52a8\\u7ea0\\u504f\",\"desc\":\"\\u81ea\\u52a8\\u7ea0\\u6b63\\u6b6a\\u659c\\u9001\\u5165\\u7684\\u6587\\u7a3f\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4,\"depend_or\":[\"page!=\\u5bf9\\u6298\"]},\"is-split\":{\"category\":\"base\",\"title\":\"\\u56fe\\u50cf\\u62c6\\u5206\",\"desc\":\"\\u81ea\\u52a8\\u62c6\\u5206\\u56fe\\u50cf\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_or\":[\"page!=\\u5bf9\\u6298\"]},\"is-photo-mode\":{\"category\":\"base\",\"title\":\"\\u7167\\u7247\\u6a21\\u5f0f\",\"desc\":\"\\u542f\\u7528\\u8be5\\u6a21\\u5f0f\\u53ef\\u4fdd\\u7559\\u56fe\\u50cf\\u539f\\u59cb\\u7ec6\\u8282\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"is-erase-black-frame\":{\"category\":\"base\",\"title\":\"\\u6d88\\u9664\\u9ed1\\u6846\",\"desc\":\"\\u6d88\\u9664\\u6587\\u7a3f\\u8303\\u56f4\\u5916\\u7684\\u9ed1\\u8272\\u80cc\\u666f\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4},\"bkg-fill-mode\":{\"category\":\"advanced\",\"title\":\"\\u80cc\\u666f\\u586b\\u5145\\u65b9\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u80cc\\u666f\\u586b\\u5145\\u65b9\\u5f0f\",\"type\":\"string\",\"cur\":\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"default\":\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"size\":40,\"range\":[\"\\u51f8\\u591a\\u8fb9\\u5f62\",\"\\u51f9\\u591a\\u8fb9\\u5f62\"],\"depend_or\":[\"is-erase-black-frame==true\"]},\"is-fill-color\":{\"category\":\"base\",\"title\":\"\\u8272\\u5f69\\u586b\\u5145\",\"desc\":\"\\u542f\\u7528\\u540e\\u9ed1\\u6846\\u90e8\\u5206\\u5c06\\u586b\\u5145\\u4e3a\\u6587\\u7a3f\\u5e95\\u8272\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"is-erase-black-frame==true\"]},\"threshold\":{\"category\":\"advanced\",\"title\":\"\\u9608\\u503c\",\"desc\":\"\\u6587\\u7a3f\\u5e95\\u8272\\u4e0e\\u9ed1\\u8272\\u80cc\\u666f\\u7070\\u5ea6\\u503c\\u7684\\u5dee\\u503c\\u5927\\u4e8e\\u8be5\\u503c\\uff0c\\u624d\\u4f1a\\u88ab\\u8bc6\\u522b\\u4e3a\\u6587\\u7a3f\",\"type\":\"int\",\"cur\":40,\"default\":40,\"size\":4,\"range\":{\"min\":30,\"max\":50},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew==true\"]},\"anti-noise-level\":{\"category\":\"advanced\",\"title\":\"\\u80cc\\u666f\\u6297\\u566a\\u7b49\\u7ea7\",\"desc\":\"\\u80fd\\u591f\\u5bb9\\u5fcd\\u7684\\u80cc\\u666f\\u6742\\u8272\\u6761\\u7eb9\\u7684\\u5bbd\\u5ea6\",\"type\":\"int\",\"cur\":8,\"default\":8,\"size\":4,\"range\":{\"min\":1,\"max\":20},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew==true\"]},\"margin\":{\"category\":\"advanced\",\"title\":\"\\u8fb9\\u7f18\\u7f29\\u8fdb\",\"desc\":\"\\u5bfb\\u627e\\u6587\\u7a3f\\u8fb9\\u7f18\\u65f6\\u5bf9\\u8fb9\\u7f18\\u7684\\u4fb5\\u5165\\u7a0b\\u5ea6\",\"type\":\"int\",\"cur\":5,\"default\":5,\"size\":4,\"range\":{\"min\":5,\"max\":30},\"depend_or\":[\"is-erase-black-frame==true\",\"paper==\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"==\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"is-anti-skew==true\"]},\"is-dark-sample\":{\"category\":\"base\",\"title\":\"\\u6df1\\u8272\\u6837\\u5f20\",\"desc\":\"\\u542f\\u7528\\u8be5\\u6a21\\u5f0f\\u9632\\u6b62\\u6df1\\u8272\\u5e95\\u8272\\u7684\\u6587\\u7a3f\\u56fe\\u50cf\\u88ab\\u8bef\\u5904\\u7406\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5bf9\\u6298\",\"is-erase-black-frame!=true\",\"paper!=\\u5339\\u914d\\u539f\\u59cb\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\",\"!=\\u6700\\u5927\\u626b\\u63cf\\u5c3a\\u5bf8\\u81ea\\u52a8\\u88c1\\u5207\",\"is-anti-skew!=true\"]},\"is-anti-permeate\":{\"category\":\"base\",\"title\":\"\\u9632\\u6b62\\u6e17\\u900f\",\"desc\":\"\\u9632\\u6b62\\u80cc\\u9762\\u56fe\\u6848\\u6e17\\u900f\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"permeate-level\":{\"category\":\"base\",\"title\":\" \\u9632\\u6b62\\u6e17\\u900f\\u7b49\\u7ea7\",\"desc\":\"\\u9009\\u62e9\\u9632\\u6b62\\u6e17\\u900f\\u7684\\u7b49\\u7ea7\",\"type\":\"string\",\"cur\":\"\\u8f83\\u5f31\",\"default\":\"\\u8f83\\u5f31\",\"size\":16,\"range\":[\"\\u5f31\",\"\\u8f83\\u5f31\",\"\\u4e00\\u822c\",\"\\u8f83\\u5f3a\",\"\\u5f3a\"],\"depend_or\":[\"is-anti-permeate==true\"]},\"is-rid-hole-l\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u5de6\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u4e0a\\u7684\\u5de6\\u4fa7\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-l\":{\"category\":\"base\",\"title\":\" \\u5de6\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-l==true\"]},\"is-rid-hole-r\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u53f3\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u4e0a\\u7684\\u53f3\\u4fa7\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-r\":{\"category\":\"base\",\"title\":\" \\u53f3\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-r==true\"]},\"is-rid-hole-t\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u4e0a\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u7684\\u4e0a\\u90e8\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-t\":{\"category\":\"base\",\"title\":\" \\u4e0a\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-t==true\"]},\"is-rid-hole-b\":{\"category\":\"base\",\"title\":\"\\u7a7f\\u5b54\\u79fb\\u9664\\u2014\\u4e0b\\u4fa7\",\"desc\":\"\\u7a7f\\u5b54\\u5728\\u7eb8\\u5f20\\u7684\\u4e0b\\u90e8\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4},\"search-hole-range-b\":{\"category\":\"base\",\"title\":\" \\u4e0b\\u4fa7\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"desc\":\"\\u7a7f\\u5b54\\u641c\\u7d22\\u8303\\u56f4\\u5360\\u5e45\\u9762\\u6bd4\\u4f8b\",\"type\":\"float\",\"cur\":0.100000,\"default\":0.100000,\"size\":4,\"range\":{\"min\":0.000000,\"max\":0.500000},\"depend_or\":[\"is-rid-hole-b==true\"]},\"grp-4\":{\"category\":\"base\",\"title\":\"\\u9001\\u7eb8\\u65b9\\u5f0f\\u8bbe\\u7f6e\",\"type\":\"group\"},\"scan-mode\":{\"category\":\"base\",\"title\":\"\\u626b\\u63cf\\u5f20\\u6570\",\"desc\":\"\\u9009\\u62e9\\u6307\\u5b9a\\u6570\\u91cf\\u626b\\u63cf\\u6216\\u8fde\\u7eed\\u626b\\u63cf\",\"type\":\"string\",\"cur\":\"\\u8fde\\u7eed\\u626b\\u63cf\",\"default\":\"\\u8fde\\u7eed\\u626b\\u63cf\",\"size\":32,\"range\":[\"\\u8fde\\u7eed\\u626b\\u63cf\",\"\\u626b\\u63cf\\u6307\\u5b9a\\u5f20\\u6570\"]},\"scan-count\":{\"category\":\"base\",\"title\":\" \\u626b\\u63cf\\u6570\\u91cf\",\"desc\":\"\\u626b\\u63cf\\u6307\\u5b9a\\u6570\\u91cf\",\"type\":\"int\",\"cur\":1,\"default\":1,\"size\":4,\"depend_or\":[\"scan-mode==\\u626b\\u63cf\\u6307\\u5b9a\\u5f20\\u6570\"]},\"direction\":{\"category\":\"base\",\"title\":\"\\u6587\\u7a3f\\u65b9\\u5411\",\"desc\":\"\\u8bbe\\u7f6e\\u56fe\\u50cf\\u7684\\u65b9\\u5411\",\"type\":\"string\",\"cur\":\"0\\u00b0\",\"default\":\"0\\u00b0\",\"size\":40,\"range\":[\"0\\u00b0\",\"90\\u00b0\",\"180\\u00b0\",\"-90\\u00b0\",\"\\u81ea\\u52a8\\u6587\\u672c\\u65b9\\u5411\\u8bc6\\u522b\\u00b0\"]},\"is-rotate-bkg-180\":{\"category\":\"base\",\"title\":\"\\u80cc\\u9762\\u65cb\\u8f6c180\\u00b0\",\"desc\":\"\\u80cc\\u9762\\u626b\\u63cf\\u7684\\u56fe\\u50cf\\u65cb\\u8f6c180\\u00b0\",\"type\":\"bool\",\"cur\":false,\"default\":false,\"size\":4,\"depend_and\":[\"page!=\\u5355\\u9762\",\"!=\\u5bf9\\u6298\",\"direction!=\\u81ea\\u52a8\\u6587\\u672c\\u65b9\\u5411\\u8bc6\\u522b\\u00b0\"]},\"is-ultrosonic\":{\"category\":\"base\",\"title\":\"\\u8d85\\u58f0\\u6ce2\\u68c0\\u6d4b\",\"desc\":\"\\u68c0\\u6d4b\\u662f\\u5426\\u51fa\\u73b0\\u53cc\\u5f20\\u9001\\u5165\",\"type\":\"bool\",\"cur\":true,\"default\":true,\"size\":4}}");
|
||
|
||
namespace settingsdsp_400
|
||
{
|
||
scanner_err device_status_to_hg_err(int usbdata)
|
||
{
|
||
scanner_err code = SCANNER_ERR_NO_DATA;
|
||
switch (usbdata)
|
||
{
|
||
case setting3288dsp::HAVE_IMAGE:
|
||
code = SCANNER_ERR_OK;
|
||
break;
|
||
case setting3288dsp::STOP_SCAN:
|
||
code = SCANNER_ERR_DEVICE_STOPPED;
|
||
break;
|
||
case setting3288dsp::COUNT_MODE:
|
||
code = SCANNER_ERR_DEVICE_COUNT_MODE;
|
||
break;
|
||
case setting3288dsp::NO_FEED:
|
||
code = SCANNER_ERR_DEVICE_NO_PAPER;
|
||
break;
|
||
case setting3288dsp::OPEN_COVER:
|
||
code = SCANNER_ERR_DEVICE_COVER_OPENNED;
|
||
break;
|
||
case setting3288dsp::FEED_IN_ERROR:
|
||
code = SCANNER_ERR_DEVICE_FEEDING_PAPER;
|
||
break;
|
||
case setting3288dsp::PAPER_JAM:
|
||
code = SCANNER_ERR_DEVICE_PAPER_JAMMED;
|
||
break;
|
||
case setting3288dsp::DETECT_DOUBLE_FEED:
|
||
code = SCANNER_ERR_DEVICE_DOUBLE_FEEDING;
|
||
break;
|
||
case setting3288dsp::DETECT_STAPLE:
|
||
code = SCANNER_ERR_DEVICE_STAPLE_ON;
|
||
break;
|
||
case setting3288dsp::PAPER_SKEW:
|
||
code = SCANNER_ERR_DEVICE_PAPER_SKEW;
|
||
break;
|
||
case setting3288dsp::HARDWARE_ERROR:
|
||
code = SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
break;
|
||
case setting3288dsp::PC_SCAN_BUSY_or_ERROR:
|
||
code = SCANNER_ERR_DEVICE_PC_BUSY;
|
||
break;
|
||
case setting3288dsp::SIZE_ERROR:
|
||
code = SCANNER_ERR_DEVICE_SIZE_CHECK;
|
||
break;
|
||
default:
|
||
code = SCANNER_ERR_NO_DATA;
|
||
break;
|
||
}
|
||
|
||
return code;
|
||
}
|
||
}
|
||
hg_scanner_400::hg_scanner_400(const char* dev_name,int pid, usb_io* io) : hg_scanner(G100Serial, dev_name, io),papersize(pid)
|
||
{
|
||
pid_ = pid;
|
||
string fw = get_firmware_version();
|
||
|
||
initdevice();
|
||
#ifndef MAPPING_FUNCTION_IN_BASE
|
||
init_setting_map(setting_map_, ARRAY_SIZE(setting_map_));//优先初始化
|
||
#endif
|
||
if (init_settings(pid_))
|
||
if (pid_ == 0x400)
|
||
init_settings((jsontext1 + jsontext2).c_str());
|
||
else
|
||
init_settings((jsontext3 + jsontext4).c_str());
|
||
}
|
||
hg_scanner_400::~hg_scanner_400()
|
||
{}
|
||
int hg_scanner_400::on_scanner_closing(bool force)
|
||
{
|
||
return SCANNER_ERR_OK;
|
||
}
|
||
void hg_scanner_400::thread_handle_usb_read(void)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
status = SCANNER_ERR_OK;
|
||
StopWatch sw;
|
||
SANE_Image_Statu statu = SANE_Image_Statu_OK;
|
||
|
||
std::vector<int> savestatus_;
|
||
while (run_)
|
||
{
|
||
USBCB usb={0};
|
||
ret = get_scanner_status(usb);
|
||
//printf("usb.u32_Data = %d ret = %d\r\n",usb.u32_Data,ret);
|
||
////如果设备出现卡纸 或者双张等设备信息问题,需要等到设备进行发送stop才能停止。 所以始终以 "停止" 消息为结束信号
|
||
////如果有图的情况下,并且卡纸或双张等,设备会先发送卡纸双张信息。所以接受到错误信息之后,仍需要把图像取出来。
|
||
|
||
if (ret == SCANNER_ERR_DEVICE_STOPPED)
|
||
{
|
||
if (!savestatus_.empty())
|
||
status_ = savestatus_[0];
|
||
else
|
||
status_ = SCANNER_ERR_OK;
|
||
|
||
savestatus_.clear();
|
||
break;
|
||
}
|
||
if (ret != SCANNER_ERR_OK && ret != SCANNER_ERR_DEVICE_STOPPED && ret != SCANNER_ERR_NO_DATA)
|
||
{
|
||
statu = last_usb_image_statu(ret);
|
||
savestatus_.push_back(ret);
|
||
}
|
||
else
|
||
statu = SANE_Image_Statu_OK;
|
||
if (sw.elapsed_s() > 30)//防止状态信息一直取不上来导致卡死
|
||
{
|
||
if (!savestatus_.empty())
|
||
{
|
||
status_ = savestatus_[0];
|
||
}
|
||
else
|
||
{
|
||
status_ = SCANNER_ERR_TIMEOUT;
|
||
}
|
||
savestatus_.clear();
|
||
hg_log::log(LOG_LEVEL_WARNING, "get status timeout,get image out\n");
|
||
break;
|
||
}
|
||
|
||
if (ret == SCANNER_ERR_OK && usb.u32_Count > 0)
|
||
{
|
||
int totalNum = usb.u32_Count & 0x3fffffff; // 2022-08-04: 兼容Android,默认图片大小均在1GB以内
|
||
if (totalNum)
|
||
{
|
||
std::shared_ptr<tiny_buffer> imagedata(aquire_memory(totalNum));
|
||
|
||
if (!imagedata.get())
|
||
{
|
||
status_ = SCANNER_ERR_INSUFFICIENT_MEMORY;
|
||
break;
|
||
}
|
||
|
||
imagedata->set_image_statu(statu);
|
||
ret = get_img_data(imagedata);
|
||
// io_->set_timeout(200);
|
||
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
ret = pop_image();
|
||
sw.reset();
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
status_ = ret;
|
||
break;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
status_ = ret;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
this_thread::sleep_for(chrono::milliseconds(10));
|
||
}
|
||
}
|
||
int hg_scanner_400::start(void)
|
||
{
|
||
bool handled = false;
|
||
int ret = try_third_app_handle_start(handled),
|
||
count = -1,
|
||
val = 1;
|
||
|
||
// for third-sane-app invoking, added on 2022-05-19
|
||
if (handled)
|
||
return ret;
|
||
|
||
user_cancel_ = false;
|
||
ret = writedown_device_configuration(true);
|
||
if (ret == SCANNER_ERR_OK)
|
||
writedown_image_configuration();
|
||
else
|
||
{
|
||
status_ = ret;
|
||
return ret;
|
||
}
|
||
|
||
ret = get_scan_is_sleep(val);
|
||
if (!val)
|
||
{
|
||
status_ = SCANNER_ERR_DEVICE_SLEEPING;
|
||
//notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_SLEEPING, SANE_EVENT_ERROR, status_);
|
||
notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_NOTIFY_SLEEP, SANE_EVENT_ERROR, status_);
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_SLEEPING);
|
||
return status_;
|
||
}
|
||
ret = get_scanner_paperon(val);
|
||
if (!val)
|
||
{
|
||
status_ = SCANNER_ERR_DEVICE_NO_PAPER;
|
||
notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_NO_PAPER, SANE_EVENT_ERROR, status_);
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_NO_PAPER);
|
||
return status_;
|
||
}
|
||
|
||
USBCB usb = { setting3288dsp::START_COMMAND, img_conf_.scannum, 0 };
|
||
ret = writeusb(usb);
|
||
//io_->set_timeout(1000);
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start is.(%s)\n", hg_scanner_err_name(ret));
|
||
|
||
if(ret == SCANNER_ERR_OK)
|
||
{
|
||
//status_ = SCANNER_ERR_DEVICE_BUSY;
|
||
wait_usb_.notify();
|
||
std::this_thread::sleep_for(std::chrono::milliseconds(300));
|
||
ret = try_third_app_after_start(ret);
|
||
}
|
||
else
|
||
status_ = ret;
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "start result: %s\n", hg_scanner_err_name(ret));
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::stop(void)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
|
||
USBCB usbcb = { setting3288dsp::STOP, 0, 0 };
|
||
ret = writeusb(usbcb);
|
||
|
||
if (status_ == SCANNER_ERR_DEVICE_BUSY)
|
||
{
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "stop !but device is busy ,so sleep 2s(%s)\n", hg_scanner_err_name(status_));
|
||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||
}
|
||
user_cancel_ = true;
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
status_ = SCANNER_ERR_DEVICE_STOPPED;
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "stop device:(%s)\n", hg_scanner_err_name(status_));
|
||
}
|
||
notify_ui_working_status("取消扫描", SANE_EVENT_STATUS, status_);
|
||
//final_imgs_.clear();
|
||
|
||
return status_;
|
||
}
|
||
int hg_scanner_400::writeusb(USBCB &usb)
|
||
{
|
||
std::lock_guard<std::mutex> lock(io_lock_);
|
||
|
||
int ret = SCANNER_ERR_OK;
|
||
int len = sizeof(usb);
|
||
|
||
ret = io_->write_bulk(&usb,&len);
|
||
if (ret)
|
||
{
|
||
status_ = ret;
|
||
}
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::readusb(USBCB &usb)
|
||
{
|
||
std::lock_guard<std::mutex> lock(io_lock_);
|
||
|
||
int ret = SCANNER_ERR_OK;
|
||
int len = sizeof(USBCB);
|
||
|
||
ret = io_->read_bulk(&usb,&len);
|
||
if (ret)
|
||
{
|
||
status_ = ret;
|
||
}
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::pop_image()
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
|
||
USBCB usbcb = { setting3288dsp::POP_IMAGE, 0, 0};
|
||
ret = writeusb(usbcb);
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::get_scanner_status(USBCB &usb)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
|
||
usb = { setting3288dsp::GET_DSP_STATUS, 0, 0};
|
||
|
||
ret = writeusb(usb);
|
||
if (ret != SCANNER_ERR_OK)
|
||
return ret;
|
||
|
||
//io_->set_timeout(500);
|
||
|
||
ret = readusb(usb);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
status_ = ret;
|
||
return ret;
|
||
}
|
||
scanner_err code = settingsdsp_400::device_status_to_hg_err(usb.u32_Data);
|
||
return code ;
|
||
}
|
||
int hg_scanner_400::get_img_data(std::shared_ptr<tiny_buffer> &imagedata)
|
||
{
|
||
int total = imagedata->size(),
|
||
ret = SCANNER_ERR_OK,
|
||
index = 0,
|
||
block = total;
|
||
|
||
USBCB usb{ setting3288dsp::GET_IMAGE, 0, total};
|
||
ret = writeusb(usb);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
status_ = ret;
|
||
return ret;
|
||
}
|
||
//io_->set_timeout(500);
|
||
|
||
while (total > 0)
|
||
{
|
||
block = 512 * 1024;
|
||
|
||
if (total < block)
|
||
block = total;
|
||
|
||
unsigned int size = block;
|
||
void* buf = imagedata->data(index, &size);
|
||
if (!buf)
|
||
{
|
||
VLOG_MINI_3(LOG_LEVEL_FATAL, "memory(0x%08x + %u) fatal when read USB image %d !!!\n", index, block, usb_img_index_);
|
||
ret = SCANNER_ERR_INSUFFICIENT_MEMORY;
|
||
break;
|
||
}
|
||
block = size;
|
||
ret = io_->read_bulk(buf, &block);
|
||
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
status_ = ret;
|
||
return ret;
|
||
}
|
||
index += block;
|
||
total -= block;
|
||
}
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
ret = save_usb_data(imagedata);
|
||
}
|
||
status_ = ret;
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::writedown_device_configuration(bool type,setting_hardware::HGSCANCONF_3288 *d)
|
||
{
|
||
if (!type)
|
||
return SCANNER_ERR_OK;
|
||
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
SIZE size;
|
||
if (!d)
|
||
{
|
||
dsp_config.params_3288.lutmode = keep_watermark_;
|
||
d = &dsp_config;
|
||
}
|
||
if (is_multiout)
|
||
{
|
||
d->params_3288.isColor = image_prc_param_.bits.multi_out == MULTI_COLOR_AND_BW ? 0 : 1;
|
||
}
|
||
else if ((image_prc_param_.bits.color_mode == COLOR_MODE_256_GRAY
|
||
|| image_prc_param_.bits.color_mode == COLOR_MODE_BLACK_WHITE)
|
||
&& image_prc_param_.bits.rid_color != RID_COLOR_NONE)
|
||
{
|
||
d->params_3288.isColor = 1;
|
||
}
|
||
if (paper_size_ == TwSS::USStatement || paper_size_ == TwSS::MaxSize)
|
||
{
|
||
d->params_3288.pageSize = setting3288dsp::G400_MAXSIZE;
|
||
}
|
||
size = papersize.GetPaperSize(TwSS::A4, 200, img_conf_.paperAlign);
|
||
d->params_3288.dstHeight = (int)((size.cy + 200) / 100); //非安卓可不需要
|
||
|
||
USBCB usbcb = { setting3288dsp::CONFIGURED_DATA, d->value, 0 };
|
||
len = sizeof(USBCB);
|
||
ret = io_->write_bulk(&usbcb, &len);
|
||
|
||
VLOG_MINI_1(LOG_LEVEL_WARNING, "writedown_device_configuration is .(%s)\n", hg_scanner_err_name(ret));
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::on_color_mode_changed(int& color_mode)
|
||
{
|
||
dsp_config.params_3288.isColor = (color_mode == COLOR_MODE_BLACK_WHITE || color_mode == COLOR_MODE_256_GRAY) ? 0 : 1;
|
||
return SCANNER_ERR_OK;
|
||
}
|
||
int hg_scanner_400::on_paper_changed(int& paper)
|
||
{
|
||
bool exact = true;
|
||
int ind = hgpaper_to_devspaper(paper_map_3288, ARRAY_SIZE(paper_map_3288),paper, &exact, &paper_size_),
|
||
ret = exact ? SCANNER_ERR_OK : SCANNER_ERR_NOT_EXACT;
|
||
|
||
if (dsp_config.params_3288.pageSize != paper_map_3288[ind].dev_value)
|
||
{
|
||
int old = dsp_config.params_3288.pageSize;
|
||
|
||
dsp_config.params_3288.pageSize = paper_map_3288[ind].dev_value;
|
||
//printf("dsp_config.params_3288.paper :%d\r\n",dsp_config.params_3288.pageSize);
|
||
ret = writedown_device_configuration();
|
||
if (ret)
|
||
{
|
||
dsp_config.params_3288.pageSize = old;
|
||
for (int i = 0; i < ARRAY_SIZE(paper_map_3288); ++i)
|
||
{
|
||
if (paper_map_3288[i].dev_value == old)
|
||
{
|
||
paper = paper_map_3288[i].paper;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
else if (!exact)
|
||
ret = SCANNER_ERR_NOT_EXACT;
|
||
}
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::on_paper_check_changed(bool& check)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
if(dsp_config.params_3288.enableSizeDetect ^ check)
|
||
{
|
||
dsp_config.params_3288.enableSizeDetect = check;
|
||
ret = writedown_device_configuration();
|
||
if (ret)
|
||
{
|
||
dsp_config.params_3288.enableSizeDetect = !check;
|
||
check = dsp_config.params_3288.enableSizeDetect;
|
||
}
|
||
}
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::on_resolution_changed(int& dpi)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
dsp_config.params_3288.dpi = 1;
|
||
ret = writedown_device_configuration(true);
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::on_ultrasonic_check_changed(bool& check)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
|
||
if (dsp_config.params_3288.doubleFeeded ^ check)
|
||
{
|
||
dsp_config.params_3288.doubleFeeded = check;
|
||
ret = writedown_device_configuration();
|
||
if (ret)
|
||
{
|
||
dsp_config.params_3288.doubleFeeded = !check;
|
||
check = dsp_config.params_3288.doubleFeeded;
|
||
}
|
||
}
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::agreement(TwSS tw,int align)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
SIZE size;
|
||
setting_hardware::HGSCANCONF_3288 d;
|
||
d = dsp_config;
|
||
size = papersize.GetPaperSize(img_conf_.papertype,200,img_conf_.paperAlign);
|
||
dsp_config.params_3288.dstHeight = (int)((size.cy + 200)/100);
|
||
if (img_conf_.is_autocrop)
|
||
{
|
||
dsp_config.params_3288.pageSize = setting3288dsp::G400_AUTO;
|
||
}
|
||
//if (image_prc_param_.bits.rid_color != RID_COLOR_NONE && img_conf_.pixtype != 2)
|
||
//{
|
||
// d.params_3288.isColor = 1;
|
||
//}
|
||
//
|
||
ret = writedown_device_configuration(true,&d);
|
||
//io_->set_timeout(200);
|
||
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::initdevice()
|
||
{
|
||
dsp_config.value = 0;
|
||
dsp_config.params_3288.enableLed = 1;
|
||
dsp_config.params_3288.isCorrect = 1;
|
||
dsp_config.params_3288.reversed1 = 0;
|
||
dsp_config.params_3288.reversed2 = 0;
|
||
dsp_config.params_3288.enableSizeDetect =0;
|
||
writedown_device_configuration(true);
|
||
printf_devconfig();
|
||
|
||
return SCANNER_ERR_OK;
|
||
}
|
||
void hg_scanner_400::writedown_image_configuration(void)
|
||
{
|
||
SCANCONF ic;
|
||
int len = sizeof(ic);
|
||
|
||
bzero(&ic, len);
|
||
|
||
ic.contrast = contrast_;
|
||
ic.brightness = bright_;
|
||
|
||
if (image_prc_param_.bits.text_direction != TEXT_DIRECTION_AUTO)
|
||
ic.imageRotateDegree = image_prc_param_.bits.text_direction;
|
||
else
|
||
ic.imageRotateDegree = 0;
|
||
|
||
if (test_1_paper_)
|
||
{
|
||
LOG_INFO(LOG_LEVEL_DEBUG_INFO, "scanning mode: testing ONE paper ...\n");
|
||
ic.scannum = 1;
|
||
}
|
||
else
|
||
ic.scannum = scan_count_;
|
||
ic.en_sizecheck = dsp_config.params_3288.enableSizeDetect;
|
||
ic.hardwarecaps.en_skrewdetect = 0;
|
||
ic.hardwarecaps.en_doublefeed = dsp_config.params_3288.doubleFeeded;
|
||
ic.hardwarecaps.en_stapledetect = 0;
|
||
ic.hardwarecaps.skrewdetectlevel = 0;
|
||
// ic.hardwarecaps.is_autopaper = dsp_config_.params_dsp.is_autopaper;
|
||
ic.hardwarecaps.capturepixtype = 0; //暂无参数 获取图像类型
|
||
ic.hardwarecaps.lowpowermode = LowPowerMode::Min_None; //暂无参数 设置休眠时间 两个参数3399未使用
|
||
image_configuration(ic);
|
||
int ret = agreement((TwSS)img_conf_.papertype, img_conf_.paperAlign);
|
||
}
|
||
void hg_scanner_400::printf_devconfig(setting_hardware::HGSCANCONF_3288 *d)
|
||
{
|
||
if (!d)
|
||
d = &dsp_config;
|
||
|
||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"\r\ndsp_config.params_3288.doubleFeeded:%d\r\n",d->params_3288.doubleFeeded);
|
||
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.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.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.reversed1:%d\r\n",d->params_3288.reversed1);
|
||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.reversed2:%d\r\n",d->params_3288.reversed2);
|
||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.enableSizeDetect:%d\r\n",d->params_3288.enableSizeDetect);
|
||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.value:%d\r\n",d->value);
|
||
}
|
||
std::string hg_scanner_400::get_firmware_version()
|
||
{
|
||
char buf[20] = { 0 };
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 10; //协议定义长度为10 100 200 =10
|
||
USBCB cmd = { setting3288dsp::GET_FW_VERSION, len, 0,};
|
||
|
||
ret = writeusb(cmd);
|
||
if(ret == SCANNER_ERR_OK)
|
||
ret = io_->read_bulk(buf, &len);
|
||
|
||
return buf;
|
||
}
|
||
std::string hg_scanner_400::get_serial_num()
|
||
{
|
||
char buf[20] = { 0 };
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 14;
|
||
USBCB cmd = { setting3288dsp::GET_SERIAL, len, 0,};
|
||
|
||
ret = writeusb(cmd);
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
std::lock_guard<std::mutex> lock(io_lock_);
|
||
ret = io_->read_bulk(buf, &len);
|
||
}
|
||
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "get serial num = %s, serial num = %s\n", hg_scanner_err_name(ret), buf);
|
||
|
||
return buf;
|
||
}
|
||
std::string hg_scanner_400::get_ip(void)
|
||
{
|
||
return "";
|
||
}
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||
int hg_scanner_400::set_leaflet_scan(void)
|
||
{
|
||
int ret = SCANNER_ERR_OK;
|
||
test_1_paper_ = true;
|
||
|
||
ret = start();
|
||
return ret;
|
||
}
|
||
|
||
int hg_scanner_400::set_clear_roller_num(void)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
|
||
int hg_scanner_400::get_device_code(void)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::get_sleep_time(int &getsleepime)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
|
||
USBCB usbcb = { setting3288dsp::GET_SLEEP_TIME, 0, 0};
|
||
ret = writeusb(usbcb);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
return ret;
|
||
}
|
||
len = sizeof(usbcb);
|
||
ret = io_->read_bulk(&usbcb,&len);
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
getsleepime = usbcb.u32_Data;
|
||
}
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::set_sleep_time(int setsleepime)
|
||
{
|
||
USBCB usbcb = { setting3288dsp::SET_SLEEP_TIME,setsleepime, 0};
|
||
return writeusb(usbcb);
|
||
}
|
||
|
||
int hg_scanner_400::get_scanner_paperon(SANE_Bool& type)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
|
||
USBCB usbcb = { setting3288dsp::GET_PAPERFEEDER_STATUS, 0, 0 };
|
||
len = sizeof(USBCB);
|
||
ret = writeusb(usbcb);
|
||
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
std::lock_guard<std::mutex> lock(io_lock_);
|
||
ret = io_->read_bulk(&usbcb, &len);
|
||
type = usbcb.u32_Data == 0 ? false : true;
|
||
}
|
||
//if (usbcb.u32_Data == 0)
|
||
// ret = SCANNER_ERR_DEVICE_NO_PAPER;
|
||
//else
|
||
// ret = SCANNER_ERR_OK;
|
||
return ret;
|
||
}
|
||
|
||
int hg_scanner_400::get_scan_is_sleep(SANE_Bool& type)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
|
||
USBCB usbcb = { setting3288dsp::ACTIVE_SCANNER, 0, 0 };
|
||
len = sizeof(USBCB);
|
||
ret = writeusb(usbcb);
|
||
|
||
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
std::lock_guard<std::mutex> lock(io_lock_);
|
||
ret = io_->read_bulk(&usbcb, &len);
|
||
}
|
||
if (ret == SCANNER_ERR_OK)
|
||
{
|
||
if (usbcb.u32_Data == 0x10)
|
||
type = true;
|
||
//return SCANNER_ERR_OK;
|
||
else if (usbcb.u32_Data == 0x100)
|
||
type = false;
|
||
//return SCANNER_ERR_DEVICE_SLEEPING;
|
||
}
|
||
return ret;
|
||
}
|
||
////////////////////////////////start/////////////////////////////
|
||
///此款设备无此功能暂时预留
|
||
int hg_scanner_400::on_staple_check_changed(bool& check)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_skew_check_changed(bool& check)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_skew_check_level_changed(int& check)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_set_feedmode(int feedmode)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_pic_type(bool& pic)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_pick_paper(bool autostrength)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_pick_paper_threshold(double threshold)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_is_auto_paper(bool isautopaper)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::on_cis_get_image(bool isautopaper)
|
||
{
|
||
is_cis_image = isautopaper;
|
||
dsp_config.params_3288.isCorrect = isautopaper == true ? false : true; //false设置获取cis原图,true校正之后的图
|
||
return writedown_device_configuration();
|
||
}
|
||
int hg_scanner_400::on_get_feedmode(int &feedmode)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
/////////////////////////////////////over///////////////////////////
|
||
int hg_scanner_400::get_device_log(string &log)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_devreboot(int data)
|
||
{
|
||
USBCB usbcb = { setting3288dsp::REBOOT,data ,0 };
|
||
return writeusb(usbcb);
|
||
}
|
||
int hg_scanner_400::set_devshtudown()
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_scan_islock(SANE_Bool type)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::get_scan_islock(SANE_Bool& type)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_scan_lock_check_val(string str)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_firmware_upgrade(std::string str)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_clean_paper_road()
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::get_dev_islock_file(int& data)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_dev_islock_file(int data)
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::set_speed_mode(int data)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
|
||
USBCB usbcb = { setting3288dsp::SET_SPEED_MODE,data,len };
|
||
len = sizeof(usbcb);
|
||
ret = io_->write_bulk(&usbcb, &len);
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::set_dpi_color_check_val(void)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
USBCB usbcb = { setting3288dsp::SET_JUST_COF_H ,1,resolution_ };
|
||
len = sizeof(usbcb);
|
||
io_->write_bulk(&usbcb, &len);
|
||
|
||
//USBCB cmd = { setting3288dsp::GET_JUST_COF_H ,0,resolution_ };
|
||
//len = sizeof(cmd);
|
||
//io_->write_bulk(&cmd, &len);
|
||
//io_->read_bulk(&cmd, &len);
|
||
//int ratio = cmd.u32_Data;
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::set_notify_sleep()
|
||
{
|
||
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
|
||
}
|
||
int hg_scanner_400::get_history_roller_count(int& num)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
USBCB usbcb = { setting3288dsp::GET_SCANN_NUM,0, 0 };
|
||
len = sizeof(usbcb);
|
||
ret = io_->write_bulk(&usbcb, &len);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
return ret;
|
||
}
|
||
ret = io_->read_bulk(&usbcb, &len);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
return ret;
|
||
}
|
||
num = usbcb.u32_Data;
|
||
return ret;
|
||
}
|
||
int hg_scanner_400::get_roller_num(int& val)
|
||
{
|
||
int ret = SCANNER_ERR_OK,
|
||
len = 0;
|
||
USBCB usbcb = { setting3288dsp::GET_ROLLER_NUM,0, 0 };
|
||
len = sizeof(usbcb);
|
||
ret = io_->write_bulk(&usbcb, &len);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
return ret;
|
||
}
|
||
ret = io_->read_bulk(&usbcb, &len);
|
||
if (ret != SCANNER_ERR_OK)
|
||
{
|
||
return ret;
|
||
}
|
||
val = usbcb.u32_Data;
|
||
return ret;
|
||
} |