算法耗时记录到日志文件中

This commit is contained in:
gb 2024-01-23 17:33:29 +08:00
parent 92ee8ac685
commit d514c6dc1e
3 changed files with 11 additions and 2 deletions

View File

@ -182,6 +182,7 @@ void hg_scanner::init(void)
scanner_->set_status_notifyer(on_status);
ret = scanner_->open_usb_scanner(dev_.dev);
img_prc_name_[0] = "raw";
img_prc_name_[10] = "rebuild";
if (ret == SCANNER_ERR_OK)
{
@ -252,9 +253,9 @@ void hg_scanner::dump_image(image_holder_ptr img)
char alg[128] = { 0 };
if (img_prc_name_.count(stage))
sprintf(alg, "%04X_%s(%u)", stage, img_prc_name_[stage].c_str(), img->get_info()->prc_time);
sprintf(alg, "%04X_%s", stage, img_prc_name_[stage].c_str());
else
sprintf(alg, "%04X_Unk(%u)", stage, img->get_info()->prc_time);
sprintf(alg, "%04X_Unk", stage);
img->save_2_file(dump_path_.c_str(), alg);
}

View File

@ -169,6 +169,7 @@ int image_holder::save_2_file(const char* root_dir, const char* alg)
if (dst)
fclose(dst);
utils::to_log(LOG_LEVEL_ALL, "Image-Process of file '%s' is %ums.\n", file.c_str(), head_.prc_time);
return err;
}

View File

@ -56,3 +56,10 @@ public:
virtual int process(LPPROCIIM* in, size_t cnt, bool(*result)(LPPROCIIM, void*), void* param);
};
#define ADD_THIS_JSON() \
{ \
std::string t(""); \
for(auto& v: device_opt_json) \
t += v; \
set_opt_json_text(&t[0]); \
}