Automatiken: Rahmen am Vorabend fuer den folgenden Tag
Neuer Schalter "Am Vorabend" im Wann-Band (Spalte next_day). Wochentage, Ferien und Feiertage gelten dann fuer morgen: "Kinderrollos zu, wenn morgen Schule ist" ist Mo-Fr, Ferien nie, Feiertage nie - wie der Wecker. Mit dem heutigen Tag ging das am letzten Ferientag, am Abend vor einem Feiertag und am Abend eines Feiertags daneben. Editor-Satz, Kurzfassung und Uebersicht nennen den Vorabend vorne, damit auch "nicht an Feiertagen" als Folgetag gelesen wird. Die Spalte legt vorabend.sql im SolarManager an, ausgewertet wird sie im Runner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1100,6 +1100,9 @@ function rahmenText() {
|
||||
if (dazu.length && tage !== 127) satz += ", dazu " + aufzaehlung(dazu);
|
||||
}
|
||||
if (verbote.length) satz += ", aber nicht " + aufzaehlung(verbote);
|
||||
// Vorabend: derselbe Satz, nur fuer morgen gerechnet. Vorne, damit auch
|
||||
// "aber nicht an Feiertagen" als Folgetag gelesen wird.
|
||||
if (autoModel.next_day) satz = satz.replace(/^Läuft /, "Läuft am Vortag, gerechnet für den Folgetag: ");
|
||||
return satz + ".";
|
||||
}
|
||||
|
||||
@@ -1112,6 +1115,7 @@ function rahmenText() {
|
||||
*/
|
||||
function rahmenKurzText() {
|
||||
const teile = [tageText(autoModel.weekdays) || "an keinem Tag"];
|
||||
if (autoModel.next_day) teile[0] = "Vorabend von " + teile[0];
|
||||
if (autoModel.on_vacation === 0) teile.push("nicht in den Ferien");
|
||||
if (autoModel.on_vacation === 2) teile.push("dazu Ferientage");
|
||||
if (autoModel.on_holiday === 0) teile.push("nicht an Feiertagen");
|
||||
@@ -1133,6 +1137,7 @@ function rahmenIstVorgabe() {
|
||||
return autoModel.weekdays === 127
|
||||
&& autoModel.on_vacation === 1
|
||||
&& autoModel.on_holiday === 1
|
||||
&& !autoModel.next_day
|
||||
&& autoModel.window_from === "00:00"
|
||||
&& autoModel.window_to === "23:59"
|
||||
&& !autoModel.once_per_day
|
||||
@@ -1179,6 +1184,7 @@ function fuelleFormular() {
|
||||
document.getElementById("tSpanTo").value = autoModel.window_to;
|
||||
document.getElementById("runOnce").checked = autoModel.force_once;
|
||||
document.getElementById("oncePerDay").checked = autoModel.once_per_day;
|
||||
document.getElementById("nextDay").checked = autoModel.next_day;
|
||||
renderRahmen();
|
||||
rahmenFelderVerdrahten();
|
||||
renderConditions();
|
||||
@@ -1197,6 +1203,7 @@ function leseFormular() {
|
||||
// sofort nachziehen muss.
|
||||
autoModel.force_once = document.getElementById("runOnce").checked;
|
||||
autoModel.once_per_day = document.getElementById("oncePerDay").checked;
|
||||
autoModel.next_day = document.getElementById("nextDay").checked;
|
||||
autoModel.lockout_secs = Number(document.getElementById("lockoutSecs").value);
|
||||
}
|
||||
|
||||
@@ -1205,7 +1212,7 @@ function leseFormular() {
|
||||
* Ohne das stuende dort "rund um die Uhr", waehrend darunter 08:45 steht.
|
||||
*/
|
||||
function rahmenFelderVerdrahten() {
|
||||
["tSpanFrom", "tSpanTo", "lockoutSecs", "runOnce", "oncePerDay"].forEach(id => {
|
||||
["tSpanFrom", "tSpanTo", "lockoutSecs", "runOnce", "oncePerDay", "nextDay"].forEach(id => {
|
||||
const feld = document.getElementById(id);
|
||||
if (feld) feld.addEventListener("change", () => { leseFormular(); renderRahmen(); });
|
||||
});
|
||||
@@ -1250,6 +1257,7 @@ function loadAutomatic() {
|
||||
weekdays: a.weekdays,
|
||||
on_vacation: a.on_vacation,
|
||||
on_holiday: a.on_holiday,
|
||||
next_day: !!a.next_day,
|
||||
force_once: a.force_once,
|
||||
once_per_day: a.once_per_day,
|
||||
lockout_secs: a.lockout_secs,
|
||||
@@ -1338,6 +1346,7 @@ function submitAutoAction() {
|
||||
weekdays: autoModel.weekdays,
|
||||
on_vacation: autoModel.on_vacation,
|
||||
on_holiday: autoModel.on_holiday,
|
||||
next_day: autoModel.next_day,
|
||||
force_once: autoModel.force_once,
|
||||
once_per_day: autoModel.once_per_day,
|
||||
lockout_secs: autoModel.lockout_secs,
|
||||
|
||||
Reference in New Issue
Block a user