Exemple #1
0
        private QState DoCompleted(IQEvent qevent)
        {
            switch (qevent.QSignal)
            {
            case (int)QSignals.Entry:
                OnDisplayState("Completed");
                lastCompleted = LastCompletedStep.None;
                return(null);

            case (int)RtcSignals.Start:
                TransitionTo(CantInterrupt);
                return(null);
            }
            return(TopState);
        }
Exemple #2
0
        private QState DoCantInterrupt(IQEvent qevent)
        {
            switch (qevent.QSignal)
            {
            case (int)QSignals.Entry:
                OnDisplayState("CantInterrupt");
                return(null);

            case (int)RtcSignals.Start:
                bool completedOK = DoSomeUninterruptibleWork();
                if (completedOK)
                {
                    this.lastCompleted = LastCompletedStep.CantInterrupt;
                }
                TransitionTo(SlowOne);
                return(null);
            }
            return(TopState);
        }
Exemple #3
0
        private QState DoSlowTwo(IQEvent qevent)
        {
            switch (qevent.QSignal)
            {
            case (int)QSignals.Entry:
                OnDisplayState("SlowTwo");
                return(null);

            case (int)RtcSignals.Start:
                bool completedOK2 = DoSomeInterruptibleWork2();
                if (completedOK2)
                {
                    this.lastCompleted = LastCompletedStep.SlowTwo;                            //not really needed
                    TransitionTo(Completed);
                }
                else
                {
                    TransitionTo(Dispatching);
                }
                return(null);
            }
            return(Interruptible);
        }
Exemple #4
0
        private QState DoSlowOne(IQEvent qevent)
        {
            switch (qevent.QSignal)
            {
            case (int)QSignals.Entry:
                OnDisplayState("SlowOne");
                return(null);

            case (int)RtcSignals.Start:
                bool completedOK1 = DoSomeInterruptibleWork1();
                if (completedOK1)
                {
                    this.lastCompleted = LastCompletedStep.SlowOne;
                    TransitionTo(SlowTwo);
                }
                else
                {
                    TransitionTo(Dispatching);
                }
                return(null);
            }
            return(Interruptible);
        }
 private QState DoSlowTwo(IQEvent qevent)
 {
     switch (qevent.QSignal)
     {
         case (int)QSignals.Entry:
             OnDisplayState("SlowTwo");
             return null;
         case (int)RtcSignals.Start:
             bool completedOK2 = DoSomeInterruptibleWork2();
             if (completedOK2)
             {
                 this.lastCompleted = LastCompletedStep.SlowTwo;//not really needed
                 TransitionTo(Completed);
             }
             else
             {
                 TransitionTo(Dispatching);
             }
             return null;
     }
     return Interruptible;
 }
 private QState DoSlowOne(IQEvent qevent)
 {
     switch (qevent.QSignal)
     {
         case (int)QSignals.Entry:
             OnDisplayState("SlowOne");
             return null;
         case (int)RtcSignals.Start:
             bool completedOK1 = DoSomeInterruptibleWork1();
             if (completedOK1)
             {
                 this.lastCompleted = LastCompletedStep.SlowOne;
                 TransitionTo(SlowTwo);
             }
             else
             {
                 TransitionTo(Dispatching);
             }
             return null;
     }
     return Interruptible;
 }
 private QState DoCompleted(IQEvent qevent)
 {
     switch (qevent.QSignal)
     {
         case (int)QSignals.Entry:
             OnDisplayState("Completed");
             lastCompleted = LastCompletedStep.None;
             return null;
         case (int)RtcSignals.Start:
             TransitionTo(CantInterrupt);
             return null;
     }
     return TopState;
 }
        private QState DoCantInterrupt(IQEvent qevent)
        {
            switch (qevent.QSignal)
            {
                case (int)QSignals.Entry:
                    OnDisplayState("CantInterrupt");
                    return null;
                case (int)RtcSignals.Start:
                    bool completedOK = DoSomeUninterruptibleWork();
                    if (completedOK)
                    {
                        this.lastCompleted = LastCompletedStep.CantInterrupt;

                    }
                    TransitionTo(SlowOne);
                    return null;
            }
            return TopState;
        }