From 18e78b77830a379b0576f5ebd26c29cef2c7dbe8 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Sat, 27 Aug 2022 20:02:49 +0200 Subject: [PATCH] implemented to cancel all jobs if all jobs are deleted. --- Webserver/Templates/dashboard/dashboard.html | 2 +- Webserver/Translater.py | 4 ++-- ZoneManager.py | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Webserver/Templates/dashboard/dashboard.html b/Webserver/Templates/dashboard/dashboard.html index 75a4c83..f54a24c 100644 --- a/Webserver/Templates/dashboard/dashboard.html +++ b/Webserver/Templates/dashboard/dashboard.html @@ -64,7 +64,7 @@ - + diff --git a/Webserver/Translater.py b/Webserver/Translater.py index 7f79400..9deb220 100644 --- a/Webserver/Translater.py +++ b/Webserver/Translater.py @@ -34,8 +34,8 @@ class Translater: "planed duration": "geplante Dauer", "cancel": "abbrechen", "delete": "löschen", - "delete all jobs" : "alle Aufträge löschen", - "switch all to" : "stelle alle um auf", + "delete and cancel all jobs": "alle Aufträge löschen und abbrechen", + "switch all to": "stelle alle um auf", } diff --git a/ZoneManager.py b/ZoneManager.py index 165c79c..f413b4a 100644 --- a/ZoneManager.py +++ b/ZoneManager.py @@ -63,6 +63,8 @@ class ZoneManager: def clearIrrigationJobs(self): with self.piplineMutexLock: self.pipeLine = [] + for zone in self.zones: + self.switchZoneState(zone=zone, state=False, duration=-1, instant=True) def isAnyZoneBusy(self): for zone in self.zones: @@ -80,7 +82,7 @@ class ZoneManager: def switchZoneIndexState(self, zoneIndex, state, duration, instant=False): zone = self.getZone(zoneIndex) - self.switchZoneState(zone, state, duration, instant) + self.switchZoneState(zone=zone, state=state, duration=duration, instant=instant) def getPlanedDurationForZone(self, zone): totalDuration = 0