升级到c++11,在存图文件夹不存在时自动创建,修复大量以byte为变量名的问题
This commit is contained in:
@@ -201,8 +201,8 @@ void Logic_myiothread::run()
|
||||
if (!m_heartCmd.isEmpty())
|
||||
{// 发送心跳
|
||||
////QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byte = m_heartCmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byte))
|
||||
QByteArray byteArray = m_heartCmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byteArray))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
@@ -217,8 +217,8 @@ void Logic_myiothread::run()
|
||||
{
|
||||
// 修改读取多个命令
|
||||
//QMutexLocker locker(m_iomutex);;
|
||||
QByteArray byte = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byte))
|
||||
QByteArray byteArray = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if (!finstcp_ptr->writeData(vec_mat, byteArray))
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:" << __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void Logic_myiothread::run()
|
||||
dataPack m_data;
|
||||
m_data.algorithmName = "程序号";
|
||||
m_data.cameraName = m_startpos;
|
||||
m_data.byte = QByteArray::number(vec_value.at(trigger_index));
|
||||
m_data.byteArray = QByteArray::number(vec_value.at(trigger_index));
|
||||
m_data.retFlag = "algorithm";
|
||||
|
||||
QMutexLocker locker(sendProcess_mutex);
|
||||
@@ -362,8 +362,8 @@ void Logic_myiothread::reciveCommond()
|
||||
// 修改读取多个命令
|
||||
//QMutexLocker locker ( m_iomutex );
|
||||
m_iomutex->lock();
|
||||
QByteArray byte = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if ( !finstcp_ptr->writeData(vec_mat,byte) )
|
||||
QByteArray byteArray = readAll_cmd.toUtf8(); // 设置 从起始位开始读取的指令
|
||||
if ( !finstcp_ptr->writeData(vec_mat,byteArray) )
|
||||
{
|
||||
qCritical() << __FUNCTION__ << "line:"<< __LINE__ << " finstcp_ptr reciveData error!";
|
||||
}
|
||||
@@ -387,17 +387,17 @@ void Logic_myiothread::reciveCommond()
|
||||
}
|
||||
|
||||
// 读取多个命令信息的解析
|
||||
void Logic_myiothread::decodeCameraCMD(QByteArray byte)
|
||||
void Logic_myiothread::decodeCameraCMD(QByteArray byteArray)
|
||||
{
|
||||
if (byte.isEmpty())
|
||||
if (byteArray.isEmpty())
|
||||
return;
|
||||
|
||||
readsnByte = byte;
|
||||
readsnByte = byteArray;
|
||||
vec_value.clear();
|
||||
while ( !byte.isEmpty() )
|
||||
while ( !byteArray.isEmpty() )
|
||||
{
|
||||
QByteArray retByte = byte.mid(0,2);
|
||||
byte.remove(0,2);
|
||||
QByteArray retByte = byteArray.mid(0,2);
|
||||
byteArray.remove(0,2);
|
||||
|
||||
QString msg = retByte.toHex();
|
||||
int number_tmp = msg.toInt(NULL,16);
|
||||
@@ -426,7 +426,7 @@ void Logic_myiothread::decodeCameraCMD(QByteArray byte)
|
||||
//SN逻辑
|
||||
// "读SN信号"满足时,代表新料来了,安装"清理容器数据"-"相机列表"及"通道序号"清理对应的容器;
|
||||
//SN保存到容器HSnData;下料的SN,根据"汇总-触发信号"、"汇总-读哪个SN"匹配Logic_hdataintegration,并保存SN到变量;
|
||||
void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byte)
|
||||
void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byteArray)
|
||||
{
|
||||
QStringList keys = map_sn_area_array.keys();
|
||||
//重新加载用
|
||||
@@ -566,7 +566,7 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byte)
|
||||
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(), byte);
|
||||
QString datatime = getSn(read_sn_error_send_format, read_datatime_list[aaa].toString(), byteArray);
|
||||
qDebug() << __FUNCTION__ << " line: " << __LINE__ << " channel_index: " << channel_index << " read_datatime_list: " << datatime;
|
||||
//sn_value = snHex(sn_value); // sn方向相反,重新做转换
|
||||
|
||||
@@ -638,7 +638,7 @@ void Logic_myiothread::readSnInfo(QVector<int> vec_value, QByteArray byte)
|
||||
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(), byte);
|
||||
QString sn_value = getSn(read_sn_error_send_format, read_sn_list[aaa].toString(), byteArray);
|
||||
qDebug() << __FUNCTION__ << " line: " << __LINE__ << " channel_index: " << channel_index << " sn_value: " << sn_value;
|
||||
//sn_value = snHex(sn_value); // sn方向相反,重新做转换
|
||||
//异常
|
||||
@@ -873,7 +873,7 @@ QString Logic_myiothread::snHex(QString sn)
|
||||
return resultStr;
|
||||
}
|
||||
//SN为""时,返回配置文件的"读SN异常-插值"
|
||||
QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byte)
|
||||
QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byteArray)
|
||||
{
|
||||
QString m_startpos = area.split("_")[0];
|
||||
QString lenght = area.split("_")[1];
|
||||
@@ -881,7 +881,7 @@ QString Logic_myiothread::getSn(QString errorinfo,QString area,QByteArray byte)
|
||||
int start_index = m_startpos.mid(1,m_startpos.length()-1).toInt();
|
||||
start_index -= trigger_startpos;
|
||||
|
||||
QByteArray snByte = byte.mid(start_index*2,lenght.toInt());
|
||||
QByteArray snByte = byteArray.mid(start_index*2,lenght.toInt());
|
||||
QString sn = snByte;
|
||||
|
||||
if ( sn.contains("\n\r") )
|
||||
|
||||
Reference in New Issue
Block a user