Browse Source

程序页面修改

master
sc 5 months ago
parent
commit
7184c188c5
  1. 12
      applications/lvgl/guider/custom/custom.c
  2. 7
      applications/lvgl/guider/generated/events_init.c
  3. 1
      applications/lvgl/guider/generated/gui_guider.h
  4. 43
      applications/lvgl/guider/generated/setup_scr_screen.c
  5. 4
      applications/lvgl/ui_data_labels.c

12
applications/lvgl/guider/custom/custom.c

@ -182,11 +182,19 @@ static void table_click_event_cb(lv_event_t *e) {
rt_snprintf(value_W, sizeof(value_W),lv_table_get_cell_value(guider_ui.screen_pname_row, row, 0)); rt_snprintf(value_W, sizeof(value_W),lv_table_get_cell_value(guider_ui.screen_pname_row, row, 0));
UI_pname_step_row(value_W); UI_pname_step_row(value_W);
UI_pname_step_inf(value_W,0); UI_pname_step_inf(value_W,0);
//按钮(删除,存储)生效
lv_obj_clear_state(guider_ui.screen_set_Delete,LV_STATE_DISABLED);
lv_obj_clear_state(guider_ui.screen_set_Save,LV_STATE_DISABLED);
} }
else if(table == guider_ui.screen_pname_step_row){//工艺程序细节信息 else if(table == guider_ui.screen_pname_step_row){//工艺程序细节信息
pname_step_row = row;// 写入行号 pname_step_row = row;// 写入行号
value_S = atoi(lv_table_get_cell_value(guider_ui.screen_pname_step_row, row, 0)); value_S = atoi(lv_table_get_cell_value(guider_ui.screen_pname_step_row, row, 0));
UI_pname_step_inf(value_W,value_S); UI_pname_step_inf(value_W,value_S);
//按钮(编辑,插入)生效
lv_obj_clear_state(guider_ui.screen_set_Edit,LV_STATE_DISABLED);
lv_obj_clear_state(guider_ui.screen_set_Insert,LV_STATE_DISABLED);
} }
} }
@ -261,6 +269,10 @@ static void tabview_event_cb(lv_event_t *e)
break; break;
case 3://程序页面 case 3://程序页面
lv_obj_add_state(guider_ui.screen_set_Edit,LV_STATE_DISABLED);
lv_obj_add_state(guider_ui.screen_set_Insert,LV_STATE_DISABLED);
lv_obj_add_state(guider_ui.screen_set_Delete,LV_STATE_DISABLED);
lv_obj_add_state(guider_ui.screen_set_Save,LV_STATE_DISABLED);
UI_pname_row(); UI_pname_row();
break; break;
case 4: case 4:

7
applications/lvgl/guider/generated/events_init.c

@ -348,7 +348,7 @@ static void screen_stepinf_s1_event_handler (lv_event_t *e)
switch (code) { switch (code) {
case LV_EVENT_CLICKED: case LV_EVENT_CLICKED:
{ {
//uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s1); 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_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_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_s3b, LV_OBJ_FLAG_HIDDEN);
@ -365,7 +365,7 @@ static void screen_stepinf_s2_event_handler (lv_event_t *e)
switch (code) { switch (code) {
case LV_EVENT_CLICKED: case LV_EVENT_CLICKED:
{ {
//uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s2); 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_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_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_s3b, LV_OBJ_FLAG_HIDDEN);
@ -382,7 +382,7 @@ static void screen_stepinf_s3_event_handler (lv_event_t *e)
switch (code) { switch (code) {
case LV_EVENT_CLICKED: case LV_EVENT_CLICKED:
{ {
//uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s3); 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_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_s2b, LV_OBJ_FLAG_HIDDEN);
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);
@ -447,7 +447,6 @@ static void screen_step_DELETE_yes_event_handler (lv_event_t *e)
switch (code) { switch (code) {
case LV_EVENT_CLICKED: case LV_EVENT_CLICKED:
{ {
UI_pname_del();
lv_obj_add_flag(guider_ui.screen_step_DELETE, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(guider_ui.screen_step_DELETE, LV_OBJ_FLAG_HIDDEN);
break; break;
} }

1
applications/lvgl/guider/generated/gui_guider.h

@ -438,6 +438,7 @@ typedef struct
lv_obj_t *screen_step_; lv_obj_t *screen_step_;
lv_obj_t *screen_step_set; lv_obj_t *screen_step_set;
lv_obj_t *screen_proess_set; lv_obj_t *screen_proess_set;
lv_obj_t *screen_label_55;
lv_obj_t *screen_w_5; lv_obj_t *screen_w_5;
lv_obj_t *screen_machine_name_rt; lv_obj_t *screen_machine_name_rt;
lv_obj_t *screen_sys_name; lv_obj_t *screen_sys_name;

43
applications/lvgl/guider/generated/setup_scr_screen.c

@ -6960,8 +6960,8 @@ void setup_scr_screen(lv_ui *ui)
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0 #if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
lv_obj_add_event_cb(ui->screen_pname_set, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer); lv_obj_add_event_cb(ui->screen_pname_set, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
#endif #endif
lv_obj_set_pos(ui->screen_pname_set, 305, 0); lv_obj_set_pos(ui->screen_pname_set, 405, 0);
lv_obj_set_size(ui->screen_pname_set, 714, 50); lv_obj_set_size(ui->screen_pname_set, 614, 50);
//Write style for screen_pname_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. //Write style for screen_pname_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_text_color(ui->screen_pname_set, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_text_color(ui->screen_pname_set, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
@ -7102,7 +7102,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_step_set //Write codes screen_step_set
ui->screen_step_set = lv_obj_create(ui->screen_tabview_tab_4); ui->screen_step_set = lv_obj_create(ui->screen_tabview_tab_4);
lv_obj_set_pos(ui->screen_step_set, 305, 55); lv_obj_set_pos(ui->screen_step_set, 305, 53);
lv_obj_set_size(ui->screen_step_set, 714, 370); lv_obj_set_size(ui->screen_step_set, 714, 370);
lv_obj_set_scrollbar_mode(ui->screen_step_set, LV_SCROLLBAR_MODE_OFF); lv_obj_set_scrollbar_mode(ui->screen_step_set, LV_SCROLLBAR_MODE_OFF);
@ -7136,6 +7136,29 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_set_style_pad_right(ui->screen_proess_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_pad_right(ui->screen_proess_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_proess_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_shadow_width(ui->screen_proess_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_label_55
ui->screen_label_55 = lv_label_create(ui->screen_tabview_tab_4);
lv_label_set_text(ui->screen_label_55, "工艺:");
lv_label_set_long_mode(ui->screen_label_55, LV_LABEL_LONG_WRAP);
lv_obj_set_pos(ui->screen_label_55, 305, 0);
lv_obj_set_size(ui->screen_label_55, 100, 50);
//Write style for screen_label_55, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_label_55, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_label_55, &lv_font_simsun_30, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_label_55, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_label_55, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->screen_label_55, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->screen_label_55, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->screen_label_55, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_label_55, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes 系统 //Write codes 系统
ui->screen_tabview_tab_5 = lv_tabview_add_tab(ui->screen_tabview,"系统"); ui->screen_tabview_tab_5 = lv_tabview_add_tab(ui->screen_tabview,"系统");
lv_obj_t * screen_tabview_tab_5_label = lv_label_create(ui->screen_tabview_tab_5); lv_obj_t * screen_tabview_tab_5_label = lv_label_create(ui->screen_tabview_tab_5);
@ -7319,6 +7342,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_set_size(ui->screen_stepinf, 700, 380); lv_obj_set_size(ui->screen_stepinf, 700, 380);
lv_obj_set_scrollbar_mode(ui->screen_stepinf, LV_SCROLLBAR_MODE_OFF); lv_obj_set_scrollbar_mode(ui->screen_stepinf, LV_SCROLLBAR_MODE_OFF);
lv_obj_add_flag(ui->screen_stepinf, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(ui->screen_stepinf, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui->screen_stepinf, LV_OBJ_FLAG_HIDDEN);
//Write style for screen_stepinf, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. //Write style for screen_stepinf, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_stepinf, 5, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_stepinf, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
@ -7480,7 +7504,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_stepinf_s2 //Write codes screen_stepinf_s2
ui->screen_stepinf_s2 = lv_dropdown_create(ui->screen_stepinf); ui->screen_stepinf_s2 = lv_dropdown_create(ui->screen_stepinf);
lv_dropdown_set_options(ui->screen_stepinf_s2, "降温水洗017降温水洗017\n加压050\n减压051\n备药064\n呼叫输送066\n快速加酸090\nph温度控制091\nph检测093\nph控制094\n"); lv_dropdown_set_options(ui->screen_stepinf_s2, "降温水洗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_s2, 105, 111); lv_obj_set_pos(ui->screen_stepinf_s2, 105, 111);
lv_obj_set_size(ui->screen_stepinf_s2, 180, 45); lv_obj_set_size(ui->screen_stepinf_s2, 180, 45);
@ -8172,6 +8196,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_set_size(ui->screen_step_DELETE, 300, 380); lv_obj_set_size(ui->screen_step_DELETE, 300, 380);
lv_obj_set_scrollbar_mode(ui->screen_step_DELETE, LV_SCROLLBAR_MODE_OFF); lv_obj_set_scrollbar_mode(ui->screen_step_DELETE, LV_SCROLLBAR_MODE_OFF);
lv_obj_add_flag(ui->screen_step_DELETE, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(ui->screen_step_DELETE, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui->screen_step_DELETE, LV_OBJ_FLAG_HIDDEN);
//Write style for screen_step_DELETE, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. //Write style for screen_step_DELETE, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_step_DELETE, 5, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_step_DELETE, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
@ -8200,16 +8225,16 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_set_size(ui->screen_step_DELETE_no, 100, 50); lv_obj_set_size(ui->screen_step_DELETE_no, 100, 50);
//Write style for screen_step_DELETE_no, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT. //Write style for screen_step_DELETE_no, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_text_color(ui->screen_step_DELETE_no, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_step_DELETE_no, &lv_font_simsun_24, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_step_DELETE_no, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_step_DELETE_no, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_step_DELETE_no, 255, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_opa(ui->screen_step_DELETE_no, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->screen_step_DELETE_no, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_color(ui->screen_step_DELETE_no, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_grad_dir(ui->screen_step_DELETE_no, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_bg_grad_dir(ui->screen_step_DELETE_no, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui->screen_step_DELETE_no, 0, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_border_width(ui->screen_step_DELETE_no, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_step_DELETE_no, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_step_DELETE_no, 5, LV_PART_MAIN|LV_STATE_DEFAULT); lv_obj_set_style_radius(ui->screen_step_DELETE_no, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_step_DELETE_no, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_step_DELETE_no, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_step_DELETE_no, &lv_font_simsun_24, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_step_DELETE_no, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_step_DELETE_no, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_step_DELETE_yes //Write codes screen_step_DELETE_yes
ui->screen_step_DELETE_yes = lv_btn_create(ui->screen_step_DELETE); ui->screen_step_DELETE_yes = lv_btn_create(ui->screen_step_DELETE);

4
applications/lvgl/ui_data_labels.c

@ -465,7 +465,7 @@ void UI_pname_step_row(char* str_data)
//工艺名显示输入框 //工艺名显示输入框
char name_data[64] = {0}; char name_data[64] = {0};
rt_snprintf(name_data, sizeof(name_data),"工艺:%s",str_data); rt_snprintf(name_data, sizeof(name_data),str_data);
lv_textarea_set_text(guider_ui.screen_pname_set,(const char *)name_data); lv_textarea_set_text(guider_ui.screen_pname_set,(const char *)name_data);
// 查询工艺数据 // 查询工艺数据
@ -585,7 +585,7 @@ void UI_pname_row_del(char* str_data)
lv_label_set_text(guider_ui.screen_step_,name_select_row); lv_label_set_text(guider_ui.screen_step_,name_select_row);
}else{ lv_label_set_text(guider_ui.screen_step_,"---/255");} }else{ lv_label_set_text(guider_ui.screen_step_,"---/255");}
lv_textarea_set_text(guider_ui.screen_pname_set,"工艺"); lv_textarea_set_text(guider_ui.screen_pname_set,"");
} }
//删除信息 //删除信息
void UI_pname_del() void UI_pname_del()

Loading…
Cancel
Save