|
@@ -2340,7 +2340,7 @@ int CHSPScannerFSM::ScanImageJS(SpReqAnsContext<HSPScannerService_ScanImageJS_Re
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_ScanImageJS).setResultCode("RTA2N0S")("fopen(%s) error after invoking scanimage: %d.", (LPCTSTR)csImageFile, errno);
|
|
|
}
|
|
|
|
|
|
- if (ctx->Req.hide && !FAILURED(SetPreviewProperty(JS::PreviewSettings(false), HSPScannerService_LogCode_ScanImageJS))) {
|
|
|
+ if (ctx->Req.hide && FAILURED(SetPreviewProperty(JS::PreviewSettings(false), HSPScannerService_LogCode_ScanImageJS))) {
|
|
|
erroCode = Error_Unexpect;
|
|
|
ret = 1;
|
|
|
}
|
|
@@ -2418,21 +2418,7 @@ ErrorCodeEnum CHSPScannerFSM::SetPreviewProperty(const JS::PreviewSettings& val,
|
|
|
return erroCode;
|
|
|
}
|
|
|
}
|
|
|
- //////////////////////////////////////////////////////////////////////////
|
|
|
- if (val.view != 0) {
|
|
|
- const ULONGLONG ullStart = SP::Module::Comm::RVCGetTickCount();
|
|
|
- erroCode = m_hDevHelper->SetParam(HSPS_MODEL_VIEW, Param_View_Map[val.view]);
|
|
|
- const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
|
|
|
- if (ISSUCCEEDED(erroCode)) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)(ParamValToString(Param_View_Map[val.view]));
|
|
|
- }
|
|
|
- else {
|
|
|
- SetErrorAndLog(erroCode, val.view == 1 ? HSPScanner_UserErrorCode_SetParam_View : HSPScanner_UserErrorCode_SetParam_Hide
|
|
|
- , "DevAdapter::SetParam", __FUNCTION__, isBusiness, ullEnd - ullStart, logCode, CombineJsonContext(ParamValToString(Param_View_Map[val.view])));
|
|
|
- SetLastUserCode(GetAlarmDEC());
|
|
|
- return erroCode;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
if (val.pos != 0) {
|
|
|
CSimpleStringA tmpParm = CSimpleStringA::Format("x(%d), y(%d), w(%d)", val.pos_x, val.pos_y, val.pos_w);
|
|
@@ -2452,6 +2438,21 @@ ErrorCodeEnum CHSPScannerFSM::SetPreviewProperty(const JS::PreviewSettings& val,
|
|
|
SetLastUserCode(GetAlarmDEC());
|
|
|
}
|
|
|
}
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
+ if (val.view != 0) {
|
|
|
+ const ULONGLONG ullStart = SP::Module::Comm::RVCGetTickCount();
|
|
|
+ erroCode = m_hDevHelper->SetParam(HSPS_MODEL_VIEW, Param_View_Map[val.view]);
|
|
|
+ const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
|
|
|
+ if (ISSUCCEEDED(erroCode)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)(ParamValToString(Param_View_Map[val.view]));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ SetErrorAndLog(erroCode, val.view == 1 ? HSPScanner_UserErrorCode_SetParam_View : HSPScanner_UserErrorCode_SetParam_Hide
|
|
|
+ , "DevAdapter::SetParam", __FUNCTION__, isBusiness, ullEnd - ullStart, logCode, CombineJsonContext(ParamValToString(Param_View_Map[val.view])));
|
|
|
+ SetLastUserCode(GetAlarmDEC());
|
|
|
+ return erroCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
return erroCode;
|
|
|
}
|
|
|
|