You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
56 lines
1.2 KiB
|
|
#include "tjc_screen_page.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "./page/Page_main.h"
|
|
#include "./page/Page_settingtime.h"
|
|
#include "tjc_screen_event.h"
|
|
static onpagefunc_t OnPageLoad;
|
|
static onpagefunc_t OnPageButton;
|
|
static onpagefunc_t OnPageInputFileModify;
|
|
|
|
/**
|
|
* @description: 判断现在所属页面
|
|
* @return {*}
|
|
*/
|
|
static bool IsBelongPage(uint8_t page) {
|
|
switch (page) {
|
|
case pg_main: {
|
|
Page_main_register();
|
|
return true;
|
|
} break;
|
|
case pg_SettingTime: {
|
|
Page_settingtime_register();
|
|
return true;
|
|
} break;
|
|
default:
|
|
return false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
/*
|
|
*
|
|
*@brief页面处理
|
|
*
|
|
*
|
|
*/
|
|
void tjc_process_page(tjc_screen_event_t* event) {
|
|
if (!IsBelongPage(event->pid)) {
|
|
printf("No this page");
|
|
return;
|
|
}
|
|
|
|
if (kpt_sys_event_page_id == event->eventId) {
|
|
OnPageLoad();
|
|
} else if (kpt_button_event == event->eventId) {
|
|
OnPageButton();
|
|
} else if (kpt_inputfield_content_change_event1 == event->eventId) {
|
|
OnPageInputFileModify();
|
|
}
|
|
}
|
|
|
|
void Load_reg(onpagefunc_t PageFunction) { OnPageLoad = PageFunction; }
|
|
void Button_reg(onpagefunc_t PageFunction) { OnPageButton = PageFunction; }
|
|
void InputFileModify_reg(onpagefunc_t PageFunction) { OnPageInputFileModify = PageFunction; }
|