mod_HSPScanner.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 CHSPScannerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  65. {
  66. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  67. {
  68. m_fsm.OnUIState4SetWhatPage(pszValue);
  69. }
  70. }
  71. #if defined(_MSC_VER)
  72. ErrorCodeEnum CHSPScannerEntity::CustomVendorLibInfo()
  73. {
  74. /** 仅做调查使用 [Gifur@2024118]*/
  75. if (vendorLibInfo.strVendor.Compare("keba", true) == 0
  76. && ((vendorLibInfo.strVersion == "7" && vendorLibInfo.strBatch == "1")
  77. || (vendorLibInfo.strVersion == "1" && vendorLibInfo.strBatch == "1"))) {
  78. CSimpleStringA strExistDriver(true);
  79. BOOL isNewOne(FALSE);
  80. if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll")) {
  81. strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll";
  82. isNewOne = TRUE;
  83. } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll")) {
  84. strExistDriver = "C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll";
  85. isNewOne = TRUE;
  86. } else if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll")) {
  87. strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll";
  88. } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll")) {
  89. strExistDriver = "C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll";
  90. }
  91. if (!strExistDriver.IsNullOrEmpty() && isNewOne) {
  92. LogWarn(Severity_Low, Error_Debug, LOG_WARN_HSPS_VENDORDLL_KEBA_MATCHED, strExistDriver);
  93. }
  94. }
  95. return Error_Succeed;
  96. }
  97. #endif //_MSC_VER
  98. SP_BEGIN_ENTITY_MAP()
  99. SP_ENTITY(CHSPScannerEntity)
  100. SP_END_ENTITY_MAP()