RescanFromServerFeeder.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "ServerImgDownloadDispatcher.h"
  3. #include <winnt.h>
  4. #include "feeder.h"
  5. class CRescanFromServerFeeder:public IFeeder
  6. {
  7. public:
  8. CRescanFromServerFeeder(void);
  9. ~CRescanFromServerFeeder(void);
  10. virtual ServiceState OnStarting( void );
  11. virtual ServiceState OnRunning( void );
  12. virtual ServiceState OnStoping( void );
  13. enum MODE{
  14. MODE_BATCH,
  15. MODE_EXAMINNE,
  16. };
  17. public:
  18. void SetImageDownloadDir(CString dir){m_imgDownloadDir= dir;}
  19. virtual bool GetNext(BOOL wait,IplImage* & img, feeder_param& param);
  20. void SetBatch( CString batch );
  21. void SetParam(long examId,long examCourseId,CString batch,CString examinneId){
  22. this->examId = examId;
  23. this->examCourseId = examCourseId;
  24. this->m_batch = batch;
  25. this->m_examineeId = examinneId;
  26. m_mode = MODE_EXAMINNE;
  27. }
  28. void SetParam(long examId,long examCourseId,CString batch){
  29. this->examId = examId;
  30. this->examCourseId = examCourseId;
  31. this->m_batch = batch;
  32. m_mode = MODE_BATCH;
  33. }
  34. private:
  35. long examId;
  36. long examCourseId;
  37. CString m_batch;
  38. CString m_examineeId;
  39. Json::Value m_imginfos;
  40. CServerImgDownloadDispatcher sidd;
  41. CString m_imgDownloadDir;
  42. IplImage* m_img;
  43. int m_count;
  44. MODE m_mode;
  45. //״̬ͬ²½Ëø
  46. RTL_CRITICAL_SECTION m_img_lock;
  47. feeder_param m_param;
  48. };