#pragma once #include "Identifor.h" #include "scan_common.h" #include "..\sqlite\CppSQLite3.h" #include "DataBaseHolder.h" #include "ScoreCounter.h" #include "..\ZLibWrapMemLib\MemZipFile.h" #include "basic_struct_result.h" #include "..\Schema\schema_struct.h" class CIdentifyService; class CResultHandler:public IService,public CDataBaseHolder { public: CResultHandler(); ~CResultHandler(); void SetIdentifor( CIdentifor* identifor ); void SetImgClipsDir( CString img_clips_dir ){this->m_img_clips_dir=img_clips_dir;} void setHandlInfo(const boost::shared_ptr& handInfo); int SetHandlerWnd(HWND hwnd); void IdentifyTaskManager(CIdentifyTaskManager* taskManager); void SetIdentifyService(CIdentifyService* service); void SetErrorHandle(bool bErrorHandle){ m_bErrorHandle = bErrorHandle; } protected: virtual ServiceState OnRunning( void ); virtual ServiceState OnStarting( void ); virtual ServiceState OnStoping( void ); virtual BOOL SupportPause( void ); virtual ServiceState OnPausing(void); protected: int SavePage( OMR_RESULT * omr_result ); void SavePaper( int handle_count_limit ); virtual void SaveImages(vector &area_results, CMemZipFile &zip, int subjectID, BOOL bOnlineCard = false, char *strPaperCode = NULL, const std::vector &postMarkTypeIDVec = std::vector(), std::map &vecTwoPic = std::map()); bool existAbsentFlag(OMR_RESULT * omr_result); bool existABJuanFlag(OMR_RESULT * omr_result ); bool existABJuanFlag(); std::string absentFlag( OMR_RESULT * omr_result ); std::string ABJuanFlag( OMR_RESULT * omr_result ); void readOnlineCardPaperId(string strPaperCode, string strStudentId);//读取魔法词汇宝批次id void WriteOnlineCardPaperId(CString strPaperCode, wstring& strSubGroupId, wstring strStudentId);//写魔法词汇宝批次id protected: CIdentifor * m_identifor; int m_muban_page_count; HWND m_hwnd; CScoreCounter scoreCounter; BOOL m_isMubanLoaded; boost::shared_ptr m_handInfo; std::map m_handInfoMap; CString m_img_clips_dir; CIdentifyTaskManager* taskManager; CIdentifyService * identifyService; UnhandledPageInfo * pUnhandledPageInfo; std::string m_strQr; bool m_bUseQr; bool m_bErrorHandle; bool m_bOnlineCard; bool m_bUseQrCode;//是否使用二维码 bool m_bIdentifyQrCode;// 是否识别二维码 bool m_bSvePage; bool m_bSend; string m_strOnlineCardPaperId; public: bool readPaperId(CString& strPaperId); bool readTimu(CString& strTimu); schema::SCHEMA m_schema; bool loadSchema(); void SavePathImg(std::string path, CMemZipFile &zip, int i); void logForDbg(string strLog); void SetUseQr(bool bUseQr, const std::string&strQr){ m_strQr = strQr; m_bUseQr = bUseQr; } string GetOnlineCardPaperId(string strPaperCode, string strStudentId);//获取魔法词汇宝批次id public: int m_nOnlineScanType;//参数说明:-1 代表原理的在线答题卡扫描 0:代表英语魔法词汇宝扫描 };