|
|
@ -12,6 +12,7 @@ |
|
|
#include <applications/data/Variable.h> |
|
|
#include <applications/data/Variable.h> |
|
|
#include <board.h> |
|
|
#include <board.h> |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
|
|
|
#include <stdlib.h> |
|
|
#include <time.h> |
|
|
#include <time.h> |
|
|
#include <string.h> |
|
|
#include <string.h> |
|
|
#include <guider/custom/custom.h> |
|
|
#include <guider/custom/custom.h> |
|
|
@ -22,9 +23,10 @@ |
|
|
#include <ui_data_labels.h> |
|
|
#include <ui_data_labels.h> |
|
|
#include "libcsv.h" |
|
|
#include "libcsv.h" |
|
|
|
|
|
|
|
|
// 全局或静态数组
|
|
|
//
|
|
|
|
|
|
int STEP_SET_MODE=-1;//页面功能状态
|
|
|
extern struct rt_memheap sram_SRAM1,sdram_heap; |
|
|
char ProgramID[32]; |
|
|
|
|
|
char stepsql[512] = {0}; // 初始化为 0
|
|
|
|
|
|
|
|
|
static const int get_step_name(char * step_id) |
|
|
static const int get_step_name(char * step_id) |
|
|
{ |
|
|
{ |
|
|
@ -83,6 +85,7 @@ static const int get_step_namer(char * step_id) |
|
|
#include "sql/DB_SQLite.h" |
|
|
#include "sql/DB_SQLite.h" |
|
|
#include"ui_data_csv.h" |
|
|
#include"ui_data_csv.h" |
|
|
|
|
|
|
|
|
|
|
|
//数字格式化
|
|
|
void str_step_ui(char *buffer,double scaled_val) |
|
|
void str_step_ui(char *buffer,double scaled_val) |
|
|
{ |
|
|
{ |
|
|
int integer_part = (int) scaled_val; |
|
|
int integer_part = (int) scaled_val; |
|
|
@ -100,8 +103,10 @@ void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf) |
|
|
//步骤信息页面填入
|
|
|
//步骤信息页面填入
|
|
|
char str_str[4]; |
|
|
char str_str[4]; |
|
|
char str_step[5]; |
|
|
char str_step[5]; |
|
|
|
|
|
|
|
|
lv_snprintf(str_str, sizeof(str_str), "%03d", STEPDATA_inf->Step); |
|
|
lv_snprintf(str_str, sizeof(str_str), "%03d", STEPDATA_inf->Step); |
|
|
lv_label_set_text(guider_ui.screen_stepinf_step,(const char *)str_str); |
|
|
lv_label_set_text(guider_ui.screen_stepinf_step,(const char *)str_str); |
|
|
|
|
|
lv_snprintf(ProgramID, sizeof(ProgramID), STEPDATA_inf->Dyelot); |
|
|
lv_label_set_text(guider_ui.screen_stepinf_name,(const char *)STEPDATA_inf->Program); |
|
|
lv_label_set_text(guider_ui.screen_stepinf_name,(const char *)STEPDATA_inf->Program); |
|
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s1,get_step_name(STEPDATA_inf->StepID)); |
|
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s1,get_step_name(STEPDATA_inf->StepID)); |
|
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s2,get_step_namer(STEPDATA_inf->StepID_S1)); |
|
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s2,get_step_namer(STEPDATA_inf->StepID_S1)); |
|
|
@ -138,5 +143,38 @@ void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf) |
|
|
lv_textarea_set_text(guider_ui.screen_stepinf_p5b2,(const char *)str_step); |
|
|
lv_textarea_set_text(guider_ui.screen_stepinf_p5b2,(const char *)str_step); |
|
|
|
|
|
|
|
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN); |
|
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN); |
|
|
|
|
|
|
|
|
|
|
|
STEP_SET_MODE=0;//程序页面步骤修改
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void STEP_DATA_set_ui_w() |
|
|
|
|
|
{ |
|
|
|
|
|
switch(STEP_SET_MODE){ |
|
|
|
|
|
case 0: |
|
|
|
|
|
rt_snprintf(stepsql, sizeof(stepsql),"UPDATE ProgramSteps " |
|
|
|
|
|
"SET P1=%s,P2=%s,P3=%s,P4=%s,P5=%s," |
|
|
|
|
|
"P1_S1=%s,P2_S1=%s,P3_S1=%s,P4_S1=%s,P5_S1=%s," |
|
|
|
|
|
"P1_S2=%s,P2_S2=%s,P3_S2=%s,P4_S2=%s,P5_S2=%s " |
|
|
|
|
|
"WHERE Program='%s' and Step=%d;", |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1b1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2b1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3b1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4b1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5b1), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1b2), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2b2), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3b2), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4b2), |
|
|
|
|
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5b2), |
|
|
|
|
|
lv_label_get_text(guider_ui.screen_stepinf_name), |
|
|
|
|
|
atoi(lv_label_get_text(guider_ui.screen_stepinf_step))); |
|
|
|
|
|
default: ; |
|
|
|
|
|
} |
|
|
|
|
|
STEP_SET_MODE=-1; |
|
|
|
|
|
} |
|
|
|