123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #pragma once
- #include "scan_common.h"
- #include "DataBaseHolder.h"
- #include <boost/smart_ptr.hpp>
- #include "../Identifier/schema_struct.h"
- #include "basic_struct_result.h"
- #include "basic_struct.h"
- #include "../Schema/schema_struct.h"
- #include "DataBaseManagerHolder.h"
- class CIdentifyTaskManager;
- class CImgUploader;
- class CSeparateThreadTwainFeeder;
- class CRescanFromServerFeeder;
- class CAutoCreateSchemaFeeder;
- class CFolderFeeder;
- class CManualMatchFeeder;
- class CIdentifor;
- class CResultHandler;
- class CResultUploader;
- class CStudentMatcher;
- class IFeeder;
- class CBatchService;
- class CIdentifyService :public IService, public CDataBaseHolder, public CDataBaseManagerHolder
- {
- public:
- CIdentifyService(CBatchService *batchService);
- virtual ~CIdentifyService();
- int SetHandlerWnd(HWND hwnd);
- void ReadScan(FEEDER_TYPE feederType, const ScanParam & param);
- void SetFolderPageNumber(int nCount);//设置文件图片搜索类筛选模板参数
- int ReIdentify(const int paper_id, const std::vector<img_param>& params);
- int SetDirs(const CString& bantch_dir, const CString&norimg_dir, const CString&excimg_dir, CString img_clips_dir, const CString&img_alynasis_dir, const CString&img_alynasis_result_dir, const CString&img_down_load_dir, const std::string& muban_img_dir);
- int continueScan(const std::string& img_dir);
- void setSchema(boost::shared_ptr<const identify::schema::ISCH_Schema> schema, boost::shared_ptr<const HANDLE_INFO> handleInfo);
- void SetQr(int student_paper_id, bool bUseQr, const std::string&strQR);
- virtual BOOL SupportPause(void);
- /*初始化服务*/
- virtual void InitService();
- void setMainService(bool isMainService);
- const boost::shared_ptr<const HANDLE_INFO>& GetHandleInfo();
- void SerErrorHandle(bool bErrorHandle);
- void SetBianShiBieBianShangChuan(bool bSC){ m_bBianSBBianUpload = bSC; }
- boost::shared_ptr<CResultHandler> GetResultHander(){ return m_result_handler; };
- protected:
- virtual ServiceState OnStarting(void);
- virtual ServiceState OnRunning(void);
- virtual ServiceState OnPausing(void);
- virtual ServiceState OnResuming(void);
- virtual ServiceState OnStoping(void);
- protected:
- boost::shared_ptr<CIdentifyTaskManager> taskManager;
- //TWAIN扫描仪图像送入器
- boost::shared_ptr<CSeparateThreadTwainFeeder> m_twain_feeder;
- boost::shared_ptr<CRescanFromServerFeeder> m_server_feeder;
- boost::shared_ptr<CAutoCreateSchemaFeeder> m_auto_schema_feeder;
- //文件夹图像送入器
- boost::shared_ptr<CFolderFeeder> m_folder_feeder;
- //重新识别图像送入器
- boost::shared_ptr<CManualMatchFeeder> m_manualmatch_feeder;
- //当前图像送入器
- boost::shared_ptr<IFeeder > m_current_feeder;
- //试卷识别服务
- boost::shared_ptr<CIdentifor> m_identifor;
- //识别结果处理服务
- boost::shared_ptr<CResultHandler> m_result_handler;
- boost::shared_ptr<CStudentMatcher> m_student_matcher;
- CBatchService* batch_service;
- FEEDER_TYPE m_feeder_type;//当前图像送入器类型
- boost::shared_ptr<const identify::schema::ISCH_Schema> m_schema;
- boost::shared_ptr<const HANDLE_INFO> m_handleInfo;
- HWND m_hwnd;
- //批次号
- CString m_bantch_code;
- //本次扫描原始图像存放目录
- CString m_norimg_dir;
- CString m_excimg_dir;
- CString m_img_clips_dir;
- CString m_img_alynasis_dir;
- CString m_img_alynasis_result_dir;
- CString m_img_down_load_dir;
- std::string m_muban_img_dir;
- //当前批次的数据库的ID
- int m_database_id;
- CString m_bantch_dir;
- //标记是否非正常关闭
- BOOL m_abnormal_stop;
- CString m_paper_code;
- long m_examCourseId;
- long m_examId;
- std::string m_examName;
- std::string m_courseName;
- bool isMainService;
- bool isReIdentify;
- bool m_bErrorHandle;
- bool m_bBianSBBianUpload;
- public:
- int m_nOnlineScanType;
- };
|