diff --git a/.config b/.config index a1d517c..b6ff15e 100644 --- a/.config +++ b/.config @@ -328,34 +328,7 @@ CONFIG_RT_USING_POSIX_FS=y CONFIG_RT_USING_RYM=y CONFIG_YMODEM_USING_CRC_TABLE=y CONFIG_YMODEM_USING_FILE_TRANSFER=y -CONFIG_RT_USING_ULOG=y -# CONFIG_ULOG_OUTPUT_LVL_A is not set -# CONFIG_ULOG_OUTPUT_LVL_E is not set -# CONFIG_ULOG_OUTPUT_LVL_W is not set -# CONFIG_ULOG_OUTPUT_LVL_I is not set -CONFIG_ULOG_OUTPUT_LVL_D=y -CONFIG_ULOG_OUTPUT_LVL=7 -# CONFIG_ULOG_USING_ISR_LOG is not set -CONFIG_ULOG_ASSERT_ENABLE=y -CONFIG_ULOG_LINE_BUF_SIZE=128 -# CONFIG_ULOG_USING_ASYNC_OUTPUT is not set - -# -# log format -# -# CONFIG_ULOG_OUTPUT_FLOAT is not set -CONFIG_ULOG_USING_COLOR=y -CONFIG_ULOG_OUTPUT_TIME=y -CONFIG_ULOG_TIME_USING_TIMESTAMP=y -CONFIG_ULOG_OUTPUT_LEVEL=y -CONFIG_ULOG_OUTPUT_TAG=y -CONFIG_ULOG_OUTPUT_THREAD_NAME=y -# end of log format - -CONFIG_ULOG_BACKEND_USING_CONSOLE=y -CONFIG_ULOG_BACKEND_USING_FILE=y -# CONFIG_ULOG_USING_FILTER is not set -# CONFIG_ULOG_USING_SYSLOG is not set +# CONFIG_RT_USING_ULOG is not set # CONFIG_RT_USING_UTEST is not set # CONFIG_RT_USING_VAR_EXPORT is not set # CONFIG_RT_USING_RESOURCE_ID is not set diff --git a/.cproject b/.cproject index 2a17e73..b70f70d 100644 --- a/.cproject +++ b/.cproject @@ -172,8 +172,6 @@ - - @@ -362,8 +360,6 @@ - - @@ -524,8 +520,6 @@ - - @@ -692,8 +686,6 @@ - - @@ -853,8 +845,6 @@ - - @@ -1023,8 +1013,6 @@ - - @@ -1193,8 +1181,6 @@ - - @@ -1364,8 +1350,6 @@ - - @@ -1522,8 +1506,6 @@ - - @@ -1543,7 +1525,7 @@ - + diff --git a/.settings/.rtmenus b/.settings/.rtmenus index b21dba3..ed2a677 100644 Binary files a/.settings/.rtmenus and b/.settings/.rtmenus differ diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index d8b4f9c..b69f4ef 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + diff --git a/applications/data/SC828_DATA_table.h b/applications/data/SC828_DATA_table.h index b9934b2..879230d 100644 --- a/applications/data/SC828_DATA_table.h +++ b/applications/data/SC828_DATA_table.h @@ -27,8 +27,11 @@ typedef struct { typedef struct { char Dyelot[32]; // 单号 + char ProgramID[16]; + char Program[32]; int ReDye; int RUN; + int Step; char StepID[4]; char StepName[20]; char ParameterName[50]; diff --git a/applications/lvgl/guider/custom/custom.c b/applications/lvgl/guider/custom/custom.c index 4e4f751..02277d1 100644 --- a/applications/lvgl/guider/custom/custom.c +++ b/applications/lvgl/guider/custom/custom.c @@ -115,6 +115,7 @@ static void table_step_cb(lv_event_t *e) } //点击事件回调 char value_W[32] = {0}; +int value_S=0; static void table_click_event_cb(lv_event_t *e) { lv_obj_t *table = lv_event_get_target(e); lv_indev_t *indev = lv_indev_get_act(); @@ -182,7 +183,8 @@ static void table_click_event_cb(lv_event_t *e) { } else if(table == guider_ui.screen_pname_step_row){//工艺程序细节信息 pname_step_row = row;// 写入行号 - if(value_W[0] == '\0') return; + value_S = lv_table_get_cell_value(guider_ui.screen_pname_step_row, row, 0); + UI_pname_step_inf(value_W,value_S); } } diff --git a/applications/lvgl/guider/generated/events_init.c b/applications/lvgl/guider/generated/events_init.c index 8bddf7e..f3324db 100644 --- a/applications/lvgl/guider/generated/events_init.c +++ b/applications/lvgl/guider/generated/events_init.c @@ -341,13 +341,50 @@ static void screen_sys_save_event_handler (lv_event_t *e) } } -static void screen_stepinf_event_handler (lv_event_t *e) +static void screen_stepinf_s1_event_handler (lv_event_t *e) { lv_event_code_t code = lv_event_get_code(e); switch (code) { case LV_EVENT_CLICKED: { - lv_obj_add_flag(guider_ui.screen_stepinf, LV_OBJ_FLAG_HIDDEN); + //uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s1); + 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); + break; + } + default: + break; + } +} + +static void screen_stepinf_s2_event_handler (lv_event_t *e) +{ + lv_event_code_t code = lv_event_get_code(e); + switch (code) { + case LV_EVENT_CLICKED: + { + //uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s2); + 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); + break; + } + default: + break; + } +} + +static void screen_stepinf_s3_event_handler (lv_event_t *e) +{ + lv_event_code_t code = lv_event_get_code(e); + switch (code) { + case LV_EVENT_CLICKED: + { + //uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s3); + 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_s1b, LV_OBJ_FLAG_HIDDEN); break; } default: @@ -361,6 +398,7 @@ static void screen_btn_1_event_handler (lv_event_t *e) switch (code) { case LV_EVENT_CLICKED: { + lv_obj_add_flag(guider_ui.screen_stepinf, LV_OBJ_FLAG_HIDDEN); break; } default: @@ -392,7 +430,9 @@ void events_init_screen (lv_ui *ui) lv_obj_add_event_cb(ui->screen_set_Delete, screen_set_Delete_event_handler, LV_EVENT_ALL, ui); lv_obj_add_event_cb(ui->screen_set_Save, screen_set_Save_event_handler, LV_EVENT_ALL, ui); lv_obj_add_event_cb(ui->screen_sys_save, screen_sys_save_event_handler, LV_EVENT_ALL, ui); - lv_obj_add_event_cb(ui->screen_stepinf, screen_stepinf_event_handler, LV_EVENT_ALL, ui); + lv_obj_add_event_cb(ui->screen_stepinf_s1, screen_stepinf_s1_event_handler, LV_EVENT_ALL, ui); + lv_obj_add_event_cb(ui->screen_stepinf_s2, screen_stepinf_s2_event_handler, LV_EVENT_ALL, ui); + lv_obj_add_event_cb(ui->screen_stepinf_s3, screen_stepinf_s3_event_handler, LV_EVENT_ALL, ui); lv_obj_add_event_cb(ui->screen_btn_1, screen_btn_1_event_handler, LV_EVENT_ALL, ui); } diff --git a/applications/lvgl/guider/generated/gui_guider.h b/applications/lvgl/guider/generated/gui_guider.h index 4c13faf..0807c56 100644 --- a/applications/lvgl/guider/generated/gui_guider.h +++ b/applications/lvgl/guider/generated/gui_guider.h @@ -447,6 +447,9 @@ typedef struct lv_obj_t *screen_sys_save; lv_obj_t *screen_sys_save_label; lv_obj_t *screen_stepinf; + lv_obj_t *screen_stepinf_s1b; + lv_obj_t *screen_stepinf_s2b; + lv_obj_t *screen_stepinf_s3b; lv_obj_t *screen_stepinf_s1; lv_obj_t *screen_stepinf_s2; lv_obj_t *screen_stepinf_s3; diff --git a/applications/lvgl/guider/generated/setup_scr_screen.c b/applications/lvgl/guider/generated/setup_scr_screen.c index d365f25..8a6ea81 100644 --- a/applications/lvgl/guider/generated/setup_scr_screen.c +++ b/applications/lvgl/guider/generated/setup_scr_screen.c @@ -7335,6 +7335,84 @@ void setup_scr_screen(lv_ui *ui) lv_obj_set_style_pad_right(ui->screen_stepinf, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_stepinf, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + //Write codes screen_stepinf_s1b + ui->screen_stepinf_s1b = lv_label_create(ui->screen_stepinf); + lv_label_set_text(ui->screen_stepinf_s1b, ""); + lv_label_set_long_mode(ui->screen_stepinf_s1b, LV_LABEL_LONG_WRAP); + lv_obj_set_pos(ui->screen_stepinf_s1b, 0, 50); + lv_obj_set_size(ui->screen_stepinf_s1b, 300, 55); + lv_obj_add_flag(ui->screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN); + + //Write style for screen_stepinf_s1b, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. + lv_obj_set_style_border_width(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_radius(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_color(ui->screen_stepinf_s1b, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_font(ui->screen_stepinf_s1b, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_opa(ui->screen_stepinf_s1b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_letter_space(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_line_space(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_align(ui->screen_stepinf_s1b, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui->screen_stepinf_s1b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_color(ui->screen_stepinf_s1b, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_grad_dir(ui->screen_stepinf_s1b, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_top(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_right(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_bottom(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_left(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_shadow_width(ui->screen_stepinf_s1b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + + //Write codes screen_stepinf_s2b + ui->screen_stepinf_s2b = lv_label_create(ui->screen_stepinf); + lv_label_set_text(ui->screen_stepinf_s2b, ""); + lv_label_set_long_mode(ui->screen_stepinf_s2b, LV_LABEL_LONG_WRAP); + lv_obj_set_pos(ui->screen_stepinf_s2b, 0, 106); + lv_obj_set_size(ui->screen_stepinf_s2b, 300, 55); + lv_obj_add_flag(ui->screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN); + + //Write style for screen_stepinf_s2b, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. + lv_obj_set_style_border_width(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_radius(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_color(ui->screen_stepinf_s2b, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_font(ui->screen_stepinf_s2b, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_opa(ui->screen_stepinf_s2b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_letter_space(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_line_space(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_align(ui->screen_stepinf_s2b, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui->screen_stepinf_s2b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_color(ui->screen_stepinf_s2b, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_grad_dir(ui->screen_stepinf_s2b, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_top(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_right(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_bottom(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_left(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_shadow_width(ui->screen_stepinf_s2b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + + //Write codes screen_stepinf_s3b + ui->screen_stepinf_s3b = lv_label_create(ui->screen_stepinf); + lv_label_set_text(ui->screen_stepinf_s3b, ""); + lv_label_set_long_mode(ui->screen_stepinf_s3b, LV_LABEL_LONG_WRAP); + lv_obj_set_pos(ui->screen_stepinf_s3b, 0, 162); + lv_obj_set_size(ui->screen_stepinf_s3b, 300, 55); + lv_obj_add_flag(ui->screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN); + + //Write style for screen_stepinf_s3b, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. + lv_obj_set_style_border_width(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_radius(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_color(ui->screen_stepinf_s3b, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_font(ui->screen_stepinf_s3b, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_opa(ui->screen_stepinf_s3b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_letter_space(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_line_space(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_text_align(ui->screen_stepinf_s3b, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui->screen_stepinf_s3b, 255, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_color(ui->screen_stepinf_s3b, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_bg_grad_dir(ui->screen_stepinf_s3b, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_top(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_right(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_bottom(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_pad_left(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + lv_obj_set_style_shadow_width(ui->screen_stepinf_s3b, 0, LV_PART_MAIN|LV_STATE_DEFAULT); + //Write codes screen_stepinf_s1 ui->screen_stepinf_s1 = lv_dropdown_create(ui->screen_stepinf); lv_dropdown_set_options(ui->screen_stepinf_s1, "温度控制001\n水位进水007\n流量进水008\n水位水洗013\n溢流水洗015\n排水020\n主泵排水022\n运转031\n入布035\n出布036\n呼叫操作员039\n取样040\n程序结束041\n等待049\n加压050\n减压051\n泵风机速度054\n泵启动055\n泵停止056\n备药064\n加药065\n呼叫输送066\n呼叫准备067\n快速加酸090\nph检测093\nph控制094\n"); @@ -7468,7 +7546,7 @@ void setup_scr_screen(lv_ui *ui) //Write codes screen_stepinf_s3 ui->screen_stepinf_s3 = lv_dropdown_create(ui->screen_stepinf); lv_dropdown_set_options(ui->screen_stepinf_s3, "降温水洗017\n加压050\n减压051\n备药064\n呼叫输送066\n快速加酸090\nph温度控制091\nph检测093\nph控制094\n"); - lv_obj_set_pos(ui->screen_stepinf_s3, 105, 173); + lv_obj_set_pos(ui->screen_stepinf_s3, 105, 167); lv_obj_set_size(ui->screen_stepinf_s3, 180, 45); //Write style for screen_stepinf_s3, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. @@ -7954,7 +8032,7 @@ void setup_scr_screen(lv_ui *ui) ui->screen_label_49 = lv_label_create(ui->screen_stepinf); lv_label_set_text(ui->screen_label_49, "副功能2"); lv_label_set_long_mode(ui->screen_label_49, LV_LABEL_LONG_WRAP); - lv_obj_set_pos(ui->screen_label_49, 10, 183); + lv_obj_set_pos(ui->screen_label_49, 10, 178); lv_obj_set_size(ui->screen_label_49, 90, 25); //Write style for screen_label_49, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. diff --git a/applications/lvgl/ui_data_csv.c b/applications/lvgl/ui_data_csv.c index 05330e9..def969d 100644 --- a/applications/lvgl/ui_data_csv.c +++ b/applications/lvgl/ui_data_csv.c @@ -345,3 +345,60 @@ int run_csv_to_set(const char *csv_data) { return 0; } + +// ============ 处理启动信息 ============ +//处理程序表 +IO_STEP_DATA step_csv_to_table(const char *csv_data) { + IO_STEP_DATA temp = {0}; + + if (csv_data == NULL) { + return temp; + } + + user = (UserData *)rt_memheap_alloc(&sdram_heap, sizeof(UserData)); + + // 解析 CSV + if (parse_csv_string(csv_data, user) != 0) { + return temp; + } + //数据组信息 + temp.RUN = 0; + rt_snprintf(temp.Dyelot ,1,csv_get_cell(user, 1, 0)); + rt_snprintf(temp.StepID ,1,csv_get_cell(user, 1, 1)); + rt_snprintf(temp.StepName ,1,csv_get_cell(user, 1, 2)); + rt_snprintf(temp.ParameterName ,1,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.P6 = atoi(csv_get_cell(user, 1, 9)); + temp.P7 = atoi(csv_get_cell(user, 1, 10)); + temp.P8 = atoi(csv_get_cell(user, 1, 11)); + temp.P9 = atoi(csv_get_cell(user, 1, 12)); + temp.P10 = atoi(csv_get_cell(user, 1, 13)); + temp.Parameter1_S1 = atof(csv_get_cell(user, 1, 14)); + temp.Parameter2_S1 = atof(csv_get_cell(user, 1, 15)); + temp.Parameter3_S1 = atof(csv_get_cell(user, 1, 16)); + temp.Parameter4_S1 = atof(csv_get_cell(user, 1, 17)); + temp.Parameter5_S1 = atof(csv_get_cell(user, 1, 18)); + temp.Parameter1_S2 = atof(csv_get_cell(user, 1, 19)); + temp.Parameter2_S2 = atof(csv_get_cell(user, 1, 20)); + temp.Parameter3_S2 = atof(csv_get_cell(user, 1, 21)); + temp.Parameter4_S2 = atof(csv_get_cell(user, 1, 22)); + temp.Parameter5_S2 = atof(csv_get_cell(user, 1, 23)); + temp.Parameter1_S3 = atof(csv_get_cell(user, 1, 24)); + temp.Parameter2_S3 = atof(csv_get_cell(user, 1, 25)); + temp.Parameter3_S3 = atof(csv_get_cell(user, 1, 26)); + temp.Parameter4_S3 = atof(csv_get_cell(user, 1, 27)); + temp.Parameter5_S3 = atof(csv_get_cell(user, 1, 28)); + temp.ReDye = atoi(csv_get_cell(user, 1, 29)); + rt_snprintf(temp.StepID_S1, 3,csv_get_cell(user, 1, 30)); + rt_snprintf(temp.StepID_S2, 3,csv_get_cell(user, 1, 31)); + rt_snprintf(temp.StepID_S3, 3,csv_get_cell(user, 1, 32)); + + // 释放内存 + rt_memheap_free(user); + + return temp; +} diff --git a/applications/lvgl/ui_data_csv.h b/applications/lvgl/ui_data_csv.h index 8161b47..5775e6c 100644 --- a/applications/lvgl/ui_data_csv.h +++ b/applications/lvgl/ui_data_csv.h @@ -14,4 +14,6 @@ int parse_csv_to_table(lv_obj_t *container, const char *csv_data,int flags); int parse_csv_to_inf(lv_obj_t *container, const char *csv_data ,int W_data,int H_data); int run_csv_to_table(const char *csv_data); int run_csv_to_set(const char *csv_data); +IO_STEP_DATA step_csv_to_table(const char *csv_data); + #endif /* APPLICATIONS_LVGL_UI_DATA_CSV_H_ */ diff --git a/applications/lvgl/ui_data_labels.c b/applications/lvgl/ui_data_labels.c index c9b447d..fb361ae 100644 --- a/applications/lvgl/ui_data_labels.c +++ b/applications/lvgl/ui_data_labels.c @@ -427,7 +427,7 @@ void Work_start(void) else { //步骤信息 - rt_snprintf(sqlSELECT, sizeof(sqlSELECT),"%s ProgramID = '%s' ORDER BY Step ASC;",select_Programstep_R,Work_NAME); + rt_snprintf(sqlSELECT, sizeof(sqlSELECT),"%s Program = '%s' ORDER BY Step ASC;",select_Programstep_R,Work_NAME); db_send_select(DB_CMD_SELECT, sqlSELECT, 500,select_data_ui); run_csv_to_table(select_data_ui); } @@ -484,3 +484,24 @@ void UI_pname_step_row(char* str_data) lv_table_set_col_width(guider_ui.screen_pname_step_row, 0, 50); lv_table_set_col_width(guider_ui.screen_pname_step_row, 1, 250); } + +//程序页面的编辑 +IO_STEP_DATA UI_pname_step_inf_temp ={0}; +void UI_pname_step_inf(char* str_data,int row) +{ + // 查询数据 + rt_snprintf(sqlSELECT, sizeof(sqlSELECT),"%s Program = '%s' AND Step = %d LIMIT 1;",select_Programstep_R,str_data); + rt_kprintf(sqlSELECT); + + db_send_select(DB_CMD_SELECT, sqlSELECT, 500,select_data_ui); + + + rt_kprintf(select_data_ui); + + + UI_pname_step_inf_temp = step_csv_to_table(select_data_ui); + rt_snprintf(UI_pname_step_inf_temp.Program, sizeof(UI_pname_step_inf_temp.Program),str_data); + UI_pname_step_inf_temp.Step = row; + + STEP_DATA_set_ui(&UI_pname_step_inf_temp); +} diff --git a/applications/lvgl/ui_data_labels.h b/applications/lvgl/ui_data_labels.h index 71a5695..411fc65 100644 --- a/applications/lvgl/ui_data_labels.h +++ b/applications/lvgl/ui_data_labels.h @@ -21,7 +21,7 @@ StartTime AS 预计开始,EndTime AS 预计完成,Time AS 预计用时,lock AS #define select_Workordersteps_R "SELECT Dyelot,StepID,StepName,ParameterName,P1,P2,P3,P4,P5,P6,P7,P8,P9,\ P1_S1,P2_S1,P3_S1,P4_S1,P5_S1,P1_S2,P2_S2,P3_S2,P4_S2,P5_S2,P1_S3,P2_S3,P3_S3,P4_S3,P5_S3,ReDye,\ StepID_S1,StepID_S2,StepID_S3 FROM WorkorderSteps WHERE " -#define select_Programstep_R "SELECT Dyelot,StepID,StepName,ParameterName,P1,P2,P3,P4,P5,P6,P7,P8,P9,\ +#define select_Programstep_R "SELECT ProgramID,StepID,StepName,ParameterName,P1,P2,P3,P4,P5,P6,P7,P8,P9,\ P1_S1,P2_S1,P3_S1,P4_S1,P5_S1,P1_S2,P2_S2,P3_S2,P4_S2,P5_S2,P1_S3,P2_S3,P3_S3,P4_S3,P5_S3,ReDye,\ StepID_S1,StepID_S2,StepID_S3 FROM ProgramSteps WHERE" @@ -104,7 +104,6 @@ void update_led_o(void); char* get_time_str(char *buf, size_t size); - void Work_Program_ui(void); void Work_Program_step_ui(char* str_data); void Work_Program_stepINF_ui(char* str_data); @@ -112,5 +111,11 @@ void Work_start(void); void UI_pname_row(void); void UI_pname_step_row(char* str_data); +void UI_pname_step_inf(char* str_data,int row); + +//step +#include + +void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf); #endif /* APPLICATIONS_LVGL_UI_DATA_LABELS_H_ */ diff --git a/applications/lvgl/ui_data_labels_step.c b/applications/lvgl/ui_data_labels_step.c new file mode 100644 index 0000000..e9b8884 --- /dev/null +++ b/applications/lvgl/ui_data_labels_step.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2026-02-04 Administrator the first version + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "lvgl.h" +#include +#include "libcsv.h" + +// 全局或静态数组 + +extern struct rt_memheap sram_SRAM1,sdram_heap; + +static const char* get_step_name(char * step_id) +{ + int id_num = atoi(step_id); + switch(id_num) { + // --- 基础控制 --- + case 1: return "温度控制001"; // 001 + case 7: return "水位进水007"; // 007 (AddWater + WaterLevel) + case 8: return "流量进水008"; // 008 (AddWater + Flowmeter) + case 13: return "水位水洗013"; // 013 (Washing + WaterLevel) + case 15: return "溢流水洗015"; // 015 (Washing + Overflow) + case 20: return "排水020"; // 020 + case 22: return "主泵排水022"; // 022 + case 31: return "运转031"; // 031 + case 35: return "入布035"; // 035 + case 36: return "出布036"; // 036 + case 39: return "呼叫操作员039"; // 039 + case 40: return "取样040"; // 040 + case 41: return "程序结束041"; // 041 + case 49: return "等待049"; // 049 + case 50: return "加压050"; // 050 + case 51: return "减压051"; // 051 + case 54: return "泵风机速度054"; // 054 (Pump + Blower) + case 55: return "泵启动055"; // 055 + case 56: return "泵停止056"; // 056 + case 64: return "备药064"; // 064 + case 65: return "加药065"; // 065 + case 66: return "呼叫输送066"; // 066 + case 67: return "呼叫准备067"; // 067 + case 90: return "快速加酸090"; // 090 + case 93: return "ph检测093"; // 093 + case 94: return "ph控制094"; // 094 + default: return ""; + } +} + +/** + * 数据信息显示 + **/ +#include "sql/DB_SQLite.h" +#include"ui_data_csv.h" + +void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf) +{ + char str_str[32]; + lv_snprintf(str_str, sizeof(str_str), "%d", STEPDATA_inf->Step); + lv_label_set_text(guider_ui.screen_stepinf_step,(const char *)str_str); + lv_label_set_text(guider_ui.screen_stepinf_name,(const char *)STEPDATA_inf->StepName); + lv_label_set_text(guider_ui.screen_stepinf_s1b,get_step_name(STEPDATA_inf->StepID)); + lv_label_set_text(guider_ui.screen_stepinf_s2b,get_step_name(STEPDATA_inf->StepID_S1)); + lv_label_set_text(guider_ui.screen_stepinf_s3b,get_step_name(STEPDATA_inf->StepID_S2)); +} diff --git a/rtconfig.h b/rtconfig.h index a1c5946..6a4539c 100644 --- a/rtconfig.h +++ b/rtconfig.h @@ -202,23 +202,6 @@ #define RT_USING_RYM #define YMODEM_USING_CRC_TABLE #define YMODEM_USING_FILE_TRANSFER -#define RT_USING_ULOG -#define ULOG_OUTPUT_LVL_D -#define ULOG_OUTPUT_LVL 7 -#define ULOG_ASSERT_ENABLE -#define ULOG_LINE_BUF_SIZE 128 - -/* log format */ - -#define ULOG_USING_COLOR -#define ULOG_OUTPUT_TIME -#define ULOG_TIME_USING_TIMESTAMP -#define ULOG_OUTPUT_LEVEL -#define ULOG_OUTPUT_TAG -#define ULOG_OUTPUT_THREAD_NAME -/* end of log format */ -#define ULOG_BACKEND_USING_CONSOLE -#define ULOG_BACKEND_USING_FILE /* end of Utilities */ /* end of RT-Thread Components */