mod_HSPScanner.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. // mod_HSPScanner.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "stdafx.h"
  4. #include "mod_HSPScanner.h"
  5. #include "fileutil.h"
  6. void CHSPScannerServerSession::Handle_StartPreview(SpReqAnsContext<HSPScannerService_StartPreview_Req,
  7. HSPScannerService_StartPreview_Ans>::Pointer ctx)
  8. {
  9. DbgToBeidou(ctx->link, __FUNCTION__)();
  10. m_pEntity->Preview(ctx);
  11. }
  12. void CHSPScannerServerSession::Handle_CancelPreview(SpReqAnsContext<HSPScannerService_CancelPreview_Req,
  13. HSPScannerService_CancelPreview_Ans>::Pointer ctx)
  14. {
  15. DbgToBeidou(ctx->link, __FUNCTION__)();
  16. m_pEntity->CancelPreview(ctx);
  17. }
  18. void CHSPScannerServerSession::Handle_ScanImage(SpReqAnsContext<HSPScannerService_ScanImage_Req,
  19. HSPScannerService_ScanImage_Ans>::Pointer ctx)
  20. {
  21. DbgToBeidou(ctx->link, __FUNCTION__)();
  22. m_pEntity->ScanImage(ctx);
  23. }
  24. void CHSPScannerServerSession::Handle_ScanImageEx(SpReqAnsContext<HSPScannerService_ScanImageEx_Req,
  25. HSPScannerService_ScanImageEx_Ans>::Pointer ctx)
  26. {
  27. DbgToBeidou(ctx->link, __FUNCTION__)();
  28. m_pEntity->ScanImageEx(ctx);
  29. }
  30. void CHSPScannerServerSession::Handle_SetProperty(SpReqAnsContext<HSPScannerService_SetProperty_Req,
  31. HSPScannerService_SetProperty_Ans>::Pointer ctx)
  32. {
  33. DbgToBeidou(ctx->link, __FUNCTION__)();
  34. m_pEntity->SetProperty(ctx);
  35. }
  36. void CHSPScannerServerSession::Handle_SetWinPos(SpReqAnsContext<HSPScannerService_SetWinPos_Req,
  37. HSPScannerService_SetWinPos_Ans>::Pointer ctx)
  38. {
  39. DbgToBeidou(ctx->link, __FUNCTION__)();
  40. m_pEntity->SetWinPos(ctx);
  41. }
  42. void CHSPScannerServerSession::Handle_ShowProperty(SpReqAnsContext<HSPScannerService_ShowProperty_Req, HSPScannerService_ShowProperty_Ans>::Pointer ctx)
  43. {
  44. DbgToBeidou(ctx->link, __FUNCTION__)();
  45. m_pEntity->ShowProperty(ctx);
  46. }
  47. void CHSPScannerServerSession::Handle_GetDevStatus(SpReqAnsContext<HSPScannerService_GetDevStatus_Req,
  48. HSPScannerService_GetDevStatus_Ans>::Pointer ctx)
  49. {
  50. DbgToBeidou(ctx->link, __FUNCTION__)();
  51. m_pEntity->GetDevStatus(ctx);
  52. }
  53. void CHSPScannerServerSession::Handle_GetDevInfo(SpReqAnsContext<HSPScannerService_GetDevInfo_Req,
  54. HSPScannerService_GetDevInfo_Ans>::Pointer ctx)
  55. {
  56. DbgToBeidou(ctx->link, __FUNCTION__)();
  57. m_pEntity->GetDevInfo(ctx);
  58. }
  59. void CHSPScannerServerSession::Handle_Exit(SpOnewayCallContext<HSPScannerService_Exit_Info>::Pointer ctx)
  60. {
  61. DbgToBeidou(ctx->link, __FUNCTION__)();
  62. m_pEntity->Exit(ctx);
  63. }
  64. void CHSPScannerServerSession::Handle_StartPreviewJS(SpReqAnsContext<HSPScannerService_StartPreviewJS_Req, HSPScannerService_StartPreviewJS_Ans>::Pointer ctx)
  65. {
  66. DbgToBeidou(ctx->link, __FUNCTION__)();
  67. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreviewJS).setAPI(__FUNCTION__)(__FUNCTION__);
  68. m_pEntity->StartPreviewJS(ctx);
  69. }
  70. void CHSPScannerServerSession::Handle_CancelPreviewJS(SpReqAnsContext<HSPScannerService_CancelPreviewJS_Req, HSPScannerService_CancelPreviewJS_Ans>::Pointer ctx)
  71. {
  72. DbgToBeidou(ctx->link, __FUNCTION__)();
  73. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreviewJS).setAPI(__FUNCTION__)(__FUNCTION__);
  74. m_pEntity->CancelPreviewJS(ctx);
  75. }
  76. void CHSPScannerServerSession::Handle_ScanImageJS(SpReqAnsContext<HSPScannerService_ScanImageJS_Req, HSPScannerService_ScanImageJS_Ans>::Pointer ctx)
  77. {
  78. DbgToBeidou(ctx->link, __FUNCTION__)();
  79. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_ScanImageJS).setAPI(__FUNCTION__)(__FUNCTION__);
  80. m_pEntity->ScanImageJS(ctx);
  81. }
  82. void CHSPScannerServerSession::Handle_SetParamJS(SpReqAnsContext<HSPScannerService_SetParamJS_Req, HSPScannerService_SetParamJS_Ans>::Pointer ctx)
  83. {
  84. DbgToBeidou(ctx->link, __FUNCTION__)();
  85. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_SetParamJS).setAPI(__FUNCTION__)(__FUNCTION__);
  86. m_pEntity->SetParamJS(ctx);
  87. }
  88. void CHSPScannerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  89. {
  90. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  91. {
  92. m_fsm.OnUIState4SetWhatPage(pszValue);
  93. }
  94. }
  95. #if defined(_MSC_VER)
  96. ErrorCodeEnum CHSPScannerEntity::CustomVendorLibInfo()
  97. {
  98. /** 仅做调查使用 [Gifur@2024118]*/
  99. if (vendorLibInfo.strVendor.Compare("keba", true) == 0
  100. && ((vendorLibInfo.strVersion == "7" && vendorLibInfo.strBatch == "1")
  101. || (vendorLibInfo.strVersion == "1" && vendorLibInfo.strBatch == "1"))) {
  102. CSimpleStringA strExistDriver(true);
  103. BOOL isNewOne(FALSE);
  104. if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll")) {
  105. strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll";
  106. isNewOne = TRUE;
  107. } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll")) {
  108. strExistDriver = "C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll";
  109. isNewOne = TRUE;
  110. } else if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll")) {
  111. strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll";
  112. } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll")) {
  113. strExistDriver = "C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll";
  114. }
  115. if (!strExistDriver.IsNullOrEmpty() && isNewOne) {
  116. LogWarn(Severity_Low, Error_Debug, LOG_WARN_HSPS_VENDORDLL_KEBA_MATCHED, strExistDriver);
  117. }
  118. }
  119. return Error_Succeed;
  120. }
  121. #endif //_MSC_VER
  122. SP_BEGIN_ENTITY_MAP()
  123. SP_ENTITY(CHSPScannerEntity)
  124. SP_END_ENTITY_MAP()