修改调试模式导致软件卡死的问题;

修改调试模式导致画面异常的问题。
main
seiyu 1 year ago
parent 6cc6ed3e76
commit 96e94011c4

Binary file not shown.

@ -251,7 +251,6 @@ Cigarette::Cigarette(QWidget *parent)
sThread.sendData("ReStartOk", g_sys_conf.FeedbackPort);
sThread.sendData("DebugDis", g_sys_conf.FeedbackPort);
sThread.sendData("LockOk", g_sys_conf.FeedbackPort);
#endif
#ifdef __ExportData
@ -602,7 +601,7 @@ void Cigarette::on_btn_start_released()
}
}
g_op_time = OP_TIME;
ui.checkBox_debug->setEnabled(true); //ʹÄÜÏà»úµ÷ÊÔcheckBox
//ui.checkBox_debug->setEnabled(true); //ʹÄÜÏà»úµ÷ÊÔcheckBox
}
void Cigarette::pause_work()
@ -872,56 +871,25 @@ void Cigarette::sendLatestData() {
for (int i = 0; i < NumberOfSupportedCameras; i++)
{
UDPSendInfo.index = i;
UDPSendInfo.FrameID = ok_frame;
UDPSendInfo.ok[i] = ok[i];
//sThread.sendData("4_999", dataport + UDPSendInfo.index);
sThread.sendData(("4_" + to_string(ok[i])).c_str(), dataport + UDPSendInfo.index);
//std::cout << "ok[" << i << "] is " << to_string(ok[i]) << std::endl;
//std::cout << ("4_" + to_string(ok[i])).c_str() << std::endl;
//UDP_Info_queue->put(UDPSendInfo);
#ifdef __UDPSend
//sThread.sendData(("4_" + to_string(ok[i])).c_str(), dataport + UDPSendInfo.index);
UDP_Info_queue->put(UDPSendInfo);
#endif
UDPSendInfo.FrameID = ng_frame;
UDPSendInfo.ng[i] = ng[i];
sThread.sendData(("5_" + to_string(ng[i])).c_str(), dataport + UDPSendInfo.index);
#ifdef __UDPSend
//sThread.sendData(("5_" + to_string(ng[i])).c_str(), dataport + UDPSendInfo.index);
UDP_Info_queue->put(UDPSendInfo);
#endif
UDPSendInfo.FrameID = total_frame;
UDPSendInfo.Total = production_number[i];
sThread.sendData(("7_" + to_string(production_number[i])).c_str(), dataport + UDPSendInfo.index);
#ifdef __UDPSend
//sThread.sendData(("7_" + to_string(production_number[i])).c_str(), dataport + UDPSendInfo.index);
UDP_Info_queue->put(UDPSendInfo);
#endif
}
//while (isLoop) {
//switch (UDPSendInfo.FrameID) {
// case info_frame: {
// sThread.sendData(&UDPSendInfo, dataport);
// break;
// }
// case speed_frame: {
// sThread.sendSpeed(&UDPSendInfo, dataport);
// break;
// }
// case kick_frame: {
// sThread.sendKick(&UDPSendInfo, dataport);
// break;
// }
// case ok_frame: {
// sThread.sendOK(&UDPSendInfo, dataport);
// break;
// }
// case ng_frame: {
// sThread.sendNG(&UDPSendInfo, dataport);
// break;
// }
// case total_frame: {
// sThread.sendTotal(&UDPSendInfo, dataport);
// break;
// }
// case image_frame: {
// //sThread.sendImage(&UDPSendInfo, imageport);
// break;
// }
//}
//}
}
void Cigarette::OnRotateReleasedHub(int Num)//旋转按钮
@ -1396,7 +1364,7 @@ void Cigarette::on_checkBox_debug_clicked(bool checked)
{
QMessageBox::information(NULL, QStringLiteral("操作顺序检查 "), QStringLiteral("请先点击‘停止工作’按钮,才能进入调试模式"), QMessageBox::Ok);
ui.checkBox_debug->setChecked(false);
return;
//return;
}
else
{
@ -1414,7 +1382,7 @@ void Cigarette::on_checkBox_debug_clicked(bool checked)
DisableDebugMode();
//on_pushButton_clear_released(); //换班
ui.checkBox_debug->setChecked(false);
ui.checkBox_debug->setEnabled(true);
//ui.checkBox_debug->setEnabled(true);
#ifdef __UDPSend
sThread.sendData("DebugDis", g_sys_conf.FeedbackPort);
#endif

@ -8,8 +8,12 @@
#include "SyncQueue.h"
#include "basecamera.h"
#include "common.h"
#include "balluffcamera.h"
#include "hikcamera.h"
extern SyncQueue<cv::Mat> *g_debug_queue[NumberOfSupportedCameras]; //相机调试模式图像队列
extern DisplayLabelConf g_display_label_conf[NumberOfSupportedCameras];
extern SingleCamInfoStruct SingleCamInfo[NumberOfSupportedCameras];
extern int rotationAngle[NumberOfSupportedCameras]; //图片旋转角度
extern bool isNeedRotate[NumberOfSupportedCameras];
@ -53,12 +57,18 @@ protected:
if (image.data)
{
//cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像
// 解决进入调试模式海康彩色相机变色,关闭色彩调整巴鲁夫相机变黑的问题
if (image.channels() == 1)
{
cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像
}
if (isNeedRotate[local_camera_number]) {
if(rotationAngle[local_camera_number] != (cv::ROTATE_90_COUNTERCLOCKWISE + 1))
{
cv::rotate(image, image, rotationAngle[local_camera_number]);
}
}
//sleep(100);
emit notify(local_camera_number,0,image);
}
#ifdef DRAW_RECT

Loading…
Cancel
Save