diff --git a/README.it.md b/README.it.md index e30dbb0..133557f 100644 --- a/README.it.md +++ b/README.it.md @@ -161,7 +161,7 @@ python3 tests/ui_contract_check.py http://192.168.3.21:8790 senza telefono) - **48/48** verifiche offline del bridge (`bridge/test_bridge_commands.py`), comprese le conversioni Wh→kWh e degli importi delle statistiche -- **190/190** stringhe tradotte nel catalogo italiano: il test carica il `.qm` +- **191/191** stringhe tradotte nel catalogo italiano: il test carica il `.qm` compilato come fa `main.cpp` e verifica che in inglese l'etichetta di stato sia la sorgente e in italiano quella tradotta, e che togliendo il catalogo si torni all'inglese diff --git a/README.md b/README.md index 4a6ef1a..034a490 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Verified so far: including that a zone command always carries every zone, that absurd values are refused (40 °C, zone 3, text), and the Wh→kWh / money conversions of the statistics -- **190/190** strings translated in the Italian catalogue, checked by loading +- **191/191** strings translated in the Italian catalogue, checked by loading the compiled `.qm` in the test the same way `main.cpp` does: source English in, Italian out, and back to English when the catalogue is removed - numbers, amounts and month names formatted through `QLocale`, so the decimal diff --git a/docs/PIANO.md b/docs/PIANO.md index 06f1437..346cf01 100644 --- a/docs/PIANO.md +++ b/docs/PIANO.md @@ -275,8 +275,13 @@ si rilegge da solo (2 s): l'aggiornamento automatico, prima, non esisteva. **Stato breve ed esteso in C++** (`AiraJson::stateShort/stateLong/statusLevel`): logica pura, verificabile senza SDK e non duplicata fra Home e Impianto. Test -del nucleo: **79/79** (erano 61). Stringhe: **190/190** tradotte. Anteprime +del nucleo: **79/79** (erano 61). Stringhe: **191/191** tradotte. Anteprime rigenerate (nuova `regolazioni.png`) in italiano e inglese. +**Copertina** (`qml/cover/CoverPage.qml`): pallino di stato come in Home, la +temperatura grande si spegne quando i numeri sono vecchi e l'etichetta finale è +diventata "esterna 18,0 °C" (era "est.", sigla che non diceva niente), con la +riga dei numeri vecchi al posto della temperatura esterna quando serve. + - Nessun comando nuovo all'impianto: anche questa versione resta **sola lettura** finché non si prova l'invio dal telefono. diff --git a/docs/UX-STUDIO.md b/docs/UX-STUDIO.md index aafb2ef..392b974 100644 --- a/docs/UX-STUDIO.md +++ b/docs/UX-STUDIO.md @@ -26,7 +26,7 @@ P9, P10 (diagnostica in Impianto), P11. Rimandato: P8 (azioni sulla copertina), in attesa della prova sul telefono. Verifiche fatte qui: **79 verifiche del nucleo** (erano 61), `qmllint` pulito su -tutti i file QML, 190/190 stringhe tradotte, anteprime rigenerate in inglese e +tutti i file QML, 191/191 stringhe tradotte, anteprime rigenerate in inglese e italiano, contratto dei dati fra UI e bridge rispettato (`tests/ui_contract_check.py`). Da provare sul telefono: che `TextSwitch` si istanzi davvero, l'altezza reale diff --git a/docs/anteprima/copertina.png b/docs/anteprima/copertina.png index 37587ee..cab1415 100644 Binary files a/docs/anteprima/copertina.png and b/docs/anteprima/copertina.png differ diff --git a/docs/anteprima/it/comandi.png b/docs/anteprima/it/comandi.png index 4ad61fc..7a4be39 100644 Binary files a/docs/anteprima/it/comandi.png and b/docs/anteprima/it/comandi.png differ diff --git a/docs/anteprima/it/copertina.png b/docs/anteprima/it/copertina.png index 598e421..f74bbe9 100644 Binary files a/docs/anteprima/it/copertina.png and b/docs/anteprima/it/copertina.png differ diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml index 215aaed..034cb8b 100644 --- a/qml/cover/CoverPage.qml +++ b/qml/cover/CoverPage.qml @@ -11,14 +11,40 @@ CoverBackground { return api.formatValue(v) } - Label { - id: titleLabel + // Colore del pallino: gli stessi criteri della Home (vedi MainPage.qml). + // Un dato vecchio e' ambra come un modo attivo: un dato vecchio non e' un + // dato buono, e la copertina e' il posto dove si guarda di sfuggita. + function statusColor() { + if (!api.hasData || api.stale) + return "orange" + var livello = api.statusLevel() + if (livello === 2) + return Theme.errorColor + if (livello === 1) + return Theme.highlightColor + return "#4caf50" + } + + Row { + id: intestazione anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: Theme.paddingLarge - text: "Aira" - color: Theme.primaryColor - font.pixelSize: Theme.fontSizeLarge + spacing: Theme.paddingSmall + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: Theme.paddingSmall + height: width + radius: width / 2 + color: cover.statusColor() + } + + Label { + text: "Aira" + color: Theme.primaryColor + font.pixelSize: Theme.fontSizeLarge + } } Column { @@ -29,8 +55,9 @@ CoverBackground { Label { width: parent.width horizontalAlignment: Text.AlignHCenter + // Spenta quando i numeri sono vecchi: non deve sembrare fresca. + color: api.stale ? Theme.secondaryColor : Theme.primaryColor text: cover.t("zone1_temperature") + " °C" - color: Theme.primaryColor font.pixelSize: Theme.fontSizeHuge } @@ -57,8 +84,13 @@ CoverBackground { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom anchors.bottomMargin: Theme.paddingMedium - text: qsTr("outdoor %1 °C").arg(cover.t("outdoor_temperature")) - color: Theme.secondaryColor + // Qui c'e' posto per dire che i numeri non sono freschi. + text: api.stale + ? qsTr("Not updated · last %1").arg(api.lastUpdate) + : qsTr("outside %1 °C").arg(cover.t("outdoor_temperature")) + color: api.stale ? "orange" : Theme.secondaryColor font.pixelSize: Theme.fontSizeExtraSmall + truncationMode: TruncationMode.Fade + width: parent.width - 2 * Theme.paddingMedium } -} \ No newline at end of file +} diff --git a/scripts/render_mockups.py b/scripts/render_mockups.py index d5468ba..f72c6ea 100644 --- a/scripts/render_mockups.py +++ b/scripts/render_mockups.py @@ -557,6 +557,8 @@ def cover_screen() -> Image.Image: card = [96, 430, W - 96, 430 + 470] d.rounded_rectangle(card, radius=34, fill=(14, 18, 24), outline=ACCENT, width=2) d.text((card[0] + 34, card[1] + 30), T("app"), font=font(40, bold=True), fill=PRIMARY) + # pallino di stato, come nella copertina vera (verde = tutto regolare) + d.ellipse([card[2] - 56, card[1] + 48, card[2] - 32, card[1] + 72], fill=OK) d.line([(card[0] + 34, card[1] + 100), (card[2] - 34, card[1] + 100)], fill=BTN_EDGE, width=2) y = card[1] + 132 diff --git a/translations/harbour-aira-it.ts b/translations/harbour-aira-it.ts index 3546102..c616f36 100644 --- a/translations/harbour-aira-it.ts +++ b/translations/harbour-aira-it.ts @@ -281,7 +281,7 @@ Lowers the house and stops the hot water - Abbassa la casa e spegne l'acqua calda + Abbassa la casa e spegne l'acqua calda @@ -306,7 +306,7 @@ The heat pump keeps the water in temperature - Mantiene l'acqua in temperatura + Mantiene l'acqua in temperatura @@ -337,19 +337,24 @@ CoverPage - + house · target %1 °C casa · obiettivo %1 °C - + DHW %1 °C · target %2 °C ACS %1 °C · obiettivo %2 °C - - outdoor %1 °C - est. %1 °C + + Not updated · last %1 + Non aggiornato · ultimo %1 + + + + outside %1 °C + esterna %1 °C