WIP_20240708_1558

This commit is contained in:
rxf
2024-07-08 15:58:12 +02:00
parent fc498dcea1
commit b7080c359a
5 changed files with 121 additions and 28 deletions

View File

@@ -42,7 +42,7 @@ void buildarc(ARC arc) {
char valuelow[10];
sprintf(valuelow, "%d", arc.lowvalue);
lv_label_set_text(low_label, valuelow);
lv_obj_align(low_label, LV_ALIGN_LEFT_MID, 0, 8);
lv_obj_align(low_label, LV_ALIGN_LEFT_MID, 5, 8);
static lv_style_t style_low_label;
lv_style_init(&style_low_label);
lv_style_set_text_font(&style_low_label, &lv_font_montserrat_10);
@@ -81,27 +81,27 @@ void buildarc(ARC arc) {
void lv_create_main_gui(void) {
// Create a text label aligned on top: https://docs.lvgl.io/master/widgets/label.html
lv_obj_t * date_label = lv_label_create(lv_screen_active());
lv_label_set_text(date_label, "17:30");
lv_obj_align(date_label, LV_ALIGN_TOP_MID, 0, 10);
// Set font type and font size. More information: https://docs.lvgl.io/master/overview/font.html
static lv_style_t style_date_label;
lv_style_init(&style_date_label);
lv_style_set_text_font(&style_date_label, &lv_font_montserrat_28);
lv_obj_add_style(date_label, &style_date_label, 0);
// Create a text label aligned on top: https://docs.lvgl.io/master/widgets/label.html
lv_obj_t * time_label = lv_label_create(lv_screen_active());
lv_label_set_text(time_label, "Dienstag, 12. Dezember 2024");
lv_obj_align(time_label, LV_ALIGN_TOP_MID, 0, 40);
time_label = lv_label_create(lv_screen_active());
lv_label_set_text(time_label, "17:30");
lv_obj_align(time_label, LV_ALIGN_TOP_MID, 0, 10);
// Set font type and font size. More information: https://docs.lvgl.io/master/overview/font.html
static lv_style_t style_time_label;
lv_style_init(&style_time_label);
lv_style_set_text_font(&style_time_label, &lv_font_montserrat_12);
lv_style_set_text_font(&style_time_label, &lv_font_montserrat_28);
lv_obj_add_style(time_label, &style_time_label, 0);
// Create a text label aligned on top: https://docs.lvgl.io/master/widgets/label.html
date_label = lv_label_create(lv_screen_active());
lv_label_set_text(date_label, "Dienstag, 12. Dezember 2024");
lv_obj_align(date_label, LV_ALIGN_TOP_MID, 0, 40);
// Set font type and font size. More information: https://docs.lvgl.io/master/overview/font.html
static lv_style_t style_date_label;
lv_style_init(&style_date_label);
lv_style_set_text_font(&style_date_label, &lv_font_montserrat_12);
lv_obj_add_style(date_label, &style_date_label, 0);
/* Refresh-Symbol anzeigen
lv_obj_t * refresh_label = lv_label_create(lv_screen_active());
lv_label_set_text(refresh_label, LV_SYMBOL_REFRESH);
@@ -181,7 +181,7 @@ void setValuetoArc(ARC arc, float value) {
// Axen
lv_obj_t * scale = lv_scale_create(container_row);
lv_obj_set_size(scale, 15, 75);
lv_scale_set_mode(scale, LV_SCALE_MODE_VERTICAL_RIGHT);
lv_scale_set_mode(scale, LV_SCALE_MODE_VERTICAL_LEFT);
lv_scale_set_label_show(scale, true);
@@ -200,6 +200,15 @@ void setValuetoArc(ARC arc, float value) {
lv_style_set_text_font(&style_scale, &lv_font_montserrat_10);
lv_obj_add_style(scale, &style_scale, 0);
lv_obj_t * unitxAx_label = lv_label_create(container_row);
lv_label_set_text(unitxAx_label, "°C");
lv_obj_align(unitxAx_label, LV_ALIGN_TOP_RIGHT, -20, 8);
static lv_style_t style_unitxAx_label;
lv_style_init(&style_unitxAx_label);
lv_style_set_text_font(&style_unitxAx_label, &lv_font_montserrat_12);
lv_obj_add_style(unitxAx_label, &style_unitxAx_label, 0);
}