解决客户端与远程端数据不统一的问题

main
seiyu 1 year ago
parent 1ba73b82f2
commit f5be5614bf

@ -231,7 +231,7 @@ void CaptureThreadHIK::process( void )
nRet = MV_CC_RegisterExceptionCallBack(CamHandle, LossCallBack[Local_Num], this); nRet = MV_CC_RegisterExceptionCallBack(CamHandle, LossCallBack[Local_Num], this);
if (nRet) { std::cout << "can not register loss callback" << std::endl; nnRet = nRet; } if (nRet) { std::cout << "can not register loss callback" << std::endl; nnRet = nRet; }
#ifdef IMM_FEED_BACK ///不打开无反馈等( 延后一次两次用ifndef // 不延后用ifdef) //#ifdef IMM_FEED_BACK ///不打开无反馈等( 延后一次两次用ifndef // 不延后用ifdef)
nRet = MV_CC_SetEnumValueByString(CamHandle, "EventSelector", "Line0FallingEdge"); nRet = MV_CC_SetEnumValueByString(CamHandle, "EventSelector", "Line0FallingEdge");
if (nRet) { std::cout << "can not set EventSelector" << std::endl; nnRet = nRet; } if (nRet) { std::cout << "can not set EventSelector" << std::endl; nnRet = nRet; }
@ -249,7 +249,7 @@ void CaptureThreadHIK::process( void )
nRet = MV_CC_RegisterEventCallBackEx(CamHandle, "Line0RisingEdge", RisingGpioEvent[Local_Num], this); nRet = MV_CC_RegisterEventCallBackEx(CamHandle, "Line0RisingEdge", RisingGpioEvent[Local_Num], this);
if (nRet) { std::cout << "can not register GPIO callback" << std::endl; nnRet = nRet; } if (nRet) { std::cout << "can not register GPIO callback" << std::endl; nnRet = nRet; }
#endif //#endif
m_Timer = new QTimer(); m_Timer = new QTimer();
connect(m_Timer, SIGNAL(timeout()), this, SLOT(fpsTimeout())); connect(m_Timer, SIGNAL(timeout()), this, SLOT(fpsTimeout()));

@ -303,6 +303,7 @@ void AlgJd::post_process_batch(std::vector<cv::Mat>& vec_frame, std::vector<cv::
//std::cout << "outs.size()\t" << outs.size() << std::endl; //std::cout << "outs.size()\t" << outs.size() << std::endl;
//std::cout << "Type\t" << outs[0].type() << std::endl; //std::cout << "Type\t" << outs[0].type() << std::endl;
for (size_t i = 0; i < outs.size(); ++i) for (size_t i = 0; i < outs.size(); ++i)
{ {
//std::cout << "outs.dims\t" << outs[i].dims << std::endl; //std::cout << "outs.dims\t" << outs[i].dims << std::endl;

@ -395,6 +395,9 @@ Cigarette::Cigarette(QWidget *parent)
m_delay = new QTimer(this);//换班防连击 m_delay = new QTimer(this);//换班防连击
connect(m_delay, SIGNAL(timeout()), this, SLOT(enable_shift())); connect(m_delay, SIGNAL(timeout()), this, SLOT(enable_shift()));
m_sendMsg_delay = new QTimer(this);
connect(m_sendMsg_delay, SIGNAL(timeout()), this, SLOT(sendLatestData()));
m_op_delay = new QTimer(this); m_op_delay = new QTimer(this);
connect(m_op_delay, SIGNAL(timeout()), this, SLOT(op_timeout())); connect(m_op_delay, SIGNAL(timeout()), this, SLOT(op_timeout()));
@ -499,6 +502,7 @@ Cigarette::Cigarette(QWidget *parent)
} }
} }
} }
//connect(ui.btn_pause, SIGNAL(clicked()), this, SLOT(sendLatestData()));
} }
Cigarette::~Cigarette() Cigarette::~Cigarette()
@ -613,6 +617,9 @@ void Cigarette::pause_work()
//显示OK/NG按钮 //显示OK/NG按钮
label_reslut_mat[i]->setVisible(false); label_reslut_mat[i]->setVisible(false);
} }
m_sendMsg_delay->setSingleShot(true);
m_sendMsg_delay->start(1000);
} }
void Cigarette::Exit() void Cigarette::Exit()
@ -686,6 +693,7 @@ void Cigarette::on_btn_pause_released()
} }
g_op_time = OP_TIME; g_op_time = OP_TIME;
} }
//锁定/解锁按钮 //锁定/解锁按钮
void Cigarette::on_btn_lock_released() void Cigarette::on_btn_lock_released()
{ {
@ -770,7 +778,7 @@ void Cigarette::TestImgs()
std::cout << "srcDirPath=" << srcDirPath.toStdString() << std::endl; std::cout << "srcDirPath=" << srcDirPath.toStdString() << std::endl;
srcDirPath += "/"; srcDirPath += "/";
//获取该路径下的所有文件 //获取该路径下的所有文件
getFiles(srcDirPath.toStdString() + "*.jpg", files); getFiles(srcDirPath.toStdString() + "*.bmp", files);
if (files.size() == 0) if (files.size() == 0)
{ {
QMessageBox::StandardButton result = QMessageBox::information(NULL, QStringLiteral("提示"), QStringLiteral("没有找到图片")); QMessageBox::StandardButton result = QMessageBox::information(NULL, QStringLiteral("提示"), QStringLiteral("没有找到图片"));
@ -847,6 +855,67 @@ void Cigarette::enable_shift()
ui.pushButton_clear->setEnabled(true); ui.pushButton_clear->setEnabled(true);
} }
void Cigarette::sendLatestData() {
// Á¬½ÓUDP·¢ËÍ×îеÄÊý¾Ý
int dataport = g_sys_conf.MonitorPort;
_UDPSendInfo UDPSendInfo;
//UDP_Info_queue->take(UDPSendInfo);
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);
UDPSendInfo.FrameID = ng_frame;
UDPSendInfo.ng[i] = ng[i];
sThread.sendData(("5_" + to_string(ng[i])).c_str(), dataport + UDPSendInfo.index);
UDPSendInfo.FrameID = total_frame;
UDPSendInfo.Total = production_number[i];
sThread.sendData(("7_" + to_string(production_number[i])).c_str(), dataport + UDPSendInfo.index);
}
//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)//旋转按钮 void Cigarette::OnRotateReleasedHub(int Num)//旋转按钮
{ {
QString str = "Start to rotate picture " + QString::number(90 * ((rotationAngle[Num] + 1) % 4)) + " degrees of camera " + QString::number(Num) + "."; QString str = "Start to rotate picture " + QString::number(90 * ((rotationAngle[Num] + 1) % 4)) + " degrees of camera " + QString::number(Num) + ".";
@ -856,7 +925,6 @@ void Cigarette::OnRotateReleasedHub(int Num)//
rotationAngle[Num] = (rotationAngle[Num] + 1) % 4; rotationAngle[Num] = (rotationAngle[Num] + 1) % 4;
save_rotate_message(); save_rotate_message();
} }
} }
//打开/关闭相机 //打开/关闭相机
@ -1220,7 +1288,7 @@ void Cigarette::OnOKHub(int Num)
_UDPSendInfo UDPSendInfo; _UDPSendInfo UDPSendInfo;
UDPSendInfo.FrameID = ok_frame; UDPSendInfo.FrameID = ok_frame;
UDPSendInfo.index = Num; UDPSendInfo.index = Num;
UDPSendInfo.ok = ok[Num]; UDPSendInfo.ok[Num] = ok[Num];
#ifdef __UDPSend #ifdef __UDPSend
UDP_Info_queue->put(UDPSendInfo); UDP_Info_queue->put(UDPSendInfo);
#endif #endif
@ -1235,7 +1303,7 @@ void Cigarette::OnNGHub(int Num)
_UDPSendInfo UDPSendInfo; _UDPSendInfo UDPSendInfo;
UDPSendInfo.FrameID = ng_frame; UDPSendInfo.FrameID = ng_frame;
UDPSendInfo.index = Num; UDPSendInfo.index = Num;
UDPSendInfo.ng = ng[Num]; UDPSendInfo.ng[Num] = ng[Num];
#ifdef __UDPSend #ifdef __UDPSend
UDP_Info_queue->put(UDPSendInfo); UDP_Info_queue->put(UDPSendInfo);
#endif #endif
@ -1247,7 +1315,6 @@ void Cigarette::OnNGHub(int Num)
void Cigarette::updateStatisticsHub(const QString& statisticalData, int Num) void Cigarette::updateStatisticsHub(const QString& statisticalData, int Num)
{ {
label_cap_speed_mat[Num]->setText(statisticalData + QStringLiteral("个/秒")); label_cap_speed_mat[Num]->setText(statisticalData + QStringLiteral("个/秒"));
_UDPSendInfo UDPSendInfo; _UDPSendInfo UDPSendInfo;
UDPSendInfo.FrameID = speed_frame; UDPSendInfo.FrameID = speed_frame;
UDPSendInfo.index = Num; UDPSendInfo.index = Num;
@ -1972,12 +2039,12 @@ void Cigarette::on_pushButton_clear_released()//
UDPSendInfo.index = i; UDPSendInfo.index = i;
UDPSendInfo.FrameID = ok_frame; UDPSendInfo.FrameID = ok_frame;
UDPSendInfo.ok = ok[i]; UDPSendInfo.ok[i] = ok[i];
#ifdef __UDPSend #ifdef __UDPSend
UDP_Info_queue->put(UDPSendInfo); UDP_Info_queue->put(UDPSendInfo);
#endif #endif
UDPSendInfo.FrameID = ng_frame; UDPSendInfo.FrameID = ng_frame;
UDPSendInfo.ok = ng[i]; UDPSendInfo.ng[i] = ng[i];
#ifdef __UDPSend #ifdef __UDPSend
UDP_Info_queue->put(UDPSendInfo); UDP_Info_queue->put(UDPSendInfo);
#endif #endif
@ -3443,7 +3510,6 @@ void Cigarette::EnableDebugMode()
else if(SingleCamInfo[i].CamClass == BaslerClassID) else if(SingleCamInfo[i].CamClass == BaslerClassID)
{ {
bool nRet = false; bool nRet = false;
nRet = BaslerCamHandle[i]->AcquisitionFrameRate.TrySetValue(10); nRet = BaslerCamHandle[i]->AcquisitionFrameRate.TrySetValue(10);
if (!nRet) { std::cout << "can not set Basler's AcquisitionFrameRate" << std::endl; } if (!nRet) { std::cout << "can not set Basler's AcquisitionFrameRate" << std::endl; }
nRet = BaslerCamHandle[i]->AcquisitionFrameRateEnable.TrySetValue(true); nRet = BaslerCamHandle[i]->AcquisitionFrameRateEnable.TrySetValue(true);
@ -3676,6 +3742,7 @@ void Cigarette::record_output_statistic(qint64 quantity, int shift)
void Cigarette::recMsgFromUdp(QString data) void Cigarette::recMsgFromUdp(QString data)
{ {
//std::cout << data.toStdString() << std::endl;
#ifdef __UDPSend #ifdef __UDPSend
if (data == "START") if (data == "START")
{ {
@ -3743,8 +3810,6 @@ void Cigarette::recMsgFromUdp(QString data)
{ {
OnRotateReleasedHub(7); OnRotateReleasedHub(7);
} }
else if (data == "LOCK") else if (data == "LOCK")
{ {
if (!g_admin_mode) if (!g_admin_mode)
@ -4012,6 +4077,7 @@ 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]) + '_'; 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); sThread.sendData(str, g_sys_conf.FeedbackPort);
//std::cout << "=> to UDP: " << str.toStdString() << std::endl;
} }
else if (dataList[0] == "UPDSETTING") else if (dataList[0] == "UPDSETTING")
{ {

@ -80,6 +80,7 @@ public:
private slots : private slots :
void on_btn_start_released(); void on_btn_start_released();
void on_btn_pause_released(); void on_btn_pause_released();
//void on_btn_pause_clicked(bool checked);
void on_btn_lock_released(); void on_btn_lock_released();
void on_btn_setup_released(); void on_btn_setup_released();
void on_checkBox_debug_clicked(bool checked); void on_checkBox_debug_clicked(bool checked);
@ -88,6 +89,7 @@ private slots :
void on_toolButton_alarm_released(); void on_toolButton_alarm_released();
void on_pushButton_clear_released(); void on_pushButton_clear_released();
void enable_shift(); void enable_shift();
void sendLatestData();
void OnNotifyHub(int Num, int Cnt, cv::Mat m); void OnNotifyHub(int Num, int Cnt, cv::Mat m);
void OnDisplayTimeCostHub(int Num, int ms); void OnDisplayTimeCostHub(int Num, int ms);
void OnDisplayCheckNumberHub(int Num, long no); void OnDisplayCheckNumberHub(int Num, long no);
@ -163,6 +165,7 @@ public:
QTimer *m_pTimer; QTimer *m_pTimer;
QTimer *m_delay; //换班防止连击 QTimer *m_delay; //换班防止连击
QTimer* m_sendMsg_delay; // 停止工作后发送最新数据给远程端
QTimer *m_op_delay; //操作员权限剩余时间 QTimer *m_op_delay; //操作员权限剩余时间
QTimer *m_admin_delay; //操作员权限剩余时间 QTimer *m_admin_delay; //操作员权限剩余时间
QTimer *clean_pTimer; //定时清理任务 QTimer *clean_pTimer; //定时清理任务

@ -1188,7 +1188,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -1248,7 +1248,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -1552,10 +1552,10 @@
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="label_17">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>880</x> <x>830</x>
<y>10</y> <y>10</y>
<width>191</width> <width>210</width>
<height>21</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -1570,16 +1570,16 @@
<string notr="true">color:white</string> <string notr="true">color:white</string>
</property> </property>
<property name="text"> <property name="text">
<string>Tel:87907256(0532)</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt; Tel:87907256(0532)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_18">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1080</x> <x>1090</x>
<y>10</y> <y>10</y>
<width>81</width> <width>80</width>
<height>21</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -1600,10 +1600,10 @@
<widget class="QLabel" name="label_cur_time"> <widget class="QLabel" name="label_cur_time">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>920</x> <x>830</x>
<y>30</y> <y>35</y>
<width>211</width> <width>210</width>
<height>31</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -1618,7 +1618,7 @@
<string notr="true">color:white</string> <string notr="true">color:white</string>
</property> </property>
<property name="text"> <property name="text">
<string>2020-10-10 13:15:39</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;2020-10-10 13:15:39&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -1933,7 +1933,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -1993,7 +1993,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -2321,7 +2321,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -2381,7 +2381,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -2602,7 +2602,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -2662,7 +2662,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3216,7 +3216,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3276,7 +3276,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3436,7 +3436,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3496,7 +3496,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3608,7 +3608,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3668,7 +3668,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3876,7 +3876,7 @@
<rect> <rect>
<x>220</x> <x>220</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -3936,7 +3936,7 @@
<rect> <rect>
<x>360</x> <x>360</x>
<y>20</y> <y>20</y>
<width>50</width> <width>61</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -4394,10 +4394,10 @@
<widget class="QLabel" name="location"> <widget class="QLabel" name="location">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1180</x> <x>1090</x>
<y>10</y> <y>35</y>
<width>81</width> <width>161</width>
<height>21</height> <height>20</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">

@ -9,7 +9,7 @@
//#define __DEBUG //debug信息输出功能 //#define __DEBUG //debug信息输出功能
#define __UDPSend //网络发送功能 #define __UDPSend //网络发送功能
#define USB_BASLER_NEW_FW //使用basler定制固件 #define USB_BASLER_NEW_FW //使用basler定制固件
#define IMM_PROCESS //拍照后立马处理,不等校验信号 //#define IMM_PROCESS //拍照后立马处理,不等校验信号
#define IMM_FEED_BACK //处理完后立马反馈,不等校验信号 #define IMM_FEED_BACK //处理完后立马反馈,不等校验信号
//#define ONE_TIME_SHIFT //错开一拍发送反馈(默认错开两次) //#define ONE_TIME_SHIFT //错开一拍发送反馈(默认错开两次)
#define AI_WARM_UP //AI识别开始前的热身动作 #define AI_WARM_UP //AI识别开始前的热身动作

@ -52,7 +52,7 @@ protected:
p_debug_queue->take(image); p_debug_queue->take(image);
if (image.data) if (image.data)
{ {
cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像 //cv::cvtColor(image, image, CV_BGR2RGB); //灰度图像转为彩色图像
if (isNeedRotate[local_camera_number]) { if (isNeedRotate[local_camera_number]) {
if(rotationAngle[local_camera_number] != (cv::ROTATE_90_COUNTERCLOCKWISE + 1)) if(rotationAngle[local_camera_number] != (cv::ROTATE_90_COUNTERCLOCKWISE + 1))
{ {

@ -668,7 +668,7 @@ void DialogSetup::on_pushButton_change_released()
connect(this, &DialogSetup::sendMsgToShift, m_change_shift, &change_shift::recMsgFromDialogSetup); connect(this, &DialogSetup::sendMsgToShift, m_change_shift, &change_shift::recMsgFromDialogSetup);
m_change_shift->show(); m_change_shift->show();
m_change_shift->move(this->geometry().center() - m_change_shift->rect().center()); m_change_shift->move(this->geometry().center() - m_change_shift->rect().center());
emit sendMsgToShift(g_sys_conf.shiftA, g_sys_conf.shiftB, g_sys_conf.shiftC); emit sendMsgToShift (g_sys_conf.shiftA, g_sys_conf.shiftB, g_sys_conf.shiftC);
} }
void DialogSetup::on_pushButton_statistic_released() void DialogSetup::on_pushButton_statistic_released()
{ {

@ -115,7 +115,7 @@ void threadSend::sendOK(_UDPSendInfo *UDPSendInfo,int port)
{ {
QString res = QString("%1_%2") QString res = QString("%1_%2")
.arg(QString::number(UDPSendInfo->FrameID)) .arg(QString::number(UDPSendInfo->FrameID))
.arg(QString::number(UDPSendInfo->ok)); .arg(QString::number(UDPSendInfo->ok[UDPSendInfo->index]));
mSocket.writeDatagram(res.toUtf8(), QHostAddress(ip), port + UDPSendInfo->index); mSocket.writeDatagram(res.toUtf8(), QHostAddress(ip), port + UDPSendInfo->index);
} }
@ -123,7 +123,7 @@ void threadSend::sendNG(_UDPSendInfo *UDPSendInfo,int port)
{ {
QString res = QString("%1_%2") QString res = QString("%1_%2")
.arg(QString::number(UDPSendInfo->FrameID)) .arg(QString::number(UDPSendInfo->FrameID))
.arg(QString::number(UDPSendInfo->ng)); .arg(QString::number(UDPSendInfo->ng[UDPSendInfo->index]));
mSocket.writeDatagram(res.toUtf8(), QHostAddress(ip), port + UDPSendInfo->index); mSocket.writeDatagram(res.toUtf8(), QHostAddress(ip), port + UDPSendInfo->index);
} }

@ -32,8 +32,8 @@ public:
long Total; long Total;
QString JD; QString JD;
QString timecost; QString timecost;
int ok; int ok[NumberOfSupportedCameras];
int ng; int ng[NumberOfSupportedCameras];
QString speed; QString speed;
int Kick[NumberOfSupportedCameras]; int Kick[NumberOfSupportedCameras];
@ -45,8 +45,8 @@ public:
Total = 0; Total = 0;
JD = QString("0,0,0"); JD = QString("0,0,0");
timecost = QString("0ms");; timecost = QString("0ms");;
ok = false; for (int i = 0; i < NumberOfSupportedCameras; i++)ok[i] = 0;
ng = false; for (int i = 0; i < NumberOfSupportedCameras; i++)ng[i] = 0;
speed = QString(" "); speed = QString(" ");
for(int i=0;i<NumberOfSupportedCameras;i++)Kick[i]=0; for(int i=0;i<NumberOfSupportedCameras;i++)Kick[i]=0;
} }

Loading…
Cancel
Save