Esempio n. 1
0
    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
Esempio n. 2
0
    def onInitialize(self):
        # Bind variables and configuration variable

        # Set InPort buffers

        # Set OutPort buffers

        # Set service provider to Ports

        # Set service consumers to Ports

        # Set CORBA Service Ports
        self._fsm = StaticFSM.Machine(testFSMpyFSM.Top, self)
        self._eventIn = EventPort.EventInPort("event", self._fsm)
        self.addInPort("event", self._eventIn)
        self._eventIn.bindEvent0("event1", testFSMpyFSM.Top.event1)
        self._eventIn.bindEvent0("event2", testFSMpyFSM.Top.event2)

        return RTC.RTC_OK
Esempio n. 3
0
    def onInitialize(self):
        # Bind variables and configuration variable

        # Set InPort buffers

        # Set OutPort buffers

        # Set service provider to Ports

        # Set service consumers to Ports

        # Set CORBA Service Ports
        # Set FSM Ports
        self._fsm = StaticFSM.Machine(ModuleNameFSM.Top, self)
        self._FSMEventVarIn = EventPort.EventInPort("FSMEventPort", self._fsm)
        self.addInPort("FSMEventPort", self._FSMEventVarIn)

        return RTC.RTC_OK

        ###
        ##
        ## The finalize action (on ALIVE->END transition)
        ##
        ## @return RTC::ReturnCode_t
        #
        ##
        #def onFinalize(self):
        #
        #    self._fsm.shutdown()
        #    return RTC.RTC_OK

        ###
        ##
        ## The startup action when ExecutionContext startup
        ##
        ## @param ec_id target ExecutionContext Id
        ##
        ## @return RTC::ReturnCode_t
        ##
        ##
        #def onStartup(self, ec_id):
        #
        #    return RTC.RTC_OK

        ###
        ##
        ## The shutdown action when ExecutionContext stop
        ##
        ## @param ec_id target ExecutionContext Id
        ##
        ## @return RTC::ReturnCode_t
        ##
        ##
        #def onShutdown(self, ec_id):
        #
        #    return RTC.RTC_OK

        ###
        ##
        ## The activated action (Active state entry action)
        ##
        ## @param ec_id target ExecutionContext Id
        ##
        ## @return RTC::ReturnCode_t
        ##
        ##
        #def onActivated(self, ec_id):
        #
        #    return RTC.RTC_OK

        ###
        ##
        ## The deactivated action (Active state exit action)
        ##
        ## @param ec_id target ExecutionContext Id
        ##
        ## @return RTC::ReturnCode_t
        ##
        ##
        #def onDeactivated(self, ec_id):
        #
        #    return RTC.RTC_OK

        ###
        ##
        ## The execution action that is invoked periodically
        ##
        ## @param ec_id target ExecutionContext Id
        ##
        ## @return RTC::ReturnCode_t
        ##
        ##
        #def onExecute(self, ec_id):
        #
        self._fsm.run_event()