diff --git a/Cigarette/cigarette.cpp b/Cigarette/cigarette.cpp index a2381fd..a13b9cf 100644 --- a/Cigarette/cigarette.cpp +++ b/Cigarette/cigarette.cpp @@ -1151,6 +1151,7 @@ void Cigarette::on_checkBox_debug_clicked(bool checked) { emit sengMsgToClog("Exit debug mode."); DisableDebugMode(); + on_pushButton_clear_released(); //换班 ui.checkBox_debug->setChecked(false); #ifdef __UDPSend sThread.sendData("DebugDis", g_sys_conf.FeedbackPort); @@ -3107,11 +3108,23 @@ void Cigarette::EnumerateCameras(SingleCamInfoStruct *TempSingleCamInfoStruct,bo { void* camhandle; MVCC_STRINGVALUE UserID; + MVCC_STRINGVALUE YSXID; + string id; MV_CC_CreateHandle(&camhandle, HIKCamera::stDeviceList.pDeviceInfo[i]); if (!MV_CC_OpenDevice(camhandle)) { MV_CC_GetDeviceUserID(camhandle, &UserID); + MV_CC_GetStringValue(camhandle, "DeviceYSXID", &YSXID); if(showinfo)std::cout << "Hikrobot user ID = " << UserID.chCurValue << std::endl; + cout << "Hikrobot YSX ID = " << YSXID.chCurValue << std::endl; + id = YSXID.chCurValue; +#ifdef identify_Hik_YSXID + if (id!="YSX9256") + { + QMessageBox::information(NULL, QStringLiteral("系统自检失败"), QStringLiteral("相机匹配失败,请检查相机型号"), QMessageBox::Ok); + exit(-1); + } +#endif MV_CC_CloseDevice(camhandle); } MV_CC_DestroyHandle(camhandle); @@ -3278,7 +3291,7 @@ void Cigarette::DisableDebugMode() } } g_debug_mode = false; - on_pushButton_clear_released(); //换班 + } void Cigarette::CleanThreadStart() @@ -3775,9 +3788,6 @@ void Cigarette::recMsgFromUdp(QString data) str += QString::number(g_sys_conf.no[i][0]) + '_' + QString::number(g_sys_conf.no[i][1]) + '_' + QString::number(g_sys_conf.no[i][2]) + '_'; } sThread.sendData(str, g_sys_conf.FeedbackPort); - printf("=====>send Message is = %s\n", str.toStdString().c_str()); - qDebug() << "getsettingpro:" << dataList; - qDebug() << "str:" << str.toStdString().c_str(); } else if (dataList[0] == "UPDSETTING") { diff --git a/Cigarette/common.h b/Cigarette/common.h index 5087b85..0c4f922 100644 --- a/Cigarette/common.h +++ b/Cigarette/common.h @@ -19,6 +19,7 @@ //#define CAP_FEED_BACK //拍照时也检测有没有测试结果,有的话就反馈 //#define DOUBLE_FEED_BACK //一次ng,两次反馈ng信号 #endif +#define identify_Hik_YSXID//识别海康相机YSXID #define Queue_Size 15 #define Unit_Queue_Size Queue_Size*3