|
|
@ -260,15 +260,18 @@ static void tabview_event_cb(lv_event_t *e) |
|
|
// 根据 tab_id 执行不同操作
|
|
|
// 根据 tab_id 执行不同操作
|
|
|
switch (tab_id) { |
|
|
switch (tab_id) { |
|
|
case 0://工单页面
|
|
|
case 0://工单页面
|
|
|
|
|
|
io_ui_show=0; |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
case 1://工艺页面
|
|
|
case 1://工艺页面
|
|
|
|
|
|
io_ui_show=0; |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
case 2: |
|
|
case 2: |
|
|
|
|
|
io_ui_show=1; |
|
|
break; |
|
|
break; |
|
|
case 3://程序页面
|
|
|
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_Edit,LV_STATE_DISABLED); |
|
|
lv_obj_add_state(guider_ui.screen_set_Insert,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_Delete,LV_STATE_DISABLED); |
|
|
@ -276,7 +279,34 @@ static void tabview_event_cb(lv_event_t *e) |
|
|
UI_pname_row(); |
|
|
UI_pname_row(); |
|
|
break; |
|
|
break; |
|
|
case 4: |
|
|
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; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -287,7 +317,9 @@ 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_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
|
|
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_w_io), 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_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_1, 0, LV_PART_MAIN); |
|
|
lv_obj_set_style_pad_all(ui->screen_tabview_tab_2, 0, LV_PART_MAIN); |
|
|
lv_obj_set_style_pad_all(ui->screen_tabview_tab_2, 0, LV_PART_MAIN); |
|
|
|