fix(P4): Fehlendes °C, unsichtbarer Verlauf, fette Zahlen (1.8.3)
Drei Punkte am neuen Dashboard: - Hinter der Temperatur stand ein leeres Rechteck statt des C. Die großen Schriften waren auf Ziffern, Komma, Punkt, Minus und Gradzeichen beschränkt; C fehlte. Jetzt enthalten, ebenso g und s für die Anzeige während eines Bezugs. - Bei "Verlauf" war keine Kurve zu sehen: Ein frisches lv_chart hat lauter LV_CHART_POINT_NONE und zeichnet nichts, und ohne Hintergrund war der Bereich unsichtbar, bis nach einer Minute Messwerte zusammenkamen. Die Kurve startet jetzt beim aktuellen Wert (lv_chart_set_all_value), Bereich und Fläche sind sofort gesetzt. - Die großen Zahlen stehen im fetten Schnitt und mit engerem Zeichenabstand, wie im Entwurf. Erzeugt aus MavenPro-VariableFont bei wght=700 via fontTools varLib.instancer; dieselbe Schriftart, nur kräftiger. Die Dateien heißen entsprechend lv_font_maven_pro_bold_96/_140. Beide Panel-Varianten mit arduino-cli gegengebaut. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f0a214d712
commit
a410da6e72
+31
-15
@@ -968,6 +968,10 @@ static lv_obj_t* tempField(lv_obj_t* parent, const char* title, lv_color_t accen
|
||||
lv_label_set_text(*big, "--.-");
|
||||
lv_obj_set_style_text_color(*big, COL_TEXT, 0);
|
||||
lv_obj_set_style_text_font(*big, valueFont, 0);
|
||||
// Grosse Zahlen etwas enger setzen. Bei dieser Groesse wirken die Werksabstaende
|
||||
// auseinandergezogen; ein paar Pixel weniger binden die Ziffern zu einer Zahl zusammen.
|
||||
if (valueFont == &lv_font_maven_pro_bold_140) lv_obj_set_style_text_letter_space(*big, -3, 0);
|
||||
else if (valueFont == &lv_font_maven_pro_bold_96) lv_obj_set_style_text_letter_space(*big, -2, 0);
|
||||
|
||||
*setp = lv_label_create(c);
|
||||
lv_label_set_text(*setp, "Soll --.-");
|
||||
@@ -990,19 +994,31 @@ static lv_obj_t* tempField(lv_obj_t* parent, const char* title, lv_color_t accen
|
||||
// Flache Verlaufskurve unter einer Temperatur. Zeigt, ob die Regelung haelt - das ist die
|
||||
// eigentliche Frage an eine PID-Regelung, und eine Zahl kann sie grundsaetzlich nicht
|
||||
// beantworten. Gespeist wird sie aus derselben Sekundenabtastung wie die Verlaufsseite.
|
||||
static lv_obj_t* tempSpark(lv_obj_t* parent, lv_color_t col, lv_chart_series_t** ser) {
|
||||
static lv_obj_t* tempSpark(lv_obj_t* parent, lv_color_t col, lv_chart_series_t** ser,
|
||||
float jetzt, float soll) {
|
||||
lv_obj_t* ch = lv_chart_create(parent);
|
||||
lv_obj_set_size(ch, LV_PCT(96), 72);
|
||||
lv_obj_set_size(ch, LV_PCT(96), 64);
|
||||
lv_chart_set_type(ch, LV_CHART_TYPE_LINE);
|
||||
lv_chart_set_point_count(ch, DASH_SPARK_POINTS);
|
||||
lv_chart_set_div_line_count(ch, 0, 0);
|
||||
lv_obj_set_style_bg_opa(ch, LV_OPA_TRANSP, 0);
|
||||
// Schwach abgesetzte Flaeche: Ohne sie waere der Bereich vor dem ersten Messwert
|
||||
// vollstaendig unsichtbar - man haette gar nicht erkannt, dass dort eine Kurve gehoert.
|
||||
lv_obj_set_style_bg_color(ch, lv_color_hex(0x151515), 0);
|
||||
lv_obj_set_style_bg_opa(ch, LV_OPA_COVER, 0);
|
||||
lv_obj_set_style_radius(ch, 6, 0);
|
||||
lv_obj_set_style_border_width(ch, 0, 0);
|
||||
lv_obj_set_style_pad_all(ch, 0, 0);
|
||||
lv_obj_set_style_pad_all(ch, 4, 0);
|
||||
lv_obj_set_style_size(ch, 0, 0, LV_PART_INDICATOR); // keine Punktmarkierungen
|
||||
lv_obj_set_style_line_width(ch, 3, LV_PART_ITEMS);
|
||||
lv_obj_clear_flag(ch, LV_OBJ_FLAG_SCROLLABLE);
|
||||
*ser = lv_chart_add_series(ch, col, LV_CHART_AXIS_PRIMARY_Y);
|
||||
|
||||
// Ausschnitt und Startwert sofort setzen. Ein frisch angelegtes Diagramm hat lauter
|
||||
// "kein Wert"-Punkte und zeichnet deshalb nichts - beim Umschalten der Darstellung
|
||||
// saehe man bis zur ersten Sekundenprobe eine leere Flaeche.
|
||||
int32_t sollT = (int32_t)(soll * 10.0f);
|
||||
lv_chart_set_range(ch, LV_CHART_AXIS_PRIMARY_Y, sollT - 60, sollT + 30);
|
||||
lv_chart_set_all_value(ch, *ser, (int32_t)(jetzt * 10.0f));
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -1031,7 +1047,7 @@ static void build_temp_row_content() {
|
||||
// zwei Drittel Flaeche fuer Wasser, ein Drittel fuer Dampf - die Asymmetrie ist die
|
||||
// Aussage, nicht ein Versehen.
|
||||
tempField(g_tempRow, "WASSER", COL_ACCENT, &lblTempW, &lblSetW, &barDutyW,
|
||||
2, &lv_font_maven_pro_140, false, 0);
|
||||
2, &lv_font_maven_pro_bold_140, false, 0);
|
||||
tempField(g_tempRow, "DAMPF", teal, &lblTempD, &lblSetD, &barDutyD,
|
||||
1, &lv_font_maven_pro_48, false, 0);
|
||||
break;
|
||||
@@ -1039,11 +1055,11 @@ static void build_temp_row_content() {
|
||||
|
||||
case TD_VERLAUF: {
|
||||
lv_obj_t* cw = tempField(g_tempRow, "WASSER", COL_ACCENT, &lblTempW, &lblSetW, &barDutyW,
|
||||
1, &lv_font_maven_pro_96, false, 0);
|
||||
g_sparkW = tempSpark(cw, COL_OK, &g_sparkSerW);
|
||||
1, &lv_font_maven_pro_bold_96, false, 0);
|
||||
g_sparkW = tempSpark(cw, COL_OK, &g_sparkSerW, g_state.tempW, g_state.setW);
|
||||
lv_obj_t* cd = tempField(g_tempRow, "DAMPF", teal, &lblTempD, &lblSetD, &barDutyD,
|
||||
1, &lv_font_maven_pro_96, false, 0);
|
||||
g_sparkD = tempSpark(cd, COL_ACCENT, &g_sparkSerD);
|
||||
1, &lv_font_maven_pro_bold_96, false, 0);
|
||||
g_sparkD = tempSpark(cd, COL_ACCENT, &g_sparkSerD, g_state.tempD, g_state.setD);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1051,9 +1067,9 @@ static void build_temp_row_content() {
|
||||
// Keine Kartenkanten: Der Bereich ist in zwei Felder geteilt, getrennt nur durch
|
||||
// einen Hauch Helligkeitsunterschied.
|
||||
tempField(g_tempRow, "WASSER", COL_ACCENT, &lblTempW, &lblSetW, &barDutyW,
|
||||
1, &lv_font_maven_pro_140, true, 0x0d0d0d);
|
||||
1, &lv_font_maven_pro_bold_140, true, 0x0d0d0d);
|
||||
tempField(g_tempRow, "DAMPF", teal, &lblTempD, &lblSetD, &barDutyD,
|
||||
1, &lv_font_maven_pro_140, true, 0x151515);
|
||||
1, &lv_font_maven_pro_bold_140, true, 0x151515);
|
||||
lv_obj_set_style_pad_column(g_tempRow, 0, 0); // Felder stossen direkt aneinander
|
||||
break;
|
||||
}
|
||||
@@ -1084,9 +1100,9 @@ static void build_temp_row_content() {
|
||||
lv_obj_set_flex_flow(inner, LV_FLEX_FLOW_ROW);
|
||||
lv_obj_clear_flag(inner, LV_OBJ_FLAG_SCROLLABLE);
|
||||
tempField(inner, "WASSER", COL_ACCENT, &lblTempW, &lblSetW, &barDutyW,
|
||||
1, &lv_font_maven_pro_96, false, 0);
|
||||
1, &lv_font_maven_pro_bold_96, false, 0);
|
||||
tempField(inner, "DAMPF", teal, &lblTempD, &lblSetD, &barDutyD,
|
||||
1, &lv_font_maven_pro_96, false, 0);
|
||||
1, &lv_font_maven_pro_bold_96, false, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3789,9 +3805,9 @@ static void dash_brew_mode(bool on) {
|
||||
lv_obj_set_flex_grow(g_tempRow, on ? 1 : 3);
|
||||
lv_obj_set_flex_grow(g_infoRow, on ? 3 : 2);
|
||||
if (lblShotTimer && g_shotFontNormal)
|
||||
lv_obj_set_style_text_font(lblShotTimer, on ? &lv_font_maven_pro_96 : g_shotFontNormal, 0);
|
||||
lv_obj_set_style_text_font(lblShotTimer, on ? &lv_font_maven_pro_bold_96 : g_shotFontNormal, 0);
|
||||
if (lblBezug && g_bezugFontNormal)
|
||||
lv_obj_set_style_text_font(lblBezug, on ? &lv_font_maven_pro_96 : g_bezugFontNormal, 0);
|
||||
lv_obj_set_style_text_font(lblBezug, on ? &lv_font_maven_pro_bold_96 : g_bezugFontNormal, 0);
|
||||
}
|
||||
|
||||
static void dash_brew_mode_tick(const MachineState& st) {
|
||||
|
||||
Reference in New Issue
Block a user