diff --git a/ePaper-ESP-IDF/components/mapView/mapView.cpp b/ePaper-ESP-IDF/components/mapView/mapView.cpp index 9b12afd..2a0e51f 100644 --- a/ePaper-ESP-IDF/components/mapView/mapView.cpp +++ b/ePaper-ESP-IDF/components/mapView/mapView.cpp @@ -5,6 +5,7 @@ #include #include "epd_driver.h" #include "fonts/opensans26b.h" +#include "fonts/opensans6.h" #include "staticmap.h" #include "utilities.h" @@ -25,9 +26,20 @@ void drawString(int32_t x, int32_t y, std::string text, alignment align) { if (align == CENTER) x = x - w / 2; int32_t cursor_y = y + h; + int32_t padding = 4; + epd_fill_rect(x - padding, y - padding, w + 2 * padding, h + 2 * padding, 255, + framebuffer); write_string(¤tFont, data, &x, &cursor_y, framebuffer); } +void drawVessel(int32_t x, int32_t y, std::string vesselName) { + currentFont = OpenSans; + int32_t radius = 10; + epd_fill_circle(x, y, radius, 255, framebuffer); + epd_draw_circle(x, y, radius, 0, framebuffer); + drawString(x, y + 2 * radius, vesselName, CENTER); +} + void mapView(void* args) { framebuffer = (uint8_t*)heap_caps_malloc(EPD_WIDTH * EPD_HEIGHT / 2, MALLOC_CAP_SPIRAM); @@ -54,6 +66,9 @@ void mapView(void* args) { currentFont = OpenSans26B; drawString(x, y, "Hello, World!", CENTER); + drawVessel(EPD_WIDTH - EPD_WIDTH / 4, EPD_HEIGHT - EPD_HEIGHT / 5, + "DEEPENSCHRIEWER 1"); + epd_poweron(); epd_clear(); epd_draw_grayscale_image(epd_full_screen(), framebuffer);