judge-xt-checker.lua 调整任务打印位置
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
-- 添加根据子错误找到对应的主错误功能
|
||||
-- 2023.7.20
|
||||
-- 充能流程异常改为电容异常
|
||||
-- 2023.7.21
|
||||
-- 修改检测项打印位置
|
||||
|
||||
|
||||
|
||||
@@ -248,13 +250,12 @@ end
|
||||
function Checker_PowerPrapare(task,err_code)
|
||||
if(find_ack(task["TaskIndex"]+1,mid(check_data,1,8))==false)then
|
||||
-- 上电错误只能是检测器异常,检测结束
|
||||
print("task failed.index=",task["TaskIndex"])
|
||||
print("PowerPrapare failed.index=",task["TaskIndex"])
|
||||
only(err_code,1)
|
||||
return nil
|
||||
else
|
||||
-- 上电正常,排除检测器异常
|
||||
-- del(err_code,1)
|
||||
print("check poweron")
|
||||
-- 下一步是上电充能
|
||||
return find_index(task["TaskIndex"]+2,1)
|
||||
end
|
||||
@@ -267,7 +268,7 @@ function XT_Test_PowerOn(task,err_code)
|
||||
if(find_ack(task["TaskIndex"]+1,mid(check_data,1,8))==false)then
|
||||
-- 上电充能异常
|
||||
del(err_code,0)
|
||||
print("task failed.index=",task["TaskIndex"])
|
||||
print("poweron failed.index=",task["TaskIndex"])
|
||||
-- 下一步检测电流
|
||||
return find_index(task["TaskIndex"]+2,3)
|
||||
else
|
||||
@@ -283,22 +284,17 @@ function XT_Test_PowerOn(task,err_code)
|
||||
-- 充电时间过长,进一步检测电流,判断开路还是短路
|
||||
if(ret_value[2]>39000) then
|
||||
del(err_code,0)
|
||||
print("check current")
|
||||
return find_index(task["TaskIndex"]+2,3)
|
||||
elseif(ret_value[2]<1) then
|
||||
-- 新小板程序在开路时会返回0,保险起见还是看一下电流
|
||||
del(err_code,0)
|
||||
print("check current")
|
||||
return find_index(task["TaskIndex"]+2,3)
|
||||
end
|
||||
---- 排除检测板异常
|
||||
-- 排除检测板异常
|
||||
del(err_code,1)
|
||||
-- print("check chip UID")
|
||||
-- -- 下一步检测UID
|
||||
-- return find_index(task["TaskIndex"]+2,4)
|
||||
print("check current")
|
||||
-- 下一步检测电流
|
||||
return find_index(task["TaskIndex"]+2,3)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -306,6 +302,7 @@ end
|
||||
|
||||
-- 扫描uid,成功则芯片正常,返回下一个检测任务,nil停止检测
|
||||
function XT_Test_ScanUID(task,err_code)
|
||||
print("read chip UID")
|
||||
if(find_ack(task["TaskIndex"]+1,mid(check_data,1,8))==false)then
|
||||
-- 通信失败,返回芯片异常,检测结束
|
||||
print("task failed.task_index=",task["TaskIndex"])
|
||||
@@ -319,7 +316,6 @@ function XT_Test_ScanUID(task,err_code)
|
||||
-- return nil
|
||||
-- end
|
||||
|
||||
print("check charge")
|
||||
return find_index(task["TaskIndex"]+2,8)
|
||||
--print("读取芯片代码")
|
||||
--return find_index(task["TaskIndex"]+2,6)
|
||||
@@ -333,6 +329,7 @@ end
|
||||
|
||||
-- 判断低压电流,返回下一个检测任务,nil停止检测
|
||||
function XT_Test_BaseCurLow(task,err_code)
|
||||
print("check current")
|
||||
if(find_ack(task["TaskIndex"]+1,mid(check_data,1,8))==false)then
|
||||
-- 电流检测错误只能是检测器异常,检测结束
|
||||
print("task failed.task_index=",task["TaskIndex"])
|
||||
@@ -358,7 +355,6 @@ function XT_Test_BaseCurLow(task,err_code)
|
||||
end
|
||||
-- 排除接触异常
|
||||
del(err_code,3)
|
||||
print("read chip UID")
|
||||
-- 下一步检测芯片
|
||||
return find_index(task["TaskIndex"]+2,4)
|
||||
-- print("读取芯片代码")
|
||||
@@ -369,6 +365,7 @@ end
|
||||
|
||||
-- 检测充能,失败则电容异常
|
||||
function JQ_Test_ChgEnergy(task,err_code)
|
||||
print("check charge")
|
||||
if(find_ack(task["TaskIndex"]+1,mid(check_data,1,8))==false)then
|
||||
-- 充能错误只能是检测器异常,检测结束
|
||||
print("task capacitance Energy failed.task_index=",task["TaskIndex"])
|
||||
|
@@ -10,3 +10,14 @@ function main(j,check_data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function get_max(data){
|
||||
var max=0;
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i]>max){
|
||||
max=data[i];
|
||||
}
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user