123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #pragma once
- #include "scan_common.h"
- #include "FolderFeeder.h"
- #include "Identifor.h"
- #include "ResultUploader.h"
- #include "basic_struct.h"
- #include "SeparateThreadTwainFeeder.h"
- #include "ImgUploader.h"
- #include "basic_struct_result.h"
- #include "StudentMatcher.h"
- #include "CManualMatchFeeder.h"
- #include "RescanFromServerFeeder.h"
- #include "..\Schema\schema_struct.h"
- #include "DataBaseManagerHolder.h"
- class CSmartEvaluationService :public IService,public CDataBaseManagerHolder
- {
- public:
- CSmartEvaluationService(void);
- ~CSmartEvaluationService(void);
- public:
- /************************************************************************/
- /* 注册窗口,识别模块遇到问题将向该窗口发送消息 */
- /************************************************************************/
- int SetHandlerWnd(HWND hwnd);
- /************************************************************************/
- /* 添加重新扫描的图像 */
- /************************************************************************/
- int AddRescanPic(const char * pic_path);
- /************************************************************************/
- /* 清除重新扫描的图像 */
- /************************************************************************/
- int ClearRescanPic();
- /************************************************************************/
- /* 准备扫描 */
- /************************************************************************/
- int ReadyScan(FEEDER_TYPE feederType, const ScanParam & param);
- int QueryExceptionPaper(const long exception_type, vector<STUDENT_INFO>& studentList);
- int QueryPaperDetail(const int paper_id, PAPER_DETAIL &paper_detail, vector<PAGE_DETAIL> &pageList, vector<GROUP_QUESTION> &questionList);
- int UpdatePaperStudent(const int paper_id, const std::string examinee_id, const std::string student_code, const std::string studentName, const long schoolId);
- int ReIdentify(const int paper_id, const std::vector<img_param>& params);
- //忽略试卷
- int IgnorePaper(const int paper_id);
- //忽略异常
- int IgnoreException(const long exceptions);
- //开始上传
- int StartUploadPaper(HWND hWnd);
- //放弃本次扫描结果
- int GiveUpCurrentBatch();
- virtual BOOL SupportPause(void);
- /*从文件夹扫描继续扫描时设置扫描路径*/
- int SetFolderScanDir(const std::string& img_dir);
- virtual BOOL Stop(void);
- //查询异常卷总数
- int QueryExptionPaperCount(int & total_count);
- //查询异常类型信息
- int QueryExptionTypeInfo(vector<EXCEPTION_TYPE_INFO> & infos);
- int LoadSchema(long long examId, std::string examName, long examCourseId, std::string courseName, std::string schemaPath);
- int SetCookie(CString path, CString name, CString value);
- void saveQuestionStd(long long examId, std::string examName, long examCourseId, std::string courseName, std::vector<schema::SCHEMA_QUESTION> &questions);
- int QueryNormalPaper(vector<STUDENT_INFO> & studentList);
- int QueryMubanImgPath(int page_index, std::string& imgPath);
- int QueryMubanImgCount(int& page_count);
- int SetLocalServerCookie(CString name, CString value);
- protected:
- virtual ServiceState OnStarting( void );
- virtual ServiceState OnRunning( void );
- virtual ServiceState OnStoping(void);
- virtual ServiceState OnPausing(void);
- virtual ServiceState OnResuming(void);
- private:
- CIdentifyTaskManager taskManager;
- CImgUploader m_img_uploader;
- CSeparateThreadTwainFeeder m_twain_feeder;//TWAIN扫描仪图像送入器
- CRescanFromServerFeeder m_server_feeder;
- CFolderFeeder m_folder_feeder;//文件夹图像送入器
- CManualMatchFeeder m_manualmatch_feeder;//重新识别图像送入器
- CIdentifor m_identifor;//试卷识别服务
- CResultHandler m_result_handler;//识别结果处理服务
- CResultUploader m_result_uploader;//成绩上传服务
-
-
- IFeeder * m_current_feeder;//当前图像送入器
- FEEDER_TYPE m_feeder_type;//当前图像送入器类型
- RTL_CRITICAL_SECTION bantch_db_lock;
- CppSQLite3DB bantch_db;
- 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;
- //当前批次的数据库的ID
- int m_database_id;
- CString m_bantch_dir;
- //标记是否非正常关闭
- BOOL m_abnormal_stop;
- CString m_paper_code;
- std::string m_muban_img_dir;
- boost::shared_ptr<const ISCH_Schema> m_schema;
- boost::shared_ptr<const HANDLE_INFO> m_handleInfo;
- schema::SCHEMA m_schema0;
- CStudentMatcher m_student_matcher;
- long m_examCourseId;
- long m_examId;
- CString m_img_down_load_dir;
- std::string m_examName;
- std::string m_courseName;
- };
|