diff --git a/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.cpp b/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.cpp index c8fd9fd..c13977d 100644 --- a/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.cpp +++ b/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.cpp @@ -106,11 +106,10 @@ void PlateCodeScanerModule::initialize(int32_t moduleid, hardware_config_t* hard // osDelay(100); // } - m_reg.laster_intensity = 10; + m_reg.laster_intensity = 99; m_reg.scan_gain = 1; m_reg.scan_velocity = 500; m_reg.scan_start_pos = 0; - m_reg.final_stop_pos = 0; m_reg.code_judgment_threshold = 0; m_reg.item = 0; m_reg.lot = 0; @@ -126,7 +125,6 @@ int32_t PlateCodeScanerModule::module_xxx_reg(int32_t param_id, bool read, int32 PROCESS_REG_CFG(scan_gain); PROCESS_REG_CFG(scan_velocity); PROCESS_REG_CFG(scan_start_pos); - PROCESS_REG_CFG(final_stop_pos); PROCESS_REG_CFG(code_judgment_threshold); PROCESS_REG_CFG(item); PROCESS_REG_CFG(lot); @@ -142,7 +140,13 @@ int32_t PlateCodeScanerModule::module_xxx_reg(int32_t param_id, bool read, int32 int32_t PlateCodeScanerModule::module_stop() { m_thread.stop(); return 0; -}; +} + +int32_t PlateCodeScanerModule::module_active_cfg() { + scaner_set_gain(m_reg.scan_gain / 10.0); + laser_set_intensity(m_reg.laster_intensity); + return 0; +} int32_t PlateCodeScanerModule::plate_code_scaner_push_card_and_scan(int32_t final_stop_pos) { ZLOGI(TAG, "plate_code_scaner_push_card_and_scan: %d", final_stop_pos); @@ -383,7 +387,7 @@ int32_t PlateCodeScanerModule::read_adc_val() { for (int i = 0; i < CAPTURE_NUM; i++) { int32_t e = t_result_adc.get_adc_value(cache[i]); // ZLOGI(TAG, "read adc: %d", cache[i]); - if(e!=0){ + if (e != 0) { ZLOGE(TAG, "read adc fail"); } } diff --git a/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.hpp b/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.hpp index f19764c..8a4b7c9 100644 --- a/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.hpp +++ b/usrc/subboards/subboard20_plate_clamp_case/plate_code_scaner_module.hpp @@ -51,7 +51,6 @@ class PlateCodeScanerModule : public ZIModule, public ZI_PlateCodeScanerModule { int32_t scan_gain; // 1 = 0.1倍增益 int32_t scan_velocity; // 扫描速度 int32_t scan_start_pos; // 扫描开始位置 - int32_t final_stop_pos; // 扫描结束停止位置 int32_t code_judgment_threshold; // 编码解析时,判断当前位置的编码是0还是1的阈值 int32_t item; // int32_t lot; // @@ -113,6 +112,7 @@ class PlateCodeScanerModule : public ZIModule, public ZI_PlateCodeScanerModule { virtual int32_t module_xxx_reg(int32_t param_id, bool read, int32_t& val) override; virtual int32_t module_stop() override; + virtual int32_t module_active_cfg() override; /*********************************************************************************************************************** * ZI_PlateCodeScanerModule *