|
|
|
@ -2892,12 +2892,8 @@ void Cigarette::init_plc_value()
|
|
|
|
|
|
|
|
|
|
void Cigarette::CreatWorkThread(int classid, int Num, Cigarette* classptr)
|
|
|
|
|
{
|
|
|
|
|
int CamId = Num;
|
|
|
|
|
#ifdef SYNC_CAMERA
|
|
|
|
|
#ifdef IS_CAM_NG_OK_DATA_MERGED
|
|
|
|
|
CamId = 0; // 默认使用第一个相机的数据
|
|
|
|
|
#endif
|
|
|
|
|
sync_work_thread.init(g_image_sync_queue, g_result_queue[CamId]);
|
|
|
|
|
sync_work_thread.init(g_image_sync_queue, g_result_queue, 0); // 默认使用第一个相机的数据
|
|
|
|
|
connect(&sync_work_thread, SIGNAL(notify(int, int, cv::Mat)), classptr, SLOT(OnNotifyHub(int, int, cv::Mat)));
|
|
|
|
|
connect(&sync_work_thread, SIGNAL(display_timecost(int, int)), classptr, SLOT(OnDisplayTimeCostHub(int, int)));
|
|
|
|
|
connect(&sync_work_thread, SIGNAL(display_check_total(int, long)), classptr, SLOT(OnDisplayCheckNumberHub(int, long)));
|
|
|
|
@ -2906,18 +2902,18 @@ void Cigarette::CreatWorkThread(int classid, int Num, Cigarette* classptr)
|
|
|
|
|
connect(&sync_work_thread, SIGNAL(event_ng(int)), classptr, SLOT(OnNGHub(int)));
|
|
|
|
|
sync_work_thread.start_work();
|
|
|
|
|
#else
|
|
|
|
|
work_thread[CamId].init(g_image_queue[CamId], g_result_queue[CamId], classid, CamId);
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(notify(int, int, cv::Mat)), classptr, SLOT(OnNotifyHub(int, int, cv::Mat)));
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(display_timecost(int, int)), classptr, SLOT(OnDisplayTimeCostHub(int, int)));
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(display_check_total(int, long)), classptr, SLOT(OnDisplayCheckNumberHub(int, long)));
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(display_jd_no(int, QString)), classptr, SLOT(OnDisplayJdNoHub(int, QString)));
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(event_ok(int)), classptr, SLOT(OnOKHub(int)));
|
|
|
|
|
connect(&work_thread[CamId], SIGNAL(event_ng(int)), classptr, SLOT(OnNGHub(int)));
|
|
|
|
|
work_thread[CamId].start_work();
|
|
|
|
|
|
|
|
|
|
debug_thread[CamId].init(g_debug_queue[CamId], CamId);
|
|
|
|
|
connect(&debug_thread[CamId], SIGNAL(notify(int, int, cv::Mat)), classptr, SLOT(OnNotifyHub(int, int, cv::Mat)));
|
|
|
|
|
debug_thread[CamId].start_work();
|
|
|
|
|
work_thread[Num].init(g_image_queue[Num], g_result_queue[Num], classid, Num);
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(notify(int, int, cv::Mat)), classptr, SLOT(OnNotifyHub(int, int, cv::Mat)));
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(display_timecost(int, int)), classptr, SLOT(OnDisplayTimeCostHub(int, int)));
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(display_check_total(int, long)), classptr, SLOT(OnDisplayCheckNumberHub(int, long)));
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(display_jd_no(int, QString)), classptr, SLOT(OnDisplayJdNoHub(int, QString)));
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(event_ok(int)), classptr, SLOT(OnOKHub(int)));
|
|
|
|
|
connect(&work_thread[Num], SIGNAL(event_ng(int)), classptr, SLOT(OnNGHub(int)));
|
|
|
|
|
work_thread[Num].start_work();
|
|
|
|
|
|
|
|
|
|
debug_thread[Num].init(g_debug_queue[Num], Num);
|
|
|
|
|
connect(&debug_thread[Num], SIGNAL(notify(int, int, cv::Mat)), classptr, SLOT(OnNotifyHub(int, int, cv::Mat)));
|
|
|
|
|
debug_thread[Num].start_work();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|