Add twilight info to GUI (#19334)

This commit is contained in:
Theo Arends 2023-08-27 17:24:33 +02:00
parent dd8b85282a
commit 23d6c0f5d5
28 changed files with 92 additions and 6 deletions

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Stuur"
#define D_TRUE "Waar"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "opgradeer"
#define D_UPLOAD "Laai op"
#define D_UPTIME "Uptyd"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Предаване"
#define D_TRUE "Вярно"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "Обновяване"
#define D_UPLOAD "Качването е"
#define D_UPTIME "Време на работа"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmet"
#define D_TRUE "Cert"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "actualitza"
#define D_UPLOAD "Envia"
#define D_UPTIME "Temps engegat"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Odešli"
#define D_TRUE "Pravda"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "aktualizace"
#define D_UPLOAD "Nahrání..."
#define D_UPTIME "Uptime"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Übertragen"
#define D_TRUE "wahr"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "astronomisch"
#define D_TWILIGHT_CIVIL "zivil"
#define D_TWILIGHT_NAUTICAL "nautisch"
#define D_UPGRADE "update"
#define D_UPLOAD "Upload"
#define D_UPTIME "Laufzeit"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Μετάδοση"
#define D_TRUE "Αληθές"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "αναβάθμιση"
#define D_UPLOAD "Ανέβασμα"
#define D_UPTIME "Χρόνος λειτουργίας"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmit"
#define D_TRUE "True"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "upgrade"
#define D_UPLOAD "Upload"
#define D_UPTIME "Uptime"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmitir"
#define D_TRUE "Verdadero"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "Actualización"
#define D_UPLOAD "Carga"
#define D_UPTIME "Tiempo Encendido"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmettre"
#define D_TRUE "Vrai"
#define D_TVOC "TVOC" // not used ???
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "la mise à jour" // "Lancer la mise à jour"
#define D_UPLOAD "Upload" // Not better in french
#define D_UPTIME "Durée d'activité"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Stjoere"
#define D_TRUE "Wier"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "upgrade"
#define D_UPLOAD "Stjoere"
#define D_UPTIME "Betjenstiid"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "עבר"
#define D_TRUE "נכון"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "שדרוג"
#define D_UPLOAD "העלאה"
#define D_UPTIME "זמן עליה"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Továbbít"
#define D_TRUE "Igaz"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "Frissítés"
#define D_UPLOAD "Feltöltés"
#define D_UPTIME "Üzemidő"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Trasmessi"
#define D_TRUE "Vero"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "astronomical"
#define D_TWILIGHT_CIVIL "civil"
#define D_TWILIGHT_NAUTICAL "nautical"
#define D_UPGRADE "aggiornamento"
#define D_UPLOAD "Caricamento"
#define D_UPTIME "Tempo accensione"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "전송"
#define D_TRUE "참"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "업그레이드"
#define D_UPLOAD "업로드"
#define D_UPTIME "가동시간"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Verzend"
#define D_TRUE "Waar"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "opwaarderen"
#define D_UPLOAD "Verzenden"
#define D_UPTIME "Bedrijfstijd"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Wyślij"
#define D_TRUE "Prawda"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "aktualizacji"
#define D_UPLOAD "Wgraj"
#define D_UPTIME "Czas pracy"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmitir"
#define D_TRUE "Verdadeiro"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "atualização"
#define D_UPLOAD "Enviar"
#define D_UPTIME "Tempo de atividade"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmitir"
#define D_TRUE "Verdadeiro"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "Atualizar"
#define D_UPLOAD "Enviar"
#define D_UPTIME "Tempo de Atividade"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Transmitere"
#define D_TRUE "Adevărat"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "actualizare"
#define D_UPLOAD "Încărcăre"
#define D_UPTIME "Folosință"

View File

@ -189,6 +189,9 @@
#define D_TRANSMIT "Передать"
#define D_TRUE "Истина"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "обновление"
#define D_UPLOAD "Загрузить"
#define D_UPTIME "Аптайм"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Odošli"
#define D_TRUE "Pravda"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "aktualizáciu"
#define D_UPLOAD "Nahrávanie..."
#define D_UPTIME "Uptime"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Sänd"
#define D_TRUE "Sant"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "uppgradera"
#define D_UPLOAD "Ladda upp"
#define D_UPTIME "Upptid"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "İletim"
#define D_TRUE "True"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "yükseltme"
#define D_UPLOAD "Yükleme"
#define D_UPTIME "Açık Kalma Süresi"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Передати"
#define D_TRUE "Так"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "оновлення"
#define D_UPLOAD "Завантажити"
#define D_UPTIME "Час роботи"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "Truyền"
#define D_TRUE "Đúng"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "nâng cấp"
#define D_UPLOAD "Tải lên"
#define D_UPTIME "Thời gian chạy"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "发送"
#define D_TRUE "True"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "升级"
#define D_UPLOAD "上传"
#define D_UPTIME "运行时间"

View File

@ -188,6 +188,9 @@
#define D_TRANSMIT "發送"
#define D_TRUE "真"
#define D_TVOC "TVOC"
#define D_TWILIGHT_ASTRONOMICAL "Astronomical"
#define D_TWILIGHT_CIVIL "Civil"
#define D_TWILIGHT_NAUTICAL "Nautical"
#define D_UPGRADE "升級"
#define D_UPLOAD "上傳"
#define D_UPTIME "啟動時間"

View File

@ -64,6 +64,8 @@ int8_t timer_window[MAX_TIMERS] = { 0 };
* Rewrite for Arduino by 'jurs' for German Arduino forum
\*********************************************************************************************/
const char kTwilight[] PROGMEM = "| " D_TWILIGHT_CIVIL "| " D_TWILIGHT_NAUTICAL "| " D_TWILIGHT_ASTRONOMICAL;
const float pi2 = TWO_PI;
const float pi = PI;
const float RAD = DEG_TO_RAD;
@ -74,9 +76,9 @@ uint32_t JulianDate(const struct TIME_T &now) {
// https://en.wikipedia.org/wiki/Julian_day
uint32_t Year = now.year; // Year ex:2020
uint32_t Month = now.month; // 1..12
uint32_t Day = now.day_of_month; // 1..31
uint32_t Julian; // Julian day number
uint32_t Month = now.month; // 1..12
uint32_t Day = now.day_of_month; // 1..31
uint32_t Julian; // Julian day number
if (Month <= 2) {
Month += 12;
@ -845,8 +847,8 @@ const char HTTP_FORM_TIMER2[] PROGMEM =
const char HTTP_FORM_TIMER3[] PROGMEM =
"<fieldset style='width:%dpx;margin:auto;text-align:left;border:0;'>"
"<label><input id='b0' name='rd' type='radio' value='0' onclick='gt();'><b>" D_TIMER_TIME "</b></label><br>"
"<label><input id='b1' name='rd' type='radio' value='1' onclick='gt();'><b>" D_SUNRISE "</b> (%s)</label><br>"
"<label><input id='b2' name='rd' type='radio' value='2' onclick='gt();'><b>" D_SUNSET "</b> (%s)</label><br>"
"<label><input id='b1' name='rd' type='radio' value='1' onclick='gt();'><b>" D_SUNRISE "</b>%s (%s)</label><br>"
"<label><input id='b2' name='rd' type='radio' value='2' onclick='gt();'><b>" D_SUNSET "</b>%s (%s)</label><br>"
"</fieldset>"
"<p></p>"
"<span><select style='width:46px;' id='dr'></select></span>"
@ -904,7 +906,10 @@ void HandleTimerConfiguration(void)
}
WSContentSend_P(HTTP_FORM_TIMER2);
#ifdef USE_SUNRISE
WSContentSend_P(HTTP_FORM_TIMER3, 100 + (strlen(D_SUNSET) *12), GetSun(0).c_str(), GetSun(1).c_str());
char twilight[30];
GetTextIndexed(twilight, sizeof(twilight), Settings->mbflag2.sunrise_dawn_angle, kTwilight);
uint32_t slen = 100 + (max(strlen(D_SUNRISE), strlen(D_SUNSET)) *11) + (strlen(twilight) *9); // Trial and error to keep it on one line while keeping it as centered as possible
WSContentSend_P(HTTP_FORM_TIMER3, slen, twilight, GetSun(0).c_str(), twilight, GetSun(1).c_str());
#else
WSContentSend_P(HTTP_FORM_TIMER3);
#endif // USE_SUNRISE