update
This commit is contained in:
@@ -187,6 +187,7 @@ void Logic_myiothread::run()
|
||||
// 一个信号取多张的情况,取图时间长,和通信线程分开。
|
||||
m_runAndCheck_cameraThread->start();
|
||||
int times = 0;
|
||||
heart_start = clock();
|
||||
while ( io_runflag )
|
||||
{
|
||||
//心跳(定时向PLC的指定寄存器写入值)代码。
|
||||
@@ -194,92 +195,65 @@ void Logic_myiothread::run()
|
||||
{
|
||||
//break;
|
||||
//times++;
|
||||
Sleep(10);
|
||||
qApp->processEvents();
|
||||
if ((m_heartTime / 10) <= times++)
|
||||
|
||||
QStringList m_heartCmdList = m_heartCmd.split("#");
|
||||
for (int m = 0; m < m_heartCmdList.size(); m++)
|
||||
{
|
||||
if (!m_heartCmd.isEmpty())
|
||||
{// 发送心跳
|
||||
////QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byteArray = m_heartCmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byteArray))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
times = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rest_signal.isEmpty())
|
||||
Sleep(10);
|
||||
qApp->processEvents();
|
||||
heart_stop = clock();
|
||||
//if ((m_heartTime / 10) <= times++)
|
||||
if (heart_stop - heart_start >= m_heartTime)
|
||||
{
|
||||
if (times % int(m_heartTime / 50 + 1) == 0)
|
||||
{
|
||||
// 修改读取多个命令
|
||||
//QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byteArray = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byteArray))
|
||||
heart_start = clock();
|
||||
if (!m_heartCmdList[m].isEmpty())
|
||||
{// 发送心跳
|
||||
////QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byte = m_heartCmdList[m].toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
|
||||
// 读取到的信息解析
|
||||
QByteArray readByte;
|
||||
if (!finstcp_ptr->readData(vec_mat, readByte))
|
||||
times = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rest_signal.isEmpty())
|
||||
{
|
||||
if (times % int(m_heartTime / 50 + 1) == 0)
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr sendData error!";
|
||||
}
|
||||
|
||||
if (readByte.isEmpty())
|
||||
return;
|
||||
QByteArray readsnByte = readByte;
|
||||
QVector<int> vec_value;
|
||||
while (!readByte.isEmpty())
|
||||
{
|
||||
QByteArray retByte = readByte.mid(0, 2);
|
||||
readByte.remove(0, 2);
|
||||
|
||||
QString msg = retByte.toHex();
|
||||
int number_tmp = msg.toInt(NULL, 16);
|
||||
vec_value.push_back(number_tmp);
|
||||
}
|
||||
|
||||
QString m_startpos = rest_signal.split("_")[0];
|
||||
QString m_value = rest_signal.split("_")[1];
|
||||
int trigger_index = m_startpos.mid(1, m_startpos.length() - 1).toInt();
|
||||
trigger_index -= trigger_startpos;
|
||||
if (trigger_index < 0)
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " vec_value is error! read_sn_startpos:" << m_startpos;
|
||||
}
|
||||
else if (vec_value.size() > trigger_index)
|
||||
{
|
||||
//读复位标志满足
|
||||
if (vec_value.at(trigger_index) == m_value.toInt())
|
||||
// 修改读取多个命令
|
||||
//QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byte = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " 复位信号:" << rest_signal;
|
||||
foreach(QString m_station_name, station_list.keys())
|
||||
for (int i = 0; i < station_list.value(m_station_name)->sndata_list.size(); i++)
|
||||
{
|
||||
QStringList cameraList;
|
||||
cameraList.append("all");
|
||||
for (int i = 0; i < 10; i++)
|
||||
station_list.value(m_station_name)->clearData("all", cameraList);
|
||||
}
|
||||
//完成清标志
|
||||
QByteArray send_byte = rest_signal_back.toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, send_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
}
|
||||
//程序号;传到到主界面类,再进行切换
|
||||
if (!program_Num.isEmpty())
|
||||
{
|
||||
QString m_startpos = program_Num;// .split("_")[0];
|
||||
//QString m_value = program_Num.split("_")[1];
|
||||
|
||||
// 读取到的信息解析
|
||||
QByteArray readByte;
|
||||
if (!finstcp_ptr->readData(vec_mat, readByte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr sendData error!";
|
||||
}
|
||||
|
||||
if (readByte.isEmpty())
|
||||
return;
|
||||
QByteArray readsnByte = readByte;
|
||||
QVector<int> vec_value;
|
||||
while (!readByte.isEmpty())
|
||||
{
|
||||
QByteArray retByte = readByte.mid(0, 2);
|
||||
readByte.remove(0, 2);
|
||||
|
||||
QString msg = retByte.toHex();
|
||||
int number_tmp = msg.toInt(NULL, 16);
|
||||
vec_value.push_back(number_tmp);
|
||||
}
|
||||
|
||||
QString m_startpos = rest_signal.split("_")[0];
|
||||
QString m_value = rest_signal.split("_")[1];
|
||||
int trigger_index = m_startpos.mid(1, m_startpos.length() - 1).toInt();
|
||||
trigger_index -= trigger_startpos;
|
||||
if (trigger_index < 0)
|
||||
@@ -289,20 +263,19 @@ void Logic_myiothread::run()
|
||||
else if (vec_value.size() > trigger_index)
|
||||
{
|
||||
//读复位标志满足
|
||||
if (vec_value.at(trigger_index) !=0)
|
||||
if (vec_value.at(trigger_index) == m_value.toInt())
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " 程序号:" << vec_value.at(trigger_index);
|
||||
|
||||
dataPack m_data;
|
||||
m_data.algorithmName = "程序号";
|
||||
m_data.cameraName = m_startpos;
|
||||
m_data.byteArray = QByteArray::number(vec_value.at(trigger_index));
|
||||
m_data.retFlag = "algorithm";
|
||||
|
||||
QMutexLocker locker(sendProcess_mutex);
|
||||
sendProcessTask.enqueue(m_data);
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " 复位信号:" << rest_signal;
|
||||
foreach(QString m_station_name, station_list.keys())
|
||||
for (int i = 0; i < station_list.value(m_station_name)->sndata_list.size(); i++)
|
||||
{
|
||||
QStringList cameraList;
|
||||
cameraList.append("all");
|
||||
for (int i = 0; i < 10; i++)
|
||||
station_list.value(m_station_name)->clearData("all", cameraList);
|
||||
}
|
||||
//完成清标志
|
||||
QByteArray send_byte = program_Num_back.toUtf8();
|
||||
QByteArray send_byte = rest_signal_back.toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, send_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
@@ -310,10 +283,47 @@ void Logic_myiothread::run()
|
||||
}
|
||||
}
|
||||
}
|
||||
//程序号;传到到主界面类,再进行切换
|
||||
if (!program_Num.isEmpty())
|
||||
{
|
||||
QString m_startpos = program_Num;// .split("_")[0];
|
||||
//QString m_value = program_Num.split("_")[1];
|
||||
int trigger_index = m_startpos.mid(1, m_startpos.length() - 1).toInt();
|
||||
trigger_index -= trigger_startpos;
|
||||
if (trigger_index < 0)
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " vec_value is error! read_sn_startpos:" << m_startpos;
|
||||
}
|
||||
else if (vec_value.size() > trigger_index)
|
||||
{
|
||||
//读复位标志满足
|
||||
if (vec_value.at(trigger_index) != 0)
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " 程序号:" << vec_value.at(trigger_index);
|
||||
|
||||
dataPack m_data;
|
||||
m_data.algorithmName = "程序号";
|
||||
m_data.cameraName = m_startpos;
|
||||
m_data.byteArray = QByteArray::number(vec_value.at(trigger_index));
|
||||
m_data.retFlag = "algorithm";
|
||||
|
||||
QMutexLocker locker(sendProcess_mutex);
|
||||
sendProcessTask.enqueue(m_data);
|
||||
//完成清标志
|
||||
QByteArray send_byte = program_Num_back.toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, send_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 写入
|
||||
writeCommond();
|
||||
@@ -362,8 +372,8 @@ void Logic_myiothread::reciveCommond()
|
||||
// 修改读取多个命令
|
||||
//QMutexLocker locker ( m_iomutex );
|
||||
m_iomutex->lock();
|
||||
QByteArray byteArray = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if ( !finstcp_ptr->writeData(vec_mat,byteArray) )
|
||||
QByteArray byte = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if ( !finstcp_ptr->writeData(vec_mat,byte) )
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:"<< __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
@@ -378,7 +388,7 @@ void Logic_myiothread::reciveCommond()
|
||||
stop = clock();
|
||||
double ctime = stop - start;
|
||||
//if (ctime > 500)
|
||||
// qCritical() << __FUNCTION__ << __LINE__ << "readAll_cmd ctime :" << ctime;//;127ms
|
||||
//qCritical() << __FUNCTION__ << __LINE__ << "readAll_cmd ctime :" << ctime<<" m_stationName:"<<m_stationName;//;127ms
|
||||
|
||||
// tmpDate = QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss-zzz");
|
||||
//qDebug() << __FUNCTION__ << " line: " << __LINE__ << " readAll_cmd done: " << readAll_cmd << " " << tmpDate;
|
||||
@@ -387,17 +397,17 @@ void Logic_myiothread::reciveCommond()
|
||||
}
|
||||
|
||||
// 读取多个命令信息的解析
|
||||
void Logic_myiothread::decodeCameraCMD(QByteArray byteArray)
|
||||
void Logic_myiothread::decodeCameraCMD(QByteArray byte)
|
||||
{
|
||||
if (byteArray.isEmpty())
|
||||
if (byte.isEmpty())
|
||||
return;
|
||||
|
||||
readsnByte = byteArray;
|
||||
readsnByte = byte;
|
||||
vec_value.clear();
|
||||
while ( !byteArray.isEmpty() )
|
||||
while ( !byte.isEmpty() )
|
||||
{
|
||||
QByteArray retByte = byteArray.mid(0,2);
|
||||
byteArray.remove(0,2);
|
||||
QByteArray retByte = byte.mid(0,2);
|
||||
byte.remove(0,2);
|
||||
|
||||
QString msg = retByte.toHex();
|
||||
int number_tmp = msg.toInt(NULL,16);
|
||||
@@ -426,7 +436,7 @@ void Logic_myiothread::decodeCameraCMD(QByteArray byteArray)
|
||||
//SN逻辑
|
||||
// "读SN信号"满足时,代表新料来了,安装"清理容器数据"-"相机列表"及"通道序号"清理对应的容器;
|
||||
//SN保存到容器HSnData;下料的SN,根据"汇总-触发信号"、"汇总-读哪个SN"匹配Logic_hdataintegration,并保存SN到变量;
|
||||
void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byte)
|
||||
{
|
||||
QStringList keys = map_sn_area_array.keys();
|
||||
//重新加载用
|
||||
@@ -497,19 +507,19 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
// sn码防重入检查
|
||||
QVector<bool> m_vec_sn_flag = map_read_sn_reentry_vector_flag.value(station_name);
|
||||
|
||||
if (m_vec_sn_flag.at(channel_index)) // false 添加sn码 true 已经添加过sn,不再重复添加
|
||||
{
|
||||
// 清理当前sn码的触发信号
|
||||
QString m_signal = "write_short_" + m_startpos + "_0";
|
||||
QByteArray m_byte = m_signal.toUtf8();
|
||||
QMutexLocker locker(m_iomutex);
|
||||
if (!finstcp_ptr->writeData(vec_mat, m_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
//if (m_vec_sn_flag.at(channel_index)) // false 添加sn码 true 已经添加过sn,不再重复添加
|
||||
//{
|
||||
// // 清理当前sn码的触发信号
|
||||
// QString m_signal = "write_short_" + m_startpos + "_0";
|
||||
// QByteArray m_byte = m_signal.toUtf8();
|
||||
// //QMutexLocker locker(m_iomutex);;
|
||||
// if (!finstcp_ptr->writeData(vec_mat, m_byte))
|
||||
// {
|
||||
// qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
// return;
|
||||
// }
|
||||
// continue;
|
||||
//}
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " m_vec_sn_flag:" << m_vec_sn_flag.at(channel_index);
|
||||
|
||||
|
||||
@@ -566,7 +576,7 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
for (int aaa = 0; aaa < read_datatime_list.size(); aaa++)
|
||||
{
|
||||
//SN为""时,返回配置文件的read_sn_error_send_format值
|
||||
QString datatime = getSn(read_sn_error_send_format, read_datatime_list[aaa].toString(), byteArray);
|
||||
QString datatime = getSn(read_sn_error_send_format, read_datatime_list[aaa].toString(), byte);
|
||||
qDebug() << __FUNCTION__ << " line: " << __LINE__ << " channel_index: " << channel_index << " read_datatime_list: " << datatime;
|
||||
//sn_value = snHex(sn_value); // sn方向相反,重新做转换
|
||||
|
||||
@@ -638,7 +648,7 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
for (int aaa = 0; aaa < read_sn_list.size(); aaa++)
|
||||
{
|
||||
//SN为""时,返回配置文件的read_sn_error_send_format值
|
||||
QString sn_value = getSn(read_sn_error_send_format, read_sn_list[aaa].toString(), byteArray);
|
||||
QString sn_value = getSn(read_sn_error_send_format, read_sn_list[aaa].toString(), byte);
|
||||
qDebug() << __FUNCTION__ << " line: " << __LINE__ << " channel_index: " << channel_index << " sn_value: " << sn_value;
|
||||
//sn_value = snHex(sn_value); // sn方向相反,重新做转换
|
||||
//异常
|
||||
@@ -668,35 +678,72 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
|
||||
|
||||
|
||||
// 清理当前区域数据
|
||||
QString clear_SN = obj.value("读SN后-清0").toString();
|
||||
if (!clear_SN.isEmpty())
|
||||
//// 清理当前区域数据
|
||||
//QString clear_SN = obj.value("读SN后-清0").toString();
|
||||
//if (!clear_SN.isEmpty())
|
||||
//{
|
||||
// QStringList mycmdHead = clear_SN.split("_");
|
||||
// for (int aaa = 0; aaa < read_sn_list.size(); aaa++)
|
||||
// {
|
||||
// QString sn_area = read_sn_list.at(aaa).toString();
|
||||
// QString start_pos = sn_area.split("_")[0];
|
||||
// int lenght = sn_area.split("_")[1].toInt();
|
||||
// QString m_signal = nullptr;
|
||||
// //SN清空
|
||||
// for (auto yyy = 0; yyy < (lenght+1)/2; yyy++)
|
||||
// {
|
||||
// m_signal += mycmdHead[2];
|
||||
// if (yyy != ((lenght + 1) / 2 - 1))
|
||||
// m_signal += ",";
|
||||
// }
|
||||
// m_signal = mycmdHead[0] + "_" + mycmdHead[1] + "_" + start_pos + "_" + m_signal;// QString("write_short_%1_%2").arg(start_pos).arg(m_signal);
|
||||
// QByteArray m_byte = m_signal.toUtf8();
|
||||
// //QMutexLocker locker(m_iomutex);;
|
||||
// if (!finstcp_ptr->writeData(vec_mat, m_byte))
|
||||
// {
|
||||
// qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
if (ifReadSnErr == true)
|
||||
{
|
||||
QStringList mycmdHead = clear_SN.split("_");
|
||||
for (int aaa = 0; aaa < read_sn_list.size(); aaa++)
|
||||
QStringList snOKCmdList = obj.value("读SN异常-回复指令").toString().split("#");
|
||||
if (!snOKCmdList.isEmpty())
|
||||
{
|
||||
QString sn_area = read_sn_list.at(aaa).toString();
|
||||
QString start_pos = sn_area.split("_")[0];
|
||||
int lenght = sn_area.split("_")[1].toInt();
|
||||
QString m_signal = nullptr;
|
||||
//SN清空
|
||||
for (auto yyy = 0; yyy < (lenght+1)/2; yyy++)
|
||||
for (int s = 0; s < snOKCmdList.size(); s++)
|
||||
{
|
||||
m_signal += mycmdHead[2];
|
||||
if (yyy != ((lenght + 1) / 2 - 1))
|
||||
m_signal += ",";
|
||||
}
|
||||
m_signal = mycmdHead[0] + "_" + mycmdHead[1] + "_" + start_pos + "_" + m_signal;// QString("write_short_%1_%2").arg(start_pos).arg(m_signal);
|
||||
QByteArray m_byte = m_signal.toUtf8();
|
||||
QMutexLocker locker(m_iomutex);
|
||||
if (!finstcp_ptr->writeData(vec_mat, m_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
//snOKCmd = CmdHeadShort + snOKCmd;
|
||||
QByteArray ok_byte = snOKCmdList[s].toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, ok_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
QStringList snOKCmdList = obj.value("读SN正常-回复指令").toString().split("#");
|
||||
if (!snOKCmdList.isEmpty())
|
||||
{
|
||||
for (int s = 0; s < snOKCmdList.size(); s++)
|
||||
{
|
||||
//snOKCmd = CmdHeadShort + snOKCmd;
|
||||
QByteArray ok_byte = snOKCmdList[s].toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, ok_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 清理当前sn码的触发信号
|
||||
QString m_signal = "write_short_" + m_startpos + "_0";
|
||||
QByteArray m_byte = m_signal.toUtf8();
|
||||
@@ -706,38 +753,6 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ifReadSnErr == true)
|
||||
{
|
||||
QString snErrCmd = obj.value("读SN异常-回复指令").toString();
|
||||
if (!snErrCmd.isEmpty())
|
||||
{
|
||||
//snErrCmd = CmdHeadShort + snErrCmd;
|
||||
QByteArray ok_byte = snErrCmd.toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, ok_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// snOKCmd
|
||||
QString snOKCmd = obj.value("读SN正常-回复指令").toString();
|
||||
if (!snOKCmd.isEmpty())
|
||||
{
|
||||
//snOKCmd = CmdHeadShort + snOKCmd;
|
||||
QByteArray ok_byte = snOKCmd.toUtf8();
|
||||
if (!finstcp_ptr->writeData(vec_mat, ok_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( vec_value.at(trigger_index) == 0 ){ //读到PLC标志为0时
|
||||
// 更改防重入标识符
|
||||
@@ -873,7 +888,7 @@ QString Logic_myiothread::snHex(QString sn)
|
||||
return resultStr;
|
||||
}
|
||||
//SN为""时,返回配置文件的"读SN异常-插值"
|
||||
QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byteArray)
|
||||
QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byte)
|
||||
{
|
||||
QString m_startpos = area.split("_")[0];
|
||||
QString lenght = area.split("_")[1];
|
||||
@@ -881,7 +896,7 @@ QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byteAr
|
||||
int start_index = m_startpos.mid(1,m_startpos.length()-1).toInt();
|
||||
start_index -= trigger_startpos;
|
||||
|
||||
QByteArray snByte = byteArray.mid(start_index*2,lenght.toInt());
|
||||
QByteArray snByte = byte.mid(start_index*2,lenght.toInt());
|
||||
QString sn = snByte;
|
||||
|
||||
if ( sn.contains("\n\r") )
|
||||
@@ -1082,14 +1097,14 @@ void Logic_myiothread::checkTriggerCamera(QVector<int> vec_value)
|
||||
QStringList myCmdHead = m_pack.clear_camera_startpos_flag.split("_");
|
||||
clear_signal = myCmdHead[0]+"_"+ myCmdHead[1] +"_" + clear_signal + +"_" + myCmdHead[2];
|
||||
QByteArray m_byte = clear_signal.toUtf8();
|
||||
QMutexLocker locker(m_iomutex);
|
||||
if ( !finstcp_ptr->writeData(vec_mat,m_byte) )
|
||||
////QMutexLocker locker(m_iomutex);;
|
||||
/*if ( !finstcp_ptr->writeData(vec_mat,m_byte) )
|
||||
{
|
||||
qCritical() << __FUNCTION__ << " line:"<< __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if ( vec_value.at(trigger_index) == m_value.toInt() && m_pack.trigger_reentry_signal == 0 )
|
||||
if ( vec_value.at(trigger_index) == m_value.toInt() )//&& m_pack.trigger_reentry_signal == 0 )
|
||||
{
|
||||
qDebug() << __FUNCTION__ << " line:" << __LINE__ << "trigger_signal: " << trigger_signal;
|
||||
|
||||
@@ -1189,7 +1204,7 @@ void Logic_myiothread::checkTriggerAlgorithm(QVector<int> vec_value)
|
||||
}
|
||||
}
|
||||
if (vec_value.at(trigger_index) == m_value.toInt() )
|
||||
if(m_pack.trigger_reentry_signal == 0)
|
||||
//if(m_pack.trigger_reentry_signal == 0)
|
||||
{
|
||||
qDebug() << __FUNCTION__ << " line:" << __LINE__ << "trigger_signal: " << trigger_signal;
|
||||
|
||||
@@ -1258,8 +1273,8 @@ void Logic_myiothread::checkTriggerAlgorithm(QVector<int> vec_value)
|
||||
//}
|
||||
|
||||
}
|
||||
else
|
||||
qDebug() << __FUNCTION__ << " line:" << __LINE__ << "trigger_signal: " << trigger_signal << " m_pack.trigger_reentry_signal != 0";
|
||||
//else
|
||||
// qDebug() << __FUNCTION__ << " line:" << __LINE__ << "trigger_signal: " << trigger_signal << " m_pack.trigger_reentry_signal != 0";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1741,7 +1756,7 @@ QByteArray runAndCheck_cameraThread::checkCamerasFinish_feedbackSignal(trigger_s
|
||||
QByteArray send_byte = send_msg.toUtf8();
|
||||
return send_byte;
|
||||
|
||||
/*QMutexLocker locker(m_iomutex);
|
||||
/*//QMutexLocker locker(m_iomutex);;
|
||||
if (!finstcp_ptr->writeData(vec_mat, send_byte))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error! ";
|
||||
|
||||
Reference in New Issue
Block a user