f60bdac268
Protocol v2 (shared header, byte-identical with the 1.3 repo): - typed DATA/CONFIG frames: 0xAA | ver | type | len | payload | XOR | 0x55 - gear split into lever (P/R/N/D/S/M) + target/engaged nibbles, engine rpm, alert bitmap decided here from tunable thresholds, link_config_t tunables - docs/UART_PROTOCOL.md rewritten for v2 Controller A modules: - tunables: gauge calibration + alert thresholds in NVS, 'cfg' serial console, bench override (never persisted) - espnow_link: every frame also broadcast on ESP-NOW ch 1; radio stays in STA (WiFiManager no longer powers it off) - uart_manager: DATA at 5 Hz + CONFIG on change/5 s on both transports - can_driver: publishes gear pieces and rpm, evaluates alerts - tuning_screen: hand-coded Gauge Tuning page (swipe right from Driveline), -/+ rows, enable switches, override sliders, Driveline/Defaults buttons UI: SquareLine Home screen (3 meters + battery) and meters_manager removed; Driveline is the boot screen; Settings back-gesture calls app_show_driveline(). tools/fix_penv_deps.ps1: repairs the shared PlatformIO penv after a 1.3 build. Bench-verified with Controller B: both transports alive, dedupe, override rpm 2000 -> 133.3 Hz tach output. Co-Authored-By: Claude <noreply@anthropic.com>
553 lines
26 KiB
C
553 lines
26 KiB
C
// This file was generated by SquareLine Studio
|
|
// SquareLine Studio version: SquareLine Studio 1.5.4
|
|
// LVGL version: 8.3.6
|
|
// Project name: ESP32-S3-Touch-LCD-5B
|
|
|
|
#include "../ui.h"
|
|
|
|
// Hand-coded Driveline screen (src/modules/driveline_screen.cpp) - replaces Home
|
|
void app_show_driveline(void);
|
|
|
|
lv_obj_t * uic_Settings_Loading_Spinner;
|
|
lv_obj_t * uic_Settings_Loading_Container;
|
|
lv_obj_t * uic_CPU_Values_LBL;
|
|
lv_obj_t * uic_FPS_Values_LBL;
|
|
lv_obj_t * uic_Device_State_Values_LBL;
|
|
lv_obj_t * uic_CPU_Static_LBL;
|
|
lv_obj_t * uic_FPS_Static_LBL;
|
|
lv_obj_t * uic_Static_LBLS_Container;
|
|
lv_obj_t * uic_Device_State_Container;
|
|
lv_obj_t * uic_Keyboard;
|
|
lv_obj_t * uic_Wifi_Passkey_TB;
|
|
lv_obj_t * uic_Select_SSID_BTN;
|
|
lv_obj_t * uic_Wifi_Container;
|
|
lv_obj_t * uic_Enable_Debug_LBL;
|
|
lv_obj_t * uic_Toggle_Debug_Switch;
|
|
lv_obj_t * uic_Debug_CTRL_Panel;
|
|
lv_obj_t * uic_Enable_BLE_LBL;
|
|
lv_obj_t * uic_Toggle_BLE_Switch;
|
|
lv_obj_t * uic_BLE_CTRL_Panel;
|
|
lv_obj_t * uic_Enable_Wifi_LBL;
|
|
lv_obj_t * uic_Toggle_Wifi_Switch;
|
|
lv_obj_t * uic_Wifi_CTRL_Panel;
|
|
lv_obj_t * uic_Enable_UART_LBL;
|
|
lv_obj_t * uic_Toggle_UART_Switch;
|
|
lv_obj_t * uic_UART_CTRL_Panel;
|
|
lv_obj_t * uic_Enable_CAN_Bus_LBL;
|
|
lv_obj_t * uic_Toggle_CAN_Bus_Switch;
|
|
lv_obj_t * uic_CAN_Bus_CTRL_Panel;
|
|
lv_obj_t * uic_Settings_CTRL_Container;
|
|
lv_obj_t * uic_Main_Container;
|
|
lv_obj_t * uic_Settings_Screen_LBL;
|
|
lv_obj_t * uic_Settings_Screen;
|
|
lv_obj_t * ui_Settings_Screen = NULL;
|
|
lv_obj_t * ui_Settings_Screen_LBL = NULL;
|
|
lv_obj_t * ui_Main_Container = NULL;
|
|
lv_obj_t * ui_Settings_CTRL_Container = NULL;
|
|
lv_obj_t * ui_CAN_Bus_CTRL_Panel = NULL;
|
|
lv_obj_t * ui_Toggle_CAN_Bus_Switch = NULL;
|
|
lv_obj_t * ui_Enable_CAN_Bus_LBL = NULL;
|
|
lv_obj_t * ui_UART_CTRL_Panel = NULL;
|
|
lv_obj_t * ui_Toggle_UART_Switch = NULL;
|
|
lv_obj_t * ui_Enable_UART_LBL = NULL;
|
|
lv_obj_t * ui_Wifi_CTRL_Panel = NULL;
|
|
lv_obj_t * ui_Toggle_Wifi_Switch = NULL;
|
|
lv_obj_t * ui_Enable_Wifi_LBL = NULL;
|
|
lv_obj_t * ui_BLE_CTRL_Panel = NULL;
|
|
lv_obj_t * ui_Toggle_BLE_Switch = NULL;
|
|
lv_obj_t * ui_Enable_BLE_LBL = NULL;
|
|
lv_obj_t * ui_Debug_CTRL_Panel = NULL;
|
|
lv_obj_t * ui_Toggle_Debug_Switch = NULL;
|
|
lv_obj_t * ui_Enable_Debug_LBL = NULL;
|
|
lv_obj_t * ui_Wifi_Container = NULL;
|
|
lv_obj_t * ui_Select_SSID_BTN = NULL;
|
|
lv_obj_t * ui_Wifi_Passkey_TB = NULL;
|
|
lv_obj_t * ui_Keyboard = NULL;
|
|
lv_obj_t * ui_Device_State_Container = NULL;
|
|
lv_obj_t * ui_Static_LBLS_Container = NULL;
|
|
lv_obj_t * ui_FPS_Static_LBL = NULL;
|
|
lv_obj_t * ui_CPU_Static_LBL = NULL;
|
|
lv_obj_t * ui_Device_State_Values_LBL = NULL;
|
|
lv_obj_t * ui_FPS_Values_LBL = NULL;
|
|
lv_obj_t * ui_CPU_Values_LBL = NULL;
|
|
lv_obj_t * ui_Settings_Loading_Container = NULL;
|
|
lv_obj_t * ui_Settings_Loading_Spinner = NULL;
|
|
// event funtions
|
|
void ui_event_Settings_Screen(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT) {
|
|
lv_indev_wait_release(lv_indev_get_act());
|
|
app_show_driveline(); // Home screen removed; back goes to the Driveline screen
|
|
}
|
|
}
|
|
|
|
void ui_event_Toggle_UART_Switch(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_RELEASED) {
|
|
onUARTToggle(e);
|
|
}
|
|
}
|
|
|
|
void ui_event_Toggle_Wifi_Switch(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_RELEASED) {
|
|
onWifiToggle(e);
|
|
}
|
|
}
|
|
|
|
void ui_event_Toggle_CAN_Bus_Switch(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_RELEASED) {
|
|
onCANBusToggle(e);
|
|
}
|
|
}
|
|
|
|
void ui_event_Toggle_Debug_Switch(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_RELEASED) {
|
|
onDebugToggle(e);
|
|
}
|
|
}
|
|
|
|
void ui_event_Select_SSID_BTN(lv_event_t * e)
|
|
{
|
|
lv_event_code_t event_code = lv_event_get_code(e);
|
|
|
|
if(event_code == LV_EVENT_CLICKED) {
|
|
onSelectSSID(e);
|
|
}
|
|
}
|
|
|
|
// build funtions
|
|
|
|
void ui_Settings_Screen_screen_init(void)
|
|
{
|
|
ui_Settings_Screen = lv_obj_create(NULL);
|
|
lv_obj_clear_flag(ui_Settings_Screen, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
lv_obj_add_event_cb(ui_Settings_Screen, scr_unloaded_delete_cb, LV_EVENT_SCREEN_UNLOADED,
|
|
ui_Settings_Screen_screen_destroy);
|
|
|
|
ui_Settings_Screen_LBL = lv_label_create(ui_Settings_Screen);
|
|
lv_obj_set_width(ui_Settings_Screen_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Settings_Screen_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Settings_Screen_LBL, -405);
|
|
lv_obj_set_y(ui_Settings_Screen_LBL, -268);
|
|
lv_obj_set_align(ui_Settings_Screen_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Settings_Screen_LBL, "Settings");
|
|
lv_obj_set_style_text_font(ui_Settings_Screen_LBL, &lv_font_montserrat_48, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Main_Container = lv_obj_create(ui_Settings_Screen);
|
|
lv_obj_remove_style_all(ui_Main_Container);
|
|
lv_obj_set_width(ui_Main_Container, 1024);
|
|
lv_obj_set_height(ui_Main_Container, 530);
|
|
lv_obj_set_x(ui_Main_Container, 0);
|
|
lv_obj_set_y(ui_Main_Container, 34);
|
|
lv_obj_set_align(ui_Main_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Main_Container, LV_FLEX_FLOW_ROW_WRAP);
|
|
lv_obj_set_flex_align(ui_Main_Container, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_Main_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_Settings_CTRL_Container = lv_obj_create(ui_Main_Container);
|
|
lv_obj_remove_style_all(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_Settings_CTRL_Container, 410);
|
|
lv_obj_set_height(ui_Settings_CTRL_Container, 530);
|
|
lv_obj_set_x(ui_Settings_CTRL_Container, -130);
|
|
lv_obj_set_y(ui_Settings_CTRL_Container, 8);
|
|
lv_obj_set_align(ui_Settings_CTRL_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Settings_CTRL_Container, LV_FLEX_FLOW_COLUMN);
|
|
lv_obj_set_flex_align(ui_Settings_CTRL_Container, LV_FLEX_ALIGN_SPACE_AROUND, LV_FLEX_ALIGN_CENTER,
|
|
LV_FLEX_ALIGN_SPACE_EVENLY);
|
|
lv_obj_clear_flag(ui_Settings_CTRL_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_CAN_Bus_CTRL_Panel = lv_obj_create(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_CAN_Bus_CTRL_Panel, 400);
|
|
lv_obj_set_height(ui_CAN_Bus_CTRL_Panel, 100);
|
|
lv_obj_set_x(ui_CAN_Bus_CTRL_Panel, 0);
|
|
lv_obj_set_y(ui_CAN_Bus_CTRL_Panel, 1);
|
|
lv_obj_set_align(ui_CAN_Bus_CTRL_Panel, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_CAN_Bus_CTRL_Panel, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_CAN_Bus_CTRL_Panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_CAN_Bus_CTRL_Panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
lv_obj_set_style_bg_color(ui_CAN_Bus_CTRL_Panel, lv_color_hex(0x7F7A9C), LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui_CAN_Bus_CTRL_Panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Toggle_CAN_Bus_Switch = lv_switch_create(ui_CAN_Bus_CTRL_Panel);
|
|
lv_obj_set_width(ui_Toggle_CAN_Bus_Switch, 110);
|
|
lv_obj_set_height(ui_Toggle_CAN_Bus_Switch, 60);
|
|
lv_obj_set_x(ui_Toggle_CAN_Bus_Switch, -181);
|
|
lv_obj_set_y(ui_Toggle_CAN_Bus_Switch, -3);
|
|
lv_obj_set_align(ui_Toggle_CAN_Bus_Switch, LV_ALIGN_CENTER);
|
|
|
|
ui_Enable_CAN_Bus_LBL = lv_label_create(ui_CAN_Bus_CTRL_Panel);
|
|
lv_obj_set_width(ui_Enable_CAN_Bus_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Enable_CAN_Bus_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Enable_CAN_Bus_LBL, -117);
|
|
lv_obj_set_y(ui_Enable_CAN_Bus_LBL, -2);
|
|
lv_obj_set_align(ui_Enable_CAN_Bus_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Enable_CAN_Bus_LBL, "Enable CANBus");
|
|
lv_obj_set_style_text_font(ui_Enable_CAN_Bus_LBL, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_UART_CTRL_Panel = lv_obj_create(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_UART_CTRL_Panel, 400);
|
|
lv_obj_set_height(ui_UART_CTRL_Panel, 100);
|
|
lv_obj_set_x(ui_UART_CTRL_Panel, 0);
|
|
lv_obj_set_y(ui_UART_CTRL_Panel, 1);
|
|
lv_obj_set_align(ui_UART_CTRL_Panel, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_UART_CTRL_Panel, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_UART_CTRL_Panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_UART_CTRL_Panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
ui_object_set_themeable_style_property(ui_UART_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
|
|
_ui_theme_color_panel_backgroung);
|
|
ui_object_set_themeable_style_property(ui_UART_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
|
|
_ui_theme_alpha_panel_backgroung);
|
|
|
|
ui_Toggle_UART_Switch = lv_switch_create(ui_UART_CTRL_Panel);
|
|
lv_obj_set_width(ui_Toggle_UART_Switch, 110);
|
|
lv_obj_set_height(ui_Toggle_UART_Switch, 60);
|
|
lv_obj_set_x(ui_Toggle_UART_Switch, -181);
|
|
lv_obj_set_y(ui_Toggle_UART_Switch, -3);
|
|
lv_obj_set_align(ui_Toggle_UART_Switch, LV_ALIGN_CENTER);
|
|
|
|
ui_Enable_UART_LBL = lv_label_create(ui_UART_CTRL_Panel);
|
|
lv_obj_set_width(ui_Enable_UART_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Enable_UART_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Enable_UART_LBL, -117);
|
|
lv_obj_set_y(ui_Enable_UART_LBL, -2);
|
|
lv_obj_set_align(ui_Enable_UART_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Enable_UART_LBL, "Enable UART");
|
|
lv_obj_set_style_text_font(ui_Enable_UART_LBL, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Wifi_CTRL_Panel = lv_obj_create(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_Wifi_CTRL_Panel, 405);
|
|
lv_obj_set_height(ui_Wifi_CTRL_Panel, 100);
|
|
lv_obj_set_x(ui_Wifi_CTRL_Panel, 0);
|
|
lv_obj_set_y(ui_Wifi_CTRL_Panel, 1);
|
|
lv_obj_set_align(ui_Wifi_CTRL_Panel, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Wifi_CTRL_Panel, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_Wifi_CTRL_Panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_Wifi_CTRL_Panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
ui_object_set_themeable_style_property(ui_Wifi_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
|
|
_ui_theme_color_panel_backgroung);
|
|
ui_object_set_themeable_style_property(ui_Wifi_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
|
|
_ui_theme_alpha_panel_backgroung);
|
|
|
|
ui_Toggle_Wifi_Switch = lv_switch_create(ui_Wifi_CTRL_Panel);
|
|
lv_obj_set_width(ui_Toggle_Wifi_Switch, 110);
|
|
lv_obj_set_height(ui_Toggle_Wifi_Switch, 60);
|
|
lv_obj_set_x(ui_Toggle_Wifi_Switch, -181);
|
|
lv_obj_set_y(ui_Toggle_Wifi_Switch, -3);
|
|
lv_obj_set_align(ui_Toggle_Wifi_Switch, LV_ALIGN_CENTER);
|
|
lv_obj_add_state(ui_Toggle_Wifi_Switch, LV_STATE_DISABLED); /// States
|
|
|
|
ui_Enable_Wifi_LBL = lv_label_create(ui_Wifi_CTRL_Panel);
|
|
lv_obj_set_width(ui_Enable_Wifi_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Enable_Wifi_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Enable_Wifi_LBL, -117);
|
|
lv_obj_set_y(ui_Enable_Wifi_LBL, -2);
|
|
lv_obj_set_align(ui_Enable_Wifi_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Enable_Wifi_LBL, "Enable Wifi");
|
|
lv_obj_set_style_text_font(ui_Enable_Wifi_LBL, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_BLE_CTRL_Panel = lv_obj_create(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_BLE_CTRL_Panel, 400);
|
|
lv_obj_set_height(ui_BLE_CTRL_Panel, 100);
|
|
lv_obj_set_x(ui_BLE_CTRL_Panel, 0);
|
|
lv_obj_set_y(ui_BLE_CTRL_Panel, 1);
|
|
lv_obj_set_align(ui_BLE_CTRL_Panel, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_BLE_CTRL_Panel, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_BLE_CTRL_Panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_BLE_CTRL_Panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
ui_object_set_themeable_style_property(ui_BLE_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
|
|
_ui_theme_color_panel_backgroung);
|
|
ui_object_set_themeable_style_property(ui_BLE_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
|
|
_ui_theme_alpha_panel_backgroung);
|
|
|
|
ui_Toggle_BLE_Switch = lv_switch_create(ui_BLE_CTRL_Panel);
|
|
lv_obj_set_width(ui_Toggle_BLE_Switch, 110);
|
|
lv_obj_set_height(ui_Toggle_BLE_Switch, 60);
|
|
lv_obj_set_x(ui_Toggle_BLE_Switch, -181);
|
|
lv_obj_set_y(ui_Toggle_BLE_Switch, -3);
|
|
lv_obj_set_align(ui_Toggle_BLE_Switch, LV_ALIGN_CENTER);
|
|
lv_obj_add_state(ui_Toggle_BLE_Switch, LV_STATE_DISABLED); /// States
|
|
|
|
ui_Enable_BLE_LBL = lv_label_create(ui_BLE_CTRL_Panel);
|
|
lv_obj_set_width(ui_Enable_BLE_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Enable_BLE_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Enable_BLE_LBL, -117);
|
|
lv_obj_set_y(ui_Enable_BLE_LBL, -2);
|
|
lv_obj_set_align(ui_Enable_BLE_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Enable_BLE_LBL, "Enable BLE");
|
|
lv_obj_set_style_text_font(ui_Enable_BLE_LBL, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Debug_CTRL_Panel = lv_obj_create(ui_Settings_CTRL_Container);
|
|
lv_obj_set_width(ui_Debug_CTRL_Panel, 400);
|
|
lv_obj_set_height(ui_Debug_CTRL_Panel, 100);
|
|
lv_obj_set_x(ui_Debug_CTRL_Panel, 0);
|
|
lv_obj_set_y(ui_Debug_CTRL_Panel, 1);
|
|
lv_obj_set_align(ui_Debug_CTRL_Panel, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Debug_CTRL_Panel, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_Debug_CTRL_Panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_Debug_CTRL_Panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
ui_object_set_themeable_style_property(ui_Debug_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
|
|
_ui_theme_color_panel_backgroung);
|
|
ui_object_set_themeable_style_property(ui_Debug_CTRL_Panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
|
|
_ui_theme_alpha_panel_backgroung);
|
|
|
|
ui_Toggle_Debug_Switch = lv_switch_create(ui_Debug_CTRL_Panel);
|
|
lv_obj_set_width(ui_Toggle_Debug_Switch, 110);
|
|
lv_obj_set_height(ui_Toggle_Debug_Switch, 60);
|
|
lv_obj_set_x(ui_Toggle_Debug_Switch, -181);
|
|
lv_obj_set_y(ui_Toggle_Debug_Switch, -3);
|
|
lv_obj_set_align(ui_Toggle_Debug_Switch, LV_ALIGN_CENTER);
|
|
|
|
ui_Enable_Debug_LBL = lv_label_create(ui_Debug_CTRL_Panel);
|
|
lv_obj_set_width(ui_Enable_Debug_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_Enable_Debug_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_Enable_Debug_LBL, -117);
|
|
lv_obj_set_y(ui_Enable_Debug_LBL, -2);
|
|
lv_obj_set_align(ui_Enable_Debug_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_Enable_Debug_LBL, "Enable Debug");
|
|
lv_obj_set_style_text_font(ui_Enable_Debug_LBL, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Wifi_Container = lv_obj_create(ui_Main_Container);
|
|
lv_obj_remove_style_all(ui_Wifi_Container);
|
|
lv_obj_set_width(ui_Wifi_Container, 610);
|
|
lv_obj_set_height(ui_Wifi_Container, 530);
|
|
lv_obj_set_x(ui_Wifi_Container, -100);
|
|
lv_obj_set_y(ui_Wifi_Container, 8);
|
|
lv_obj_set_align(ui_Wifi_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Wifi_Container, LV_FLEX_FLOW_COLUMN);
|
|
lv_obj_set_flex_align(ui_Wifi_Container, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
|
lv_obj_clear_flag(ui_Wifi_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_Select_SSID_BTN = lv_btn_create(ui_Wifi_Container);
|
|
lv_obj_set_width(ui_Select_SSID_BTN, 668);
|
|
lv_obj_set_height(ui_Select_SSID_BTN, 50);
|
|
lv_obj_set_x(ui_Select_SSID_BTN, 7);
|
|
lv_obj_set_y(ui_Select_SSID_BTN, -4);
|
|
lv_obj_set_align(ui_Select_SSID_BTN, LV_ALIGN_CENTER);
|
|
lv_obj_add_flag(ui_Select_SSID_BTN, LV_OBJ_FLAG_HIDDEN); /// Flags
|
|
lv_obj_set_style_bg_color(ui_Select_SSID_BTN, lv_color_hex(0x7F7A9C), LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
lv_obj_set_style_bg_opa(ui_Select_SSID_BTN, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
|
|
|
ui_Wifi_Passkey_TB = lv_textarea_create(ui_Wifi_Container);
|
|
lv_obj_set_width(ui_Wifi_Passkey_TB, 200);
|
|
lv_obj_set_height(ui_Wifi_Passkey_TB, LV_SIZE_CONTENT); /// 70
|
|
lv_obj_set_x(ui_Wifi_Passkey_TB, 129);
|
|
lv_obj_set_y(ui_Wifi_Passkey_TB, -173);
|
|
lv_obj_set_align(ui_Wifi_Passkey_TB, LV_ALIGN_CENTER);
|
|
lv_textarea_set_placeholder_text(ui_Wifi_Passkey_TB, "Placeholder...");
|
|
lv_textarea_set_one_line(ui_Wifi_Passkey_TB, true);
|
|
lv_obj_add_flag(ui_Wifi_Passkey_TB, LV_OBJ_FLAG_HIDDEN); /// Flags
|
|
|
|
ui_Keyboard = lv_keyboard_create(ui_Settings_Screen);
|
|
lv_obj_set_width(ui_Keyboard, 1012);
|
|
lv_obj_set_height(ui_Keyboard, 268);
|
|
lv_obj_set_x(ui_Keyboard, 3);
|
|
lv_obj_set_y(ui_Keyboard, 161);
|
|
lv_obj_set_align(ui_Keyboard, LV_ALIGN_CENTER);
|
|
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN); /// Flags
|
|
|
|
ui_Device_State_Container = lv_obj_create(ui_Settings_Screen);
|
|
lv_obj_remove_style_all(ui_Device_State_Container);
|
|
lv_obj_set_width(ui_Device_State_Container, 75);
|
|
lv_obj_set_height(ui_Device_State_Container, 30);
|
|
lv_obj_set_x(ui_Device_State_Container, 470);
|
|
lv_obj_set_y(ui_Device_State_Container, -282);
|
|
lv_obj_set_align(ui_Device_State_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Device_State_Container, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_Device_State_Container, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
|
lv_obj_add_flag(ui_Device_State_Container, LV_OBJ_FLAG_HIDDEN); /// Flags
|
|
lv_obj_clear_flag(ui_Device_State_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_Static_LBLS_Container = lv_obj_create(ui_Device_State_Container);
|
|
lv_obj_remove_style_all(ui_Static_LBLS_Container);
|
|
lv_obj_set_width(ui_Static_LBLS_Container, 35);
|
|
lv_obj_set_height(ui_Static_LBLS_Container, 30);
|
|
lv_obj_set_align(ui_Static_LBLS_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Static_LBLS_Container, LV_FLEX_FLOW_COLUMN);
|
|
lv_obj_set_flex_align(ui_Static_LBLS_Container, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_START);
|
|
lv_obj_clear_flag(ui_Static_LBLS_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_FPS_Static_LBL = lv_label_create(ui_Static_LBLS_Container);
|
|
lv_obj_set_width(ui_FPS_Static_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_FPS_Static_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_FPS_Static_LBL, -176);
|
|
lv_obj_set_y(ui_FPS_Static_LBL, 34);
|
|
lv_obj_set_align(ui_FPS_Static_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_FPS_Static_LBL, "FPS:");
|
|
|
|
ui_CPU_Static_LBL = lv_label_create(ui_Static_LBLS_Container);
|
|
lv_obj_set_width(ui_CPU_Static_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_CPU_Static_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_CPU_Static_LBL, -1);
|
|
lv_obj_set_y(ui_CPU_Static_LBL, -1);
|
|
lv_obj_set_align(ui_CPU_Static_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_CPU_Static_LBL, "CPU:");
|
|
|
|
ui_Device_State_Values_LBL = lv_obj_create(ui_Device_State_Container);
|
|
lv_obj_remove_style_all(ui_Device_State_Values_LBL);
|
|
lv_obj_set_width(ui_Device_State_Values_LBL, 35);
|
|
lv_obj_set_height(ui_Device_State_Values_LBL, 30);
|
|
lv_obj_set_align(ui_Device_State_Values_LBL, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Device_State_Values_LBL, LV_FLEX_FLOW_COLUMN);
|
|
lv_obj_set_flex_align(ui_Device_State_Values_LBL, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
|
lv_obj_clear_flag(ui_Device_State_Values_LBL, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_FPS_Values_LBL = lv_label_create(ui_Device_State_Values_LBL);
|
|
lv_obj_set_width(ui_FPS_Values_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_FPS_Values_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_FPS_Values_LBL, -176);
|
|
lv_obj_set_y(ui_FPS_Values_LBL, 34);
|
|
lv_obj_set_align(ui_FPS_Values_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_FPS_Values_LBL, "0");
|
|
|
|
ui_CPU_Values_LBL = lv_label_create(ui_Device_State_Values_LBL);
|
|
lv_obj_set_width(ui_CPU_Values_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_height(ui_CPU_Values_LBL, LV_SIZE_CONTENT); /// 1
|
|
lv_obj_set_x(ui_CPU_Values_LBL, -1);
|
|
lv_obj_set_y(ui_CPU_Values_LBL, -1);
|
|
lv_obj_set_align(ui_CPU_Values_LBL, LV_ALIGN_CENTER);
|
|
lv_label_set_text(ui_CPU_Values_LBL, "0%");
|
|
|
|
ui_Settings_Loading_Container = lv_obj_create(ui_Settings_Screen);
|
|
lv_obj_remove_style_all(ui_Settings_Loading_Container);
|
|
lv_obj_set_width(ui_Settings_Loading_Container, 1024);
|
|
lv_obj_set_height(ui_Settings_Loading_Container, 600);
|
|
lv_obj_set_align(ui_Settings_Loading_Container, LV_ALIGN_CENTER);
|
|
lv_obj_set_flex_flow(ui_Settings_Loading_Container, LV_FLEX_FLOW_ROW);
|
|
lv_obj_set_flex_align(ui_Settings_Loading_Container, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
|
lv_obj_clear_flag(ui_Settings_Loading_Container, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
|
|
|
ui_Settings_Loading_Spinner = lv_spinner_create(ui_Settings_Loading_Container, 1000, 90);
|
|
lv_obj_set_width(ui_Settings_Loading_Spinner, 80);
|
|
lv_obj_set_height(ui_Settings_Loading_Spinner, 80);
|
|
lv_obj_set_x(ui_Settings_Loading_Spinner, -22);
|
|
lv_obj_set_y(ui_Settings_Loading_Spinner, -22);
|
|
lv_obj_set_align(ui_Settings_Loading_Spinner, LV_ALIGN_CENTER);
|
|
lv_obj_add_flag(ui_Settings_Loading_Spinner, LV_OBJ_FLAG_HIDDEN); /// Flags
|
|
lv_obj_clear_flag(ui_Settings_Loading_Spinner, LV_OBJ_FLAG_CLICKABLE); /// Flags
|
|
|
|
lv_obj_add_event_cb(ui_Toggle_UART_Switch, ui_event_Toggle_UART_Switch, LV_EVENT_ALL, NULL);
|
|
lv_obj_add_event_cb(ui_Toggle_Wifi_Switch, ui_event_Toggle_Wifi_Switch, LV_EVENT_ALL, NULL);
|
|
lv_obj_add_event_cb(ui_Toggle_CAN_Bus_Switch, ui_event_Toggle_CAN_Bus_Switch, LV_EVENT_ALL, NULL);
|
|
lv_obj_add_event_cb(ui_Toggle_Debug_Switch, ui_event_Toggle_Debug_Switch, LV_EVENT_ALL, NULL);
|
|
lv_obj_add_event_cb(ui_Select_SSID_BTN, ui_event_Select_SSID_BTN, LV_EVENT_ALL, NULL);
|
|
lv_obj_add_event_cb(ui_Settings_Screen, ui_event_Settings_Screen, LV_EVENT_ALL, NULL);
|
|
uic_Settings_Screen = ui_Settings_Screen;
|
|
uic_Settings_Screen_LBL = ui_Settings_Screen_LBL;
|
|
uic_Main_Container = ui_Main_Container;
|
|
uic_Settings_CTRL_Container = ui_Settings_CTRL_Container;
|
|
uic_CAN_Bus_CTRL_Panel = ui_CAN_Bus_CTRL_Panel;
|
|
uic_Toggle_CAN_Bus_Switch = ui_Toggle_CAN_Bus_Switch;
|
|
uic_Enable_CAN_Bus_LBL = ui_Enable_CAN_Bus_LBL;
|
|
uic_UART_CTRL_Panel = ui_UART_CTRL_Panel;
|
|
uic_Toggle_UART_Switch = ui_Toggle_UART_Switch;
|
|
uic_Enable_UART_LBL = ui_Enable_UART_LBL;
|
|
uic_Wifi_CTRL_Panel = ui_Wifi_CTRL_Panel;
|
|
uic_Toggle_Wifi_Switch = ui_Toggle_Wifi_Switch;
|
|
uic_Enable_Wifi_LBL = ui_Enable_Wifi_LBL;
|
|
uic_BLE_CTRL_Panel = ui_BLE_CTRL_Panel;
|
|
uic_Toggle_BLE_Switch = ui_Toggle_BLE_Switch;
|
|
uic_Enable_BLE_LBL = ui_Enable_BLE_LBL;
|
|
uic_Debug_CTRL_Panel = ui_Debug_CTRL_Panel;
|
|
uic_Toggle_Debug_Switch = ui_Toggle_Debug_Switch;
|
|
uic_Enable_Debug_LBL = ui_Enable_Debug_LBL;
|
|
uic_Wifi_Container = ui_Wifi_Container;
|
|
uic_Select_SSID_BTN = ui_Select_SSID_BTN;
|
|
uic_Wifi_Passkey_TB = ui_Wifi_Passkey_TB;
|
|
uic_Keyboard = ui_Keyboard;
|
|
uic_Device_State_Container = ui_Device_State_Container;
|
|
uic_Static_LBLS_Container = ui_Static_LBLS_Container;
|
|
uic_FPS_Static_LBL = ui_FPS_Static_LBL;
|
|
uic_CPU_Static_LBL = ui_CPU_Static_LBL;
|
|
uic_Device_State_Values_LBL = ui_Device_State_Values_LBL;
|
|
uic_FPS_Values_LBL = ui_FPS_Values_LBL;
|
|
uic_CPU_Values_LBL = ui_CPU_Values_LBL;
|
|
uic_Settings_Loading_Container = ui_Settings_Loading_Container;
|
|
uic_Settings_Loading_Spinner = ui_Settings_Loading_Spinner;
|
|
|
|
}
|
|
|
|
void ui_Settings_Screen_screen_destroy(void)
|
|
{
|
|
if(ui_Settings_Screen) lv_obj_del(ui_Settings_Screen);
|
|
|
|
// NULL screen variables
|
|
uic_Settings_Screen = NULL;
|
|
ui_Settings_Screen = NULL;
|
|
uic_Settings_Screen_LBL = NULL;
|
|
ui_Settings_Screen_LBL = NULL;
|
|
uic_Main_Container = NULL;
|
|
ui_Main_Container = NULL;
|
|
uic_Settings_CTRL_Container = NULL;
|
|
ui_Settings_CTRL_Container = NULL;
|
|
uic_CAN_Bus_CTRL_Panel = NULL;
|
|
ui_CAN_Bus_CTRL_Panel = NULL;
|
|
uic_Toggle_CAN_Bus_Switch = NULL;
|
|
ui_Toggle_CAN_Bus_Switch = NULL;
|
|
uic_Enable_CAN_Bus_LBL = NULL;
|
|
ui_Enable_CAN_Bus_LBL = NULL;
|
|
uic_UART_CTRL_Panel = NULL;
|
|
ui_UART_CTRL_Panel = NULL;
|
|
uic_Toggle_UART_Switch = NULL;
|
|
ui_Toggle_UART_Switch = NULL;
|
|
uic_Enable_UART_LBL = NULL;
|
|
ui_Enable_UART_LBL = NULL;
|
|
uic_Wifi_CTRL_Panel = NULL;
|
|
ui_Wifi_CTRL_Panel = NULL;
|
|
uic_Toggle_Wifi_Switch = NULL;
|
|
ui_Toggle_Wifi_Switch = NULL;
|
|
uic_Enable_Wifi_LBL = NULL;
|
|
ui_Enable_Wifi_LBL = NULL;
|
|
uic_BLE_CTRL_Panel = NULL;
|
|
ui_BLE_CTRL_Panel = NULL;
|
|
uic_Toggle_BLE_Switch = NULL;
|
|
ui_Toggle_BLE_Switch = NULL;
|
|
uic_Enable_BLE_LBL = NULL;
|
|
ui_Enable_BLE_LBL = NULL;
|
|
uic_Debug_CTRL_Panel = NULL;
|
|
ui_Debug_CTRL_Panel = NULL;
|
|
uic_Toggle_Debug_Switch = NULL;
|
|
ui_Toggle_Debug_Switch = NULL;
|
|
uic_Enable_Debug_LBL = NULL;
|
|
ui_Enable_Debug_LBL = NULL;
|
|
uic_Wifi_Container = NULL;
|
|
ui_Wifi_Container = NULL;
|
|
uic_Select_SSID_BTN = NULL;
|
|
ui_Select_SSID_BTN = NULL;
|
|
uic_Wifi_Passkey_TB = NULL;
|
|
ui_Wifi_Passkey_TB = NULL;
|
|
uic_Keyboard = NULL;
|
|
ui_Keyboard = NULL;
|
|
uic_Device_State_Container = NULL;
|
|
ui_Device_State_Container = NULL;
|
|
uic_Static_LBLS_Container = NULL;
|
|
ui_Static_LBLS_Container = NULL;
|
|
uic_FPS_Static_LBL = NULL;
|
|
ui_FPS_Static_LBL = NULL;
|
|
uic_CPU_Static_LBL = NULL;
|
|
ui_CPU_Static_LBL = NULL;
|
|
uic_Device_State_Values_LBL = NULL;
|
|
ui_Device_State_Values_LBL = NULL;
|
|
uic_FPS_Values_LBL = NULL;
|
|
ui_FPS_Values_LBL = NULL;
|
|
uic_CPU_Values_LBL = NULL;
|
|
ui_CPU_Values_LBL = NULL;
|
|
uic_Settings_Loading_Container = NULL;
|
|
ui_Settings_Loading_Container = NULL;
|
|
uic_Settings_Loading_Spinner = NULL;
|
|
ui_Settings_Loading_Spinner = NULL;
|
|
|
|
}
|