From 7c7e271a6c5e82d4cbf17f3a6c7e2aa5a374b5ae Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Tue, 19 Dec 2023 17:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BE=85=E7=BA=B8=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hardware/cis/FpgaComm.h | 6 +--- hardware/hardware.cpp | 39 +++++++++++++++++++++---- hardware/hardware.h | 63 ++++++++++++++++++++++++++++++----------- sdk/base/plat_types.h | 1 + 4 files changed, 81 insertions(+), 28 deletions(-) diff --git a/hardware/cis/FpgaComm.h b/hardware/cis/FpgaComm.h index 154d738..90fed95 100644 --- a/hardware/cis/FpgaComm.h +++ b/hardware/cis/FpgaComm.h @@ -132,11 +132,7 @@ enum }; enum { - CIS_GAIN_IND_COUNT = 6, -}; -enum -{ - CIS_OFFSET_IND_COUNT = 6, + CIS_SECTOR_COUNT = 6, // how many sectors of ONE CIS }; class FpgaComm : public IRegsAccess diff --git a/hardware/hardware.cpp b/hardware/hardware.cpp index 95cdd6c..6e4f16d 100644 --- a/hardware/hardware.cpp +++ b/hardware/hardware.cpp @@ -7,7 +7,7 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////// // scanner_hw static std::string device_opt_json[] = { - "{\"mode\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u989c\\u8272\\u6a21\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u8272\\u5f69\\u6a21\\u5f0f\",\"type\":\"string\",\"fix-id\":34819,\"ui-pos\":10,\"auth\":0,\"size\":12,\"cur\":\"\\u5f69\\u8272\",\"default\":\"\\u5f69\\u8272\",\"range\":[\"\\u5f69\\u8272\",\"\\u7070\\u5ea6\"]},\"resolution\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5206\\u8fa8\\u7387\",\"desc\":\"\\u8bbe\\u7f6e\\u626b\\u63cf\\u56fe\\u50cf\\u7684\\u5206\\u8fa8\\u7387\",\"type\":\"int\",\"fix-id\":34840,\"ui-pos\":11,\"auth\":0,\"size\":4,\"cur\":300,\"default\":300,\"range\":[200,300]},\"baud\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u6ce2\\u7279\\u7387\",\"desc\":\"CIS\\u63a7\\u5236\\u901a\\u4fe1\\u901f\\u7387\",\"type\":\"int\",\"ui-pos\":12,\"auth\":0,\"size\":4,\"cur\":921600,\"default\":921600,\"range\":[110,300,600,1200,2400,4800,9600,19200,38400,57600,115200,500000,921600,1500000]},\"act-after\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5ef6\\u8fdf\\u54cd\\u5e94\",\"desc\":\"\\u91c7\\u96c6\\u5934\\u63a5\\u53d7\\u547d\\u4ee4\\u540e\\u7684\\u52a8\\u4f5c\\u5ef6\\u8fdf\\u65f6\\u95f4\",\"type\":\"int\",\"ui-pos\":12,\"auth\":0,\"unit\":\"microsec\",\"size\":4,\"cur\":1000,\"default\":1000},\"fram-h\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5e27\\u9ad8\\u5ea6\",\"desc\":\"\\u91c7\\u96c6\\u5934\\u6bcf\\u4e00\\u5e27\\u7684\\u91c7\\u96c6\\u9ad8\\u5ea6\",\"type\":\"int\",\"ui-pos\":13,\"auth\":0,\"size\":4,\"cur\":12,\"default\":12},\"sample\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u91c7\\u6837\\u9891\\u7387\",\"desc\":\"\\u91c7\\u6837\\u9891\\u7387\",\"type\":\"int\",\"ui-pos\":14,\"auth\":0,\"size\":4,\"cur\":256,\"default\":256},\"expo-fb\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u84dd\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u84dd\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":15,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-fg\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u7eff\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7eff\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":16,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-fr\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u7ea2\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7ea2\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":17,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-bb\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u84dd\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u84dd\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":18,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-bg\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u7eff\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7eff\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":19,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-br\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u7ea2\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7ea2\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":20,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"gain-f\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u589e\\u76ca\\uff08\\u6b63\\u9762\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7684\\u589e\\u76ca\\u91cf\",\"type\":\"int\",\"ui-pos\":21,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"gain-b\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u589e\\u76ca\\uff08\\u80cc\\u9762\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7684\\u589e\\u76ca\\u91cf\",\"type\":\"int\",\"ui-pos\":24,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"off-f\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u504f\\u79fb\\uff08\\u6b63\\u9762\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7684\\u504f\\u79fb\\u91cf\",\"type\":\"int\",\"ui-pos\":27,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":0,\"max\":100,\"step\":1}},\"off-b\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u504f\\u79fb\\uff08\\u80cc\\u9762\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7684\\u504f\\u79fb\\u91cf\",\"type\":\"int\",\"ui-pos\":30,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":0,\"max\":100,\"step\":1}}}" + "{\"mode\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u989c\\u8272\\u6a21\\u5f0f\",\"desc\":\"\\u9009\\u62e9\\u8272\\u5f69\\u6a21\\u5f0f\",\"type\":\"string\",\"fix-id\":34819,\"ui-pos\":10,\"auth\":0,\"size\":12,\"cur\":\"\\u5f69\\u8272\",\"default\":\"\\u5f69\\u8272\",\"range\":[\"\\u5f69\\u8272\",\"\\u7070\\u5ea6\"]},\"resolution\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5206\\u8fa8\\u7387\",\"desc\":\"\\u8bbe\\u7f6e\\u626b\\u63cf\\u56fe\\u50cf\\u7684\\u5206\\u8fa8\\u7387\",\"type\":\"int\",\"fix-id\":34840,\"ui-pos\":11,\"auth\":0,\"size\":4,\"cur\":300,\"default\":300,\"range\":[200,300]},\"is-wait-scan\":{\"cat\":\"base\",\"group\":\"feeder\",\"title\":\"\\u5f85\\u7eb8\\u626b\\u63cf\",\"desc\":\"\\u542f\\u7528\\u540e\\uff0c\\u6587\\u7a3f\\u653e\\u5165\\u626b\\u63cf\\u4eea\\u65f6\\u5c06\\u81ea\\u52a8\\u542f\\u52a8\\u626b\\u63cf\",\"type\":\"bool\",\"fix-id\":34873,\"ui-pos\":12,\"auth\":0,\"size\":4,\"cur\":false,\"default\":false},\"wait-scan-exit\":{\"cat\":\"base\",\"group\":\"feeder\",\"title\":\"\\u5f85\\u7eb8\\u626b\\u63cf\\u9000\\u51fa\\u65f6\\u95f4\",\"desc\":\"\\u8bbe\\u7f6e\\u7ed3\\u675f\\u5f85\\u7eb8\\u626b\\u63cf\\u7684\\u65f6\\u95f4\",\"type\":\"string\",\"fix-id\":34920,\"ui-pos\":13,\"auth\":0,\"size\":16,\"cur\":\"60s\",\"default\":\"60s\",\"range\":[\"15s\",\"30s\",\"60s\",\"2min\",\"4min\",\"8min\"],\"depend\":\"is-wait-scan==true\"},\"baud\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u6ce2\\u7279\\u7387\",\"desc\":\"CIS\\u63a7\\u5236\\u901a\\u4fe1\\u901f\\u7387\",\"type\":\"int\",\"ui-pos\":20,\"auth\":0,\"size\":4,\"cur\":921600,\"default\":921600,\"range\":[110,300,600,1200,2400,4800,9600,19200,38400,57600,115200,500000,921600,1500000]},\"act-after\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5ef6\\u8fdf\\u54cd\\u5e94\",\"desc\":\"\\u91c7\\u96c6\\u5934\\u63a5\\u53d7\\u547d\\u4ee4\\u540e\\u7684\\u52a8\\u4f5c\\u5ef6\\u8fdf\\u65f6\\u95f4\",\"type\":\"int\",\"ui-pos\":21,\"auth\":0,\"unit\":\"microsec\",\"size\":4,\"cur\":1000,\"default\":1000},\"fram-h\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u5e27\\u9ad8\\u5ea6\",\"desc\":\"\\u91c7\\u96c6\\u5934\\u6bcf\\u4e00\\u5e27\\u7684\\u91c7\\u96c6\\u9ad8\\u5ea6\",\"type\":\"int\",\"ui-pos\":22,\"auth\":0,\"size\":4,\"cur\":12,\"default\":12},\"sample\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u91c7\\u6837\\u9891\\u7387\",\"desc\":\"\\u91c7\\u6837\\u9891\\u7387\",\"type\":\"int\",\"ui-pos\":23,\"auth\":0,\"size\":4,\"cur\":256,\"default\":256},\"expo-fb\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u84dd\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u84dd\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":30,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-fg\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u7eff\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7eff\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":31,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-fr\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u6b63\\u9762\\u7ea2\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7ea2\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":32,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-bb\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u84dd\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u84dd\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":33,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-bg\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u7eff\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7eff\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":34,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"expo-br\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u66dd\\u5149\\u5ea6\\uff08\\u80cc\\u9762\\u7ea2\\u8272\\u901a\\u9053\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7ea2\\u8272\\u901a\\u9053\\u7684\\u66dd\\u5149\\u5f3a\\u5ea6\",\"type\":\"int\",\"ui-pos\":35,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"gain-f\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u589e\\u76ca\\uff08\\u6b63\\u9762\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7684\\u589e\\u76ca\\u91cf\",\"type\":\"int\",\"ui-pos\":40,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"gain-b\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u589e\\u76ca\\uff08\\u80cc\\u9762\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7684\\u589e\\u76ca\\u91cf\",\"type\":\"int\",\"ui-pos\":41,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":-1000,\"max\":1000,\"step\":1}},\"off-f\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u504f\\u79fb\\uff08\\u6b63\\u9762\\uff09\",\"desc\":\"\\u6b63\\u9762\\u7684\\u504f\\u79fb\\u91cf\",\"type\":\"int\",\"ui-pos\":45,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":0,\"max\":100,\"step\":1}},\"off-b\":{\"cat\":\"none\",\"group\":\"CIS\",\"title\":\"\\u504f\\u79fb\\uff08\\u80cc\\u9762\\uff09\",\"desc\":\"\\u80cc\\u9762\\u7684\\u504f\\u79fb\\u91cf\",\"type\":\"int\",\"ui-pos\":46,\"auth\":0,\"size\":4,\"cur\":0,\"default\":0,\"range\":{\"min\":0,\"max\":100,\"step\":1}}}" }; @@ -32,6 +32,26 @@ void scanner_hw::init(void) set_opt_json_text(&text[0]); + auto a = [this](void* value) -> void + { + auto_scan_ = *(bool*)value; + }; + auto e = [this](void* value) -> void + { + if(strcmp((char*)value, "15s") == 0) + time_to_exit_auto_scan_ = 15; + else if(strcmp((char*)value, "30s") == 0) + time_to_exit_auto_scan_ = 30; + else if(strcmp((char*)value, "2min") == 0) + time_to_exit_auto_scan_ = 120; + else if(strcmp((char*)value, "4min") == 0) + time_to_exit_auto_scan_ = 240; + else if(strcmp((char*)value, "8min") == 0) + time_to_exit_auto_scan_ = 480; + else + time_to_exit_auto_scan_ = 60; + }; + auto m = [this](void* value) -> void { if(strcmp((char*)value, "\347\201\260\345\272\246") == 0) @@ -106,6 +126,13 @@ void scanner_hw::init(void) off_[SIDE_BACK] = *(int*)value; }; + CLEAN_ARRAY(exposure_); + CLEAN_ARRAY(gain_); + CLEAN_ARRAY(off_); + + opt_handler_[SANE_FULL_NAME(WAIT_TO_SCAN)] = a; + opt_handler_[SANE_FULL_NAME(WAIT_SCAN_EXIT)] = e; + opt_handler_[SANE_FULL_NAME(COLOR_MODE)] = m; opt_handler_[SANE_FULL_NAME(RESOLUTION)] = r; opt_handler_[SANE_FULL_NAME(CIS_BAUD)] = b; @@ -122,7 +149,7 @@ void scanner_hw::init(void) opt_handler_[SANE_FULL_NAME(CIS_GAIN_FRONT)] = gf; opt_handler_[SANE_FULL_NAME(CIS_GAIN_BACK)] = gb; - + opt_handler_[SANE_FULL_NAME(CIS_OFFSET_FRONT)] = of; opt_handler_[SANE_FULL_NAME(CIS_OFFSET_BACK)] = ob; } @@ -167,14 +194,14 @@ int scanner_hw::open(std::function image_handler) (img_controller_.get()->*exposure[i * SIDE_COUNT + j])(exposure_[i][j]); } - for(int i = 0; i < CIS_GAIN_IND_COUNT; ++i) + for(int i = 0; i < CIS_SECTOR_COUNT; ++i) img_controller_->setAGain(i, gain_[SIDE_FRONT]); - for(int i = 0; i < CIS_GAIN_IND_COUNT; ++i) + for(int i = 0; i < CIS_SECTOR_COUNT; ++i) img_controller_->setBGain(i, gain_[SIDE_BACK]); - for(int i = 0; i < CIS_OFFSET_IND_COUNT; ++i) + for(int i = 0; i < CIS_SECTOR_COUNT; ++i) img_controller_->setAOffset(i, off_[SIDE_FRONT]); - for(int i = 0; i < CIS_OFFSET_IND_COUNT; ++i) + for(int i = 0; i < CIS_SECTOR_COUNT; ++i) img_controller_->setBOffset(i, off_[SIDE_BACK]); return 0; diff --git a/hardware/hardware.h b/hardware/hardware.h index a98461f..a579ab0 100644 --- a/hardware/hardware.h +++ b/hardware/hardware.h @@ -25,9 +25,10 @@ class FpgaComm; class scanner_hw : public sane_opt_provider { std::function img_handler_; - bool scanning_ = false; - bool auto_scan_ = false; - std::unique_ptr img_controller_; + bool scanning_ = false; + bool auto_scan_ = false; + int time_to_exit_auto_scan_ = 60; // seconds + std::unique_ptr img_controller_; enum { @@ -103,13 +104,41 @@ public: // "default": 300, // "range": [200, 300] // }, +// "is-wait-scan": { +// "cat": "base", +// "group": "feeder", +// "title": "待纸扫描", +// "desc": "启用后,文稿放入扫描仪时将自动启动扫描", +// "type": "bool", +// "fix-id": 34873, +// "ui-pos": 12, +// "auth": 0, +// "size": 4, +// "cur": false, +// "default": false +// }, +// "wait-scan-exit": { +// "cat": "base", +// "group": "feeder", +// "title": "待纸扫描退出时间", +// "desc": "设置结束待纸扫描的时间", +// "type": "string", +// "fix-id": 34920, +// "ui-pos": 13, +// "auth": 0, +// "size": 16, +// "cur": "60s", +// "default": "60s", +// "range": ["15s", "30s", "60s", "2min", "4min", "8min"], +// "depend": "is-wait-scan==true" +// }, // "baud": { // "cat": "none", // "group": "CIS", // "title": "波特率", // "desc": "CIS控制通信速率", // "type": "int", -// "ui-pos": 12, +// "ui-pos": 20, // "auth": 0, // "size": 4, // "cur": 921600, @@ -122,7 +151,7 @@ public: // "title": "延迟响应", // "desc": "采集头接受命令后的动作延迟时间", // "type": "int", -// "ui-pos": 12, +// "ui-pos": 21, // "auth": 0, // "unit": "microsec", // "size": 4, @@ -135,7 +164,7 @@ public: // "title": "帧高度", // "desc": "采集头每一帧的采集高度", // "type": "int", -// "ui-pos": 13, +// "ui-pos": 22, // "auth": 0, // "size": 4, // "cur": 12, @@ -147,7 +176,7 @@ public: // "title": "采样频率", // "desc": "采样频率", // "type": "int", -// "ui-pos": 14, +// "ui-pos": 23, // "auth": 0, // "size": 4, // "cur": 256, @@ -159,7 +188,7 @@ public: // "title": "曝光度(正面蓝色通道)", // "desc": "正面蓝色通道的曝光强度", // "type": "int", -// "ui-pos": 15, +// "ui-pos": 30, // "auth": 0, // "size": 4, // "cur": 0, @@ -176,7 +205,7 @@ public: // "title": "曝光度(正面绿色通道)", // "desc": "正面绿色通道的曝光强度", // "type": "int", -// "ui-pos": 16, +// "ui-pos": 31, // "auth": 0, // "size": 4, // "cur": 0, @@ -193,7 +222,7 @@ public: // "title": "曝光度(正面红色通道)", // "desc": "正面红色通道的曝光强度", // "type": "int", -// "ui-pos": 17, +// "ui-pos": 32, // "auth": 0, // "size": 4, // "cur": 0, @@ -210,7 +239,7 @@ public: // "title": "曝光度(背面蓝色通道)", // "desc": "背面蓝色通道的曝光强度", // "type": "int", -// "ui-pos": 18, +// "ui-pos": 33, // "auth": 0, // "size": 4, // "cur": 0, @@ -227,7 +256,7 @@ public: // "title": "曝光度(背面绿色通道)", // "desc": "背面绿色通道的曝光强度", // "type": "int", -// "ui-pos": 19, +// "ui-pos": 34, // "auth": 0, // "size": 4, // "cur": 0, @@ -244,7 +273,7 @@ public: // "title": "曝光度(背面红色通道)", // "desc": "背面红色通道的曝光强度", // "type": "int", -// "ui-pos": 20, +// "ui-pos": 35, // "auth": 0, // "size": 4, // "cur": 0, @@ -261,7 +290,7 @@ public: // "title": "增益(正面)", // "desc": "正面的增益量", // "type": "int", -// "ui-pos": 21, +// "ui-pos": 40, // "auth": 0, // "size": 4, // "cur": 0, @@ -278,7 +307,7 @@ public: // "title": "增益(背面)", // "desc": "背面的增益量", // "type": "int", -// "ui-pos": 24, +// "ui-pos": 41, // "auth": 0, // "size": 4, // "cur": 0, @@ -295,7 +324,7 @@ public: // "title": "偏移(正面)", // "desc": "正面的偏移量", // "type": "int", -// "ui-pos": 27, +// "ui-pos": 45, // "auth": 0, // "size": 4, // "cur": 0, @@ -312,7 +341,7 @@ public: // "title": "偏移(背面)", // "desc": "背面的偏移量", // "type": "int", -// "ui-pos": 30, +// "ui-pos": 46, // "auth": 0, // "size": 4, // "cur": 0, diff --git a/sdk/base/plat_types.h b/sdk/base/plat_types.h index 17f31ce..354fe72 100644 --- a/sdk/base/plat_types.h +++ b/sdk/base/plat_types.h @@ -16,6 +16,7 @@ #define ALIGN_TO(v, align) (((v) + (align) - 1) / (align) * (align)) #define ALIGN_INT(v) ALIGN_TO(v, sizeof(int)) +#define CLEAN_ARRAY(a) memset(a, 0, sizeof(a)) #define RETURN_ENUM_STR(v, e) \ if(v == e) \