implemented to cancel all jobs if all jobs are deleted.

This commit is contained in:
schrom01 2022-08-27 20:02:49 +02:00
parent cb9a3b6830
commit 18e78b7783
3 changed files with 6 additions and 4 deletions

View File

@ -64,7 +64,7 @@
</tbody>
</table>
</div>
<button onclick="buttonDeleteJobById('all')">{{ translater.getTranslation("delete all jobs")}}</button>
<button onclick="buttonDeleteJobById('all')">{{ translater.getTranslation("delete and cancel all jobs")}}</button>
</div>
</div>

View File

@ -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",
}

View File

@ -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