解决生成新赋码任务数据长度异常的bug
This commit is contained in:
@@ -29,3 +29,8 @@
|
||||
添加读取电机步数命令
|
||||
添加新赋码仪检测命令,赋码仪注码命令
|
||||
添加检测并写入流水号命令
|
||||
2023.12.25
|
||||
解决生成新赋码任务数据长度异常的bug
|
||||
|
||||
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-12-22 18:08:01"
|
||||
#define BUILD_DATE "2023-12-25 18:43:09"
|
||||
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"build_date": "2023-12-22 18:08:01",
|
||||
"build_date": "2023-12-25 18:43:09",
|
||||
"hard_version": "MHPZ2_V1.00",
|
||||
"private": [
|
||||
"info.json",
|
||||
|
@@ -132,7 +132,7 @@ const task_def *coder_find_task(const char *str)
|
||||
int chip=elec_extract_chip(check_plan()->get_plan_id());
|
||||
const task_def *table=nullptr;
|
||||
|
||||
qDebug("find task in ext_table.");
|
||||
// qDebug("find task in ext_table.");
|
||||
table=g_ext_task_table;
|
||||
for(int i=0;i<100;i++){
|
||||
if(table[i].name==nullptr){
|
||||
@@ -145,10 +145,10 @@ const task_def *coder_find_task(const char *str)
|
||||
table=nullptr;
|
||||
if(chip==0){
|
||||
table=g_jq_task_table;
|
||||
qDebug("find task in jq_table.");
|
||||
// qDebug("find task in jq_table.");
|
||||
}else if(chip==2){
|
||||
table=g_ew_task_table;
|
||||
qDebug("find task in ew_table.");
|
||||
// qDebug("find task in ew_table.");
|
||||
}
|
||||
if(table==nullptr){
|
||||
return nullptr;
|
||||
@@ -158,7 +158,7 @@ const task_def *coder_find_task(const char *str)
|
||||
break;
|
||||
}
|
||||
if(qstrcmp(str,table[i].name)==0){
|
||||
qDebug("find task index=%d.",i);
|
||||
// qDebug("find task index=%d.",i);
|
||||
return &table[i];
|
||||
}
|
||||
}
|
||||
@@ -189,8 +189,8 @@ int coder_add_task(myarray &d,const char *name,int slot_index,int task_index,uin
|
||||
qWarning("can not find task with %s.",name);
|
||||
return -1;
|
||||
}else{
|
||||
qDebug("task_name:%s,task_id=%d,par_count=%d,ret_count=%d,err=%d",name,task->task_id,
|
||||
task->par_count,task->ret_count,task->errcode);
|
||||
// qDebug("task_name:%s,task_id=%d,par_count=%d,ret_count=%d,err=%d",name,task->task_id,
|
||||
// task->par_count,task->ret_count,task->errcode);
|
||||
}
|
||||
char *par=(char *)params;
|
||||
d.append(uint8_t(slot_index));
|
||||
@@ -454,7 +454,7 @@ myarray cmd_coder_code2::cmd_pc_to_slave(myarray data)
|
||||
data.remove(0,4);
|
||||
memcpy(year,data.mid(1,4).data(),4);
|
||||
qDebug("tran pc data to slave");
|
||||
for (int i=0;i<addrs;i++){
|
||||
for (int i=0;i<addrs_num;i++){
|
||||
myarray d;
|
||||
uid_code uid={{0},{0},{0},{0}};
|
||||
memcpy(uid.shell,data.mid(5+i*14+1,13).data(),13);
|
||||
@@ -500,6 +500,7 @@ myarray cmd_coder_code2::cmd_pc_to_slave(myarray data)
|
||||
// 检测模式1,返回异常代码和任务插槽数据
|
||||
ret.insert(0,uint8_t(1));
|
||||
qDebug("tran pc data to slave end");
|
||||
qDebug()<<"slave_data:"<<ret.toHex(' ');
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -118,9 +118,11 @@ public:
|
||||
QList<int> cmd_pc_to_addrs(myarray data){
|
||||
QList<int> addr_list;
|
||||
addrs=data[0]|(data[1]<<8)|(data[2]<<16);
|
||||
addrs_num=0;
|
||||
for(int i=0;i<20;i++){
|
||||
if((addrs&(1<<i))!=0){
|
||||
addr_list.append(i+1);
|
||||
addrs_num++;
|
||||
}
|
||||
}
|
||||
return addr_list;
|
||||
@@ -150,6 +152,7 @@ public:
|
||||
myarray ret_slave_to_pc(QList<myarray> data);
|
||||
protected:
|
||||
int addrs;
|
||||
int addrs_num;
|
||||
};
|
||||
|
||||
|
||||
@@ -233,9 +236,11 @@ public:
|
||||
QList<int> cmd_pc_to_addrs(myarray data){
|
||||
QList<int> addr_list;
|
||||
addrs=data[0]|(data[1]<<8)|(data[2]<<16);
|
||||
addrs_num=0;
|
||||
for(int i=0;i<20;i++){
|
||||
if((addrs&(1<<i))!=0){
|
||||
addr_list.append(i+1);
|
||||
addrs_num++;
|
||||
}
|
||||
}
|
||||
return addr_list;
|
||||
@@ -264,6 +269,7 @@ public:
|
||||
protected:
|
||||
int addrs;
|
||||
int chip_mode;
|
||||
int addrs_num;
|
||||
uint16_t delay;
|
||||
QList<uid_code> uid_codes;
|
||||
};
|
||||
|
Reference in New Issue
Block a user