diff --git a/Firmware/CoverUI/YardForce/WYM240128K1.hpp b/Firmware/CoverUI/YardForce/WYM240128K1.hpp index e7d4482..951ba23 100644 --- a/Firmware/CoverUI/YardForce/WYM240128K1.hpp +++ b/Firmware/CoverUI/YardForce/WYM240128K1.hpp @@ -15,6 +15,8 @@ #define LVGL_BUFFER_MULTIPLIER 10 #define LVGL_TIMER_HANDLER_PERIOD_MS 10 // 10ms lv_timer_handler() soft period +#define TOP_STATUS_BAR_GAP_PX 5 // Amount of (gap) pixels between top status-bar icons/symbols + #include "UC1698.h" #include @@ -40,7 +42,9 @@ namespace display lv_disp_drv_t lv_disp_drv; // LVGL driver // Status Screen Widgets - WidgetLedSymbol *v_led_ros, *v_led_charge; + WidgetLedSymbol *v_led_heartbeat, *v_led_ros, + *v_led_emergency_wheel, *v_led_emergency, *v_led_emergency_stop, + *v_led_charge; WidgetBar *bar_gps, *bar_bat; WidgetTextTicker *text_ticker_status; @@ -85,15 +89,25 @@ namespace display static void mainStatusScreen() { - // Status symbols, from right to left - v_led_charge = new WidgetLedSymbol(FA_SYMBOL_CHARGE, LV_ALIGN_OUT_TOP_RIGHT, (240 - (1 * 14)), 0); - v_led_ros = new WidgetLedSymbol(FA_SYMBOL_ROS, LV_ALIGN_OUT_TOP_RIGHT, (240 - (2 * 14) - 5), 0); + // On the left side of the status bar we do have functional status symbols like heartbeat and ROS + v_led_heartbeat = new WidgetLedSymbol(FA_SYMBOL_HEARTBEAT, LV_ALIGN_TOP_LEFT, 0, 0); // Leftmost + v_led_ros = new WidgetLedSymbol(FA_SYMBOL_ROS, LV_ALIGN_TOP_LEFT, 14 + TOP_STATUS_BAR_GAP_PX, 0); + + // In the middle, we do have emergencies + v_led_emergency = new WidgetLedSymbol(FA_SYMBOL_EMERGENCY, LV_ALIGN_TOP_MID, 0, 0); // Centered + v_led_emergency_wheel = new WidgetLedSymbol(FA_SYMBOL_EMERGENCY_WHEEL, LV_ALIGN_TOP_MID, -14 - TOP_STATUS_BAR_GAP_PX - 2, 0); // Left of centered + v_led_emergency_stop = new WidgetLedSymbol(FA_SYMBOL_EMERGENCY_STOP, LV_ALIGN_TOP_MID, 14 + TOP_STATUS_BAR_GAP_PX, 0); // Right of centered + + // On the right side, mowing status like, charging, docking, ... + v_led_charge = new WidgetLedSymbol(FA_SYMBOL_CHARGE, LV_ALIGN_OUT_TOP_RIGHT, (240 - (1 * 14)), 0); // Rightmost + // GPS & Battery bars bar_gps = new WidgetBar(FA_SYMBOL_GPS2 " %d %%", LV_ALIGN_TOP_MID, 0, 30, UC1698_DISPLAY_WIDTH, 21); bar_bat = new WidgetBar(FA_SYMBOL_BATTERY " %d %%", LV_ALIGN_TOP_MID, 0, 60, UC1698_DISPLAY_WIDTH, 21); + // Mower status text (ticker) text_ticker_status = new WidgetTextTicker(LV_ALIGN_TOP_MID, 0, 95, UC1698_DISPLAY_WIDTH); - text_ticker_status->set_text("Long text should ticker: Lorem Ipsum Bla bla bla"); + text_ticker_status->set_text("Mower status like Idle, Mowing, Emergency, ..."); } static void anim_x_cb(void *var, int32_t v) @@ -160,8 +174,6 @@ namespace display openmower_anim(); //mainStatusScreen(); - // test1(); - // testCanvas(); return true; } diff --git a/Firmware/CoverUI/YardForce/WidgetLedSymbol.hpp b/Firmware/CoverUI/YardForce/WidgetLedSymbol.hpp index 9016f3e..36a5122 100644 --- a/Firmware/CoverUI/YardForce/WidgetLedSymbol.hpp +++ b/Firmware/CoverUI/YardForce/WidgetLedSymbol.hpp @@ -25,6 +25,7 @@ namespace display { label = lv_label_create(lv_scr_act()); lv_label_set_text(label, symbol_str.c_str()); + lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_style_text_color(lv_scr_act(), lv_color_black(), LV_PART_MAIN); lv_obj_align(label, align, x_ofs, y_ofs); } diff --git a/Firmware/CoverUI/YardForce/assets/PerfectPixel_FA_14.c b/Firmware/CoverUI/YardForce/assets/PerfectPixel_FA_14.c index 3ec8da8..0bcd1f9 100644 --- a/Firmware/CoverUI/YardForce/assets/PerfectPixel_FA_14.c +++ b/Firmware/CoverUI/YardForce/assets/PerfectPixel_FA_14.c @@ -365,6 +365,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+2022 "•" */ 0x6f, 0xf6, + /* U+F06A "" */ + 0xf, 0xc0, 0x7f, 0x83, 0xff, 0x1f, 0x3e, 0xfc, + 0xff, 0xf3, 0xff, 0xcf, 0xff, 0xff, 0xfc, 0xff, + 0xf3, 0xf7, 0xcf, 0x8f, 0xfc, 0x1f, 0xe0, 0x3f, + 0x0, + /* U+F071 "" */ 0x1, 0x80, 0x3, 0xc0, 0x3, 0xc0, 0x7, 0xe0, 0x7, 0xe0, 0xe, 0x70, 0x1e, 0x70, 0x1e, 0x78, @@ -398,6 +404,11 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xdf, 0xf3, 0xfe, 0x7f, 0xc7, 0xf0, 0x7c, 0x2, 0x0, 0x40, 0x8, 0x0, + /* U+F21E "" */ + 0x3c, 0xf1, 0xff, 0xef, 0xff, 0xff, 0xff, 0xf3, + 0x7d, 0xec, 0xe0, 0xe8, 0xf, 0x3c, 0x1f, 0xe0, + 0x3f, 0x0, 0x78, 0x0, 0xc0, + /* U+F240 "" */ 0xff, 0xff, 0xbf, 0xff, 0xec, 0x0, 0x1f, 0x7f, 0xf7, 0xdf, 0xfc, 0xf7, 0xff, 0x7c, 0x0, 0x1f, @@ -434,6 +445,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xdf, 0x1e, 0x3c, 0x78, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, + /* U+F5E1 "" */ + 0x10, 0x0, 0x6, 0x80, 0x1, 0xef, 0x1, 0xff, + 0xf8, 0x3d, 0x8f, 0x1d, 0xc0, 0x4f, 0x5e, 0x18, + 0xd3, 0xfe, 0x2f, 0xff, 0x83, 0xff, 0x30, 0xff, + 0xc8, 0x18, 0x7e, 0x0, 0x3, 0x0, 0x1, 0xc0, + /* U+F5E7 "" */ 0x7f, 0x80, 0x7f, 0x86, 0x63, 0x86, 0x63, 0x8f, 0x61, 0x8f, 0x63, 0x8f, 0x7b, 0x86, 0x77, 0xe6, @@ -549,21 +566,24 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 860, .adv_w = 89, .box_w = 6, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, {.bitmap_index = 871, .adv_w = 126, .box_w = 7, .box_h = 5, .ofs_x = 1, .ofs_y = 3}, {.bitmap_index = 876, .adv_w = 76, .box_w = 4, .box_h = 4, .ofs_x = 1, .ofs_y = 4}, - {.bitmap_index = 878, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 906, .adv_w = 140, .box_w = 9, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 922, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 950, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 975, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1003, .adv_w = 168, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1023, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1044, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1065, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1086, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1107, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1128, .adv_w = 252, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1155, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1175, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1203, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2} + {.bitmap_index = 878, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 903, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 931, .adv_w = 140, .box_w = 9, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 947, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 975, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1000, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1028, .adv_w = 168, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1048, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 1069, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1090, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1111, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1132, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1153, .adv_w = 280, .box_w = 18, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 1174, .adv_w = 252, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1201, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1221, .adv_w = 280, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1253, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 1281, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2} }; /*--------------------- @@ -571,8 +591,9 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { *--------------------*/ static const uint16_t unicode_list_2[] = { - 0x0, 0xd04f, 0xd0c5, 0xd0c7, 0xd102, 0xd11b, 0xd1c4, 0xd21e, - 0xd21f, 0xd220, 0xd221, 0xd222, 0xd5ba, 0xd5bd, 0xd5c5, 0xd79e + 0x0, 0xd048, 0xd04f, 0xd0c5, 0xd0c7, 0xd102, 0xd11b, 0xd1c4, + 0xd1fc, 0xd21e, 0xd21f, 0xd220, 0xd221, 0xd222, 0xd5ba, 0xd5bd, + 0xd5bf, 0xd5c5, 0xd79e }; /*Collect the unicode lists and glyph_id offsets*/ @@ -588,7 +609,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 8226, .range_length = 55199, .glyph_id_start = 95, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 16, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; diff --git a/Firmware/CoverUI/YardForce/lv_conf.h b/Firmware/CoverUI/YardForce/lv_conf.h index 0df8ed7..51687b1 100644 --- a/Firmware/CoverUI/YardForce/lv_conf.h +++ b/Firmware/CoverUI/YardForce/lv_conf.h @@ -400,12 +400,24 @@ /* PerfectPixel font, Size 14, 1 Bpp, Characters: * !"# %-... Bullet * 0x20-0x23, 0x25-0x7E, 0x2022 - * + FontAwesome location-arrow (GPS), bolt (charge), umbrella (rain), exclamation-triangle (emergency), anchor (home?), plug (docking or charge?) - * 0xF124, 0xF0E7, 0xF0E9, 0xF071, 0xF13D, 0xF1E6 - * battery-full, battery 3/4, battery 1/2, battery 1/4, battery-empty - * 0xF240-0xF244 - * charging-station (charge), brain (ROS?), sattelite-dish (GPS), car-battery - * 0xf5e7, 0xf5dc, 0xf7c0, 0xf5df + * + FontAwesome5-Solid+Brands+Regular + * location-arrow (GPS), + * bolt (charge), + * umbrella (rain), + * exclamation-triangle (emergency), + * anchor (home?), + * plug (docking or charge?) + * battery-full, battery 3/4, battery 1/2, battery 1/4, battery-empty + * 0xF124, 0xF0E7, 0xF0E9, 0xF071, 0xF13D, 0xF1E6, 0xF240-0xF244, + * + * charging-station (charge), + * brain (ROS?), + * sattelite-dish (GPS), + * car-battery, + * car-crash (Wheel lift Hall1-2), + * heartbeat, + * exclamation-circle (stop pressed) + * 0xf5e7, 0xf5dc, 0xf7c0, 0xf5df, 0xf5e1, 0xf21e, 0xf06a */ #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(PerfectPixel_FA_14) #define FA_SYMBOL_GPS1 "\xEF\x9F\x80" @@ -413,6 +425,10 @@ #define FA_SYMBOL_BATTERY "\xEF\x97\x9F" #define FA_SYMBOL_CHARGE "\xEF\x87\xA6" #define FA_SYMBOL_ROS "\xEF\x97\x9C" // Brain +#define FA_SYMBOL_EMERGENCY "\xEF\x81\xB1" +#define FA_SYMBOL_EMERGENCY_WHEEL "\xEF\x97\xA1" // Car-crash +#define FA_SYMBOL_EMERGENCY_STOP "\xEF\x81\xAA" // Exclamation-circle +#define FA_SYMBOL_HEARTBEAT "\xEF\x88\x9E" /*Always set a default font*/ #define LV_FONT_DEFAULT &PerfectPixel_FA_14