添加表格显示

This commit is contained in:
sc committed 2026-02-19 16:13:15 +08:00
1 parent c073059846
commit e8d8bedc05
14 files changed
+1886 -1637

No files matched your search

@@ -15,12 +15,6 @@
#include "freemaster_client.h"
#endif
#include <lvgl/ui_data_labels.h>
#include "DB_SQLite.h"
int Work_Program_DATA=0;
char select_data_ui[4096]= {0};
#include "INI/config.h"
#include "data/Variable.h"
@@ -108,21 +102,7 @@ static void screen_w_w_event_handler (lv_event_t *e)
switch (code) {
case LV_EVENT_CLICKED:
{
if(Work_Program_DATA)
{
char sqlSELECT[512] = {0}; // 初始化为 0
char time_str[32];
if (get_time_str(time_str, sizeof(time_str)) != RT_NULL)
{
// 安全格式化
rt_snprintf(sqlSELECT, sizeof(sqlSELECT),"%S,%S",select_WorkOrder_DATA,time_str);
db_send_select(DB_CMD_SELECT, "SELECT * FROM WorkOrder WHERE State=101 LIMIT 16;", 500,select_data_ui);
}
}
else
{
db_send_select(DB_CMD_SELECT, select_Program_DATA, 500,select_data_ui);
}
Work_Program_ui();
break;
}
default:
@@ -34,6 +34,8 @@ typedef struct
lv_obj_t *screen_order;
lv_obj_t *screen_SYS_TIME;
lv_obj_t *screen_RUN_TIME;
lv_obj_t *screen_inf_err;
lv_obj_t *screen_inf_err_label;
lv_obj_t *screen_tabview;
lv_obj_t *screen_tabview_tab_1;
lv_obj_t *screen_tabview_tab_2;
@@ -80,7 +80,7 @@ void setup_scr_screen(lv_ui *ui)
lv_img_set_src(ui->screen_inf_img, &_ico_order_alpha_40x40);
lv_img_set_pivot(ui->screen_inf_img, 40,40);
lv_img_set_angle(ui->screen_inf_img, 0);
lv_obj_set_pos(ui->screen_inf_img, 350, 5);
lv_obj_set_pos(ui->screen_inf_img, 280, 5);
lv_obj_set_size(ui->screen_inf_img, 40, 40);
//Write style for screen_inf_img, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -192,7 +192,7 @@ void setup_scr_screen(lv_ui *ui)
lv_label_set_text(ui->screen_water, "9999");
lv_label_set_long_mode(ui->screen_water, LV_LABEL_LONG_CLIP);
lv_obj_set_pos(ui->screen_water, 180, 10);
lv_obj_set_size(ui->screen_water, 90, 25);
lv_obj_set_size(ui->screen_water, 80, 25);
//Write style for screen_water, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_water, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
@@ -214,8 +214,8 @@ void setup_scr_screen(lv_ui *ui)
ui->screen_order = lv_label_create(ui->screen_TITLE);
lv_label_set_text(ui->screen_order, "SC---------");
lv_label_set_long_mode(ui->screen_order, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_obj_set_pos(ui->screen_order, 400, 10);
lv_obj_set_size(ui->screen_order, 200, 30);
lv_obj_set_pos(ui->screen_order, 330, 10);
lv_obj_set_size(ui->screen_order, 300, 30);
//Write style for screen_order, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
@@ -279,6 +279,27 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_set_style_pad_left(ui->screen_RUN_TIME, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_RUN_TIME, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_inf_err
ui->screen_inf_err = lv_btn_create(ui->screen_TITLE);
ui->screen_inf_err_label = lv_label_create(ui->screen_inf_err);
lv_label_set_text(ui->screen_inf_err_label, "" LV_SYMBOL_WARNING " ");
lv_label_set_long_mode(ui->screen_inf_err_label, LV_LABEL_LONG_WRAP);
lv_obj_align(ui->screen_inf_err_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_inf_err, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_inf_err_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_inf_err, 970, 0);
lv_obj_set_size(ui->screen_inf_err, 50, 50);
//Write style for screen_inf_err, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_bg_opa(ui->screen_inf_err, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui->screen_inf_err, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_inf_err, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->screen_inf_err, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_inf_err, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_inf_err, &lv_font_simsun_24, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_inf_err, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->screen_inf_err, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN|LV_STATE_DEFAULT);
//Write codes screen_tabview
ui->screen_tabview = lv_tabview_create(ui->screen, LV_DIR_BOTTOM, 50);
lv_obj_set_pos(ui->screen_tabview, 0, 50);
@@ -411,7 +432,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_w_text
ui->screen_w_text = lv_label_create(ui->screen_tabview_tab_1);
lv_label_set_text(ui->screen_w_text, "Label");
lv_label_set_text(ui->screen_w_text, "信息");
lv_label_set_long_mode(ui->screen_w_text, LV_LABEL_LONG_WRAP);
lv_obj_set_pos(ui->screen_w_text, 305, 265);
lv_obj_set_size(ui->screen_w_text, 550, 230);
@@ -454,16 +475,9 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_w_list
ui->screen_w_list = lv_table_create(ui->screen_step_list);
lv_table_set_col_cnt(ui->screen_w_list,2);
lv_table_set_row_cnt(ui->screen_w_list,4);
lv_table_set_col_cnt(ui->screen_w_list,1);
lv_table_set_row_cnt(ui->screen_w_list,1);
lv_table_set_cell_value(ui->screen_w_list,0,0,"Name");
lv_table_set_cell_value(ui->screen_w_list,1,0,"Apple");
lv_table_set_cell_value(ui->screen_w_list,2,0,"Banana");
lv_table_set_cell_value(ui->screen_w_list,3,0,"Citron");
lv_table_set_cell_value(ui->screen_w_list,0,1,"Price");
lv_table_set_cell_value(ui->screen_w_list,1,1,"$1");
lv_table_set_cell_value(ui->screen_w_list,2,1,"$2");
lv_table_set_cell_value(ui->screen_w_list,3,1,"$3");
lv_obj_set_pos(ui->screen_w_list, 0, 0);
lv_obj_set_scrollbar_mode(ui->screen_w_list, LV_SCROLLBAR_MODE_OFF);
@@ -514,16 +528,9 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_list_inf
ui->screen_list_inf = lv_table_create(ui->screen_inf_list);
lv_table_set_col_cnt(ui->screen_list_inf,2);
lv_table_set_row_cnt(ui->screen_list_inf,4);
lv_table_set_col_cnt(ui->screen_list_inf,1);
lv_table_set_row_cnt(ui->screen_list_inf,1);
lv_table_set_cell_value(ui->screen_list_inf,0,0,"Name");
lv_table_set_cell_value(ui->screen_list_inf,1,0,"Apple");
lv_table_set_cell_value(ui->screen_list_inf,2,0,"Banana");
lv_table_set_cell_value(ui->screen_list_inf,3,0,"Citron");
lv_table_set_cell_value(ui->screen_list_inf,0,1,"Price");
lv_table_set_cell_value(ui->screen_list_inf,1,1,"$1");
lv_table_set_cell_value(ui->screen_list_inf,2,1,"$2");
lv_table_set_cell_value(ui->screen_list_inf,3,1,"$3");
lv_obj_set_pos(ui->screen_list_inf, 0, 0);
lv_obj_set_scrollbar_mode(ui->screen_list_inf, LV_SCROLLBAR_MODE_OFF);
@@ -851,7 +858,7 @@ void setup_scr_screen(lv_ui *ui)
lv_label_set_text(screen_tabview_tab_3_label, "");
//Write codes screen_w_io
ui->screen_w_io = lv_tabview_create(ui->screen_tabview_tab_3, LV_DIR_RIGHT, 50);
ui->screen_w_io = lv_tabview_create(ui->screen_tabview_tab_3, LV_DIR_RIGHT, 90);
lv_obj_set_pos(ui->screen_w_io, 0, 0);
lv_obj_set_size(ui->screen_w_io, 1024, 500);
lv_obj_set_scrollbar_mode(ui->screen_w_io, LV_SCROLLBAR_MODE_OFF);
@@ -859,7 +866,7 @@ void setup_scr_screen(lv_ui *ui)
//Write style for screen_w_io, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_bg_opa(ui->screen_w_io, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->screen_w_io, lv_color_hex(0x4d4d4d), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_w_io, &lv_font_simsun_12, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->screen_w_io, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui->screen_w_io, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->screen_w_io, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui->screen_w_io, 16, LV_PART_MAIN|LV_STATE_DEFAULT);
@@ -913,7 +920,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_DI_t1
ui->screen_DI_t1 = lv_obj_create(ui->screen_w_io_tab_1);
lv_obj_set_pos(ui->screen_DI_t1, 0, 0);
lv_obj_set_size(ui->screen_DI_t1, 850, 500);
lv_obj_set_size(ui->screen_DI_t1, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_DI_t1, LV_SCROLLBAR_MODE_OFF);
//Write style for screen_DI_t1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -2372,7 +2379,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_DI_t2
ui->screen_DI_t2 = lv_obj_create(ui->screen_w_io_tab_1);
lv_obj_set_pos(ui->screen_DI_t2, 0, 0);
lv_obj_set_size(ui->screen_DI_t2, 850, 500);
lv_obj_set_size(ui->screen_DI_t2, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_DI_t2, LV_SCROLLBAR_MODE_OFF);
lv_obj_add_flag(ui->screen_DI_t2, LV_OBJ_FLAG_HIDDEN);
@@ -2877,7 +2884,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_DIU_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_DIU, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_DIU_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_DIU, 860, 10);
lv_obj_set_pos(ui->screen_btn_DIU, 850, 10);
lv_obj_set_size(ui->screen_btn_DIU, 50, 100);
lv_obj_add_flag(ui->screen_btn_DIU, LV_OBJ_FLAG_HIDDEN);
@@ -2901,7 +2908,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_DID_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_DID, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_DID_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_DID, 860, 360);
lv_obj_set_pos(ui->screen_btn_DID, 850, 360);
lv_obj_set_size(ui->screen_btn_DID, 50, 100);
//Write style for screen_btn_DID, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -2924,7 +2931,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_DO_t2
ui->screen_DO_t2 = lv_obj_create(ui->screen_w_io_tab_2);
lv_obj_set_pos(ui->screen_DO_t2, 0, 0);
lv_obj_set_size(ui->screen_DO_t2, 850, 500);
lv_obj_set_size(ui->screen_DO_t2, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_DO_t2, LV_SCROLLBAR_MODE_OFF);
lv_obj_add_flag(ui->screen_DO_t2, LV_OBJ_FLAG_HIDDEN);
@@ -3424,7 +3431,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_DO_t1
ui->screen_DO_t1 = lv_obj_create(ui->screen_w_io_tab_2);
lv_obj_set_pos(ui->screen_DO_t1, 0, 0);
lv_obj_set_size(ui->screen_DO_t1, 850, 500);
lv_obj_set_size(ui->screen_DO_t1, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_DO_t1, LV_SCROLLBAR_MODE_OFF);
//Write style for screen_DO_t1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -4888,7 +4895,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_DOU_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_DOU, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_DOU_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_DOU, 860, 10);
lv_obj_set_pos(ui->screen_btn_DOU, 850, 10);
lv_obj_set_size(ui->screen_btn_DOU, 50, 100);
lv_obj_add_flag(ui->screen_btn_DOU, LV_OBJ_FLAG_HIDDEN);
@@ -4912,7 +4919,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_DOD_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_DOD, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_DOD_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_DOD, 860, 360);
lv_obj_set_pos(ui->screen_btn_DOD, 850, 360);
lv_obj_set_size(ui->screen_btn_DOD, 50, 100);
//Write style for screen_btn_DOD, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -4935,7 +4942,7 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_AIO_t2
ui->screen_AIO_t2 = lv_obj_create(ui->screen_w_io_tab_3);
lv_obj_set_pos(ui->screen_AIO_t2, 0, 0);
lv_obj_set_size(ui->screen_AIO_t2, 850, 500);
lv_obj_set_size(ui->screen_AIO_t2, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_AIO_t2, LV_SCROLLBAR_MODE_OFF);
lv_obj_add_flag(ui->screen_AIO_t2, LV_OBJ_FLAG_HIDDEN);
@@ -5231,7 +5238,7 @@ void setup_scr_screen(lv_ui *ui)
ui->screen_label_30 = lv_label_create(ui->screen_AIO_t2);
lv_label_set_text(ui->screen_label_30, "加料比例1");
lv_label_set_long_mode(ui->screen_label_30, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_obj_set_pos(ui->screen_label_30, 50, 90);
lv_obj_set_pos(ui->screen_label_30, 50, 91);
lv_obj_set_size(ui->screen_label_30, 155, 30);
//Write style for screen_label_30, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -5755,11 +5762,14 @@ void setup_scr_screen(lv_ui *ui)
//Write codes screen_AIO_t1
ui->screen_AIO_t1 = lv_obj_create(ui->screen_w_io_tab_3);
lv_obj_set_pos(ui->screen_AIO_t1, 0, 0);
lv_obj_set_size(ui->screen_AIO_t1, 850, 500);
lv_obj_set_size(ui->screen_AIO_t1, 830, 500);
lv_obj_set_scrollbar_mode(ui->screen_AIO_t1, LV_SCROLLBAR_MODE_OFF);
//Write style for screen_AIO_t1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->screen_AIO_t1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui->screen_AIO_t1, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(ui->screen_AIO_t1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_color(ui->screen_AIO_t1, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_border_side(ui->screen_AIO_t1, LV_BORDER_SIDE_FULL, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->screen_AIO_t1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->screen_AIO_t1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->screen_AIO_t1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
@@ -6322,7 +6332,7 @@ void setup_scr_screen(lv_ui *ui)
ui->screen_label_3 = lv_label_create(ui->screen_AIO_t1);
lv_label_set_text(ui->screen_label_3, "温度2");
lv_label_set_long_mode(ui->screen_label_3, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_obj_set_pos(ui->screen_label_3, 449, 10);
lv_obj_set_pos(ui->screen_label_3, 450, 10);
lv_obj_set_size(ui->screen_label_3, 155, 30);
//Write style for screen_label_3, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
@@ -6976,7 +6986,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_AIOU_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_AIOU, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_AIOU_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_AIOU, 860, 10);
lv_obj_set_pos(ui->screen_btn_AIOU, 850, 10);
lv_obj_set_size(ui->screen_btn_AIOU, 50, 100);
lv_obj_add_flag(ui->screen_btn_AIOU, LV_OBJ_FLAG_HIDDEN);
@@ -7000,7 +7010,7 @@ void setup_scr_screen(lv_ui *ui)
lv_obj_align(ui->screen_btn_AIOD_label, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_set_style_pad_all(ui->screen_btn_AIOD, 0, LV_STATE_DEFAULT);
lv_obj_set_width(ui->screen_btn_AIOD_label, LV_PCT(100));
lv_obj_set_pos(ui->screen_btn_AIOD, 860, 360);
lv_obj_set_pos(ui->screen_btn_AIOD, 850, 360);
lv_obj_set_size(ui->screen_btn_AIOD, 50, 100);
//Write style for screen_btn_AIOD, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.