Move Guardian TimerManager code into ezca
The timer code is useful for all manner of scripting, and so Ezca should get a property for ezca.timer access. This allows decorators in Guardian access to timers and will allow scripts access as well.
Since this makes a more global timer, and the concern is that user error handling may not catch the possibility of state timers, I suggest a change such that for ezca timers, the timer may be read out only exactly once after it has triggered, so that users must store the fact that the timer has tripped in local code.
Something like
ezca.timer["CHECK_X"] = 10
X_tripped = False
#some algorithm, or dither or whatever
while True:
time.sleep(1)
if X_tripped or ezca.timer["CHECK_X"]:
X_tripped = True
#DO X
if yadda_yadda_subcall_X():
break
else:
#DO Y
yadda_yadda_subcall_Y()
and if the ezca.timer["X"] is checked a second time after tripping, it throws some descriptive error, perhaps with a link to this example pattern.
This avoids the worry of stale timers by forcing a transition to local state. In principle, the Guardian timers should also have this behavoir (in which case they could start using the global timer instance), but it would break existing code.