diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 035fc81..ab06129 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1719,6 +1719,7 @@ int hg_scanner::setting_setsleeptime(int sn, void* data) { std::string str((char *)data); int val = match_best_sleep_time(str,0); + int mintosec = 0; switch (val) { case SLEEP_TIME_0MIN: @@ -1745,7 +1746,12 @@ int hg_scanner::setting_setsleeptime(int sn, void* data) } if (val == sleeptime_) return SCANNER_ERR_OK; - int mintosec = val * 60; + mintosec = val ; + if (val != -1) + { + mintosec = val * 60; + } + int ret = set_sleep_time(mintosec); if (ret == SCANNER_ERR_OK) sleeptime_ = val; diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index c25f253..3af39cc 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -804,7 +804,7 @@ namespace hg_imgproc #endif #if ((!defined x86_64) && (!defined WIN32)) //linux x86_64 暂时没有OCR三方 -#ifndef test + #ifndef test ret = HWOCR_SDKInitialize(&pHanld); for (size_t i = 0; i < mats.size(); i++) { @@ -823,7 +823,7 @@ namespace hg_imgproc mats_.push_back(mats[i]); } HWOCR_SDKExit(pHanld); -#else + #else typedef int (*sdkinit)(void *); typedef int (*sdkgetfiledirectimage)(unsigned char*pbImage, int nWidth, int nHeight, TColorType nColorType, void *pstHandle, int *pDirect); typedef int (*sdkexit)(void *); @@ -860,7 +860,22 @@ namespace hg_imgproc } e(pHanld) ; dlclose(hanlde); -#endif + #endif +#else + /*#ifdef _WIN32 + printf("\r\n rotatetype:%d\r\n", rotatetype); + TCHAR szIniFile[MAX_PATH] = {0}; + SHGetSpecialFolderPath(NULL, szIniFile, CSIDL_WINDOWS, TRUE); + _tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata")); + int iLen = WideCharToMultiByte(CP_ACP, 0, szIniFile, -1, NULL, 0, NULL, NULL); + char *chRtn = new char[iLen * sizeof(char)]; + WideCharToMultiByte(CP_ACP, 0, szIniFile, -1, chRtn, iLen, NULL, NULL); + std:shared_ptrp_rotation(new CImageApplyRotation(rotatetype, m_param.imageProcess.backRotate180, m_param.resolution, chRtn)); + //printf("chRtn : %s ,duplex:%d m_param.resolution:%d\r\n", chRtn, m_param.scanSide.duplex, m_param.resolution); + p_rotation->apply(mats_, m_param.scanSide.duplex); + delete []chRtn; + chRtn = NULL; + #endif // WIN32*/ //暂时保留文本方向旋转 #endif return ret;