diff --git a/hardware/hardware.cpp b/hardware/hardware.cpp index dd36870..ea668fd 100644 --- a/hardware/hardware.cpp +++ b/hardware/hardware.cpp @@ -387,8 +387,11 @@ void scanner_hw::thread_image_capture(bool paper_ready) utils::to_log(LOG_LEVEL_DEBUG, "set capture thread to CPU %d = %d\n", CPU_MAJOR_0, utils::set_cpu_affinity(&cpu[0], cpu.size())); #endif + img.pos.paper_all = 1; + img.pos.ind_in_paper = 0; avail_mem.enable_wait_log(false); motor_->clear_error(); + if(paper_ready) motor_->start(); scanstream.mode = count_mode_ ? devui::SCAN_COUNT_MODE : devui::SCAN_NORMAL; diff --git a/imgproc/algs/rebuild.cpp b/imgproc/algs/rebuild.cpp index a37a4de..7e4d693 100644 --- a/imgproc/algs/rebuild.cpp +++ b/imgproc/algs/rebuild.cpp @@ -84,8 +84,11 @@ void rebuild::do_rebuild(LPPACKIMAGE info, uint8_t* stream, std::vectorwidth == linel) // gray diff --git a/imgproc/imgprc_mgr.cpp b/imgproc/imgprc_mgr.cpp index 2a8c29f..7fbd1e8 100644 --- a/imgproc/imgprc_mgr.cpp +++ b/imgproc/imgprc_mgr.cpp @@ -468,8 +468,14 @@ void imgproc_mgr::send_image(LPPAGEDPARAM obj, std::vector& imgs, b // } // } + int total = imgs.size(), + ind = 0; for(auto& v: imgs) + { + v.info.pos.paper_all = total; + v.info.pos.ind_in_paper = ind++; imgproc_mgr::send_image(obj, &v.info, v.img, v.ext_info.empty() ? nullptr : &v.ext_info[0], v.ext_info.length(), last); + } // if(last) // sent_ind_++; diff --git a/sdk/base/data.h b/sdk/base/data.h index 6e9c354..88c9569 100644 --- a/sdk/base/data.h +++ b/sdk/base/data.h @@ -402,7 +402,7 @@ public: #define FUNCTION_PROTO_PARAMETERS dyn_mem_ptr, uint32_t*, packet_data_base_ptr* #define FUNCTION_PROTO_COMMAND_HANDLE dyn_mem_ptr(FUNCTION_PROTO_PARAMETERS) -#define USE_THREAD_PAGED_DATA +// #define USE_THREAD_PAGED_DATA #define REBUILD_IN_CIS_THREAD // #define BIND_CPU diff --git a/sdk/base/packet.h b/sdk/base/packet.h index 457a9d8..3bfd0d3 100644 --- a/sdk/base/packet.h +++ b/sdk/base/packet.h @@ -293,7 +293,9 @@ typedef struct _config_val typedef struct _img_pos { - uint64_t paper_ind : 32; // paper index in this turn/start, based ZERO. (image-collector set) + uint64_t paper_ind : 22; // paper index in this turn/start, based ONE. (image-collector set) + uint64_t paper_all : 5; // total images of this paper + uint64_t ind_in_paper: 5; // image index of this paper, based ZERO uint64_t new_img : 1; // 0 - partial data; 1 - new image data. (image-collector set) uint64_t img_over : 1; // 0 - has data yet; 1 - END for the image. (image-collector set) uint64_t paper_side : 3; // enum paper_side. front of paper(When scanning multiple sheets, the paper feeding side is the front side). (image-collector set)