下拉菜单功能完善完毕
This commit is contained in:
parent
c3219ea19b
commit
c43f1a010c
File diff suppressed because one or more lines are too long
@ -2254,7 +2254,8 @@
|
|||||||
"InheritedType": 11
|
"InheritedType": 11
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"saved_objtypeKey": "PANEL"
|
"saved_objtypeKey": "PANEL",
|
||||||
|
"tree_closed": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"guid": "GUID16763883-502735S24514463",
|
"guid": "GUID16763883-502735S24514463",
|
||||||
@ -2652,7 +2653,7 @@
|
|||||||
{
|
{
|
||||||
"nid": 10,
|
"nid": 10,
|
||||||
"strtype": "OBJECT/Name",
|
"strtype": "OBJECT/Name",
|
||||||
"strval": "ButtonMinus1",
|
"strval": "ButtonPlus",
|
||||||
"InheritedType": 10
|
"InheritedType": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -4652,8 +4653,7 @@
|
|||||||
"InheritedType": 11
|
"InheritedType": 11
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"saved_objtypeKey": "PANEL",
|
"saved_objtypeKey": "PANEL"
|
||||||
"tree_closed": true
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dont_export": false,
|
"dont_export": false,
|
||||||
@ -4984,7 +4984,7 @@
|
|||||||
{
|
{
|
||||||
"nid": 10,
|
"nid": 10,
|
||||||
"strtype": "OBJECT/Name",
|
"strtype": "OBJECT/Name",
|
||||||
"strval": "Button1",
|
"strval": "startTest",
|
||||||
"InheritedType": 10
|
"InheritedType": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5038,13 +5038,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nid": 90,
|
"nid": 90,
|
||||||
"flags": 1048576,
|
|
||||||
"strtype": "OBJECT/Flags",
|
"strtype": "OBJECT/Flags",
|
||||||
"InheritedType": 1
|
"InheritedType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nid": 225,
|
"nid": 225,
|
||||||
"flags": 1048576,
|
|
||||||
"strtype": "OBJECT/Scrolling",
|
"strtype": "OBJECT/Scrolling",
|
||||||
"InheritedType": 1
|
"InheritedType": 1
|
||||||
},
|
},
|
||||||
@ -5074,7 +5072,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nid": 320,
|
"nid": 320,
|
||||||
"flags": 1048576,
|
|
||||||
"strtype": "OBJECT/States",
|
"strtype": "OBJECT/States",
|
||||||
"InheritedType": 1
|
"InheritedType": 1
|
||||||
},
|
},
|
||||||
@ -7804,6 +7801,71 @@
|
|||||||
"strtype": "DROPDOWN/Style_list_selected",
|
"strtype": "DROPDOWN/Style_list_selected",
|
||||||
"strval": "{\"python\":\"{0}.get_list()\",\"c\":\"lv_dropdown_get_list({0})\"} lv.PART.SELECTED, Text, Rectangle",
|
"strval": "{\"python\":\"{0}.get_list()\",\"c\":\"lv_dropdown_get_list({0})\"} lv.PART.SELECTED, Text, Rectangle",
|
||||||
"InheritedType": 11
|
"InheritedType": 11
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"disabled": false,
|
||||||
|
"nid": 1000183,
|
||||||
|
"strtype": "_event/EventHandler",
|
||||||
|
"strval": "VALUE_CHANGED",
|
||||||
|
"childs": [
|
||||||
|
{
|
||||||
|
"nid": 1000184,
|
||||||
|
"strtype": "_event/name",
|
||||||
|
"strval": "Event18",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000185,
|
||||||
|
"strtype": "_event/condition_C",
|
||||||
|
"strval": "",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000186,
|
||||||
|
"strtype": "_event/condition_P",
|
||||||
|
"strval": "",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000187,
|
||||||
|
"strtype": "_event/action",
|
||||||
|
"strval": "CALL FUNCTION",
|
||||||
|
"childs": [
|
||||||
|
{
|
||||||
|
"nid": 1000188,
|
||||||
|
"strtype": "CALL FUNCTION/Name",
|
||||||
|
"strval": "CALL FUNCTION",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000189,
|
||||||
|
"strtype": "CALL FUNCTION/Call",
|
||||||
|
"strval": "<{Function_name}>( event_struct )",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000190,
|
||||||
|
"strtype": "CALL FUNCTION/CallC",
|
||||||
|
"strval": "<{Function_name}>( e );",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000191,
|
||||||
|
"strtype": "CALL FUNCTION/Function_name",
|
||||||
|
"strval": "DeviceDropDownValueChanged",
|
||||||
|
"InheritedType": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nid": 1000192,
|
||||||
|
"strtype": "CALL FUNCTION/Dont_export_function",
|
||||||
|
"strval": "False",
|
||||||
|
"InheritedType": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InheritedType": 10
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InheritedType": 4
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"saved_objtypeKey": "DROPDOWN"
|
"saved_objtypeKey": "DROPDOWN"
|
||||||
@ -16389,7 +16451,7 @@
|
|||||||
"uiExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
"uiExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
||||||
"projectExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
"projectExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
||||||
"custom_variable_prefix": "uic",
|
"custom_variable_prefix": "uic",
|
||||||
"backup_cnt": 226,
|
"backup_cnt": 230,
|
||||||
"autosave_cnt": 0,
|
"autosave_cnt": 0,
|
||||||
"group_color_cnt": 0,
|
"group_color_cnt": 0,
|
||||||
"lvgl_version": "8.3.6",
|
"lvgl_version": "8.3.6",
|
||||||
@ -16406,7 +16468,7 @@
|
|||||||
"drive_fatfs_path": "",
|
"drive_fatfs_path": "",
|
||||||
"naming": "_Screen_Name",
|
"naming": "_Screen_Name",
|
||||||
"naming_force_lowercase": false,
|
"naming_force_lowercase": false,
|
||||||
"nidcnt": 1000183,
|
"nidcnt": 1000193,
|
||||||
"BitDepth": 16,
|
"BitDepth": 16,
|
||||||
"Name": "ESP32S3_UI"
|
"Name": "ESP32S3_UI"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,3 +18,7 @@ def ReadSdCallFunc(event_struct):
|
|||||||
def lightSliderCallback(event_struct):
|
def lightSliderCallback(event_struct):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def DeviceDropDownValueChanged(event_struct):
|
||||||
|
return
|
||||||
|
|
||||||
|
|||||||
@ -42,16 +42,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_opa(ui_Home_WIFILabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_WIFILabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_WIFILabel, &ui_font_MiSansN14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_WIFILabel, &ui_font_MiSansN14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_HeaderTimeHome = lv_label_create(ui_Home);
|
ui_Home_HeaderDeviceType = lv_label_create(ui_Home);
|
||||||
lv_obj_set_width(ui_Home_HeaderTimeHome, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_HeaderDeviceType, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_Home_HeaderTimeHome, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_Home_HeaderDeviceType, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_Home_HeaderTimeHome, 0);
|
lv_obj_set_x(ui_Home_HeaderDeviceType, 0);
|
||||||
lv_obj_set_y(ui_Home_HeaderTimeHome, -225);
|
lv_obj_set_y(ui_Home_HeaderDeviceType, -225);
|
||||||
lv_obj_set_align(ui_Home_HeaderTimeHome, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_HeaderDeviceType, LV_ALIGN_CENTER);
|
||||||
lv_label_set_text(ui_Home_HeaderTimeHome, "Spirit-3");
|
lv_label_set_text(ui_Home_HeaderDeviceType, "Spirit-3");
|
||||||
lv_obj_set_style_text_color(ui_Home_HeaderTimeHome, lv_color_hex(0xFCF6F6), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_HeaderDeviceType, lv_color_hex(0xFCF6F6), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_HeaderTimeHome, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_HeaderDeviceType, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_HeaderTimeHome, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_HeaderDeviceType, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_SliderHeaderBat = lv_slider_create(ui_Home);
|
ui_Home_SliderHeaderBat = lv_slider_create(ui_Home);
|
||||||
lv_slider_set_value(ui_Home_SliderHeaderBat, 60, LV_ANIM_OFF);
|
lv_slider_set_value(ui_Home_SliderHeaderBat, 60, LV_ANIM_OFF);
|
||||||
@ -227,16 +227,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_color(ui_Home_ButtonMinus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_ButtonMinus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_ButtonMinus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_ButtonMinus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_ButtonMinus1 = lv_btn_create(ui_Home_Panel3);
|
ui_Home_ButtonPlus = lv_btn_create(ui_Home_Panel3);
|
||||||
lv_obj_set_width(ui_Home_ButtonMinus1, 100);
|
lv_obj_set_width(ui_Home_ButtonPlus, 100);
|
||||||
lv_obj_set_height(ui_Home_ButtonMinus1, 50);
|
lv_obj_set_height(ui_Home_ButtonPlus, 50);
|
||||||
lv_obj_set_x(ui_Home_ButtonMinus1, 88);
|
lv_obj_set_x(ui_Home_ButtonPlus, 88);
|
||||||
lv_obj_set_y(ui_Home_ButtonMinus1, 140);
|
lv_obj_set_y(ui_Home_ButtonPlus, 140);
|
||||||
lv_obj_set_align(ui_Home_ButtonMinus1, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_ButtonPlus, LV_ALIGN_CENTER);
|
||||||
lv_obj_set_style_bg_color(ui_Home_ButtonMinus1, lv_color_hex(0xE0E4E3), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_color(ui_Home_ButtonPlus, lv_color_hex(0xE0E4E3), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_bg_opa(ui_Home_ButtonMinus1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_opa(ui_Home_ButtonPlus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_color(ui_Home_ButtonMinus1, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_ButtonPlus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_ButtonMinus1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_ButtonPlus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Label1 = lv_label_create(ui_Home_Panel3);
|
ui_Home_Label1 = lv_label_create(ui_Home_Panel3);
|
||||||
lv_obj_set_width(ui_Home_Label1, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_Label1, LV_SIZE_CONTENT); /// 1
|
||||||
@ -343,16 +343,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_align(ui_Home_Spinbox4, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_align(ui_Home_Spinbox4, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_Spinbox4, &ui_font_homePanelLabel, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_Spinbox4, &ui_font_homePanelLabel, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Button1 = lv_btn_create(ui_Home);
|
ui_Home_startTest = lv_btn_create(ui_Home);
|
||||||
lv_obj_set_width(ui_Home_Button1, 296);
|
lv_obj_set_width(ui_Home_startTest, 296);
|
||||||
lv_obj_set_height(ui_Home_Button1, 61);
|
lv_obj_set_height(ui_Home_startTest, 61);
|
||||||
lv_obj_set_x(ui_Home_Button1, 3);
|
lv_obj_set_x(ui_Home_startTest, 3);
|
||||||
lv_obj_set_y(ui_Home_Button1, 194);
|
lv_obj_set_y(ui_Home_startTest, 194);
|
||||||
lv_obj_set_align(ui_Home_Button1, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_startTest, LV_ALIGN_CENTER);
|
||||||
lv_obj_set_style_bg_color(ui_Home_Button1, lv_color_hex(0x4A58DD), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_color(ui_Home_startTest, lv_color_hex(0x4A58DD), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_bg_opa(ui_Home_Button1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_opa(ui_Home_startTest, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Label4 = lv_label_create(ui_Home_Button1);
|
ui_Home_Label4 = lv_label_create(ui_Home_startTest);
|
||||||
lv_obj_set_width(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_Home_Label4, 3);
|
lv_obj_set_x(ui_Home_Label4, 3);
|
||||||
@ -364,6 +364,6 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_add_event_cb(ui_Home_Panel2, ui_event_Home_Panel2, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_Panel2, ui_event_Home_Panel2, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_Panel6, ui_event_Home_Panel6, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_Panel6, ui_event_Home_Panel6, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_ButtonMinus, ui_event_Home_ButtonMinus, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_ButtonMinus, ui_event_Home_ButtonMinus, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_ButtonMinus1, ui_event_Home_ButtonMinus1, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_ButtonPlus, ui_event_Home_ButtonPlus, LV_EVENT_ALL, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -269,6 +269,7 @@ void ui_settings_screen_init(void)
|
|||||||
lv_obj_add_event_cb(ui_settings_Bat, ui_event_settings_Bat, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Bat, ui_event_settings_Bat, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time, ui_event_settings_Time, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time, ui_event_settings_Time, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_lightSlider, ui_event_settings_lightSlider, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_lightSlider, ui_event_settings_lightSlider, LV_EVENT_ALL, NULL);
|
||||||
|
lv_obj_add_event_cb(ui_settings_deviceDropdown, ui_event_settings_deviceDropdown, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time5, ui_event_settings_Time5, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time5, ui_event_settings_Time5, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time1, ui_event_settings_Time1, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time1, ui_event_settings_Time1, LV_EVENT_ALL, NULL);
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ void ui_Home_screen_init(void);
|
|||||||
lv_obj_t * ui_Home;
|
lv_obj_t * ui_Home;
|
||||||
lv_obj_t * ui_Home_header;
|
lv_obj_t * ui_Home_header;
|
||||||
lv_obj_t * ui_Home_WIFILabel;
|
lv_obj_t * ui_Home_WIFILabel;
|
||||||
lv_obj_t * ui_Home_HeaderTimeHome;
|
lv_obj_t * ui_Home_HeaderDeviceType;
|
||||||
lv_obj_t * ui_Home_SliderHeaderBat;
|
lv_obj_t * ui_Home_SliderHeaderBat;
|
||||||
lv_obj_t * ui_Home_PanelBathead;
|
lv_obj_t * ui_Home_PanelBathead;
|
||||||
lv_obj_t * ui_Home_LabelHeaderBatValue;
|
lv_obj_t * ui_Home_LabelHeaderBatValue;
|
||||||
@ -30,8 +30,8 @@ lv_obj_t * ui_Home_Panel3;
|
|||||||
lv_obj_t * ui_Home_SpinboxStage;
|
lv_obj_t * ui_Home_SpinboxStage;
|
||||||
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
||||||
lv_obj_t * ui_Home_ButtonMinus;
|
lv_obj_t * ui_Home_ButtonMinus;
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e);
|
void ui_event_Home_ButtonPlus(lv_event_t * e);
|
||||||
lv_obj_t * ui_Home_ButtonMinus1;
|
lv_obj_t * ui_Home_ButtonPlus;
|
||||||
lv_obj_t * ui_Home_Label1;
|
lv_obj_t * ui_Home_Label1;
|
||||||
lv_obj_t * ui_Home_Label5;
|
lv_obj_t * ui_Home_Label5;
|
||||||
lv_obj_t * ui_Home_Panel4;
|
lv_obj_t * ui_Home_Panel4;
|
||||||
@ -43,7 +43,7 @@ lv_obj_t * ui_Home_Spinbox3;
|
|||||||
lv_obj_t * ui_Home_Panel5;
|
lv_obj_t * ui_Home_Panel5;
|
||||||
lv_obj_t * ui_Home_Label8;
|
lv_obj_t * ui_Home_Label8;
|
||||||
lv_obj_t * ui_Home_Spinbox4;
|
lv_obj_t * ui_Home_Spinbox4;
|
||||||
lv_obj_t * ui_Home_Button1;
|
lv_obj_t * ui_Home_startTest;
|
||||||
lv_obj_t * ui_Home_Label4;
|
lv_obj_t * ui_Home_Label4;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ lv_obj_t * ui_settings_dianchi3;
|
|||||||
void ui_event_settings_lightSlider(lv_event_t * e);
|
void ui_event_settings_lightSlider(lv_event_t * e);
|
||||||
lv_obj_t * ui_settings_lightSlider;
|
lv_obj_t * ui_settings_lightSlider;
|
||||||
lv_obj_t * ui_settings_Time3;
|
lv_obj_t * ui_settings_Time3;
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e);
|
||||||
lv_obj_t * ui_settings_deviceDropdown;
|
lv_obj_t * ui_settings_deviceDropdown;
|
||||||
lv_obj_t * ui_settings_dianchi4;
|
lv_obj_t * ui_settings_dianchi4;
|
||||||
void ui_event_settings_Time5(lv_event_t * e);
|
void ui_event_settings_Time5(lv_event_t * e);
|
||||||
@ -187,7 +188,7 @@ void ui_event_Home_ButtonMinus(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e)
|
void ui_event_Home_ButtonPlus(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);
|
||||||
|
|
||||||
@ -241,6 +242,15 @@ void ui_event_settings_lightSlider(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e)
|
||||||
|
{
|
||||||
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
|
|
||||||
|
if(event_code == LV_EVENT_VALUE_CHANGED) {
|
||||||
|
DeviceDropDownValueChanged(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ui_event_settings_Time5(lv_event_t * e)
|
void ui_event_settings_Time5(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);
|
||||||
|
|||||||
@ -21,7 +21,7 @@ void ui_Home_screen_init(void);
|
|||||||
extern lv_obj_t * ui_Home;
|
extern lv_obj_t * ui_Home;
|
||||||
extern lv_obj_t * ui_Home_header;
|
extern lv_obj_t * ui_Home_header;
|
||||||
extern lv_obj_t * ui_Home_WIFILabel;
|
extern lv_obj_t * ui_Home_WIFILabel;
|
||||||
extern lv_obj_t * ui_Home_HeaderTimeHome;
|
extern lv_obj_t * ui_Home_HeaderDeviceType;
|
||||||
extern lv_obj_t * ui_Home_SliderHeaderBat;
|
extern lv_obj_t * ui_Home_SliderHeaderBat;
|
||||||
extern lv_obj_t * ui_Home_PanelBathead;
|
extern lv_obj_t * ui_Home_PanelBathead;
|
||||||
extern lv_obj_t * ui_Home_LabelHeaderBatValue;
|
extern lv_obj_t * ui_Home_LabelHeaderBatValue;
|
||||||
@ -38,8 +38,8 @@ extern lv_obj_t * ui_Home_Panel3;
|
|||||||
extern lv_obj_t * ui_Home_SpinboxStage;
|
extern lv_obj_t * ui_Home_SpinboxStage;
|
||||||
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_Home_ButtonMinus;
|
extern lv_obj_t * ui_Home_ButtonMinus;
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e);
|
void ui_event_Home_ButtonPlus(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_Home_ButtonMinus1;
|
extern lv_obj_t * ui_Home_ButtonPlus;
|
||||||
extern lv_obj_t * ui_Home_Label1;
|
extern lv_obj_t * ui_Home_Label1;
|
||||||
extern lv_obj_t * ui_Home_Label5;
|
extern lv_obj_t * ui_Home_Label5;
|
||||||
extern lv_obj_t * ui_Home_Panel4;
|
extern lv_obj_t * ui_Home_Panel4;
|
||||||
@ -51,7 +51,7 @@ extern lv_obj_t * ui_Home_Spinbox3;
|
|||||||
extern lv_obj_t * ui_Home_Panel5;
|
extern lv_obj_t * ui_Home_Panel5;
|
||||||
extern lv_obj_t * ui_Home_Label8;
|
extern lv_obj_t * ui_Home_Label8;
|
||||||
extern lv_obj_t * ui_Home_Spinbox4;
|
extern lv_obj_t * ui_Home_Spinbox4;
|
||||||
extern lv_obj_t * ui_Home_Button1;
|
extern lv_obj_t * ui_Home_startTest;
|
||||||
extern lv_obj_t * ui_Home_Label4;
|
extern lv_obj_t * ui_Home_Label4;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
|
|
||||||
@ -77,6 +77,7 @@ extern lv_obj_t * ui_settings_dianchi3;
|
|||||||
void ui_event_settings_lightSlider(lv_event_t * e);
|
void ui_event_settings_lightSlider(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_settings_lightSlider;
|
extern lv_obj_t * ui_settings_lightSlider;
|
||||||
extern lv_obj_t * ui_settings_Time3;
|
extern lv_obj_t * ui_settings_Time3;
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_settings_deviceDropdown;
|
extern lv_obj_t * ui_settings_deviceDropdown;
|
||||||
extern lv_obj_t * ui_settings_dianchi4;
|
extern lv_obj_t * ui_settings_dianchi4;
|
||||||
void ui_event_settings_Time5(lv_event_t * e);
|
void ui_event_settings_Time5(lv_event_t * e);
|
||||||
|
|||||||
@ -29,3 +29,8 @@ void lightSliderCallback(lv_event_t * e)
|
|||||||
{
|
{
|
||||||
// Your code here
|
// Your code here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceDropDownValueChanged(lv_event_t * e)
|
||||||
|
{
|
||||||
|
// Your code here
|
||||||
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lightSliderCallback(lv_event_t * e);
|
void lightSliderCallback(lv_event_t * e);
|
||||||
|
void DeviceDropDownValueChanged(lv_event_t * e);
|
||||||
void ReadSdCallFunc(lv_event_t * e);
|
void ReadSdCallFunc(lv_event_t * e);
|
||||||
void F1callbackFunc(lv_event_t * e);
|
void F1callbackFunc(lv_event_t * e);
|
||||||
void F2callbackFunc(lv_event_t * e);
|
void F2callbackFunc(lv_event_t * e);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
components/FluxButton/CMakeLists.txt
Normal file
3
components/FluxButton/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
idf_component_register(SRCS "FluxButton.c"
|
||||||
|
REQUIRES espressif__button FluxUI driver lvgl
|
||||||
|
INCLUDE_DIRS ".")
|
||||||
164
components/FluxButton/FluxButton.c
Normal file
164
components/FluxButton/FluxButton.c
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "FluxButton.h"
|
||||||
|
#include "driver/gpio.h"
|
||||||
|
#include "ui.h"
|
||||||
|
|
||||||
|
static const char *BUTTON_TAG = "button_test";
|
||||||
|
|
||||||
|
|
||||||
|
/*定义按键事件列表*/
|
||||||
|
const char *button_event_table[] = {
|
||||||
|
"BUTTON_PRESS_DOWN",
|
||||||
|
"BUTTON_PRESS_UP",
|
||||||
|
"BUTTON_PRESS_REPEAT",
|
||||||
|
"BUTTON_PRESS_REPEAT_DONE",
|
||||||
|
"BUTTON_SINGLE_CLICK",
|
||||||
|
"BUTTON_DOUBLE_CLICK",
|
||||||
|
"BUTTON_MULTIPLE_CLICK",
|
||||||
|
"BUTTON_LONG_PRESS_START",
|
||||||
|
"BUTTON_LONG_PRESS_HOLD",
|
||||||
|
"BUTTON_LONG_PRESS_UP",
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void button_event_cb(void *arg, void *data)
|
||||||
|
{
|
||||||
|
ESP_LOGI(BUTTON_TAG, "Button event %d", (int)data);
|
||||||
|
|
||||||
|
#if CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE
|
||||||
|
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
||||||
|
if (cause != ESP_SLEEP_WAKEUP_UNDEFINED) {
|
||||||
|
ESP_LOGI(BUTTON_TAG, "Wake up from light sleep, reason %d", cause);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*根据输入按键事件进行事件处理*/
|
||||||
|
switch ((int)data)
|
||||||
|
{
|
||||||
|
case BUTTON_CMD_POWER_ON:
|
||||||
|
/*响应电源键按下事件*/
|
||||||
|
gpio_set_level(BUTTON_PowerOut_IO_NUM, POWER_ON_OUT_LEVEL);
|
||||||
|
break;
|
||||||
|
case BUTTON_CMD_POWER_OFF:
|
||||||
|
gpio_set_level(BUTTON_PowerOut_IO_NUM, POWER_OFF_OUT_LEVEL);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BUTTON_CMD_CENTER_KEY:
|
||||||
|
/*开始测试按键*/
|
||||||
|
lv_event_send(ui_Home_startTest, LV_EVENT_CLICKED, NULL);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case BUTTON_CMD_LEFT_KEY:
|
||||||
|
lv_event_send(ui_Home_ButtonMinus, LV_EVENT_CLICKED, NULL);
|
||||||
|
break;
|
||||||
|
case BUTTON_CMD_RIGHT_KEY:
|
||||||
|
lv_event_send(ui_Home_ButtonPlus, LV_EVENT_CLICKED, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void button_init_func(uint32_t button_num)
|
||||||
|
{
|
||||||
|
uint8_t activeLevel = BUTTON_ACTIVE_LEVEL;
|
||||||
|
/*当按键为电源按键时修改激活状态为高电平*/
|
||||||
|
if (button_num == BUTTON_PowerIn_IO_NUM)
|
||||||
|
{
|
||||||
|
activeLevel = BUTTON_POWERIN_ACTIVE_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
button_config_t btn_cfg = {
|
||||||
|
.type = BUTTON_TYPE_GPIO,
|
||||||
|
.gpio_button_config = {
|
||||||
|
.gpio_num = button_num,
|
||||||
|
.active_level = activeLevel,
|
||||||
|
#if CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE
|
||||||
|
.enable_power_save = true,
|
||||||
|
#endif
|
||||||
|
},
|
||||||
|
};
|
||||||
|
button_handle_t btn = iot_button_create(&btn_cfg);
|
||||||
|
assert(btn);
|
||||||
|
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
|
/*为电源键按下注册回调函数*/
|
||||||
|
if (button_num == BUTTON_PowerIn_IO_NUM)
|
||||||
|
{
|
||||||
|
/*双击电源键键进行关机*/
|
||||||
|
err |= iot_button_register_cb(btn, BUTTON_DOUBLE_CLICK, button_event_cb, (void *)BUTTON_CMD_POWER_OFF);
|
||||||
|
/*长按电源键进行开机*/
|
||||||
|
err |= iot_button_register_cb(btn, BUTTON_LONG_PRESS_HOLD, button_event_cb, (void *)BUTTON_CMD_POWER_ON);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
/*为下方三个按键 单击 注册回调函数*/
|
||||||
|
switch (button_num)
|
||||||
|
{
|
||||||
|
case BUTTON_Center_IO_NUM:
|
||||||
|
err |= iot_button_register_cb(btn, BUTTON_SINGLE_CLICK, button_event_cb, (void *)BUTTON_CMD_CENTER_KEY);
|
||||||
|
break;
|
||||||
|
case BUTTON_Left_IO_NUM:
|
||||||
|
err |= iot_button_register_cb(btn, BUTTON_SINGLE_CLICK, button_event_cb, (void *)BUTTON_CMD_LEFT_KEY);
|
||||||
|
break;
|
||||||
|
case BUTTON_Right_IO_NUM:
|
||||||
|
err |= iot_button_register_cb(btn, BUTTON_SINGLE_CLICK, button_event_cb, (void *)BUTTON_CMD_RIGHT_KEY);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ESP_ERROR_CHECK(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*初始化所有引脚*/
|
||||||
|
void button_init(void)
|
||||||
|
{
|
||||||
|
button_init_func(BUTTON_Center_IO_NUM);
|
||||||
|
button_init_func(BUTTON_Left_IO_NUM);
|
||||||
|
button_init_func(BUTTON_Right_IO_NUM);
|
||||||
|
|
||||||
|
button_init_func(BUTTON_PowerIn_IO_NUM);
|
||||||
|
|
||||||
|
/*在此处初始化电源控制IO输出*/
|
||||||
|
gpio_reset_pin(BUTTON_PowerOut_IO_NUM);
|
||||||
|
gpio_set_direction(BUTTON_PowerOut_IO_NUM, GPIO_MODE_OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
|
||||||
|
void power_save_init(void)
|
||||||
|
{
|
||||||
|
esp_pm_config_t pm_config = {
|
||||||
|
.max_freq_mhz = CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ,
|
||||||
|
.min_freq_mhz = CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ,
|
||||||
|
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||||
|
.light_sleep_enable = true
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void power_save_init(void)
|
||||||
|
{
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
|
esp_pm_config_esp32_t pm_config = {
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
|
esp_pm_config_esp32s2_t pm_config = {
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||||
|
esp_pm_config_esp32c3_t pm_config = {
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
|
esp_pm_config_esp32s3_t pm_config = {
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C2
|
||||||
|
esp_pm_config_esp32c2_t pm_config = {
|
||||||
|
#endif
|
||||||
|
.max_freq_mhz = CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ,
|
||||||
|
.min_freq_mhz = CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ,
|
||||||
|
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||||
|
.light_sleep_enable = true
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
33
components/FluxButton/FluxButton.h
Normal file
33
components/FluxButton/FluxButton.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
/*导入外部button组件头文件*/
|
||||||
|
#include "iot_button.h"
|
||||||
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
#define BUTTON_Center_IO_NUM (42)
|
||||||
|
#define BUTTON_Left_IO_NUM (41)
|
||||||
|
#define BUTTON_Right_IO_NUM (40)
|
||||||
|
|
||||||
|
#define BUTTON_PowerIn_IO_NUM (10)
|
||||||
|
#define BUTTON_PowerOut_IO_NUM (11)
|
||||||
|
|
||||||
|
#define POWER_OFF_OUT_LEVEL 0
|
||||||
|
#define POWER_ON_OUT_LEVEL 1
|
||||||
|
|
||||||
|
#define BUTTON_ACTIVE_LEVEL 0
|
||||||
|
#define BUTTON_POWERIN_ACTIVE_LEVEL 1
|
||||||
|
|
||||||
|
/*定义按键控制指令码*/
|
||||||
|
enum button_cmd_t
|
||||||
|
{
|
||||||
|
BUTTON_CMD_POWER_ON=0,
|
||||||
|
BUTTON_CMD_POWER_OFF=1,
|
||||||
|
BUTTON_CMD_CENTER_KEY=2,
|
||||||
|
BUTTON_CMD_LEFT_KEY=3,
|
||||||
|
BUTTON_CMD_RIGHT_KEY=4,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE 0
|
||||||
|
|
||||||
|
void button_init_func(uint32_t button_num);
|
||||||
|
|
||||||
|
void button_init(void);
|
||||||
@ -136,7 +136,7 @@ void flux_sd_init(void)
|
|||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
|
|
||||||
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
|
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
|
||||||
.format_if_mount_failed = false,
|
.format_if_mount_failed = true,
|
||||||
.max_files = 5,
|
.max_files = 5,
|
||||||
.allocation_unit_size = 16 * 1024
|
.allocation_unit_size = 16 * 1024
|
||||||
};
|
};
|
||||||
@ -153,7 +153,6 @@ void flux_sd_init(void)
|
|||||||
slot_config.clk = CONFIG_EXAMPLE_PIN_CLK;
|
slot_config.clk = CONFIG_EXAMPLE_PIN_CLK;
|
||||||
slot_config.cmd = CONFIG_EXAMPLE_PIN_CMD;
|
slot_config.cmd = CONFIG_EXAMPLE_PIN_CMD;
|
||||||
slot_config.d0 = CONFIG_EXAMPLE_PIN_D0;
|
slot_config.d0 = CONFIG_EXAMPLE_PIN_D0;
|
||||||
|
|
||||||
slot_config.d1 = CONFIG_EXAMPLE_PIN_D1;
|
slot_config.d1 = CONFIG_EXAMPLE_PIN_D1;
|
||||||
slot_config.d2 = CONFIG_EXAMPLE_PIN_D2;
|
slot_config.d2 = CONFIG_EXAMPLE_PIN_D2;
|
||||||
slot_config.d3 = CONFIG_EXAMPLE_PIN_D3;
|
slot_config.d3 = CONFIG_EXAMPLE_PIN_D3;
|
||||||
@ -162,6 +161,7 @@ void flux_sd_init(void)
|
|||||||
ESP_LOGI(TAG, "Mounting filesystem");
|
ESP_LOGI(TAG, "Mounting filesystem");
|
||||||
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
|
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
|
||||||
|
|
||||||
|
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
if (ret == ESP_FAIL) {
|
if (ret == ESP_FAIL) {
|
||||||
ESP_LOGE(TAG, "Failed to mount filesystem. "
|
ESP_LOGE(TAG, "Failed to mount filesystem. "
|
||||||
|
|||||||
@ -42,16 +42,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_opa(ui_Home_WIFILabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_WIFILabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_WIFILabel, &ui_font_MiSansN14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_WIFILabel, &ui_font_MiSansN14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_HeaderTimeHome = lv_label_create(ui_Home);
|
ui_Home_HeaderDeviceType = lv_label_create(ui_Home);
|
||||||
lv_obj_set_width(ui_Home_HeaderTimeHome, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_HeaderDeviceType, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_Home_HeaderTimeHome, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_Home_HeaderDeviceType, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_Home_HeaderTimeHome, 0);
|
lv_obj_set_x(ui_Home_HeaderDeviceType, 0);
|
||||||
lv_obj_set_y(ui_Home_HeaderTimeHome, -225);
|
lv_obj_set_y(ui_Home_HeaderDeviceType, -225);
|
||||||
lv_obj_set_align(ui_Home_HeaderTimeHome, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_HeaderDeviceType, LV_ALIGN_CENTER);
|
||||||
lv_label_set_text(ui_Home_HeaderTimeHome, "Spirit-3");
|
lv_label_set_text(ui_Home_HeaderDeviceType, "Spirit-3");
|
||||||
lv_obj_set_style_text_color(ui_Home_HeaderTimeHome, lv_color_hex(0xFCF6F6), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_HeaderDeviceType, lv_color_hex(0xFCF6F6), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_HeaderTimeHome, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_HeaderDeviceType, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_HeaderTimeHome, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_HeaderDeviceType, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_SliderHeaderBat = lv_slider_create(ui_Home);
|
ui_Home_SliderHeaderBat = lv_slider_create(ui_Home);
|
||||||
lv_slider_set_value(ui_Home_SliderHeaderBat, 60, LV_ANIM_OFF);
|
lv_slider_set_value(ui_Home_SliderHeaderBat, 60, LV_ANIM_OFF);
|
||||||
@ -227,16 +227,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_color(ui_Home_ButtonMinus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_ButtonMinus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_ButtonMinus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_ButtonMinus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_ButtonMinus1 = lv_btn_create(ui_Home_Panel3);
|
ui_Home_ButtonPlus = lv_btn_create(ui_Home_Panel3);
|
||||||
lv_obj_set_width(ui_Home_ButtonMinus1, 100);
|
lv_obj_set_width(ui_Home_ButtonPlus, 100);
|
||||||
lv_obj_set_height(ui_Home_ButtonMinus1, 50);
|
lv_obj_set_height(ui_Home_ButtonPlus, 50);
|
||||||
lv_obj_set_x(ui_Home_ButtonMinus1, 88);
|
lv_obj_set_x(ui_Home_ButtonPlus, 88);
|
||||||
lv_obj_set_y(ui_Home_ButtonMinus1, 140);
|
lv_obj_set_y(ui_Home_ButtonPlus, 140);
|
||||||
lv_obj_set_align(ui_Home_ButtonMinus1, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_ButtonPlus, LV_ALIGN_CENTER);
|
||||||
lv_obj_set_style_bg_color(ui_Home_ButtonMinus1, lv_color_hex(0xE0E4E3), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_color(ui_Home_ButtonPlus, lv_color_hex(0xE0E4E3), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_bg_opa(ui_Home_ButtonMinus1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_opa(ui_Home_ButtonPlus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_color(ui_Home_ButtonMinus1, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui_Home_ButtonPlus, lv_color_hex(0x050000), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui_Home_ButtonMinus1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui_Home_ButtonPlus, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Label1 = lv_label_create(ui_Home_Panel3);
|
ui_Home_Label1 = lv_label_create(ui_Home_Panel3);
|
||||||
lv_obj_set_width(ui_Home_Label1, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_Label1, LV_SIZE_CONTENT); /// 1
|
||||||
@ -343,16 +343,16 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_set_style_text_align(ui_Home_Spinbox4, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_align(ui_Home_Spinbox4, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui_Home_Spinbox4, &ui_font_homePanelLabel, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui_Home_Spinbox4, &ui_font_homePanelLabel, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Button1 = lv_btn_create(ui_Home);
|
ui_Home_startTest = lv_btn_create(ui_Home);
|
||||||
lv_obj_set_width(ui_Home_Button1, 296);
|
lv_obj_set_width(ui_Home_startTest, 296);
|
||||||
lv_obj_set_height(ui_Home_Button1, 61);
|
lv_obj_set_height(ui_Home_startTest, 61);
|
||||||
lv_obj_set_x(ui_Home_Button1, 3);
|
lv_obj_set_x(ui_Home_startTest, 3);
|
||||||
lv_obj_set_y(ui_Home_Button1, 194);
|
lv_obj_set_y(ui_Home_startTest, 194);
|
||||||
lv_obj_set_align(ui_Home_Button1, LV_ALIGN_CENTER);
|
lv_obj_set_align(ui_Home_startTest, LV_ALIGN_CENTER);
|
||||||
lv_obj_set_style_bg_color(ui_Home_Button1, lv_color_hex(0x4A58DD), LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_color(ui_Home_startTest, lv_color_hex(0x4A58DD), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_bg_opa(ui_Home_Button1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_opa(ui_Home_startTest, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||||
|
|
||||||
ui_Home_Label4 = lv_label_create(ui_Home_Button1);
|
ui_Home_Label4 = lv_label_create(ui_Home_startTest);
|
||||||
lv_obj_set_width(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_width(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_height(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
lv_obj_set_height(ui_Home_Label4, LV_SIZE_CONTENT); /// 1
|
||||||
lv_obj_set_x(ui_Home_Label4, 3);
|
lv_obj_set_x(ui_Home_Label4, 3);
|
||||||
@ -364,6 +364,6 @@ void ui_Home_screen_init(void)
|
|||||||
lv_obj_add_event_cb(ui_Home_Panel2, ui_event_Home_Panel2, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_Panel2, ui_event_Home_Panel2, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_Panel6, ui_event_Home_Panel6, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_Panel6, ui_event_Home_Panel6, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_ButtonMinus, ui_event_Home_ButtonMinus, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_ButtonMinus, ui_event_Home_ButtonMinus, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_Home_ButtonMinus1, ui_event_Home_ButtonMinus1, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_Home_ButtonPlus, ui_event_Home_ButtonPlus, LV_EVENT_ALL, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -269,6 +269,7 @@ void ui_settings_screen_init(void)
|
|||||||
lv_obj_add_event_cb(ui_settings_Bat, ui_event_settings_Bat, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Bat, ui_event_settings_Bat, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time, ui_event_settings_Time, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time, ui_event_settings_Time, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_lightSlider, ui_event_settings_lightSlider, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_lightSlider, ui_event_settings_lightSlider, LV_EVENT_ALL, NULL);
|
||||||
|
lv_obj_add_event_cb(ui_settings_deviceDropdown, ui_event_settings_deviceDropdown, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time5, ui_event_settings_Time5, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time5, ui_event_settings_Time5, LV_EVENT_ALL, NULL);
|
||||||
lv_obj_add_event_cb(ui_settings_Time1, ui_event_settings_Time1, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(ui_settings_Time1, ui_event_settings_Time1, LV_EVENT_ALL, NULL);
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ void ui_Home_screen_init(void);
|
|||||||
lv_obj_t * ui_Home;
|
lv_obj_t * ui_Home;
|
||||||
lv_obj_t * ui_Home_header;
|
lv_obj_t * ui_Home_header;
|
||||||
lv_obj_t * ui_Home_WIFILabel;
|
lv_obj_t * ui_Home_WIFILabel;
|
||||||
lv_obj_t * ui_Home_HeaderTimeHome;
|
lv_obj_t * ui_Home_HeaderDeviceType;
|
||||||
lv_obj_t * ui_Home_SliderHeaderBat;
|
lv_obj_t * ui_Home_SliderHeaderBat;
|
||||||
lv_obj_t * ui_Home_PanelBathead;
|
lv_obj_t * ui_Home_PanelBathead;
|
||||||
lv_obj_t * ui_Home_LabelHeaderBatValue;
|
lv_obj_t * ui_Home_LabelHeaderBatValue;
|
||||||
@ -30,8 +30,8 @@ lv_obj_t * ui_Home_Panel3;
|
|||||||
lv_obj_t * ui_Home_SpinboxStage;
|
lv_obj_t * ui_Home_SpinboxStage;
|
||||||
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
||||||
lv_obj_t * ui_Home_ButtonMinus;
|
lv_obj_t * ui_Home_ButtonMinus;
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e);
|
void ui_event_Home_ButtonPlus(lv_event_t * e);
|
||||||
lv_obj_t * ui_Home_ButtonMinus1;
|
lv_obj_t * ui_Home_ButtonPlus;
|
||||||
lv_obj_t * ui_Home_Label1;
|
lv_obj_t * ui_Home_Label1;
|
||||||
lv_obj_t * ui_Home_Label5;
|
lv_obj_t * ui_Home_Label5;
|
||||||
lv_obj_t * ui_Home_Panel4;
|
lv_obj_t * ui_Home_Panel4;
|
||||||
@ -43,7 +43,7 @@ lv_obj_t * ui_Home_Spinbox3;
|
|||||||
lv_obj_t * ui_Home_Panel5;
|
lv_obj_t * ui_Home_Panel5;
|
||||||
lv_obj_t * ui_Home_Label8;
|
lv_obj_t * ui_Home_Label8;
|
||||||
lv_obj_t * ui_Home_Spinbox4;
|
lv_obj_t * ui_Home_Spinbox4;
|
||||||
lv_obj_t * ui_Home_Button1;
|
lv_obj_t * ui_Home_startTest;
|
||||||
lv_obj_t * ui_Home_Label4;
|
lv_obj_t * ui_Home_Label4;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ lv_obj_t * ui_settings_dianchi3;
|
|||||||
void ui_event_settings_lightSlider(lv_event_t * e);
|
void ui_event_settings_lightSlider(lv_event_t * e);
|
||||||
lv_obj_t * ui_settings_lightSlider;
|
lv_obj_t * ui_settings_lightSlider;
|
||||||
lv_obj_t * ui_settings_Time3;
|
lv_obj_t * ui_settings_Time3;
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e);
|
||||||
lv_obj_t * ui_settings_deviceDropdown;
|
lv_obj_t * ui_settings_deviceDropdown;
|
||||||
lv_obj_t * ui_settings_dianchi4;
|
lv_obj_t * ui_settings_dianchi4;
|
||||||
void ui_event_settings_Time5(lv_event_t * e);
|
void ui_event_settings_Time5(lv_event_t * e);
|
||||||
@ -187,7 +188,7 @@ void ui_event_Home_ButtonMinus(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e)
|
void ui_event_Home_ButtonPlus(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);
|
||||||
|
|
||||||
@ -241,6 +242,15 @@ void ui_event_settings_lightSlider(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e)
|
||||||
|
{
|
||||||
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
|
|
||||||
|
if(event_code == LV_EVENT_VALUE_CHANGED) {
|
||||||
|
DeviceDropDownValueChanged(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ui_event_settings_Time5(lv_event_t * e)
|
void ui_event_settings_Time5(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);
|
||||||
|
|||||||
@ -21,7 +21,7 @@ void ui_Home_screen_init(void);
|
|||||||
extern lv_obj_t * ui_Home;
|
extern lv_obj_t * ui_Home;
|
||||||
extern lv_obj_t * ui_Home_header;
|
extern lv_obj_t * ui_Home_header;
|
||||||
extern lv_obj_t * ui_Home_WIFILabel;
|
extern lv_obj_t * ui_Home_WIFILabel;
|
||||||
extern lv_obj_t * ui_Home_HeaderTimeHome;
|
extern lv_obj_t * ui_Home_HeaderDeviceType;
|
||||||
extern lv_obj_t * ui_Home_SliderHeaderBat;
|
extern lv_obj_t * ui_Home_SliderHeaderBat;
|
||||||
extern lv_obj_t * ui_Home_PanelBathead;
|
extern lv_obj_t * ui_Home_PanelBathead;
|
||||||
extern lv_obj_t * ui_Home_LabelHeaderBatValue;
|
extern lv_obj_t * ui_Home_LabelHeaderBatValue;
|
||||||
@ -38,8 +38,8 @@ extern lv_obj_t * ui_Home_Panel3;
|
|||||||
extern lv_obj_t * ui_Home_SpinboxStage;
|
extern lv_obj_t * ui_Home_SpinboxStage;
|
||||||
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
void ui_event_Home_ButtonMinus(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_Home_ButtonMinus;
|
extern lv_obj_t * ui_Home_ButtonMinus;
|
||||||
void ui_event_Home_ButtonMinus1(lv_event_t * e);
|
void ui_event_Home_ButtonPlus(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_Home_ButtonMinus1;
|
extern lv_obj_t * ui_Home_ButtonPlus;
|
||||||
extern lv_obj_t * ui_Home_Label1;
|
extern lv_obj_t * ui_Home_Label1;
|
||||||
extern lv_obj_t * ui_Home_Label5;
|
extern lv_obj_t * ui_Home_Label5;
|
||||||
extern lv_obj_t * ui_Home_Panel4;
|
extern lv_obj_t * ui_Home_Panel4;
|
||||||
@ -51,7 +51,7 @@ extern lv_obj_t * ui_Home_Spinbox3;
|
|||||||
extern lv_obj_t * ui_Home_Panel5;
|
extern lv_obj_t * ui_Home_Panel5;
|
||||||
extern lv_obj_t * ui_Home_Label8;
|
extern lv_obj_t * ui_Home_Label8;
|
||||||
extern lv_obj_t * ui_Home_Spinbox4;
|
extern lv_obj_t * ui_Home_Spinbox4;
|
||||||
extern lv_obj_t * ui_Home_Button1;
|
extern lv_obj_t * ui_Home_startTest;
|
||||||
extern lv_obj_t * ui_Home_Label4;
|
extern lv_obj_t * ui_Home_Label4;
|
||||||
// CUSTOM VARIABLES
|
// CUSTOM VARIABLES
|
||||||
|
|
||||||
@ -77,6 +77,7 @@ extern lv_obj_t * ui_settings_dianchi3;
|
|||||||
void ui_event_settings_lightSlider(lv_event_t * e);
|
void ui_event_settings_lightSlider(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_settings_lightSlider;
|
extern lv_obj_t * ui_settings_lightSlider;
|
||||||
extern lv_obj_t * ui_settings_Time3;
|
extern lv_obj_t * ui_settings_Time3;
|
||||||
|
void ui_event_settings_deviceDropdown(lv_event_t * e);
|
||||||
extern lv_obj_t * ui_settings_deviceDropdown;
|
extern lv_obj_t * ui_settings_deviceDropdown;
|
||||||
extern lv_obj_t * ui_settings_dianchi4;
|
extern lv_obj_t * ui_settings_dianchi4;
|
||||||
void ui_event_settings_Time5(lv_event_t * e);
|
void ui_event_settings_Time5(lv_event_t * e);
|
||||||
|
|||||||
@ -50,3 +50,12 @@ void lightSliderCallback(lv_event_t * e)
|
|||||||
// Update duty to apply the new value
|
// Update duty to apply the new value
|
||||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0));
|
ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DeviceDropDownValueChanged(lv_event_t * e)
|
||||||
|
{
|
||||||
|
char buf[32]={};
|
||||||
|
lv_dropdown_get_selected_str(e->target,buf,32);
|
||||||
|
lv_label_set_text(ui_Home_HeaderDeviceType, buf);
|
||||||
|
|
||||||
|
}
|
||||||
@ -11,6 +11,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void lightSliderCallback(lv_event_t * e);
|
void lightSliderCallback(lv_event_t * e);
|
||||||
|
void DeviceDropDownValueChanged(lv_event_t * e);
|
||||||
void ReadSdCallFunc(lv_event_t * e);
|
void ReadSdCallFunc(lv_event_t * e);
|
||||||
void F1callbackFunc(lv_event_t * e);
|
void F1callbackFunc(lv_event_t * e);
|
||||||
void F2callbackFunc(lv_event_t * e);
|
void F2callbackFunc(lv_event_t * e);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ if(CONFIG_EXAMPLE_LCD_IMAGE_FROM_EMBEDDED_BINARY)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
idf_component_register(SRCS "i80_controller_example_main.c" "lvgl_demo_ui.c" ${embedded_images}
|
idf_component_register(SRCS "i80_controller_example_main.c" "lvgl_demo_ui.c" ${embedded_images}
|
||||||
REQUIRES FluxUI FluxPower spiffs FluxSD FluxMod
|
REQUIRES FluxUI FluxPower spiffs FluxSD FluxMod FluxButton
|
||||||
INCLUDE_DIRS ".")
|
INCLUDE_DIRS ".")
|
||||||
|
|
||||||
if(CONFIG_EXAMPLE_LCD_IMAGE_FROM_FILE_SYSTEM)
|
if(CONFIG_EXAMPLE_LCD_IMAGE_FROM_FILE_SYSTEM)
|
||||||
|
|||||||
@ -32,6 +32,9 @@
|
|||||||
/*导入外部LVGL项目*/
|
/*导入外部LVGL项目*/
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
|
/*包含按键控制头文件*/
|
||||||
|
#include "FluxButton.h"
|
||||||
|
|
||||||
static const char *TAG = "example";
|
static const char *TAG = "example";
|
||||||
|
|
||||||
#include "modbus_params.h"
|
#include "modbus_params.h"
|
||||||
@ -457,6 +460,9 @@ void app_main(void)
|
|||||||
/*初始化SD卡*/
|
/*初始化SD卡*/
|
||||||
flux_sd_init();
|
flux_sd_init();
|
||||||
|
|
||||||
|
/*初始化FluxButton*/
|
||||||
|
button_init();
|
||||||
|
|
||||||
/*初始化Modbus*/
|
/*初始化Modbus*/
|
||||||
//modbus_master_init();
|
//modbus_master_init();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user