|
|
@ -1597,7 +1597,7 @@ void Cigarette::handleTimeout()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
qint64 secA = time.secsTo(g_sys_conf.shiftA);
|
|
|
|
qint64 secA = time.secsTo(g_sys_conf.shiftA);
|
|
|
|
qint64 secB = time.secsTo(g_sys_conf.shiftB);
|
|
|
|
qint64 secB = time.secsTo(g_sys_conf.shiftB);
|
|
|
|
qint64 secC = time.secsTo(g_sys_conf.shiftC);
|
|
|
|
qint64 secC = time.secsTo(g_sys_conf.shiftC);
|
|
|
|
if (secA == 0)
|
|
|
|
if (secA == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_op_mode = true; //激活操作员模式
|
|
|
|
g_op_mode = true; //激活操作员模式
|
|
|
@ -1912,7 +1912,7 @@ void Cigarette::on_pushButton_clear_released()//
|
|
|
|
if (g_modbus_conf.quantity > 0)
|
|
|
|
if (g_modbus_conf.quantity > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint16_t dest16[2];
|
|
|
|
uint16_t dest16[2];
|
|
|
|
int ret = m_PLCDevice->read_short_from_plc( g_modbus_conf.quantity, 2, dest16);
|
|
|
|
int ret = m_PLCDevice->read_short_from_plc(g_modbus_conf.quantity, 2, dest16);
|
|
|
|
//std::cout << ret << std::endl;
|
|
|
|
//std::cout << ret << std::endl;
|
|
|
|
if (ret > 0)
|
|
|
|
if (ret > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -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,24 +3355,26 @@ 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];
|
|
|
|
std::string manufacture = pDev->manufacturer.read();
|
|
|
|
if (!pDev->isInUse()) {
|
|
|
|
if(showinfo)std::cout << "Camera:" << i << ",vendor = " << manufacture << std::endl;
|
|
|
|
std::string manufacture = pDev->manufacturer.read();
|
|
|
|
transform(manufacture.begin(), manufacture.end(), manufacture.begin(), ::toupper);
|
|
|
|
if (showinfo)std::cout << "Camera:" << i << ",vendor = " << manufacture << std::endl;
|
|
|
|
SingleCamInfoStruct CamInfo;
|
|
|
|
transform(manufacture.begin(), manufacture.end(), manufacture.begin(), ::toupper);
|
|
|
|
if ((!manufacture.compare(0, 7, "BALLUFF"))||(!manufacture.compare(0, 13, "MATRIX VISION")))
|
|
|
|
SingleCamInfoStruct CamInfo;
|
|
|
|
{
|
|
|
|
if ((!manufacture.compare(0, 7, "BALLUFF")) || (!manufacture.compare(0, 13, "MATRIX VISION")))
|
|
|
|
mvIMPACT::acquire::GenICam::DeviceControl dc(pDev);
|
|
|
|
{
|
|
|
|
std::string UserID = dc.deviceUserID.read();
|
|
|
|
mvIMPACT::acquire::GenICam::DeviceControl dc(pDev);
|
|
|
|
pDev->close();
|
|
|
|
std::string UserID = dc.deviceUserID.read();
|
|
|
|
if(showinfo)std::cout << "Balluff user ID = " << UserID << std::endl;
|
|
|
|
pDev->close();
|
|
|
|
CamInfo.UserID = atoi(UserID.c_str());
|
|
|
|
if (showinfo)std::cout << "Balluff user ID = " << UserID << std::endl;
|
|
|
|
CamInfo.CamClass = BalluffClassID;
|
|
|
|
CamInfo.UserID = atoi(UserID.c_str());
|
|
|
|
CamInfo.unfiltered_num = i;
|
|
|
|
CamInfo.CamClass = BalluffClassID;
|
|
|
|
CamInfo.Detect = false;
|
|
|
|
CamInfo.unfiltered_num = i;
|
|
|
|
CamInfo.IsOpen = false;
|
|
|
|
CamInfo.Detect = false;
|
|
|
|
CamInfo.OffLine = false;
|
|
|
|
CamInfo.IsOpen = false;
|
|
|
|
TempSingleCamInfo.push_back(CamInfo);
|
|
|
|
CamInfo.OffLine = false;
|
|
|
|
balluff_cnt++;
|
|
|
|
TempSingleCamInfo.push_back(CamInfo);
|
|
|
|
|
|
|
|
balluff_cnt++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -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);
|
|
|
|