新增按键按下事件
This commit is contained in:
parent
27458a3f11
commit
5022a65504
@ -91,53 +91,70 @@ void ui_pageSDCard_screen_init(void)
|
|||||||
lv_obj_set_width(ui_pageSDCard_labelSDCardUsed, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_pageSDCard_labelSDCardUsed, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_pageSDCard_labelSDCardUsed, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_pageSDCard_labelSDCardUsed, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_pageSDCard_labelSDCardUsed, -2);
|
lv_obj_set_x(ui_pageSDCard_labelSDCardUsed, -2);
|
||||||
lv_obj_set_y(ui_pageSDCard_labelSDCardUsed, -53);
|
lv_obj_set_y(ui_pageSDCard_labelSDCardUsed, -68);
|
||||||
lv_obj_set_align(ui_pageSDCard_labelSDCardUsed, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_pageSDCard_labelSDCardUsed, LV_ALIGN_CENTER);
|
||||||
lv_label_set_text(ui_pageSDCard_labelSDCardUsed, "used:4GB");
|
lv_label_set_text(ui_pageSDCard_labelSDCardUsed, "used:4GB");
|
||||||
|
|
||||||
ui_pageSDCard_labelSDCardSize = lv_label_create(ui_pageSDCard_panelSDCardUse);
|
ui_pageSDCard_labelSDCardSize = lv_label_create(ui_pageSDCard_panelSDCardUse);
|
||||||
lv_obj_set_width(ui_pageSDCard_labelSDCardSize, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_pageSDCard_labelSDCardSize, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_pageSDCard_labelSDCardSize, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_pageSDCard_labelSDCardSize, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_pageSDCard_labelSDCardSize, -4);
|
lv_obj_set_x(ui_pageSDCard_labelSDCardSize, -3);
|
||||||
lv_obj_set_y(ui_pageSDCard_labelSDCardSize, -24);
|
lv_obj_set_y(ui_pageSDCard_labelSDCardSize, -44);
|
||||||
lv_obj_set_align(ui_pageSDCard_labelSDCardSize, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_pageSDCard_labelSDCardSize, LV_ALIGN_CENTER);
|
||||||
lv_label_set_text(ui_pageSDCard_labelSDCardSize, "size:8GB");
|
lv_label_set_text(ui_pageSDCard_labelSDCardSize, "size:8GB");
|
||||||
|
|
||||||
ui_pageSDCard_lableSDCardMountPoint = lv_label_create(ui_pageSDCard_panelSDCardUse);
|
ui_pageSDCard_lableSDCardMountPoint = lv_label_create(ui_pageSDCard_panelSDCardUse);
|
||||||
lv_obj_set_width(ui_pageSDCard_lableSDCardMountPoint, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_pageSDCard_lableSDCardMountPoint, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_pageSDCard_lableSDCardMountPoint, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_pageSDCard_lableSDCardMountPoint, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_pageSDCard_lableSDCardMountPoint, 1);
|
lv_obj_set_x(ui_pageSDCard_lableSDCardMountPoint, 2);
|
||||||
lv_obj_set_y(ui_pageSDCard_lableSDCardMountPoint, 32);
|
lv_obj_set_y(ui_pageSDCard_lableSDCardMountPoint, -11);
|
||||||
lv_obj_set_align(ui_pageSDCard_lableSDCardMountPoint, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_pageSDCard_lableSDCardMountPoint, LV_ALIGN_CENTER);
|
||||||
lv_label_set_text(ui_pageSDCard_lableSDCardMountPoint, "MontPoint:\n/Data");
|
lv_label_set_text(ui_pageSDCard_lableSDCardMountPoint, "MontPoint:\n/Data");
|
||||||
|
|
||||||
ui_pageSDCard_textAreaSDCard = lv_textarea_create(ui_pageSDCard_panelBody);
|
|
||||||
lv_obj_set_width(ui_pageSDCard_textAreaSDCard, 320);
|
|
||||||
lv_obj_set_height(ui_pageSDCard_textAreaSDCard, 130);
|
|
||||||
lv_obj_set_x(ui_pageSDCard_textAreaSDCard, -1);
|
|
||||||
lv_obj_set_y(ui_pageSDCard_textAreaSDCard, 36);
|
|
||||||
lv_obj_set_align(ui_pageSDCard_textAreaSDCard, LV_ALIGN_CENTER);
|
|
||||||
lv_textarea_set_placeholder_text(ui_pageSDCard_textAreaSDCard, "Placeholder...");
|
|
||||||
|
|
||||||
ui_pageSDCard_buttonReadSDCard = lv_btn_create(ui_pageSDCard_panelBody);
|
ui_pageSDCard_buttonReadSDCard = lv_btn_create(ui_pageSDCard_panelBody);
|
||||||
lv_obj_set_width(ui_pageSDCard_buttonReadSDCard, 300);
|
lv_obj_set_width(ui_pageSDCard_buttonReadSDCard, 91);
|
||||||
lv_obj_set_height(ui_pageSDCard_buttonReadSDCard, 50);
|
lv_obj_set_height(ui_pageSDCard_buttonReadSDCard, 50);
|
||||||
lv_obj_set_x(ui_pageSDCard_buttonReadSDCard, -2);
|
lv_obj_set_x(ui_pageSDCard_buttonReadSDCard, -96);
|
||||||
lv_obj_set_y(ui_pageSDCard_buttonReadSDCard, 137);
|
lv_obj_set_y(ui_pageSDCard_buttonReadSDCard, -77);
|
||||||
lv_obj_set_align(ui_pageSDCard_buttonReadSDCard, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_pageSDCard_buttonReadSDCard, LV_ALIGN_CENTER);
|
||||||
|
|
||||||
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_buttonReadSDCard);
|
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_buttonReadSDCard);
|
||||||
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, -5);
|
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, -2);
|
||||||
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, -1);
|
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, -1);
|
||||||
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
|
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
|
||||||
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "< < <Read SD Card Infomation > > >");
|
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "SD Size");
|
||||||
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
|
ui_pageSDCard_Panel9 = lv_obj_create(ui_pageSDCard);
|
||||||
|
lv_obj_set_width(ui_pageSDCard_Panel9, 304);
|
||||||
|
lv_obj_set_height(ui_pageSDCard_Panel9, 165);
|
||||||
|
lv_obj_set_x(ui_pageSDCard_Panel9, 0);
|
||||||
|
lv_obj_set_y(ui_pageSDCard_Panel9, 86);
|
||||||
|
lv_obj_set_align(ui_pageSDCard_Panel9, LV_ALIGN_CENTER);
|
||||||
|
lv_obj_clear_flag(ui_pageSDCard_Panel9, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
||||||
|
|
||||||
|
ui_pageSDCard_buttonClearSD = lv_btn_create(ui_pageSDCard_Panel9);
|
||||||
|
lv_obj_set_width(ui_pageSDCard_buttonClearSD, 91);
|
||||||
|
lv_obj_set_height(ui_pageSDCard_buttonClearSD, 50);
|
||||||
|
lv_obj_set_x(ui_pageSDCard_buttonClearSD, -91);
|
||||||
|
lv_obj_set_y(ui_pageSDCard_buttonClearSD, 45);
|
||||||
|
lv_obj_set_align(ui_pageSDCard_buttonClearSD, LV_ALIGN_CENTER);
|
||||||
|
|
||||||
|
ui_pageSDCard_labelReadSDCard1 = lv_label_create(ui_pageSDCard_buttonClearSD);
|
||||||
|
lv_obj_set_width(ui_pageSDCard_labelReadSDCard1, LV_SIZE_CONTENT); /// 1
|
||||||
|
lv_obj_set_height(ui_pageSDCard_labelReadSDCard1, LV_SIZE_CONTENT); /// 1
|
||||||
|
lv_obj_set_x(ui_pageSDCard_labelReadSDCard1, -7);
|
||||||
|
lv_obj_set_y(ui_pageSDCard_labelReadSDCard1, 1);
|
||||||
|
lv_obj_set_align(ui_pageSDCard_labelReadSDCard1, LV_ALIGN_LEFT_MID);
|
||||||
|
lv_label_set_text(ui_pageSDCard_labelReadSDCard1, "Clear SD");
|
||||||
|
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard1, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
lv_obj_add_event_cb(ui_pageSDCard_panelHeader, ui_event_pageSDCard_panelHeader, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_pageSDCard_panelHeader, ui_event_pageSDCard_panelHeader, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_pageSDCard_buttonReadSDCard, ui_event_pageSDCard_buttonReadSDCard, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_pageSDCard_buttonReadSDCard, ui_event_pageSDCard_buttonReadSDCard, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_pageSDCard_panelBody, ui_event_pageSDCard_panelBody, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_pageSDCard_panelBody, ui_event_pageSDCard_panelBody, LV_EVENT_ALL, NULL);
|
||||||
|
lv_obj_add_event_cb(ui_pageSDCard_buttonClearSD, ui_event_pageSDCard_buttonClearSD, LV_EVENT_ALL, NULL);
|
||||||
uic_pageSDCard_panelSDCardFree = ui_pageSDCard_panelSDCardFree;
|
uic_pageSDCard_panelSDCardFree = ui_pageSDCard_panelSDCardFree;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -310,10 +310,13 @@ lv_obj_t * ui_pageSDCard_panelSDCardUse;
|
|||||||
lv_obj_t * ui_pageSDCard_labelSDCardUsed;
|
lv_obj_t * ui_pageSDCard_labelSDCardUsed;
|
||||||
lv_obj_t * ui_pageSDCard_labelSDCardSize;
|
lv_obj_t * ui_pageSDCard_labelSDCardSize;
|
||||||
lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
|
lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
|
||||||
lv_obj_t * ui_pageSDCard_textAreaSDCard;
|
|
||||||
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
|
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
|
||||||
lv_obj_t * ui_pageSDCard_buttonReadSDCard;
|
lv_obj_t * ui_pageSDCard_buttonReadSDCard;
|
||||||
lv_obj_t * ui_pageSDCard_labelReadSDCard;
|
lv_obj_t * ui_pageSDCard_labelReadSDCard;
|
||||||
|
lv_obj_t * ui_pageSDCard_Panel9;
|
||||||
|
void ui_event_pageSDCard_buttonClearSD(lv_event_t * e);
|
||||||
|
lv_obj_t * ui_pageSDCard_buttonClearSD;
|
||||||
|
lv_obj_t * ui_pageSDCard_labelReadSDCard1;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
lv_obj_t * uic_pageSDCard_panelSDCardFree;
|
lv_obj_t * uic_pageSDCard_panelSDCardFree;
|
||||||
|
|
||||||
@ -945,6 +948,15 @@ void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ui_event_pageSDCard_buttonClearSD(lv_event_t * e)
|
||||||
|
{
|
||||||
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
|
|
||||||
|
if(event_code == LV_EVENT_CLICKED) {
|
||||||
|
on_buttonClearSD_clicked(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ui_event_pageFluxRead(lv_event_t * e)
|
void ui_event_pageFluxRead(lv_event_t * e)
|
||||||
{
|
{
|
||||||
lv_event_code_t event_code = lv_event_get_code(e);
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
|
|||||||
@ -320,10 +320,13 @@ extern lv_obj_t * ui_pageSDCard_panelSDCardUse;
|
|||||||
extern lv_obj_t * ui_pageSDCard_labelSDCardUsed;
|
extern lv_obj_t * ui_pageSDCard_labelSDCardUsed;
|
||||||
extern lv_obj_t * ui_pageSDCard_labelSDCardSize;
|
extern lv_obj_t * ui_pageSDCard_labelSDCardSize;
|
||||||
extern lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
|
extern lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
|
||||||
extern lv_obj_t * ui_pageSDCard_textAreaSDCard;
|
|
||||||
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
|
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_pageSDCard_buttonReadSDCard;
|
extern lv_obj_t * ui_pageSDCard_buttonReadSDCard;
|
||||||
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
|
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
|
||||||
|
extern lv_obj_t * ui_pageSDCard_Panel9;
|
||||||
|
void ui_event_pageSDCard_buttonClearSD(lv_event_t * e);
|
||||||
|
extern lv_obj_t * ui_pageSDCard_buttonClearSD;
|
||||||
|
extern lv_obj_t * ui_pageSDCard_labelReadSDCard1;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
extern lv_obj_t * uic_pageSDCard_panelSDCardFree;
|
extern lv_obj_t * uic_pageSDCard_panelSDCardFree;
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,6 @@ void on_dropdownDeviceType_valueChanged(lv_event_t * e)
|
|||||||
void on_buttonReadSDCard_clicked(lv_event_t * e)
|
void on_buttonReadSDCard_clicked(lv_event_t * e)
|
||||||
{
|
{
|
||||||
/*首先清空显示页面*/
|
/*首先清空显示页面*/
|
||||||
lv_textarea_set_text(ui_pageSDCard_textAreaSDCard,"");
|
|
||||||
esp_vfs_fat_info(MOUNT_POINT,&sdData.total_bytes,&sdData.free_bytes);
|
esp_vfs_fat_info(MOUNT_POINT,&sdData.total_bytes,&sdData.free_bytes);
|
||||||
sdData.free_percent = (float)sdData.free_bytes / (float)sdData.total_bytes * 100;
|
sdData.free_percent = (float)sdData.free_bytes / (float)sdData.total_bytes * 100;
|
||||||
|
|
||||||
@ -209,4 +208,10 @@ void on_switchShutOff_valueChanged(lv_event_t * e)
|
|||||||
{
|
{
|
||||||
/* 关机开关 */
|
/* 关机开关 */
|
||||||
POWER_OFF;
|
POWER_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 清空SD卡中的内容 */
|
||||||
|
void on_buttonClearSD_clicked(lv_event_t * e)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -27,6 +27,7 @@ void on_buttonClearPassword_clicked(lv_event_t * e);
|
|||||||
void on_buttonSearchWifi_clicked(lv_event_t * e);
|
void on_buttonSearchWifi_clicked(lv_event_t * e);
|
||||||
void on_buttonConnectWifi_clicked(lv_event_t * e);
|
void on_buttonConnectWifi_clicked(lv_event_t * e);
|
||||||
void on_buttonReadSDCard_clicked(lv_event_t * e);
|
void on_buttonReadSDCard_clicked(lv_event_t * e);
|
||||||
|
void on_buttonClearSD_clicked(lv_event_t * e);
|
||||||
void on_dropDownWorkmode_valueChanged(lv_event_t * e);
|
void on_dropDownWorkmode_valueChanged(lv_event_t * e);
|
||||||
void on_buttonReadFlux_clicked(lv_event_t * e);
|
void on_buttonReadFlux_clicked(lv_event_t * e);
|
||||||
void on_spinboxTime_valueChanged(lv_event_t * e);
|
void on_spinboxTime_valueChanged(lv_event_t * e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user