OnlineCardIdentifyWorker.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "scan_common.h"
  3. #include "../Identifier/OnlineCardIdentifier.h"
  4. #include "OnlineCardStruct.h"
  5. namespace OnLineCard{
  6. class COnlineCardIdentifyWorker : public IService
  7. {
  8. public:
  9. enum class identify_state {
  10. waiting,
  11. identifing
  12. };
  13. public:
  14. COnlineCardIdentifyWorker();
  15. virtual ~COnlineCardIdentifyWorker();
  16. public:
  17. void SetTemplate(PaperTemplate*pT);
  18. void SetQr(bool bUseQr, const std::string&strQr);
  19. void SetOnlineScanType(int nOnlineScanType);
  20. inline identify_state GetIdentifyState(){ return m_identify_state; }
  21. void SetRCS(RTL_CRITICAL_SECTION*rcs, RTL_CRITICAL_SECTION*rcs1){ m_Identifier.SetRCS(rcs); m_buffer_cs = rcs1; }
  22. public:
  23. virtual ServiceState OnStarting(void) override;
  24. virtual ServiceState OnRunning(void);
  25. virtual bool OnLineCardIdentify(IplImage * img, void * out_result, int out_size, result_buffer_state * presult_buffer_state);
  26. protected:
  27. identify_state m_identify_state;
  28. COnlineCardIdentifier m_Identifier;
  29. IplImage* m_img;
  30. void* m_out_result;
  31. int m_out_size;
  32. result_buffer_state* m_presult_buffer_state;
  33. RTL_CRITICAL_SECTION* m_buffer_cs;
  34. };
  35. }