Beispiel #1
0
 def tick(self):
     print("  Clock tick")
     tb = self.data(TOP)
     tb.decrementTimer()
     if tb.getRemainingTime() == 0:
         print("  Finished")
         self.set_state(StaticFSM.State(Idle))
     else:
         tb.printTimer()
    def onInitialize(self):
        self._fsm = StaticFSM.Machine(MicrowaveFsm.TOP, self)
        self._eventIn = EventPort.EventInPort("event", self._fsm)

        self.addInPort("event", self._eventIn)
        self._eventIn.bindEvent0("open", MicrowaveFsm.TOP.open)
        self._eventIn.bindEvent0("close", MicrowaveFsm.TOP.close)
        self._eventIn.bindEvent1("minute", MicrowaveFsm.TOP.minute,
                                 RTC.TimedLong(RTC.Time(0, 0), 0))
        self._eventIn.bindEvent0("start", MicrowaveFsm.TOP.start)
        self._eventIn.bindEvent0("stop", MicrowaveFsm.TOP.stop)
        self._eventIn.bindEvent0("tick", MicrowaveFsm.TOP.tick)

        return RTC.RTC_OK
Beispiel #3
0
 def minute(self, time_):
     self.set_state(StaticFSM.State(Programmed))
     self.dispatch(StaticFSM.Event(TOP.minute, time_))
Beispiel #4
0
 def onInit(self):
     self.set_state(StaticFSM.State(Idle))
     return RTC.RTC_OK
Beispiel #5
0
 def stop(self):
     self.set_state(StaticFSM.State(Idle))
Beispiel #6
0
 def open(self):
     self.set_state(StaticFSM.State(Disabled))
Beispiel #7
0
 def close(self):
     # self.setStateHistory(OpenRTM_aist.Macho.State(Operational))
     self.set_state(StaticFSM.State(Operational))
Beispiel #8
0
 def onInit(self):
     self.set_state(StaticFSM.State(Operational))
     return RTC.RTC_OK
Beispiel #9
0
 def start(self):
     self.set_state(StaticFSM.State(Cooking))