自研批检仪检测命令测试成功

广播方式升级从机发现卡死现象
This commit is contained in:
ranchuan
2023-12-04 18:15:37 +08:00
parent 66b9453255
commit 2451c5dfc5
19 changed files with 256 additions and 69 deletions

View File

@@ -4,15 +4,15 @@
#include "QList"
// 字符串转化为数字列表
template <typename T>
QList<T> str_to_nums(mystring str, char c)
{
QStringList snums = str.split(c);
QList<T> nums;
for (int i = 0; i < snums.size(); i++)
nums.append(T(snums[i].toInt(nullptr, 10)));
return nums;
}
//template <typename T>
//QList<T> str_to_nums(mystring str, char c)
//{
// QStringList snums = str.split(c);
// QList<T> nums;
// for (int i = 0; i < snums.size(); i++)
// nums.append(T(snums[i].toInt(nullptr, 10)));
// return nums;
//}
// 字符串转化为数组
myarray str_to_data(mystring str, char c)

View File

@@ -102,7 +102,14 @@ protected:
};
template <typename T>
QList<T> str_to_nums(mystring str, char c);
QList<T> str_to_nums(mystring str, char c)
{
QStringList snums = str.split(c);
QList<T> nums;
for (int i = 0; i < snums.size(); i++)
nums.append(T(snums[i].toInt(nullptr, 10)));
return nums;
}
myarray str_to_data(mystring str, char c);

View File

@@ -95,10 +95,10 @@ void check_cfg::scheme_json_to_struct()
QList<check_range> rangs = ct.get_ranges();
int rangs_num = rangs.size();
int err_num = ret_errs.size();
qDebug("st,err,item_num=%d,taskid=%d,taskindex=%d", st->item_num, st->taskid, st->taskindex);
// qDebug("st,err,item_num=%d,taskid=%d,taskindex=%d", st->item_num, st->taskid, st->taskindex);
for (int i = 0; i < st->item_num; i++)
{
qDebug("\ti=%d", i);
// qDebug("\ti=%d", i);
if (rangs_num > i)
{
st->range[i].err = 0;

View File

@@ -91,7 +91,7 @@ void print_to_console(QtMsgType type, const QMessageLogContext &context, const Q
if(context.file!=0){
fprintf(stderr, "%s | %s | %s:%u | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), &context.file[20], context.line, localMsg.constData());
}else{
fprintf(stderr,"%s | %s | %s:%u | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), context.file, context.line, localMsg.constData());
fprintf(stderr,"%s | %s | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), localMsg.constData());
}
g_debug.mutex.unlock();
}
@@ -107,7 +107,7 @@ void print_to_file(QtMsgType type, const QMessageLogContext &context, const QStr
if(context.file!=0){
tWrite << QString::asprintf("%s | %s | %s:%u | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), &context.file[20], context.line, localMsg.constData());
}else{
tWrite << QString::asprintf("%s | %s | %s:%u | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), context.file, context.line, localMsg.constData());
tWrite << QString::asprintf("%s | %s | %s\n", msgHead[type], current_date_time.toLocal8Bit().constData(), localMsg.constData());
}
}
g_debug.mutex.unlock();