Compare commits

..
5 Commits
Author SHA1 Message Date
sc 8587957fdb 程序编辑保存逻辑 2026-03-17 00:02:31 +08:00
sc e0d328e16d 步骤页面数据更新功能 2026-03-15 23:04:59 +08:00
sc ca4953af85 信息步骤页面 2026-03-15 00:38:46 +08:00
sc 4e4dfbb640 添加数字键盘 2026-03-14 23:30:04 +08:00
sc e8966f0764 步骤编辑页面添加功能 2026-03-14 00:12:59 +08:00
9 changed files with 1395 additions and 317 deletions

No files matched your search

+18
View File
@@ -406,6 +406,24 @@ void custom_init(lv_ui *ui)
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,0,"步");
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,1,"工艺");
lv_obj_add_event_cb(ui->screen_machine_id_rt, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p5, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p4, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p3, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p5b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p4b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p3b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p2b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p1b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p5b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p4b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p3b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p2b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
lv_obj_add_event_cb(ui->screen_stepinf_p1b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
/* Add your codes here */
}
@@ -366,6 +366,9 @@ static void screen_stepinf_s1_event_handler (lv_event_t *e)
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
break;
}
default:
@@ -383,6 +386,9 @@ static void screen_stepinf_s2_event_handler (lv_event_t *e)
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
break;
}
default:
@@ -400,6 +406,9 @@ static void screen_stepinf_s3_event_handler (lv_event_t *e)
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
break;
}
default:
@@ -430,6 +439,7 @@ static void screen_btn_2_event_handler (lv_event_t *e)
switch (code) {
case LV_EVENT_CLICKED:
{
STEP_DATA_set_ui_w();
lv_obj_add_flag(guider_ui.screen_stepinf, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
@@ -456,21 +456,44 @@ typedef struct
lv_obj_t *screen_stepinf_s1;
lv_obj_t *screen_stepinf_s2;
lv_obj_t *screen_stepinf_s3;
lv_obj_t *screen_stepinf_p1;
lv_obj_t *screen_stepinf_p2;
lv_obj_t *screen_stepinf_p3;
lv_obj_t *screen_stepinf_p4;
lv_obj_t *screen_stepinf_p5;
lv_obj_t *screen_btn_1;
lv_obj_t *screen_btn_1_label;
lv_obj_t *screen_btn_2;
lv_obj_t *screen_btn_2_label;
lv_obj_t *screen_label_42;
lv_obj_t *screen_stepinf_p1n;
lv_obj_t *screen_stepinf_p2n;
lv_obj_t *screen_stepinf_p3n;
lv_obj_t *screen_stepinf_p4n;
lv_obj_t *screen_stepinf_steps1;
lv_obj_t *screen_stepinf_p5;
lv_obj_t *screen_stepinf_p4;
lv_obj_t *screen_stepinf_p3;
lv_obj_t *screen_stepinf_p2;
lv_obj_t *screen_stepinf_p1;
lv_obj_t *screen_stepinf_p5n;
lv_obj_t *screen_stepinf_p4n;
lv_obj_t *screen_stepinf_p3n;
lv_obj_t *screen_stepinf_p2n;
lv_obj_t *screen_stepinf_p1n;
lv_obj_t *screen_stepinf_steps2;
lv_obj_t *screen_stepinf_p5b1;
lv_obj_t *screen_stepinf_p4b1;
lv_obj_t *screen_stepinf_p3b1;
lv_obj_t *screen_stepinf_p2b1;
lv_obj_t *screen_stepinf_p1b1;
lv_obj_t *screen_stepinf_p5n1;
lv_obj_t *screen_stepinf_p4n1;
lv_obj_t *screen_stepinf_p3n1;
lv_obj_t *screen_stepinf_p2n1;
lv_obj_t *screen_stepinf_p1n1;
lv_obj_t *screen_stepinf_steps3;
lv_obj_t *screen_stepinf_p5b2;
lv_obj_t *screen_stepinf_p4b2;
lv_obj_t *screen_stepinf_p3b2;
lv_obj_t *screen_stepinf_p2b2;
lv_obj_t *screen_stepinf_p1b2;
lv_obj_t *screen_stepinf_p5n2;
lv_obj_t *screen_stepinf_p4n2;
lv_obj_t *screen_stepinf_p3n2;
lv_obj_t *screen_stepinf_p2n2;
lv_obj_t *screen_stepinf_p1n2;
lv_obj_t *screen_line_1;
lv_obj_t *screen_label_48;
lv_obj_t *screen_label_49;
File diff suppressed because it is too large. Load diff
@@ -42,6 +42,37 @@ __attribute__((unused)) void ta_event_cb (lv_event_t *e) {
if (code == LV_EVENT_CANCEL || code == LV_EVENT_DEFOCUSED)
{
#if LV_USE_ZH_KEYBOARD != 0
lv_zh_keyboard_set_textarea(kb, ta);
#endif
#if LV_USE_KEYBOARD != 0
lv_keyboard_set_textarea(kb, ta);
#endif
lv_obj_move_background(kb);
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
}
}
__attribute__((unused)) void ta_event_cb_NUMBER (lv_event_t *e) {
lv_event_code_t code = lv_event_get_code(e);
#if LV_USE_KEYBOARD || LV_USE_ZH_KEYBOARD
lv_obj_t *ta = lv_event_get_target(e);
#endif
lv_obj_t *kb = lv_event_get_user_data(e);
if (code == LV_EVENT_FOCUSED || code == LV_EVENT_CLICKED)
{
#if LV_USE_ZH_KEYBOARD != 0
lv_zh_keyboard_set_textarea(kb, ta);
#endif
#if LV_USE_KEYBOARD != 0
lv_keyboard_set_textarea(kb, ta);
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER);
#endif
lv_obj_move_foreground(kb);
lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN);
}
if (code == LV_EVENT_CANCEL || code == LV_EVENT_DEFOCUSED)
{
#if LV_USE_ZH_KEYBOARD != 0
lv_zh_keyboard_set_textarea(kb, ta);
#endif
@@ -18,6 +18,7 @@ extern "C" {
__attribute__((unused)) void kb_event_cb(lv_event_t *e);
__attribute__((unused)) void ta_event_cb(lv_event_t *e);
__attribute__((unused)) void ta_event_cb_NUMBER (lv_event_t *e);
#if LV_USE_ANALOGCLOCK != 0
void clock_count(int *hour, int *min, int *sec);
#endif
+19 -19
View File
@@ -368,25 +368,25 @@ IO_STEP_DATA step_csv_to_table(const char *csv_data) {
}
//数据组信息
temp.RUN = 0;
rt_snprintf(temp.Dyelot ,1,csv_get_cell(user, 1, 0));
rt_snprintf(temp.StepID ,3,csv_get_cell(user, 1, 1));
rt_snprintf(temp.StepID_S1 ,3,csv_get_cell(user, 1, 2));
rt_snprintf(temp.StepID_S2 ,3,csv_get_cell(user, 1, 3));
temp.Parameter1 = atof(csv_get_cell(user, 1, 4));
temp.Parameter2 = atof(csv_get_cell(user, 1, 5));
temp.Parameter3 = atof(csv_get_cell(user, 1, 6));
temp.Parameter4 = atof(csv_get_cell(user, 1, 7));
temp.Parameter5 = atof(csv_get_cell(user, 1, 8));
temp.Parameter1_S1 = atof(csv_get_cell(user, 1, 9));
temp.Parameter2_S1 = atof(csv_get_cell(user, 1, 10));
temp.Parameter3_S1 = atof(csv_get_cell(user, 1, 11));
temp.Parameter4_S1 = atof(csv_get_cell(user, 1, 12));
temp.Parameter5_S1 = atof(csv_get_cell(user, 1, 13));
temp.Parameter1_S2 = atof(csv_get_cell(user, 1, 14));
temp.Parameter2_S2 = atof(csv_get_cell(user, 1, 15));
temp.Parameter3_S2 = atof(csv_get_cell(user, 1, 16));
temp.Parameter4_S2 = atof(csv_get_cell(user, 1, 17));
temp.Parameter5_S2 = atof(csv_get_cell(user, 1, 18));
rt_snprintf(temp.Dyelot ,sizeof(temp.Dyelot),csv_get_cell(user, 1, 0));
rt_snprintf(temp.StepID ,sizeof(temp.StepID),csv_get_cell(user, 1, 1));
rt_snprintf(temp.StepID_S1 ,sizeof(temp.StepID_S1),csv_get_cell(user, 1, 2));
rt_snprintf(temp.StepID_S2 ,sizeof(temp.StepID_S2),csv_get_cell(user, 1, 3));
temp.Parameter1 = atoi(csv_get_cell(user, 1, 4));
temp.Parameter2 = atoi(csv_get_cell(user, 1, 5));
temp.Parameter3 = atoi(csv_get_cell(user, 1, 6));
temp.Parameter4 = atoi(csv_get_cell(user, 1, 7));
temp.Parameter5 = atoi(csv_get_cell(user, 1, 8));
temp.Parameter1_S1 = atoi(csv_get_cell(user, 1, 9));
temp.Parameter2_S1 = atoi(csv_get_cell(user, 1, 10));
temp.Parameter3_S1 = atoi(csv_get_cell(user, 1, 11));
temp.Parameter4_S1 = atoi(csv_get_cell(user, 1, 12));
temp.Parameter5_S1 = atoi(csv_get_cell(user, 1, 13));
temp.Parameter1_S2 = atoi(csv_get_cell(user, 1, 14));
temp.Parameter2_S2 = atoi(csv_get_cell(user, 1, 15));
temp.Parameter3_S2 = atoi(csv_get_cell(user, 1, 16));
temp.Parameter4_S2 = atoi(csv_get_cell(user, 1, 17));
temp.Parameter5_S2 = atoi(csv_get_cell(user, 1, 18));
// 释放内存
rt_memheap_free(user);
+1
View File
@@ -123,5 +123,6 @@ void UI_pname_new();
#include <data/SC828_DATA_table.h>
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf);
void STEP_DATA_set_ui_w();
#endif /* APPLICATIONS_LVGL_UI_DATA_LABELS_H_ */
+309 -2
View File
@@ -12,6 +12,7 @@
#include <applications/data/Variable.h>
#include <board.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <guider/custom/custom.h>
@@ -22,9 +23,18 @@
#include <ui_data_labels.h>
#include "libcsv.h"
// 全局或静态数组
typedef struct {
char STEPNAME[16];
char STEPID[4];
} step_DATA_tab;
extern struct rt_memheap sram_SRAM1,sdram_heap;
//
int STEP_SET_MODE=-1;//页面功能状态
char ProgramID[32];
char stepsql[512] = {0}; // 初始化为 0
step_DATA_tab STEP_NAME_S1;
step_DATA_tab STEP_NAME_S2;
step_DATA_tab STEP_NAME_S3;
static const int get_step_name(char * step_id)
{
@@ -77,22 +87,319 @@ static const int get_step_namer(char * step_id)
default: return 9;
}
}
static void get_step_sql(int id_num)
{
switch(id_num) {
// --- 基础控制 ---
case 0:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"温度控制");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"001");
break;
case 1:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"水位进水");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"007");
break;
case 2:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"流量进水");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"008");
break;
case 3:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"水位水洗");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"013");
break;
case 4:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"溢流水洗");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"015");
break;
case 5:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"排水");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"020");
break;
case 6:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"主泵排水");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"022");
break;
case 7:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"运转");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"031");
break;
case 8:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"入布");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"035");
break;
case 9:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"出布");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"036");
break;
case 10:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫操作员");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"039");
break;
case 11:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"取样");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"040");
break;
case 12:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"程序结束");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"041");
break;
case 13:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"等待");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"049");
break;
case 14:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"加压");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"050");
break;
case 15:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"减压");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"051");
break;
case 16:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵风机速度");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"054");
break;
case 17:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵启动");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"055");
break;
case 18:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵停止");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"056");
break;
case 19:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"备药");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"064");
break;
case 20:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"加药");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"065");
break;
case 21:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫输送");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"066");
break;
case 22:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫准备");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"067");
break;
case 23:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"快速加酸");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"090");
break;
case 24:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"ph检测");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"093");
break;
case 25:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"ph控制");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"094");
break;
default:
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"");
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"000");
}
}
static void get_step_sqlr2(int id_num)
{
switch(id_num) {
// --- 基础控制 ---
case 0:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"降温水洗");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"017");
break;
case 1:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"加压");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"050");
break;
case 2:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"减压");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"051");
break;
case 3:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"备药");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"064");
break;
case 4:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"呼叫输送");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"066");
break;
case 5:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"快速加酸");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"090");
break;
case 6:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"温控加酸");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"091");
break;
case 7:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"ph检测");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"093");
break;
case 8:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"ph控制");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"094");
break;
default:
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"");
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"000");
}
}
static void get_step_sqlr3(int id_num)
{
switch(id_num) {
// --- 基础控制 ---
case 0:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"降温水洗");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"017");
break;
case 1:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"加压");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"050");
break;
case 2:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"减压");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"051");
break;
case 3:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"备药");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"064");
break;
case 4:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"呼叫输送");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"066");
break;
case 5:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"快速加酸");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"090");
break;
case 6:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"温控加酸");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"091");
break;
case 7:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"ph检测");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"093");
break;
case 8:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"ph控制");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"094");
break;
default:
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"");
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"000");
}
}
/**
* 数据信息显示
**/
#include "sql/DB_SQLite.h"
#include"ui_data_csv.h"
//数字格式化
void str_step_ui(char *buffer,double scaled_val)
{
int integer_part = (int) scaled_val;
int fractional_part = (int)((scaled_val * 10)-(integer_part*10));
if (fractional_part == 0) {
lv_snprintf(buffer, sizeof(buffer), "%d", integer_part);
} else {
lv_snprintf(buffer, sizeof(buffer), "%d.%d", integer_part, fractional_part);
}
}
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf)
{
//步骤信息页面填入
char str_str[4];
char str_step[5];
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_snprintf(ProgramID, sizeof(ProgramID), STEPDATA_inf->Dyelot);
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_s2,get_step_namer(STEPDATA_inf->StepID_S1));
lv_dropdown_set_selected(guider_ui.screen_stepinf_s3,get_step_namer(STEPDATA_inf->StepID_S2));
str_step_ui(str_step, STEPDATA_inf->Parameter1);
lv_textarea_set_text(guider_ui.screen_stepinf_p1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter2);
lv_textarea_set_text(guider_ui.screen_stepinf_p2,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter3);
lv_textarea_set_text(guider_ui.screen_stepinf_p3,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter4);
lv_textarea_set_text(guider_ui.screen_stepinf_p4,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter5);
lv_textarea_set_text(guider_ui.screen_stepinf_p5,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter1_S1);
lv_textarea_set_text(guider_ui.screen_stepinf_p1b1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter2_S1);
lv_textarea_set_text(guider_ui.screen_stepinf_p2b1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter3_S1);
lv_textarea_set_text(guider_ui.screen_stepinf_p3b1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter4_S1);
lv_textarea_set_text(guider_ui.screen_stepinf_p4b1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter5_S1);
lv_textarea_set_text(guider_ui.screen_stepinf_p5b1,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter1_S2);
lv_textarea_set_text(guider_ui.screen_stepinf_p1b2,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter2_S2);
lv_textarea_set_text(guider_ui.screen_stepinf_p2b2,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter3_S2);
lv_textarea_set_text(guider_ui.screen_stepinf_p3b2,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter4_S2);
lv_textarea_set_text(guider_ui.screen_stepinf_p4b2,(const char *)str_step);
str_step_ui(str_step, STEPDATA_inf->Parameter5_S2);
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);
STEP_SET_MODE=0;//程序页面步骤修改
}
void STEP_DATA_set_ui_w()
{
get_step_sql(lv_dropdown_get_selected (guider_ui.screen_stepinf_s1));
get_step_sqlr2(lv_dropdown_get_selected (guider_ui.screen_stepinf_s2));
get_step_sqlr3(lv_dropdown_get_selected (guider_ui.screen_stepinf_s3));
switch(STEP_SET_MODE){
case 0:
rt_snprintf(stepsql, sizeof(stepsql),"UPDATE ProgramSteps "
"SET StepID='%s',StepName='%s',StepID_S1='%s',StepID_S2='%s',"
"StepName_S1='%s',StepName_S1='%s',"
"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;",
STEP_NAME_S1.STEPID,STEP_NAME_S1.STEPNAME,
STEP_NAME_S2.STEPID,STEP_NAME_S3.STEPID,
STEP_NAME_S2.STEPNAME,STEP_NAME_S3.STEPNAME,
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)));
if( db_send_command(DB_CMD_EXEC, stepsql, 500)==RT_EOK) //
{
}
break;
default: ;
}
STEP_SET_MODE=-1;
}