// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.2
// LVGL version: 9.1.0
// Project name: SmartGrow

#include "ui.h"
#include "ui_helpers.h"

///////////////////// VARIABLES ////////////////////


// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
lv_obj_t * ui_Screen1;
lv_obj_t * ui_lblclock;
lv_obj_t * ui_imgtemp;
lv_obj_t * ui_imghum;
lv_obj_t * ui_btnmode;
void ui_event_btnlight(lv_event_t * e);
lv_obj_t * ui_btnlight;
void ui_event_btnfan(lv_event_t * e);
lv_obj_t * ui_btnfan;
lv_obj_t * ui_lbltemp;
lv_obj_t * ui_lblhum;
lv_obj_t * ui_lbllightstatus;
lv_obj_t * ui_lblfanspeed;
void ui_event_settings(lv_event_t * e);
lv_obj_t * ui_settings;
lv_obj_t * ui_growmode;


// SCREEN: ui_Screen2
void ui_Screen2_screen_init(void);
lv_obj_t * ui_Screen2;
lv_obj_t * ui_Image3;
lv_obj_t * ui_Image4;
void ui_event_Label1(lv_event_t * e);
lv_obj_t * ui_Label1;
lv_obj_t * ui_Label2;
lv_obj_t * ui_light2statuslbl;
lv_obj_t * ui_light1statuslbl;
lv_obj_t * ui_light1switch;
lv_obj_t * ui_light2switch;
lv_obj_t * ui_light2percent;
lv_obj_t * ui_light1percent;
lv_obj_t * ui_light1up;
lv_obj_t * ui_light1down;
lv_obj_t * ui_light2up;
lv_obj_t * ui_light2down;


// SCREEN: ui_Screen3
void ui_Screen3_screen_init(void);
lv_obj_t * ui_Screen3;
lv_obj_t * ui_Image1;
lv_obj_t * ui_Image2;
lv_obj_t * ui_fantemp;
lv_obj_t * ui_fanhum;
lv_obj_t * ui_lblfanfanspeed;
lv_obj_t * ui_btnfandown;
lv_obj_t * ui_btnfanup;
lv_obj_t * ui_Image6;
void ui_event_btnfanhome(lv_event_t * e);
lv_obj_t * ui_btnfanhome;
lv_obj_t * ui_switchfanstatus;
lv_obj_t * ui_lblfanstatus;


// SCREEN: ui_Screen4
void ui_Screen4_screen_init(void);
lv_obj_t * ui_Screen4;
lv_obj_t * ui_wifistatus;
lv_obj_t * ui_lblgrowmode;
void ui_event_wifibtn(lv_event_t * e);
lv_obj_t * ui_wifibtn;
void ui_event_growmodebtn(lv_event_t * e);
lv_obj_t * ui_growmodebtn;
lv_obj_t * ui_homebtn;


// SCREEN: ui_Screen5
void ui_Screen5_screen_init(void);
lv_obj_t * ui_Screen5;
lv_obj_t * ui_wifipw;
void ui_event_wifikeyboard(lv_event_t * e);
lv_obj_t * ui_wifikeyboard;
lv_obj_t * ui_wifinetlist;
lv_obj_t * ui_wifipwlbl;
void ui_event_wifiname(lv_event_t * e);
lv_obj_t * ui_wifiname;


// SCREEN: ui_Screen6
void ui_Screen6_screen_init(void);
lv_obj_t * ui_Screen6;
lv_obj_t * ui_starthour;
lv_obj_t * ui_startmin;
lv_obj_t * ui_Label4;
lv_obj_t * ui_Label6;
lv_obj_t * ui_endmin;
lv_obj_t * ui_endhour;
lv_obj_t * ui_Label5;
lv_obj_t * ui_Label7;
lv_obj_t * ui_Label8;
lv_obj_t * ui_sunsetcheck;
lv_obj_t * ui_setmode;
lv_obj_t * ui_savemode;
lv_obj_t * ui_lblsavemode;
void ui_event_homebtngrow(lv_event_t * e);
lv_obj_t * ui_homebtngrow;
lv_obj_t * ui____initial_actions0;

///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16
    #error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
#endif

///////////////////// ANIMATIONS ////////////////////

///////////////////// FUNCTIONS ////////////////////
void ui_event_btnlight(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_screen_change(&ui_Screen2, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen2_screen_init);
    }
}
void ui_event_btnfan(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_screen_change(&ui_Screen3, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen3_screen_init);
    }
}
void ui_event_settings(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_screen_change(&ui_Screen4, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen4_screen_init);
    }
}
void ui_event_Label1(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_screen_change(&ui_Screen1, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen1_screen_init);
    }
}
void ui_event_btnfanhome(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_screen_change(&ui_Screen1, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen1_screen_init);
    }
}
void ui_event_wifibtn(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_screen_change(&ui_Screen5, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen5_screen_init);
    }
}
void ui_event_growmodebtn(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_screen_change(&ui_Screen6, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen6_screen_init);
    }
}
void ui_event_wifikeyboard(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_READY) {
        _ui_screen_change(&ui_Screen4, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen4_screen_init);
    }
    if(event_code == LV_EVENT_CLICKED) {
        _ui_keyboard_set_target(ui_wifikeyboard,  ui_wifipw);
    }
}
void ui_event_wifiname(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_screen_change(&ui_Screen4, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen4_screen_init);
    }
}
void ui_event_homebtngrow(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_screen_change(&ui_Screen1, LV_SCR_LOAD_ANIM_FADE_ON, 500, 0, &ui_Screen1_screen_init);
    }
}

///////////////////// SCREENS ////////////////////

void ui_init(void)
{
    lv_disp_t * dispp = lv_display_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_Screen1_screen_init();
    ui_Screen2_screen_init();
    ui_Screen3_screen_init();
    ui_Screen4_screen_init();
    ui_Screen5_screen_init();
    ui_Screen6_screen_init();
    ui____initial_actions0 = lv_obj_create(NULL);
    lv_disp_load_scr(ui_Screen1);
}
