添加重复执行指定任务的任务

This commit is contained in:
ranchuan
2023-11-20 18:06:03 +08:00
parent be3c644d23
commit fa2509c5af
8 changed files with 112 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
#include "elec_judge.h"
#include "CheckerExt.h"
#include "basechecker.h"
#include "elec_det.h"
@@ -69,7 +69,52 @@ par0:要执行的任务序号
return:无
exe:如果要执行的任务序号不小于此任务则此任务失败
}*/
//void CheckerExt_Repeat
static int calc_skip_num(int index);
void CheckerExt_Repeat(void)
{
int index;
uint16_t ret=0;
int self_index=checker_runcfg.task_info.runindex;
if(checker_runcfg.param_count<1){
ret=1;
goto end;
}
index=checker_runcfg.params[0];
if(index>=self_index){
ret=2;
goto end;
}
if(elec_task_env_back()){
ret=3;
goto end;
}
if(elec_check_load_task_param(index)){
ret=4;
goto end;
}
checker_runcfg.rtv_index=calc_skip_num(index);
elec_exe_task();
if(elec_task_env_restore()){
ret=5;
goto end;
}
end:
Checker_MaskResult(ret,self_index);
}
// 计算在taskindex之前有多少个返回值
static int calc_skip_num(int index)
{
const scheme_def *s=check_scheme();
const scheme_task_def *t;
int num=0;
for(int i=0;i<index;i++)
{
t=&s->task[i];
num+=t->item_num;
}
return num;
}
CheckerTask exttaskArray[CHECKER_EXTID_COUNT]={

View File

@@ -17,6 +17,7 @@ extern CheckerTask exttaskArray[CHECKER_EXTID_COUNT];
void CheckerExt_CalcErr(void);
void CheckerExt_Repeat(void);

View File

@@ -858,6 +858,7 @@ EW_Test_PowerOFF, //26 关总线
EW_Updata, //27 升级
EW_Test_ChgEnergy, //28 充能统计
CheckerExt_CalcErr, //29 计算异常
CheckerExt_Repeat, //30 重新执行一次指定任务
(void*)0 //数组结束
};