1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #pragma once
- #include "Identifor.h"
- #include "OnlineCardIdentifyWorker.h"
- //////////////////////////////////////////////////////////////////////////
- // author liulang
- // date 2020-04-24
- //////////////////////////////////////////////////////////////////////////
- #ifdef _DEBUG
- #define ONLINE_WORKER_COUNT 1
- #else
- #define ONLINE_WORKER_COUNT 3
- #endif
- namespace OnLineCard{
- class COnlineCardIdentifor : public CIdentifor
- {
- #define max_result_buffer (1024*1024*10)
- #define max_result_buffer_count 6
- public:
- COnlineCardIdentifor();
- virtual ~COnlineCardIdentifor();
- public:
- void SetTemplate(PaperTemplate*pT){ m_template = pT; }
- PaperTemplate*GetTemplate(){ return m_template; }
- OMR_RESULT * GetResult(BOOL wait);
- void FreeResult(identify::result::OMR_RESULT * &result);
- virtual int GetMubanCount();
- protected:
- virtual ServiceState OnStarting(void) override;
- virtual ServiceState OnRunning(void) override;
- virtual ServiceState OnStoping(void) override;
- protected:
- COnlineCardIdentifyWorker m_Wordkers[ONLINE_WORKER_COUNT];
- void* m_result_buffer;
- void* result[max_result_buffer_count];
- int m_next_result_index;
- result_buffer_state m_buffer_state[max_result_buffer_count];
- PaperTemplate* m_template;
- CRITICAL_SECTION m_althom_rcs;
- CRITICAL_SECTION m_buffer_rcs;
- };
- }
|