|
@@ -151,24 +151,42 @@ ErrorCodeEnum HSPSClassImpl::SetPreview(short nValue)
|
|
|
ErrorCodeEnum HSPSClassImpl::ScanImage(const char* pszFileName)
|
|
|
{
|
|
|
ErrorCodeEnum err = Error_NotImpl;
|
|
|
+ static unsigned long times = 0;
|
|
|
+ ScanImageAns ans;
|
|
|
|
|
|
- err = SimulatorHttpFunction(EntityName, "ScanImage");
|
|
|
+ err = SimulatorHttpFunction(EntityName, "ScanImage", ans);
|
|
|
LOG4VTM(INFO, "ScanImage err = " << err);
|
|
|
-
|
|
|
if (err == Error_Succeed)
|
|
|
{
|
|
|
- string srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "HspTest.jpg";
|
|
|
-
|
|
|
+ string srcPath("");
|
|
|
+ if (ans.ImageType == 2) {
|
|
|
+ srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "simulator_hsps_01.jpg";
|
|
|
+ }
|
|
|
+ else if (ans.ImageType == 1) {
|
|
|
+ srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "simulator_hsps_02.jpg";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (times % 3 == 0) {
|
|
|
+ srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "simulator_hsps_01.jpg";
|
|
|
+ }
|
|
|
+ else if (times % 3 == 1) {
|
|
|
+ srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "simulator_hsps_02.jpg";
|
|
|
+ }
|
|
|
+ else if (times % 3 == 2) {
|
|
|
+ srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "simulator_hsps_03.jpg";
|
|
|
+ }
|
|
|
+ times++;
|
|
|
+ }
|
|
|
+ LOG4VTM(INFO, "ScanImage file = " << srcPath);
|
|
|
#ifdef _WIN32
|
|
|
- CopyFileA(srcPath.c_str(), pszFileName, TRUE);
|
|
|
+ CopyFileA(srcPath.c_str(), pszFileName, TRUE);
|
|
|
#else
|
|
|
- string cmdStr = "cp " + srcPath + " " + pszFileName;
|
|
|
- char buff[256] = { 0 };
|
|
|
- sprintf(buff, cmdStr.c_str());
|
|
|
- system(buff);
|
|
|
+ string cmdStr = "cp " + srcPath + " " + pszFileName;
|
|
|
+ char buff[256] = { 0 };
|
|
|
+ sprintf(buff, cmdStr.c_str());
|
|
|
+ system(buff);
|
|
|
#endif
|
|
|
}
|
|
|
-
|
|
|
return err;
|
|
|
}
|
|
|
|
|
@@ -182,7 +200,7 @@ ErrorCodeEnum HSPSClassImpl::ScanImageEx(BYTE* pBtImg, int& nBtLen, const char*
|
|
|
|
|
|
if (err == Error_Succeed)
|
|
|
{
|
|
|
- string srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "HspTest.jpg";
|
|
|
+ string srcPath = GetCurrentDirectory() + SPLIT_SLASH_STR + "agent.jpg";
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
CopyFileA(srcPath.c_str(), pszFileName, TRUE);
|