OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Temporarily Pause Programs › Reply To: Temporarily Pause Programs
Andrew
This brings up the question of what the scheduler should do if a new program is supposed to start during the period the controller is pausing. Should it push it back to the queue or should it just ignore the new program? If it’s pushed back, obviously this can end up accumulating a lot of stations and the controller will run out of space to queue these stations.
Excellent question. I would say implement two different pauses:
1) Pause program – this will pause the program but the system will continue to run and if ANOTHER program is scheduled to run then it will. If the paused program comes up to run as scheduled again it remains paused where it was and the scheduled program just gets ignored
2) Pause system – the system (all programs0 pause exactly where it is. All programs scheduled to run do not run until taken out of pause.
This begs the question what happens when the system (or a program) is taken out of pause and conflicts with a scheduled run? I would say it would give the user the choice to continue the current program or start the program that is “supposed” to be currently running.
A way to avoid some of these conflicts is to require the pause be time bound – e.g. Pause for X minutes (maximum being that of the next scheduled run).
It’s funny – this is an excellent example of “hey – lets have a pause” and when you dig deeper into the logic you realize that it requires thinking through the various scenarios.
-Andrew (just another Gozerian)