self.v = v
def next(self):
- """Displays next stage of the idler"""
- pass
+ """Displays next stage of the idler. Returns time to the next step"""
+ return 1
def reset(self):
"""Resets the idler to a known intial state"""
"""How much we want this idler to be the next one chosen"""
return 1
+class GreetingIdler(Idler):
+ def __init__(self, v, secs_to_greeting = None):
+ self.v = v
+ self.secs_to_greeting = secs_to_greeting
+
+ def next(self):
+ if not self.secs_to_greeting is None:
+ x = self.secs_to_greeting
+ self.secs_to_greeting = None
+ return x
+
+ self.v.display('UCC SNACKS')
+ return 2
+
+ def reset(self):
+ pass
+
+ def finished(self):
+ return self.secs_to_greeting == None
+
+ def affinity(self):
+ return 0
+
class TrainIdler(Idler):
def __init__(self, v):
self.idle_state = 0