io页面ui刷新逻辑修改

This commit is contained in:
sc committed 2026-03-08 00:04:55 +08:00
1 parent f687b4aac4
commit 281662556f
5 files changed
+63 -9

No files matched your search

+33 -1
View File
@@ -260,15 +260,18 @@ static void tabview_event_cb(lv_event_t *e)
// 根据 tab_id 执行不同操作
switch (tab_id) {
case 0://工单页面
io_ui_show=0;
break;
case 1://工艺页面
io_ui_show=0;
break;
case 2:
io_ui_show=1;
break;
case 3://程序页面
io_ui_show=0;
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);
@@ -276,18 +279,47 @@ static void tabview_event_cb(lv_event_t *e)
UI_pname_row();
break;
case 4:
io_ui_show=0;
break;
}
}
}
// 机台页面事件回调函数
static void w_io_event_cb(lv_event_t *e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t *tabview = lv_event_get_target(e);
if (code == LV_EVENT_VALUE_CHANGED) {
// 获取当前选中的 Tab 索引
uint16_t tab_id = lv_tabview_get_tab_act(tabview);
// 根据 tab_id 执行不同操作
switch (tab_id) {
case 0:
io_ui_size=0;
break;
case 1:
io_ui_size=1;
break;
case 2:
io_ui_size=2;
break;
case 3:
io_ui_size=3;
break;
}
}
}
void custom_init(lv_ui *ui)
{
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_w_io), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
//选项卡回调事件设置
lv_obj_add_event_cb(ui->screen_tabview, tabview_event_cb, LV_EVENT_VALUE_CHANGED, NULL);//
lv_obj_add_event_cb(ui->screen_w_io, w_io_event_cb, LV_EVENT_VALUE_CHANGED, NULL);//
lv_obj_set_style_pad_all(ui->screen_tabview_tab_1, 0, LV_PART_MAIN);
lv_obj_set_style_pad_all(ui->screen_tabview_tab_2, 0, LV_PART_MAIN);