添加重复执行指定任务的任务
This commit is contained in:
@@ -1548,7 +1548,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>rt_thread</GroupName>
|
<GroupName>rt_thread</GroupName>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
|
@@ -269,4 +269,6 @@
|
|||||||
2023.11.17
|
2023.11.17
|
||||||
添加扩展任务 用于小板端执行异常判定
|
添加扩展任务 用于小板端执行异常判定
|
||||||
ew程序下载批量验证成功
|
ew程序下载批量验证成功
|
||||||
|
2023.11.20
|
||||||
|
添加重复执行指定任务的任务
|
||||||
|
|
||||||
|
@@ -29,6 +29,17 @@
|
|||||||
|
|
||||||
#define PLAN_MAX_TASK 64
|
#define PLAN_MAX_TASK 64
|
||||||
|
|
||||||
|
#define TASK_PAR_BACK_LEN 10
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct{
|
||||||
|
CheckerTask_Info_st task_par;
|
||||||
|
int par_count;
|
||||||
|
int ret_count;
|
||||||
|
int rtv_index;// 返回值下标
|
||||||
|
uint16_t params[10];
|
||||||
|
}task_par_back;
|
||||||
|
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
CheckerTask_Info_st* task_info_array[PLAN_MAX_TASK];//方案参数结构体指针
|
CheckerTask_Info_st* task_info_array[PLAN_MAX_TASK];//方案参数结构体指针
|
||||||
@@ -41,6 +52,8 @@ typedef struct{
|
|||||||
int task_num;
|
int task_num;
|
||||||
int scheme_inited;
|
int scheme_inited;
|
||||||
array_def *data;
|
array_def *data;
|
||||||
|
task_par_back *task_back_table[TASK_PAR_BACK_LEN];
|
||||||
|
int task_back_index;
|
||||||
}self_def;
|
}self_def;
|
||||||
|
|
||||||
|
|
||||||
@@ -423,6 +436,48 @@ int elec_check_load_task_param(uint8_t task_index)
|
|||||||
memcpy(checker_runcfg.params,checker_runcfg.task_info.params,checker_runcfg.param_count*2);
|
memcpy(checker_runcfg.params,checker_runcfg.task_info.params,checker_runcfg.param_count*2);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 备份任务运行环境,0成功
|
||||||
|
int elec_task_env_back(void)
|
||||||
|
{
|
||||||
|
self_def *s=&g_self;
|
||||||
|
task_par_back *b=0;
|
||||||
|
if(s->task_back_index>=TASK_PAR_BACK_LEN){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
s->task_back_table[s->task_back_index]=calloc(1,sizeof(task_par_back));
|
||||||
|
b=s->task_back_table[s->task_back_index];
|
||||||
|
if(b==0){
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
b->par_count=checker_runcfg.param_count;
|
||||||
|
b->ret_count=checker_runcfg.rtv_count;
|
||||||
|
b->rtv_index=checker_runcfg.rtv_index;
|
||||||
|
memcpy(&b->task_par, &checker_runcfg.task_info,sizeof(CheckerTask_Info_st));
|
||||||
|
memcpy(b->params,checker_runcfg.params,checker_runcfg.param_count*2);
|
||||||
|
s->task_back_index++;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// 恢复任务运行环境,0成功
|
||||||
|
int elec_task_env_restore(void)
|
||||||
|
{
|
||||||
|
self_def *s=&g_self;
|
||||||
|
task_par_back *b=0;
|
||||||
|
if(s->task_back_index<=0){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
b=s->task_back_table[s->task_back_index-1];
|
||||||
|
checker_runcfg.param_count=b->par_count;
|
||||||
|
checker_runcfg.rtv_count=b->ret_count;
|
||||||
|
checker_runcfg.rtv_index=b->rtv_index;
|
||||||
|
memcpy(&checker_runcfg.task_info,&b->task_par, sizeof(CheckerTask_Info_st));
|
||||||
|
memcpy(checker_runcfg.params,b->params,checker_runcfg.param_count*2);
|
||||||
|
free(b);
|
||||||
|
s->task_back_index--;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据任务id获取检测函数
|
// 根据任务id获取检测函数
|
||||||
CheckerTask elec_get_task_fun(CheckerTask *tasks_fun_table[],uint8_t chip_type,uint8_t taskid)
|
CheckerTask elec_get_task_fun(CheckerTask *tasks_fun_table[],uint8_t chip_type,uint8_t taskid)
|
||||||
{
|
{
|
||||||
|
@@ -44,6 +44,10 @@ int elec_check_load_task_param(uint8_t task_index);
|
|||||||
|
|
||||||
void elec_exe_task(void);
|
void elec_exe_task(void);
|
||||||
|
|
||||||
|
int elec_task_env_back(void);
|
||||||
|
|
||||||
|
int elec_task_env_restore(void);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#include "elec_judge.h"
|
#include "elec_judge.h"
|
||||||
#include "CheckerExt.h"
|
#include "CheckerExt.h"
|
||||||
#include "basechecker.h"
|
#include "basechecker.h"
|
||||||
|
#include "elec_det.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +69,52 @@ par0:要执行的任务序号
|
|||||||
return:无
|
return:无
|
||||||
exe:如果要执行的任务序号不小于此任务则此任务失败
|
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]={
|
CheckerTask exttaskArray[CHECKER_EXTID_COUNT]={
|
||||||
|
@@ -17,6 +17,7 @@ extern CheckerTask exttaskArray[CHECKER_EXTID_COUNT];
|
|||||||
|
|
||||||
void CheckerExt_CalcErr(void);
|
void CheckerExt_CalcErr(void);
|
||||||
|
|
||||||
|
void CheckerExt_Repeat(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -858,6 +858,7 @@ EW_Test_PowerOFF, //26 关总线
|
|||||||
EW_Updata, //27 升级
|
EW_Updata, //27 升级
|
||||||
EW_Test_ChgEnergy, //28 充能统计
|
EW_Test_ChgEnergy, //28 充能统计
|
||||||
CheckerExt_CalcErr, //29 计算异常
|
CheckerExt_CalcErr, //29 计算异常
|
||||||
|
CheckerExt_Repeat, //30 重新执行一次指定任务
|
||||||
(void*)0 //数组结束
|
(void*)0 //数组结束
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUILD_DATE "2023-11-18 14:06:40"
|
#define BUILD_DATE "2023-11-20 10:44:09"
|
||||||
#define SOFT_VERSION "2.06"
|
#define SOFT_VERSION "2.06"
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user