|
@@ -157,7 +157,35 @@ DWORD WINAPI ProcessThread(void *param)
|
|
|
|
|
|
int IdentifyCallback(result::spinfo& pinfo, void* param)
|
|
|
{
|
|
|
-
|
|
|
+ CMFCApplication1Dlg* pWnd = (CMFCApplication1Dlg*)theApp.m_pMainWnd;
|
|
|
+ pWnd->FormatScanMsg("启动扫描线程......");
|
|
|
+
|
|
|
+ std::string strChoiceRes;
|
|
|
+ for (auto& row : pinfo.choiceRes)
|
|
|
+ {
|
|
|
+ for (auto& col : row.vecRes)
|
|
|
+ {
|
|
|
+ strChoiceRes.append(col ? "1" : "0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int length = strChoiceRes.length();
|
|
|
+ int number = 0;
|
|
|
+ for (int i = 0; i < length; ++i)
|
|
|
+ {
|
|
|
+ //其中注意if的判断两个条件相等的符号
|
|
|
+ if (strChoiceRes[i] == '1')
|
|
|
+ number += pow(2, length - 1 - i);
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string strJsonDir = CT2A(CConfig::Instance()->m_strMode);
|
|
|
+ strJsonDir.append("/");
|
|
|
+ strJsonDir.append(std::to_string(number));
|
|
|
+ strJsonDir.append(".json");
|
|
|
+ std::string strSaveDir = CT2A(CConfig::Instance()->m_strCut);
|
|
|
+ cutPaper(number, strJsonDir, pinfo.vecUrlAPath[0], strSaveDir);
|
|
|
+
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -172,14 +200,14 @@ DWORD WINAPI ScanThread(void *param)
|
|
|
pWnd->FormatScanMsg("扫描线程退出。");
|
|
|
SendMessage(pWnd->m_hWnd, WM_SHOWSCANINFO, 0, 1);
|
|
|
};
|
|
|
- std::vector<std::string> imgPath; //图片本地路径(和上面url地址一一对应)
|
|
|
+ std::vector<std::string> imgPath = {"C:\\Users\\admin\\Desktop\\3\\dtk\\20220913133034765_0001.jpg","C:\\Users\\admin\\Desktop\\3\\dtk\\20220913133034765_0002.jpg" }; //图片本地路径(和上面url地址一一对应)
|
|
|
preinfo::templatesInfo temeplatInfo;
|
|
|
preinfo::SubjChiInfo sujChiInfo;
|
|
|
- std::string strTempDir = "./scantemp/";
|
|
|
- if (_access(strTempDir.c_str(), 0) == -1)
|
|
|
+ std::string strTempDir = CT2A(CConfig::Instance()->m_strCut);
|
|
|
+ /*if (_access(strTempDir.c_str(), 0) == -1)
|
|
|
{
|
|
|
_mkdir(strTempDir.c_str());
|
|
|
- }
|
|
|
+ }*/
|
|
|
int nRet = PareseModeJson(temeplatInfo);
|
|
|
if (nRet)
|
|
|
{
|