123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- // mod_HSPScanner.cpp : 定义 DLL 应用程序的导出函数。
- //
- #include "stdafx.h"
- #include "mod_HSPScanner.h"
- #include "fileutil.h"
- void CHSPScannerServerSession::Handle_StartPreview(SpReqAnsContext<HSPScannerService_StartPreview_Req,
- HSPScannerService_StartPreview_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->Preview(ctx);
- }
- void CHSPScannerServerSession::Handle_CancelPreview(SpReqAnsContext<HSPScannerService_CancelPreview_Req,
- HSPScannerService_CancelPreview_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->CancelPreview(ctx);
- }
- void CHSPScannerServerSession::Handle_ScanImage(SpReqAnsContext<HSPScannerService_ScanImage_Req,
- HSPScannerService_ScanImage_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ScanImage(ctx);
- }
- void CHSPScannerServerSession::Handle_ScanImageEx(SpReqAnsContext<HSPScannerService_ScanImageEx_Req,
- HSPScannerService_ScanImageEx_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ScanImageEx(ctx);
- }
- void CHSPScannerServerSession::Handle_SetProperty(SpReqAnsContext<HSPScannerService_SetProperty_Req,
- HSPScannerService_SetProperty_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->SetProperty(ctx);
- }
- void CHSPScannerServerSession::Handle_SetWinPos(SpReqAnsContext<HSPScannerService_SetWinPos_Req,
- HSPScannerService_SetWinPos_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->SetWinPos(ctx);
- }
- void CHSPScannerServerSession::Handle_ShowProperty(SpReqAnsContext<HSPScannerService_ShowProperty_Req, HSPScannerService_ShowProperty_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ShowProperty(ctx);
- }
- void CHSPScannerServerSession::Handle_GetDevStatus(SpReqAnsContext<HSPScannerService_GetDevStatus_Req,
- HSPScannerService_GetDevStatus_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevStatus(ctx);
- }
- void CHSPScannerServerSession::Handle_GetDevInfo(SpReqAnsContext<HSPScannerService_GetDevInfo_Req,
- HSPScannerService_GetDevInfo_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevInfo(ctx);
- }
- void CHSPScannerServerSession::Handle_Exit(SpOnewayCallContext<HSPScannerService_Exit_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->Exit(ctx);
- }
- void CHSPScannerServerSession::Handle_StartPreviewJS(SpReqAnsContext<HSPScannerService_StartPreviewJS_Req, HSPScannerService_StartPreviewJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreviewJS).setAPI(__FUNCTION__)(__FUNCTION__);
- m_pEntity->StartPreviewJS(ctx);
- }
- void CHSPScannerServerSession::Handle_CancelPreviewJS(SpReqAnsContext<HSPScannerService_CancelPreviewJS_Req, HSPScannerService_CancelPreviewJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreviewJS).setAPI(__FUNCTION__)(__FUNCTION__);
- m_pEntity->CancelPreviewJS(ctx);
- }
- void CHSPScannerServerSession::Handle_ScanImageJS(SpReqAnsContext<HSPScannerService_ScanImageJS_Req, HSPScannerService_ScanImageJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_ScanImageJS).setAPI(__FUNCTION__)(__FUNCTION__);
- m_pEntity->ScanImageJS(ctx);
- }
- void CHSPScannerServerSession::Handle_SetParamJS(SpReqAnsContext<HSPScannerService_SetParamJS_Req, HSPScannerService_SetParamJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_SetParamJS).setAPI(__FUNCTION__)(__FUNCTION__);
- m_pEntity->SetParamJS(ctx);
- }
- void CHSPScannerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
- {
- if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
- {
- m_fsm.OnUIState4SetWhatPage(pszValue);
- }
- }
- #if defined(_MSC_VER)
- ErrorCodeEnum CHSPScannerEntity::CustomVendorLibInfo()
- {
- /** 仅做调查使用 [Gifur@2024118]*/
- if (vendorLibInfo.strVendor.Compare("keba", true) == 0
- && ((vendorLibInfo.strVersion == "7" && vendorLibInfo.strBatch == "1")
- || (vendorLibInfo.strVersion == "1" && vendorLibInfo.strBatch == "1"))) {
- CSimpleStringA strExistDriver(true);
- BOOL isNewOne(FALSE);
- if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll";
- isNewOne = TRUE;
- } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll";
- isNewOne = TRUE;
- } else if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll";
- } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll";
- }
- if (!strExistDriver.IsNullOrEmpty() && isNewOne) {
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_HSPS_VENDORDLL_KEBA_MATCHED, strExistDriver);
- }
- }
- return Error_Succeed;
- }
- #endif //_MSC_VER
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CHSPScannerEntity)
- SP_END_ENTITY_MAP()
|