import qhsm
from qhsm import QSignals, QEvent

# generated by PythonGenerator version 0.1

class TestSample1(qhsm.QHsm):

    def initialiseStateMachine(self):
        self.initialiseState(self.s_StateX)


    def s_StateX(self, ev):
        if ev.QSignal == QSignals.Entry:
            self.enterStateX()
        elif ev.QSignal == QSignals.Exit:
            self.exitStateX()
        elif ev.QSignal == QSignals.Init:
            self.initialiseState(self.s_State0)
        else:
            return self._TopState
        return None


    def s_State0(self, ev):
        if ev.QSignal == "Bye":
            pass
            self.transitionTo(self.s_State1)
        elif ev.QSignal == "Hello":
            if self.Ok(ev):
                self.sayHello3()
                self.transitionTo(self.s_State0)
            else:
                self.sayHello1()
                self.transitionTo(self.s_State1)
        elif ev.QSignal == QSignals.Entry:
            self.enterState0()
        elif ev.QSignal == QSignals.Exit:
            self.exitState0()
        else:
            return self.s_StateX
        return None


    def s_State1(self, ev):
        if ev.QSignal == "Hello":
            self.sayHello2()
            self.transitionTo(self.s_State0)
        elif ev.QSignal == QSignals.Entry:
            self.enterState1()
        elif ev.QSignal == QSignals.Exit:
            self.exitState1()
        else:
            return self._TopState
        return None


    #end of TestSample1
    pass

import qhsm
from qhsm import QSignals, QEvent

# generated by PythonGenerator version 0.1

class TestSample1(qhsm.QHsm):

    def initialiseStateMachine(self):
        self.initialiseState(self.s_StateX)


    def s_StateX(self, ev):
        if ev.QSignal == QSignals.Entry:
            self.enterStateX()
        elif ev.QSignal == QSignals.Exit:
            self.exitStateX()
        elif ev.QSignal == QSignals.Init:
            self.initialiseState(self.s_State0)
        else:
            return self._TopState
        return None


    def s_State0(self, ev):
        if ev.QSignal == "Bye":
            pass
            self.transitionTo(self.s_State1)
        elif ev.QSignal == "Hello":
            if self.Ok(ev):
                self.sayHello3()
                self.transitionTo(self.s_State0)
            else:
                self.sayHello1()
                self.transitionTo(self.s_State1)
        elif ev.QSignal == QSignals.Entry:
            self.enterState0()
        elif ev.QSignal == QSignals.Exit:
            self.exitState0()
        else:
            return self.s_StateX
        return None


    def s_State1(self, ev):
        if ev.QSignal == "Hello":
            self.sayHello2()
            self.transitionTo(self.s_State0)
        elif ev.QSignal == QSignals.Entry:
            self.enterState1()
        elif ev.QSignal == QSignals.Exit:
            self.exitState1()
        else:
            return self._TopState
        return None


    #end of TestSample1
    pass

# generated by PythonGenerator version 0.1 #end of TestSample1