From 5aa4f78df5ee1f4e3812fca964ab734e721057d1 Mon Sep 17 00:00:00 2001 From: seiyu Date: Fri, 29 Dec 2023 16:55:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=89=8D=E5=B7=B2=E7=BB=8F=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E5=B8=B8=E4=BF=9D=E5=AD=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=B0XML=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cigarette/CaptureThread.cpp | 10 --- Cigarette/CaptureThreadBasler.cpp | 5 -- Cigarette/CaptureThreadHIK.cpp | 5 -- Cigarette/cigarette.cpp | 119 ++++++++++++++++-------------- Cigarette/cigarette.h | 14 ++++ Cigarette/exportData.cpp | 39 ++++++---- Cigarette/exportData.h | 37 +++++----- Cigarette/workthread.cpp | 23 ++---- 8 files changed, 127 insertions(+), 125 deletions(-) diff --git a/Cigarette/CaptureThread.cpp b/Cigarette/CaptureThread.cpp index de2faa5..5ca7612 100644 --- a/Cigarette/CaptureThread.cpp +++ b/Cigarette/CaptureThread.cpp @@ -19,11 +19,6 @@ void CaptureThread::fpsTimeout(void) m_cntLastGrabbedImages = m_cntGrabbedImages; QString data = QString("%1").arg(delta); emit updateStatistics(data.left(4), Local_Num); -#ifdef __ExportData - _XMLExportDataInfo exportXMLDataInfo; - exportXMLDataInfo.AcquisitionSpeed = data.left(4).toStdString(); - export_XMLData_Info_queue->put(exportXMLDataInfo); -#endif } CaptureThread::~CaptureThread() @@ -120,11 +115,6 @@ void CaptureThread::process( void ) { QString data = QString::fromStdString(statistics.framesPerSecond.readS()); emit updateStatistics(data.left(4),Local_Num); -#ifdef __ExportData - _XMLExportDataInfo exportXMLDataInfo; - exportXMLDataInfo.AcquisitionSpeed = data.left(3).toStdString(); - export_XMLData_Info_queue->put(exportXMLDataInfo); -#endif } } else diff --git a/Cigarette/CaptureThreadBasler.cpp b/Cigarette/CaptureThreadBasler.cpp index 1594aa1..cdd6de3 100644 --- a/Cigarette/CaptureThreadBasler.cpp +++ b/Cigarette/CaptureThreadBasler.cpp @@ -165,11 +165,6 @@ void CaptureThreadBasler::fpsTimeout() m_cntLastGrabbedImages = m_cntGrabbedImages; QString data = QString("%1").arg(delta); emit updateStatistics(data.left(4), Local_Num); -#ifdef __ExportData - _XMLExportDataInfo exportXMLDataInfo; - exportXMLDataInfo.AcquisitionSpeed = data.left(3).toStdString(); - export_XMLData_Info_queue->put(exportXMLDataInfo); -#endif } void CaptureThreadBasler::ioTimeout() diff --git a/Cigarette/CaptureThreadHIK.cpp b/Cigarette/CaptureThreadHIK.cpp index aa4d05f..c2148ce 100644 --- a/Cigarette/CaptureThreadHIK.cpp +++ b/Cigarette/CaptureThreadHIK.cpp @@ -204,11 +204,6 @@ void CaptureThreadHIK::fpsTimeout(void) m_cntLastGrabbedImages = m_cntGrabbedImages; QString data = QString("%1").arg(delta); emit updateStatistics(data.left(4), Local_Num); -#ifdef __ExportData - _XMLExportDataInfo exportXMLDataInfo; - exportXMLDataInfo.AcquisitionSpeed = data.left(3).toStdString(); - export_XMLData_Info_queue->put(exportXMLDataInfo); -#endif } //----------------------------------------------------------------------------- diff --git a/Cigarette/cigarette.cpp b/Cigarette/cigarette.cpp index a964323..a7d4e94 100644 --- a/Cigarette/cigarette.cpp +++ b/Cigarette/cigarette.cpp @@ -55,7 +55,7 @@ ASyncQueue *g_result_queue[NumberOfSupportedCameras]; // bool g_debug_mode; //相机调试模式,工作模式必须暂停状态才能打开 SyncQueue *g_debug_queue[NumberOfSupportedCameras]; //相机调试模式图像队列 -SyncQueue<_UDPSendInfo> *UDP_Info_queue; +SyncQueue<_UDPSendInfo>* UDP_Info_queue; //SyncQueue<_ExportDataInfo> *export_Data_Info_queue; SyncQueue<_XMLExportDataInfo>* export_XMLData_Info_queue; ExportDataThread exportDataThread; @@ -81,6 +81,7 @@ int quantity_stop_count; // int g_seconds; int CurOpLabel; bool onrestart = false; +bool flag = false; VOID BeforeWork(int shoot[]) { @@ -244,11 +245,11 @@ Cigarette::Cigarette(QWidget *parent) saveThread.init(); saveThread.start_work(); #ifdef __UDPSend - sThread.init(UDP_Info_queue,g_sys_conf.MonitorIP ,g_sys_conf.MonitorPort); + sThread.init(UDP_Info_queue, g_sys_conf.MonitorIP, g_sys_conf.MonitorPort); sThread.start_work(); rThread = new threadReceive(); - rThread->init(g_sys_conf.MonitorIP ,g_sys_conf.MonitorPort); + rThread->init(g_sys_conf.MonitorIP, g_sys_conf.MonitorPort); connect(rThread, &threadReceive::sendMsgToCigratte, this, &Cigarette::recMsgFromUdp); rThread->start_work(); #endif @@ -256,6 +257,7 @@ Cigarette::Cigarette(QWidget *parent) #ifdef __ExportData exportDataThread.init(); exportDataThread.start_work(); + connect(this, &Cigarette::sendMsgToExportData, &exportDataThread, &ExportDataThread::EDrecMsgFromCigarette); #endif m_PLCDevice = new PLCDevice; @@ -1244,6 +1246,7 @@ void Cigarette::OnNotifyHub(int Num, int Cnt,cv::Mat m) void Cigarette::OnDisplayTimeCostHub(int Num, int ms) { label_timecost_mat[Num]->setText(QString::number(ms) + "ms"); + exportData[Num].detectTime = QString::number(ms) + "ms"; } void Cigarette::OnDisplayCheckNumberHub(int Num, long no) @@ -1262,6 +1265,10 @@ void Cigarette::OnDisplayCheckNumberHub(int Num, long no) void Cigarette::OnDisplayJdNoHub(int Num, QString jd_no) { label_jd_no_mat[Num]->setText(jd_no); +#ifdef __ExportData + exportData[Num].cameraId = Num; + exportData[Num].jdNum = jd_no; +#endif } void Cigarette::OnOKHub(int Num) @@ -1278,7 +1285,7 @@ void Cigarette::OnOKHub(int Num) label_reslut_mat[Num]->setText("OK"); label_reslut_mat[Num]->setStyleSheet(tr("background-color: rgb(0, 255, 0);")); - + exportData[Num].okNum = ok[Num]; } void Cigarette::OnNGHub(int Num) @@ -1294,10 +1301,11 @@ void Cigarette::OnNGHub(int Num) lcdNumber_ng_mat[Num]->display(ng[Num]); label_reslut_mat[Num]->setText("NG"); label_reslut_mat[Num]->setStyleSheet(tr("background-color: rgb(255, 0, 0);")); + + exportData[Num].ngNum = ng[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("个/秒")); _UDPSendInfo UDPSendInfo; UDPSendInfo.FrameID = speed_frame; @@ -1306,6 +1314,7 @@ void Cigarette::updateStatisticsHub(const QString& statisticalData, int Num) #ifdef __UDPSend UDP_Info_queue->put(UDPSendInfo); #endif + exportData[Num].acquisitionTime = statisticalData + QStringLiteral("个/秒"); } //不剔除模式 @@ -1479,13 +1488,16 @@ void Cigarette::handleTimeout() int ret = m_PLCDevice->read_short_from_plc(g_modbus_conf.kick[i], 2, dest16); if (ret == 2) { Kick[i] = dest16[0] + (dest16[1] << 16); - lcdNumber_kick_mat[i]->display(Kick[i]); + lcdNumber_kick_mat[i]->display(dest16[0] + (dest16[1] << 16)); #ifdef __UDPSend _UDPSendInfo UDPSendInfo; UDPSendInfo.FrameID = kick_frame; - UDPSendInfo.index = 0; + UDPSendInfo.index = i; UDPSendInfo.Kick[UDPSendInfo.index] = dest16[0] + (dest16[1] << 16); UDP_Info_queue->put(UDPSendInfo); +#endif +#ifdef __ExportData + exportData[i].kick = dest16[0] + (dest16[1] << 16); #endif } } @@ -1860,10 +1872,9 @@ void Cigarette::on_toolButton_alarm_released() } void Cigarette::on_pushButton_clear_released()//换班 { -#ifdef __ExportData - _XMLExportDataInfo exportXMLDataInfo; -#endif emit sengMsgToClog("Change shift."); + emit sendMsgToExportData(); + if (!g_admin_mode) { if (!g_op_mode) @@ -1889,10 +1900,6 @@ void Cigarette::on_pushButton_clear_released()// { production_number[i]=0; lcdNumber_total_mat[i]->display(production_number[i]); -#ifdef __ExportData - exportXMLDataInfo.okNum[i] = ok[i]; - exportXMLDataInfo.ngNum[i] = ng[i]; -#endif ok[i] = 0; lcdNumber_ok_mat[i]->display(ok[i]); ng[i] = 0; @@ -1943,48 +1950,13 @@ void Cigarette::on_pushButton_clear_released()// { int cur_quantity = dest16[0] + (dest16[1] << 16); ui.lcdNumber_total_no_last->display(cur_quantity); - exportXMLDataInfo.TotalCheckNum = cur_quantity; +#ifdef __ExportData + exportData->totalCheckNum = cur_quantity; +#endif #ifdef __UDPSend sThread.sendData("totallast_" + QString::number(cur_quantity), g_sys_conf.FeedbackPort); #endif } - -#ifdef __ExportData - // 读取剔除值 - for (int i = 0; i < NumberOfSupportedCameras; i++) { -#if defined(NumberOfSupportedCameras) && (NumberOfSupportedCameras > i) - if (g_modbus_conf.kick[i] > 0) { - uint16_t dest16[2]; - int ret = m_PLCDevice->read_short_from_plc(g_modbus_conf.kick[i], 2, dest16); - if (ret == 2) { - exportXMLDataInfo.kickNum[i] = dest16[0] + (dest16[1] << 16); - } - } -#endif - - } - int flag = 0; - for (int i = 1; i < NumberOfSupportedCameras; i++) { - if (exportXMLDataInfo.kickNum[i] != exportXMLDataInfo.kickNum[0]) { - flag = 1; - break; - } - } - if (flag == 1) { - // Kick值不一致 - for (int i = 0; i < NumberOfSupportedCameras; i++) { - exportXMLDataInfo.TotalKickNum += exportXMLDataInfo.kickNum[i]; - } - } - else - exportXMLDataInfo.TotalKickNum = exportXMLDataInfo.kickNum[0]; - - exportXMLDataInfo.KickRate = ((double)exportXMLDataInfo.TotalKickNum / (double)exportXMLDataInfo.TotalCheckNum) * 100; - exportXMLDataInfo.PassRate = (1.0 - exportXMLDataInfo.KickRate) * 100; - - export_XMLData_Info_queue->put(exportXMLDataInfo); -#endif - } //发送换班消息给PLC if (g_modbus_conf.shift > 0) @@ -1999,6 +1971,45 @@ void Cigarette::on_pushButton_clear_released()// } } g_op_time = OP_TIME; + +#ifdef __ExportData + for (int i = 0; i < NumberOfSupportedCameras; i++) { + _XMLExportDataInfo exportXMLDataInfo; + exportXMLDataInfo.cameraTotal = NumberOfSupportedCameras; + exportXMLDataInfo.cameraId = exportData[i].cameraId; + exportXMLDataInfo.TotalCheckNum = exportData[i].totalCheckNum; + exportXMLDataInfo.shotCounts = g_sys_conf.shoot[i]; + exportXMLDataInfo.DetectSpeed = exportData[i].detectTime; + exportXMLDataInfo.AcquisitionSpeed = exportData[i].acquisitionTime; + exportXMLDataInfo.jdNum = exportData[i].jdNum; + exportXMLDataInfo.okNum = exportData[i].okNum; + exportXMLDataInfo.ngNum = exportData[i].ngNum; + exportXMLDataInfo.kickNum= exportData[i].kick; + int flag = 0; + for (int i = 1; i < NumberOfSupportedCameras; i++) { + if (exportData[i].kick != exportData[0].kick) { + flag = 1; + break; + } + } + if (flag == 1) { + // Kick值不一致 + for (int i = 0; i < NumberOfSupportedCameras; i++) { + exportXMLDataInfo.TotalKickNum += exportData[i].kick; + } + } + else + exportXMLDataInfo.TotalKickNum = exportData[0].kick; + if (exportXMLDataInfo.TotalKickNum == 0) + exportXMLDataInfo.KickRate = 0; + else + exportXMLDataInfo.KickRate = (double)exportXMLDataInfo.TotalKickNum / exportXMLDataInfo.TotalCheckNum; + exportXMLDataInfo.PassRate = 1.0 - exportXMLDataInfo.KickRate; + + export_XMLData_Info_queue->put(exportXMLDataInfo); + } + flag = false; +#endif } //读取系统管理员密码 @@ -2505,7 +2516,7 @@ bool Cigarette::read_modbus_config(ModbusConf &conf) size_t pos = line.find('='); std::string tmp_key = line.substr(0, pos); for (int i = 0; i < NumberOfSupportedCameras; i++) { - str_kick = QString("KICK%1").arg(i + 1); + str_kick = QString("KICK%1").arg(i+1); if (tmp_key == str_kick.toStdString()) conf.kick[i] = atoi(line.substr(pos + 1).c_str()); } diff --git a/Cigarette/cigarette.h b/Cigarette/cigarette.h index 435c229..822e94d 100644 --- a/Cigarette/cigarette.h +++ b/Cigarette/cigarette.h @@ -162,6 +162,19 @@ public: WorkThread work_thread[NumberOfSupportedCameras]; DebugThread debug_thread[NumberOfSupportedCameras]; + struct export_info { + int cameraId = -1; + int totalCheckNum = 0; + int totalKickNum = 0; + int kick = 0; + QString detectTime = "0"; + QString acquisitionTime = "0"; + QString jdNum = QString("0,0,0"); + int okNum = 0; + int ngNum = 0; + }; + export_info exportData[NumberOfSupportedCameras]; + SaveThread saveThread; void record_output_statistic(qint64 cur_quantity, int Kick[NumberOfSupportedCameras], int shift); @@ -196,6 +209,7 @@ public slots: signals: void sengMsgToClog(QString); + void sendMsgToExportData(); }; #endif // CIGARETTE_H diff --git a/Cigarette/exportData.cpp b/Cigarette/exportData.cpp index f4cffe1..5a7f35a 100644 --- a/Cigarette/exportData.cpp +++ b/Cigarette/exportData.cpp @@ -12,6 +12,7 @@ Cigarette* cg; //extern SyncQueue<_ExportDataInfo>* export_Data_Info_queue; extern SyncQueue<_XMLExportDataInfo>* export_XMLData_Info_queue; extern ConfPath g_conf_path; +extern bool flag; ExportDataThread::ExportDataThread(QObject* parent) : QThread(parent) { @@ -63,6 +64,7 @@ ExportDataThread::ExportDataThread(QObject* parent) : QThread(parent) void ExportDataThread::init() { b_quit = false; + flag = 0; } void ExportDataThread::start_work() @@ -192,14 +194,14 @@ int ExportDataThread::insertXMLNode(const char* xmlPath, _XMLExportDataInfo& dat // 合格率 XMLElement* PassRate = pDocument[data.cameraId]->NewElement("PassRate"); - std::string temp_str = std::to_string(data.PassRate); + std::string temp_str = std::to_string(data.PassRate * 100); const char* temp_char = temp_str.c_str(); PassRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char)); Total->InsertEndChild(PassRate); // 剔除率 XMLElement* KickRate = pDocument[data.cameraId]->NewElement("KickRate"); - temp_str = std::to_string(data.KickRate); + temp_str = std::to_string(data.KickRate * 100); temp_char = temp_str.c_str(); KickRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char)); Total->InsertEndChild(KickRate); @@ -215,35 +217,37 @@ int ExportDataThread::insertXMLNode(const char* xmlPath, _XMLExportDataInfo& dat XMLElement* JudgeNum = pDocument[data.cameraId]->NewElement("JudgeNum"); // 各相机ok数量 XMLElement* okNum = pDocument[data.cameraId]->NewElement("OkNum"); - okNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.okNum[data.cameraId], s, 10))); + okNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.okNum, s, 10))); JudgeNum->InsertEndChild(okNum); // 各相机ng数量 XMLElement* ngNum = pDocument[data.cameraId]->NewElement("NgNum"); - ngNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.ngNum[data.cameraId], s, 10))); + ngNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.ngNum, s, 10))); JudgeNum->InsertEndChild(ngNum); // 各相机实际剔除数量(单通道剔除时为总剔除数量) XMLElement* kickNum = pDocument[data.cameraId]->NewElement("KickNum"); - kickNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.kickNum[data.cameraId], s, 10))); + kickNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.kickNum, s, 10))); JudgeNum->InsertEndChild(kickNum); // 各相机胶点识别个数 XMLElement* JdNum = pDocument[data.cameraId]->NewElement("JdNum"); - JdNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.shotCounts, s, 10))); - for (int j = 0; j < data.shotCounts; j++) - JdNum->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.jdNum[j], s, 10))); + JdNum->InsertEndChild(pDocument[data.cameraId]->NewText(data.jdNum.toStdString().c_str())); JudgeNum->InsertEndChild(JdNum); + XMLElement* shotCounts = pDocument[data.cameraId]->NewElement("ShotCounts"); + shotCounts->InsertEndChild(pDocument[data.cameraId]->NewText(itoa(data.shotCounts, s, 10))); + JudgeNum->InsertEndChild(shotCounts); + CameraNode->InsertEndChild(JudgeNum); // 各相机采集速度 XMLElement* speed = pDocument[data.cameraId]->NewElement("Speed"); XMLElement* AcquisitionSpeed = pDocument[data.cameraId]->NewElement("AcquisitionSpeed"); - AcquisitionSpeed->InsertEndChild(pDocument[data.cameraId]->NewText(data.AcquisitionSpeed.c_str())); + AcquisitionSpeed->InsertEndChild(pDocument[data.cameraId]->NewText(data.AcquisitionSpeed.toStdString().c_str())); speed->InsertEndChild(AcquisitionSpeed); // 各相机检测速度 XMLElement* DetectSpeed = pDocument[data.cameraId]->NewElement("DetectSpeed"); - DetectSpeed->InsertEndChild(pDocument[data.cameraId]->NewText(data.DetectSpeed.c_str())); + DetectSpeed->InsertEndChild(pDocument[data.cameraId]->NewText(data.DetectSpeed.toStdString().c_str())); speed->InsertEndChild(DetectSpeed); CameraNode->InsertEndChild(speed); @@ -259,7 +263,8 @@ void ExportDataThread::run() //export_Data_Info_queue->take(element); _XMLExportDataInfo element; export_XMLData_Info_queue->take(element); - if (element.cameraId != -1) { + + if (element.cameraId != -1 && flag == 1) { char buf[256]; memset(buf, 0, 256); QString xmlPath = QString(EXPORTDATA_FILE).arg(element.cameraId); @@ -275,13 +280,13 @@ void ExportDataThread::run() /* 设置通讯协议 */ url.setScheme("ftp"); /* 设置用户名 */ - url.setUserName("xxx"); + url.setUserName("FTP2"); /* 设置密码 */ - url.setPassword("xxxxxx"); + url.setPassword("123"); /* 设置主机,也可以是域名 */ - url.setHost("127.0.0.1"); + url.setHost("192.168.1.170"); /* 设置端口号,一般为21 */ - url.setPort(21); + url.setPort(666); /* 设置路径 */ url.setPath("/tmp/" + xmlPath); @@ -335,4 +340,8 @@ void ExportDataThread::check_save_dir(std::string dir_path) } vec_save_dirs.push_back(dir_path); } +} + +void ExportDataThread::EDrecMsgFromCigarette(){ + flag = true; } \ No newline at end of file diff --git a/Cigarette/exportData.h b/Cigarette/exportData.h index 9dee399..5c484a8 100644 --- a/Cigarette/exportData.h +++ b/Cigarette/exportData.h @@ -18,20 +18,20 @@ using namespace tinyxml2; class _XMLExportDataInfo { public: // 总的统计数据 + long long cameraTotal; int TotalCheckNum; // 总检测数量 int TotalKickNum; // 总剔除数量 double PassRate; // 合格率 double KickRate; // 剔除率 // 各相机数据 - long long cameraTotal; int cameraId; int shotCounts; // 拍摄张数 - int okNum[NumberOfSupportedCameras]; // 各相机ok数量 - int ngNum[NumberOfSupportedCameras]; // 各相机ng数量 - int kickNum[NumberOfSupportedCameras]; // 各相机实际剔除数量(单通道剔除时为总剔除数量) - string AcquisitionSpeed; // 各相机采集速度 - int jdNum[20]; // 各相机胶点识别个数 - string DetectSpeed; // 各相机检测速度(识别时间) + int okNum; // 各相机ok数量 + int ngNum; // 各相机ng数量 + int kickNum; // 各相机实际剔除数量(单通道剔除时为总剔除数量) + QString AcquisitionSpeed; // 各相机采集速度 + QString jdNum; // 各相机胶点识别个数 + QString DetectSpeed; // 各相机检测速度(识别时间) _XMLExportDataInfo() { // 总的统计数据 @@ -40,17 +40,14 @@ public: PassRate = 0.0; // 合格率 KickRate = 0.0; // 剔除率 cameraId = -1; - shotCounts = 0; + jdNum = QString("0,0,0"); // 各相机数据 - for (int i = 0; i < NumberOfSupportedCameras; i++) { - okNum[i] = 0; - ngNum[i] = 0; - kickNum[i] = 0; // 各相机实际剔除数量(单通道剔除时为总剔除数量) - } - - AcquisitionSpeed = "0ms"; // 各相机采集速度 - for (int i = 0; i < 20; i++) jdNum[i] = 0; // 各相机胶点识别个数 - DetectSpeed = "0ms"; // 各相机检测速度 + shotCounts = 0; + okNum = 0; + ngNum = 0; + kickNum = 0; // 各相机实际剔除数量(单通道剔除时为总剔除数量) + AcquisitionSpeed = "0"; // 各相机采集速度 + DetectSpeed = "0"; // 各相机检测速度 } }; @@ -117,7 +114,7 @@ public: void init(); void start_work(); void stop(); - int insertXMLNode(const char* xmlPath, _ExportDataInfo& data); + //int insertXMLNode(const char* xmlPath, _ExportDataInfo& data); int insertXMLNode(const char* xmlPath, _XMLExportDataInfo& data); protected: void run(); @@ -126,4 +123,8 @@ public: bool b_quit; std::vector vec_save_dirs; tinyxml2::XMLDocument *pDocument[NumberOfSupportedCameras]; + int flag; + +public slots: + void EDrecMsgFromCigarette(); }; diff --git a/Cigarette/workthread.cpp b/Cigarette/workthread.cpp index 62fa631..579456c 100644 --- a/Cigarette/workthread.cpp +++ b/Cigarette/workthread.cpp @@ -18,9 +18,8 @@ extern bool isNeedRotate[NumberOfSupportedCameras]; extern SyncQueue >* g_save_queue; //图片保存队列 extern SyncQueue >* g_image_queue[NumberOfSupportedCameras]; //int表示一个目标拍了几张 -extern SyncQueue<_UDPSendInfo> *UDP_Info_queue; +extern SyncQueue<_UDPSendInfo>* UDP_Info_queue; //extern SyncQueue<_ExportDataInfo>* export_Data_Info_queue; -extern SyncQueue<_XMLExportDataInfo>* export_XMLData_Info_queue; extern PLCDevice* m_PLCDevice; extern bool g_debug_mode; @@ -88,10 +87,6 @@ void WorkThread::run() //_ExportDataInfo exportDataInfo; //exportDataInfo.cameraId = local_camera_number; - _XMLExportDataInfo exportXMLDataInfo; - exportXMLDataInfo.cameraTotal = NumberOfSupportedCameras; - exportXMLDataInfo.cameraId = local_camera_number; - exportXMLDataInfo.shotCounts = unit_count; if (!image.data) { @@ -107,12 +102,11 @@ void WorkThread::run() std::vector vec_in; int w = image.cols; int h = image.rows / unit_count; - for(int index=0;index 0; - exportXMLDataInfo.jdNum[index] = vec_results[index].size(); } jd_no.chop(1); emit display_jd_no(local_camera_number, jd_no); @@ -289,10 +280,6 @@ void WorkThread::run() } #ifdef __UDPSend UDP_Info_queue->put(UDPSendInfo); -#endif -#ifdef __ExportData - //export_Data_Info_queue->put(exportDataInfo); - export_XMLData_Info_queue->put(exportXMLDataInfo); #endif } }