//----------------------------------------------------------------------------- #ifndef CaptureThreadHIKH #define CaptureThreadHIKH CaptureThreadHIKH //----------------------------------------------------------------------------- #include "hikcamera.h" #include #include #include #include #include "SyncQueue.h" #include "ASyncQueue.h" #include class CaptureThreadHIK_Func { public: void *CamHandle_; ASyncQueue *p_result_queue_; ASyncQueue *p_double_queue_; void SendFeedBack(int OpID) { bool send_ng=false; bool send_ok=false; if(OpID == EdgeEvent) { #if defined DOUBLE_FEED_BACK if(p_double_queue_->count() > 0) { bool temp; p_double_queue_->take(temp); send_ng=true; } #endif } if (p_result_queue_->count() > 0) { bool result; p_result_queue_->take(result); if (!result) { #if defined DOUBLE_FEED_BACK p_double_queue_->put(true); #endif send_ng=true; } } if(send_ng) { MV_CC_SetEnumValue(CamHandle_, "LineSelector", 1); MV_CC_SetCommandValue(CamHandle_, "LineTriggerSoftware"); } } }; //----------------------------------------------------------------------------- class CaptureThreadHIK : public QObject //----------------------------------------------------------------------------- { Q_OBJECT public: explicit CaptureThreadHIK(void *camhandle, bool boTerminated,int Num); CaptureThreadHIK::~CaptureThreadHIK(void); void terminate( void ) { boTerminated_ = true; } signals: void error( QString err ); void finished( void ); void requestReady( void ); void updateStatistics( const QString& data ,int Num); private slots: void process( void ); void fpsTimeout(void); public: int Local_Num; SyncQueue > *p_image_queue; ASyncQueue *p_unit_queue; ASyncQueue *p_result_queue; ASyncQueue *p_result_wait_queue; ASyncQueue *p_double_queue; ASyncQueue *p_shooted_queue; SyncQueue *p_debug_queue; void* CamHandle; QTimer* m_Timer; uint64_t m_cntGrabbedImages = 0; uint64_t m_cntLastGrabbedImages = 0; bool Ready = false; CaptureThreadHIK_Func m_threadFunc; private: MV_FRAME_OUT_INFO_EX stFrameInfo; unsigned char* g_pImage_buf; volatile bool boTerminated_; QMutex lock_; }; #endif // CaptureThreadHIKH