修改巴鲁夫部分代码、删除产量统计部分代码等

main
seiyu 1 year ago
parent 39f080cdca
commit 215acc558b

@ -1972,7 +1972,6 @@ void Cigarette::on_pushButton_clear_released()//
} }
//flag = false; //flag = false;
#endif #endif
//·¢ËÍ»»°àÏûÏ¢¸øPLC //·¢ËÍ»»°àÏûÏ¢¸øPLC
if (g_modbus_conf.shift > 0) if (g_modbus_conf.shift > 0)
{ {
@ -3356,6 +3355,7 @@ void Cigarette::EnumerateCameras(SingleCamInfoStruct *TempSingleCamInfoStruct,bo
for (int i = 0; i < min(unfiltered, NumberOfSupportedCameras); i++) for (int i = 0; i < min(unfiltered, NumberOfSupportedCameras); i++)
{ {
Device* pDev = BalluffCamera::devMgr[i]; Device* pDev = BalluffCamera::devMgr[i];
if (!pDev->isInUse()) {
std::string manufacture = pDev->manufacturer.read(); std::string manufacture = pDev->manufacturer.read();
if (showinfo)std::cout << "Camera:" << i << ",vendor = " << manufacture << std::endl; if (showinfo)std::cout << "Camera:" << i << ",vendor = " << manufacture << std::endl;
transform(manufacture.begin(), manufacture.end(), manufacture.begin(), ::toupper); transform(manufacture.begin(), manufacture.end(), manufacture.begin(), ::toupper);
@ -3376,6 +3376,7 @@ void Cigarette::EnumerateCameras(SingleCamInfoStruct *TempSingleCamInfoStruct,bo
balluff_cnt++; balluff_cnt++;
} }
} }
}
if (showinfo) { if (showinfo) {
std::cout << "Camera Count:\t" << TempSingleCamInfo.size() << std::endl; std::cout << "Camera Count:\t" << TempSingleCamInfo.size() << std::endl;
@ -3555,9 +3556,10 @@ void Cigarette::record_output_statistic(qint64 quantity, int Kick[NumberOfSuppor
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "\n\n**************************************************************************************\n"); sprintf(buf, "\n\n**************************************************************************************\n");
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
QDate date = QDate::currentDate(); //QDate date = QDate::currentDate();
QDateTime date = QDateTime::currentDateTime();
memset(buf, 0, 256); memset(buf, 0, 256);
sprintf(buf, "%s:\n", date.toString("yyyy-MM-dd ").toStdString().c_str()); sprintf(buf, "%s:\n", date.toString("yyyy-MM-dd_HH-mm-ss").toStdString().c_str());
cfg_file.write(buf, strlen(buf)); cfg_file.write(buf, strlen(buf));
} }
memset(buf, 0, 256); memset(buf, 0, 256);

@ -190,14 +190,14 @@ int ExportDataThread::insertXMLNode(const char* xmlPath, _XMLExportDataInfo& dat
// ºÏ¸ñÂÊ // ºÏ¸ñÂÊ
XMLElement* PassRate = pDocument[data.cameraId]->NewElement("PassRate"); XMLElement* PassRate = pDocument[data.cameraId]->NewElement("PassRate");
std::string temp_str = std::to_string(data.PassRate * 100); std::string temp_str = std::to_string(data.PassRate * 100 ) + "%";
const char* temp_char = temp_str.c_str(); const char* temp_char = temp_str.c_str();
PassRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char)); PassRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char));
JudgeNum->InsertEndChild(PassRate); JudgeNum->InsertEndChild(PassRate);
// ÌÞ³ýÂÊ // ÌÞ³ýÂÊ
XMLElement* KickRate = pDocument[data.cameraId]->NewElement("KickRate"); XMLElement* KickRate = pDocument[data.cameraId]->NewElement("KickRate");
temp_str = std::to_string(data.KickRate * 100); temp_str = std::to_string(data.KickRate * 100) + "%";
temp_char = temp_str.c_str(); temp_char = temp_str.c_str();
KickRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char)); KickRate->InsertEndChild(pDocument[data.cameraId]->NewText(temp_char));
JudgeNum->InsertEndChild(KickRate); JudgeNum->InsertEndChild(KickRate);

@ -47,36 +47,6 @@ output_statistic::~output_statistic()
void output_statistic::recMsgFromDialogSetup() void output_statistic::recMsgFromDialogSetup()
{ {
#ifdef __ExportData
_ExportDataInfo data;
map<string, float> averageData[NumberOfSupportedCameras];
ui.tabWidget->setTabVisible(1, false);
ui.tabWidget->setTabVisible(2, false);
ui.tabWidget->setTabVisible(3, false);
ui.tabWidget->setTabVisible(4, false);
ui.tabWidget->setTabVisible(5, false);
ui.tabWidget->setTabVisible(6, false);
ui.tabWidget->setTabVisible(7, false);
ui.tabWidget->setTabText(0, "Statistical data");
for (int index = 0; index < NumberOfSupportedCameras; index++) {
data.getAverageData(averageData[index], index);
QString text;
text.append(" CameraId: ");
text.append(std::to_string((int)averageData[index]["CameraId"]).c_str());
text.append("\n IsNG: ");
text.append(std::to_string((int)averageData[index]["IsNG"]).c_str());
text.append("\n IsJdExist: ");
text.append(std::to_string((int)averageData[index]["IsJdExist"]).c_str());
text.append("\n TimeCost: ");
text.append(std::to_string(averageData[index]["TimeCost"]).c_str());
text.append("\n*************************************************\n");
ui.textBrowser_1->insertPlainText(text);
}
#else
QString file_path, file_name; QString file_path, file_name;
QFile file; QFile file;
for (int i = 0; i < NumberOfSupportedCameras; i++) { for (int i = 0; i < NumberOfSupportedCameras; i++) {
@ -95,6 +65,5 @@ void output_statistic::recMsgFromDialogSetup()
file.close(); file.close();
this->show(); this->show();
} }
#endif
//this->show(); //this->show();
} }
Loading…
Cancel
Save