ResultHandler.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. #include "Identifor.h"
  3. #include "scan_common.h"
  4. #include "..\sqlite\CppSQLite3.h"
  5. #include "DataBaseHolder.h"
  6. #include "ScoreCounter.h"
  7. #include "..\ZLibWrapMemLib\MemZipFile.h"
  8. #include "basic_struct_result.h"
  9. #include "..\Schema\schema_struct.h"
  10. class CIdentifyService;
  11. class CResultHandler:public IService,public CDataBaseHolder
  12. {
  13. public:
  14. CResultHandler();
  15. ~CResultHandler();
  16. void SetIdentifor( CIdentifor* identifor );
  17. void SetImgClipsDir( CString img_clips_dir ){this->m_img_clips_dir=img_clips_dir;}
  18. void setHandlInfo(const boost::shared_ptr<const HANDLE_INFO>& handInfo);
  19. int SetHandlerWnd(HWND hwnd);
  20. void IdentifyTaskManager(CIdentifyTaskManager* taskManager);
  21. void SetIdentifyService(CIdentifyService* service);
  22. void SetErrorHandle(bool bErrorHandle){ m_bErrorHandle = bErrorHandle; }
  23. protected:
  24. virtual ServiceState OnRunning( void );
  25. virtual ServiceState OnStarting( void );
  26. virtual ServiceState OnStoping( void );
  27. virtual BOOL SupportPause( void );
  28. virtual ServiceState OnPausing(void);
  29. protected:
  30. int SavePage( OMR_RESULT * omr_result );
  31. void SavePaper( int handle_count_limit );
  32. virtual void SaveImages(vector<CUT_AREA_RESULT*> &area_results, CMemZipFile &zip, int subjectID, BOOL bOnlineCard = false, char *strPaperCode = NULL,
  33. const std::vector<std::string> &postMarkTypeIDVec = std::vector<std::string>(), std::map<std::string, int> &vecTwoPic = std::map<std::string, int>());
  34. bool existAbsentFlag(OMR_RESULT * omr_result);
  35. bool existABJuanFlag(OMR_RESULT * omr_result );
  36. bool existABJuanFlag();
  37. std::string absentFlag( OMR_RESULT * omr_result );
  38. std::string ABJuanFlag( OMR_RESULT * omr_result );
  39. void readOnlineCardPaperId(string strPaperCode, string strStudentId);//读取魔法词汇宝批次id
  40. void WriteOnlineCardPaperId(CString strPaperCode, wstring& strSubGroupId, wstring strStudentId);//写魔法词汇宝批次id
  41. protected:
  42. CIdentifor * m_identifor;
  43. int m_muban_page_count;
  44. HWND m_hwnd;
  45. CScoreCounter scoreCounter;
  46. BOOL m_isMubanLoaded;
  47. boost::shared_ptr<const HANDLE_INFO> m_handInfo;
  48. std::map<int ,const PAGE_RESULT_HANDLE_INFO> m_handInfoMap;
  49. CString m_img_clips_dir;
  50. CIdentifyTaskManager* taskManager;
  51. CIdentifyService * identifyService;
  52. UnhandledPageInfo * pUnhandledPageInfo;
  53. std::string m_strQr;
  54. bool m_bUseQr;
  55. bool m_bErrorHandle;
  56. bool m_bOnlineCard;
  57. bool m_bUseQrCode;//是否使用二维码
  58. bool m_bIdentifyQrCode;// 是否识别二维码
  59. bool m_bSvePage;
  60. bool m_bSend;
  61. string m_strOnlineCardPaperId;
  62. public:
  63. bool readPaperId(CString& strPaperId);
  64. bool readTimu(CString& strTimu);
  65. schema::SCHEMA m_schema;
  66. bool loadSchema();
  67. void SavePathImg(std::string path, CMemZipFile &zip, int i);
  68. void logForDbg(string strLog);
  69. void SetUseQr(bool bUseQr, const std::string&strQr){ m_strQr = strQr; m_bUseQr = bUseQr; }
  70. string GetOnlineCardPaperId(string strPaperCode, string strStudentId);//获取魔法词汇宝批次id
  71. public:
  72. int m_nOnlineScanType;//参数说明:-1 代表原理的在线答题卡扫描 0:代表英语魔法词汇宝扫描
  73. };