304 lines
11 KiB
C
Executable File
304 lines
11 KiB
C
Executable File
// This file was generated by SquareLine Studio
|
|
// SquareLine Studio version: SquareLine Studio 1.3.0
|
|
// LVGL version: 8.3.3
|
|
// Project name: demo1
|
|
|
|
#include "ui.h"
|
|
#include "ui_helpers.h"
|
|
|
|
///////////////////// VARIABLES ////////////////////
|
|
|
|
void move_x_add_Animation(lv_obj_t * TargetObject, int delay);
|
|
void mov_x_sub_Animation(lv_obj_t * TargetObject, int delay);
|
|
|
|
// SCREEN: ui_Screen1
|
|
void ui_UiPage1_screen_init(lv_obj_t *parent);
|
|
void ui_event_Screen1(lv_event_t * e);
|
|
lv_obj_t * ui_Screen1;
|
|
lv_obj_t * ui_sun;
|
|
lv_obj_t * ui_cloudBig;
|
|
lv_obj_t * ui_cloudSmall2;
|
|
lv_obj_t * ui_cloudSmall1;
|
|
lv_obj_t * ui_temp;
|
|
lv_obj_t * ui_weather;
|
|
lv_obj_t * ui_timeInfo;
|
|
lv_obj_t * ui_dataInfo;
|
|
|
|
// SCREEN: ui_UiPage2
|
|
void ui_UiPage2_screen_init(lv_obj_t *parent);
|
|
lv_obj_t * ui_UiPage2;
|
|
lv_obj_t * ui_Ui2Tittle;
|
|
void ui_event_Ui2Panel2(lv_event_t * e);
|
|
lv_obj_t * ui_Ui2Panel2;
|
|
lv_obj_t * ui_Ui2Panel2Label;
|
|
lv_obj_t * ui_Ui2Panel2Value;
|
|
lv_obj_t * ui_Ui2Panel2Img;
|
|
void ui_event_Ui2Panel1(lv_event_t * e);
|
|
lv_obj_t * ui_Ui2Panel1;
|
|
lv_obj_t * ui_Ui2Panel1Tittle;
|
|
void ui_event_Ui2Panel4(lv_event_t * e);
|
|
lv_obj_t * ui_Ui2Panel4;
|
|
lv_obj_t * ui_Ui2Panel4Label1;
|
|
lv_obj_t * ui_Ui2Panel4Value;
|
|
lv_obj_t * ui_Ui2Panel4Img;
|
|
void ui_event_Ui2Panel3(lv_event_t * e);
|
|
lv_obj_t * ui_Ui2Panel3;
|
|
lv_obj_t * ui_Ui2Panel1Tittle1;
|
|
|
|
// SCREEN: ui_UiPage3
|
|
void ui_UiPage3_screen_init(lv_obj_t *parent);
|
|
lv_obj_t * ui_UiPage3;
|
|
lv_obj_t * ui_Ui3Tittle;
|
|
lv_obj_t * ui_Ui3Panel1;
|
|
lv_obj_t * ui_Ui3Panel1Label;
|
|
lv_obj_t * ui_UI3Panel1Stop;
|
|
lv_obj_t * ui_UI3Panel1On;
|
|
lv_obj_t * ui_UI3Panel1Off;
|
|
lv_obj_t * ui_Ui3Panel2;
|
|
lv_obj_t * ui_Ui3Panel2Label;
|
|
lv_obj_t * ui_UI3Panel2Stop;
|
|
lv_obj_t * ui_UI3Panel2On;
|
|
lv_obj_t * ui_UI3Panel2Off;
|
|
|
|
// SCREEN: ui_UiPage4
|
|
void ui_UiPage4_screen_init(lv_obj_t *parent);
|
|
lv_obj_t * ui_UiPage4;
|
|
lv_obj_t * ui_Ui4Tittle;
|
|
void ui_event_Ui4Panel1(lv_event_t * e);
|
|
lv_obj_t * ui_Ui4Panel1;
|
|
lv_obj_t * ui_Ui4Panel1Tittle;
|
|
void ui_event_Ui4Panel2(lv_event_t * e);
|
|
lv_obj_t * ui_Ui4Panel2;
|
|
lv_obj_t * ui_Ui4Panel2Tittle;
|
|
|
|
// SCREEN: ui_UiArcPage
|
|
void ui_UiArcPage_screen_init(lv_obj_t *parent);
|
|
lv_obj_t * ui_UiArcPage;
|
|
lv_obj_t * ui_UAPColdImg;
|
|
lv_obj_t * ui_WAPSwitchImg;
|
|
lv_obj_t * ui_UAPFanImg;
|
|
lv_obj_t * ui_UAPtittle;
|
|
lv_obj_t * ui_circleBg1;
|
|
lv_obj_t * ui_circleBg2;
|
|
lv_obj_t * ui_jianbutton;
|
|
lv_obj_t * ui_jiabutton;
|
|
lv_obj_t * ui_jian;
|
|
lv_obj_t * ui_jia1;
|
|
lv_obj_t * ui_jia2;
|
|
lv_obj_t * ui_tempDesc;
|
|
lv_obj_t * ui_tempValue;
|
|
lv_obj_t * ui_tempDan;
|
|
|
|
// SCREEN: ui_UiPage5
|
|
void ui_UiPage5_screen_init(lv_obj_t *parent);
|
|
lv_obj_t * ui_UiPage5;
|
|
lv_obj_t * ui_Ui5Tittle;
|
|
lv_obj_t * ui_Ui5Panel1;
|
|
lv_obj_t * ui_Ui5Symbol1;
|
|
lv_obj_t * ui_Ui5Label1;
|
|
lv_obj_t * ui_Ui5Panel2;
|
|
lv_obj_t * ui_Ui5Symbol2;
|
|
lv_obj_t * ui_Ui5Label2;
|
|
lv_obj_t * ui_Ui5Panel3;
|
|
lv_obj_t * ui_Ui5Symbol3;
|
|
lv_obj_t * ui_Ui5Label3;
|
|
lv_obj_t * ui_Ui5Panel4;
|
|
lv_obj_t * ui_Ui5Symbol4;
|
|
lv_obj_t * ui_Ui5Label4;
|
|
lv_obj_t * ui_Ui5Panel5;
|
|
lv_obj_t * ui_Ui5Symbol5;
|
|
lv_obj_t * ui_Ui5Label5;
|
|
|
|
// SCREEN: ui_UiPage6
|
|
void ui_UiPage6_screen_init(void);
|
|
lv_obj_t * ui_UiPage6;
|
|
lv_obj_t * ui_Ui6Panel1;
|
|
lv_obj_t * ui_Ui6Symbol1;
|
|
lv_obj_t * ui_Ui6Label1;
|
|
lv_obj_t * ui_Ui6Panel2;
|
|
lv_obj_t * ui_Ui6Symbol2;
|
|
lv_obj_t * ui_Ui6Label2;
|
|
lv_obj_t * ui_Ui6Panel3;
|
|
lv_obj_t * ui_Ui6Symbol3;
|
|
lv_obj_t * ui_Ui6Label3;
|
|
lv_obj_t * ui_Ui6Panel4;
|
|
lv_obj_t * ui_Ui6Symbol4;
|
|
lv_obj_t * ui_Ui6Label4;
|
|
lv_obj_t * ui_Ui6Panel5;
|
|
lv_obj_t * ui_Ui6Symbol5;
|
|
lv_obj_t * ui_Ui6Label5;
|
|
lv_obj_t * ui_Ui6Panel6;
|
|
lv_obj_t * ui_Ui6Symbol6;
|
|
lv_obj_t * ui_Ui6Label6;
|
|
lv_obj_t * ui____initial_actions0;
|
|
const lv_img_dsc_t * ui_imgset_anime_lin[1] = {&ui_img_anime_lin2_png};
|
|
const lv_img_dsc_t * ui_imgset_anime_line[1] = {&ui_img_anime_line1_png};
|
|
const lv_img_dsc_t * ui_imgset_arrow[1] = {&ui_img_arrow1_png};
|
|
const lv_img_dsc_t * ui_imgset_cloud[1] = {&ui_img_cloud1_png};
|
|
const lv_img_dsc_t * ui_imgset_common_switch[1] = {&ui_img_common_switch1_png};
|
|
|
|
///////////////////// TEST LVGL SETTINGS ////////////////////
|
|
#if LV_COLOR_DEPTH != 16
|
|
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
|
|
#endif
|
|
#if LV_COLOR_16_SWAP !=0
|
|
#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings"
|
|
#endif
|
|
|
|
///////////////////// ANIMATIONS ////////////////////
|
|
|
|
///////////////////// FUNCTIONS ////////////////////
|
|
void move_x_add_Animation(lv_obj_t * TargetObject, int delay)
|
|
{
|
|
ui_anim_user_data_t * PropertyAnimation_0_user_data = lv_mem_alloc(sizeof(ui_anim_user_data_t));
|
|
PropertyAnimation_0_user_data->target = TargetObject;
|
|
PropertyAnimation_0_user_data->val = -1;
|
|
lv_anim_t PropertyAnimation_0;
|
|
lv_anim_init(&PropertyAnimation_0);
|
|
lv_anim_set_time(&PropertyAnimation_0, 2000);
|
|
lv_anim_set_user_data(&PropertyAnimation_0, PropertyAnimation_0_user_data);
|
|
lv_anim_set_custom_exec_cb(&PropertyAnimation_0, _ui_anim_callback_set_x);
|
|
lv_anim_set_values(&PropertyAnimation_0, 0, 60);
|
|
lv_anim_set_path_cb(&PropertyAnimation_0, lv_anim_path_linear);
|
|
lv_anim_set_delay(&PropertyAnimation_0, delay + 0);
|
|
lv_anim_set_deleted_cb(&PropertyAnimation_0, _ui_anim_callback_free_user_data);
|
|
lv_anim_set_playback_time(&PropertyAnimation_0, 0);
|
|
lv_anim_set_playback_delay(&PropertyAnimation_0, 0);
|
|
lv_anim_set_repeat_count(&PropertyAnimation_0, LV_ANIM_REPEAT_INFINITE);
|
|
lv_anim_set_repeat_delay(&PropertyAnimation_0, 2000);
|
|
lv_anim_set_early_apply(&PropertyAnimation_0, false);
|
|
lv_anim_set_get_value_cb(&PropertyAnimation_0, &_ui_anim_callback_get_x);
|
|
lv_anim_start(&PropertyAnimation_0);
|
|
|
|
}
|
|
void mov_x_sub_Animation(lv_obj_t * TargetObject, int delay)
|
|
{
|
|
ui_anim_user_data_t * PropertyAnimation_0_user_data = lv_mem_alloc(sizeof(ui_anim_user_data_t));
|
|
PropertyAnimation_0_user_data->target = TargetObject;
|
|
PropertyAnimation_0_user_data->val = -1;
|
|
lv_anim_t PropertyAnimation_0;
|
|
lv_anim_init(&PropertyAnimation_0);
|
|
lv_anim_set_time(&PropertyAnimation_0, 2000);
|
|
lv_anim_set_user_data(&PropertyAnimation_0, PropertyAnimation_0_user_data);
|
|
lv_anim_set_custom_exec_cb(&PropertyAnimation_0, _ui_anim_callback_set_x);
|
|
lv_anim_set_values(&PropertyAnimation_0, 0, -60);
|
|
lv_anim_set_path_cb(&PropertyAnimation_0, lv_anim_path_linear);
|
|
lv_anim_set_delay(&PropertyAnimation_0, delay + 0);
|
|
lv_anim_set_deleted_cb(&PropertyAnimation_0, _ui_anim_callback_free_user_data);
|
|
lv_anim_set_playback_time(&PropertyAnimation_0, 0);
|
|
lv_anim_set_playback_delay(&PropertyAnimation_0, 0);
|
|
lv_anim_set_repeat_count(&PropertyAnimation_0, LV_ANIM_REPEAT_INFINITE);
|
|
lv_anim_set_repeat_delay(&PropertyAnimation_0, 2000);
|
|
lv_anim_set_early_apply(&PropertyAnimation_0, false);
|
|
lv_anim_set_get_value_cb(&PropertyAnimation_0, &_ui_anim_callback_get_x);
|
|
lv_anim_start(&PropertyAnimation_0);
|
|
|
|
}
|
|
|
|
///////////////////// FUNCTIONS ////////////////////
|
|
void ui_event_Screen1(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_SCREEN_LOADED) {
|
|
move_x_add_Animation(ui_cloudSmall1, 0);
|
|
mov_x_sub_Animation(ui_cloudSmall2, 0);
|
|
mov_x_sub_Animation(ui_cloudSmall1, 2000);
|
|
move_x_add_Animation(ui_cloudSmall2, 2000);
|
|
}
|
|
}
|
|
|
|
void ui_event_Ui2Panel2(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel2Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_TOGGLE);
|
|
}
|
|
if(event_code == LV_EVENT_VALUE_CHANGED && lv_obj_has_state(target, LV_STATE_CHECKED)) {
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "开");
|
|
}
|
|
if(event_code == LV_EVENT_VALUE_CHANGED && !lv_obj_has_state(target, LV_STATE_CHECKED)) {
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
}
|
|
}
|
|
void ui_event_Ui2Panel1(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel2Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_ADD);
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "开");
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "开");
|
|
_ui_state_modify(ui_Ui2Panel4Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_ADD);
|
|
}
|
|
}
|
|
void ui_event_Ui2Panel4(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel4Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_TOGGLE);
|
|
}
|
|
if(event_code == LV_EVENT_VALUE_CHANGED && lv_obj_has_state(target, LV_STATE_CHECKED)) {
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "开");
|
|
}
|
|
if(event_code == LV_EVENT_VALUE_CHANGED && !lv_obj_has_state(target, LV_STATE_CHECKED)) {
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
}
|
|
}
|
|
void ui_event_Ui2Panel3(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel2Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_state_modify(ui_Ui2Panel4Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
}
|
|
}
|
|
void ui_event_Ui4Panel1(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel2Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_state_modify(ui_Ui2Panel4Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
}
|
|
}
|
|
void ui_event_Ui4Panel2(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
lv_obj_t * target = lv_event_get_target(e);
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
_ui_state_modify(ui_Ui2Panel2Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
_ui_label_set_property(ui_Ui2Panel4Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_label_set_property(ui_Ui2Panel2Value, _UI_LABEL_PROPERTY_TEXT, "关");
|
|
_ui_state_modify(ui_Ui2Panel4Img, LV_STATE_CHECKED, _UI_MODIFY_STATE_REMOVE);
|
|
}
|
|
}
|
|
|
|
///////////////////// SCREENS ////////////////////
|
|
|
|
#if 0
|
|
void ui_init(void)
|
|
{
|
|
lv_disp_t * dispp = lv_disp_get_default();
|
|
lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
|
|
false, LV_FONT_DEFAULT);
|
|
lv_disp_set_theme(dispp, theme);
|
|
ui_UiPage1_screen_init();
|
|
ui_UiPage2_screen_init();
|
|
ui_UiPage3_screen_init();
|
|
ui_UiPage4_screen_init();
|
|
ui_UiArcPage_screen_init();
|
|
ui_UiPage5_screen_init();
|
|
ui_UiPage6_screen_init();
|
|
ui____initial_actions0 = lv_obj_create(NULL);
|
|
lv_disp_load_scr(ui_UiPage1);
|
|
}
|
|
#endif
|