V1.6.2 IP-Adresse per MQTT

This commit is contained in:
rxf
2024-08-23 14:24:39 +02:00
parent 251c73b517
commit 23abbb837a
6 changed files with 38 additions and 31 deletions

View File

@@ -5,6 +5,14 @@
#include "main.h"
#include "grafik.h"
// Definition der diversen Farben
#define TEXTCOLOTR_TFAUSSEN 0x57d3F7
#define BACKGROUND_COLOR 0xD3F0FF
#define TEXTCOLOR 0x0000FF
#define TEXTCOLOR_FEUCHTE 0xFF0000
#define TEXTCOLOR_XACHSE 0x0000FF
#define TEXTCOLOR_INFO 0x404040
#define DRAW_BUF_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT / 10 * (LV_COLOR_DEPTH / 8))
uint32_t draw_buf[DRAW_BUF_SIZE / 4];
@@ -105,7 +113,7 @@ void showAussenData(float val, bool what)
static lv_style_t style_tta_label;
lv_style_init(&style_tta_label);
lv_style_set_text_font(&style_tta_label, &lv_font_montserrat_10);
lv_style_set_text_color(&style_tta_label, LV_COLOR_MAKE(0x60, 0x60, 0xFF));
lv_style_set_text_color(&style_tta_label, lv_color_hex(TEXTCOLOTR_TFAUSSEN));
lv_obj_add_style(tta_label, &style_tta_label, 0);
lv_obj_add_style(tfa_label, &style_tta_label, 0);
}
@@ -233,7 +241,7 @@ void drawChart()
static lv_style_t style_scaleT;
lv_style_init(&style_scaleT);
lv_style_set_text_font(&style_scaleT, &lv_font_montserrat_10);
lv_style_set_text_color(&style_scaleT, lv_color_hex(0x0000FF));
lv_style_set_text_color(&style_scaleT, lv_color_hex(TEXTCOLOR));
// lv_style_set_bg_color(&style_scaleT, lv_color_hex(0xFF00FF));
lv_obj_add_style(scaleT, &style_scaleT, 0);
@@ -284,7 +292,7 @@ void drawChart()
static lv_style_t style_scale;
lv_style_init(&style_scale);
lv_style_set_text_font(&style_scale, &lv_font_montserrat_10);
lv_style_set_text_color(&style_scale, lv_color_hex(0xFF0000));
lv_style_set_text_color(&style_scale, lv_color_hex(TEXTCOLOR_FEUCHTE));
lv_obj_add_style(scale, &style_scale, 0);
// X-Achse
@@ -311,7 +319,7 @@ void drawChart()
static lv_style_t style_xscale;
lv_style_init(&style_xscale);
lv_style_set_text_font(&style_xscale, &lv_font_montserrat_10);
lv_style_set_text_color(&style_xscale, lv_color_hex(0x0000FF));
lv_style_set_text_color(&style_xscale, lv_color_hex(TEXTCOLOR_XACHSE));
lv_obj_add_style(xscale, &style_xscale, 0);
// Text als Überschrift an die Axen
@@ -335,23 +343,15 @@ void drawChart()
static lv_style_t style_info_label;
lv_style_init(&style_info_label);
lv_style_set_text_font(&style_info_label, &lv_font_montserrat_8);
lv_style_set_text_color(&style_info_label, LV_COLOR_MAKE(0x40, 0x40, 0x40));
lv_style_set_text_color(&style_info_label, lv_color_hex(TEXTCOLOR_INFO));
// Versionsnummer und Datum
// Versionsnummer, IP-Adresse und Datum
lv_obj_t *version_label = lv_label_create(lv_screen_active());
char ver[40];
sprintf(ver, "V %s %s %s", VERSION, VDATE, VTIME);
lv_label_set_text(version_label, ver);
lv_obj_align(version_label, LV_ALIGN_BOTTOM_MID, 0, 0);
lv_obj_align(version_label, LV_ALIGN_BOTTOM_RIGHT, -4, 0);
lv_obj_add_style(version_label, &style_info_label, LV_PART_MAIN);
// links davon die Abtastrate
// bmr_label = lv_label_create(lv_screen_active());
// char rate[20];
// sprintf(rate, "Rate: %ds", updateTime / 1000);
// lv_label_set_text(bmr_label, rate);
// lv_obj_align(bmr_label, LV_ALIGN_BOTTOM_LEFT, 40, 0);
// lv_obj_add_style(bmr_label, &style_info_label, LV_PART_MAIN);
}
void showRate(int r) {
@@ -360,7 +360,6 @@ void showRate(int r) {
lv_label_set_text(bmr_label, rate);
}
void updatechartData(float value, float humvalue)
{
int i = 0;
@@ -418,7 +417,7 @@ void showResetTime(struct tm tinfo) {
static lv_style_t style_info_label;
lv_style_init(&style_info_label);
lv_style_set_text_font(&style_info_label, &lv_font_montserrat_8);
lv_style_set_text_color(&style_info_label, LV_COLOR_MAKE(0x40, 0x40, 0x40));
lv_style_set_text_color(&style_info_label, lv_color_hex(TEXTCOLOR_INFO));
char date[20];
strftime(date, 20, "%d-%m-%Y %H:%M", &tinfo);