Exemplo n.º 1
0
        // Implementation of State OnStage

        // Method for Entry

        public void OnStage__onEntry(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.OnStage__onEntry() Executing in response to event " + evt.getEventName());

            // Find the CDPlayer:player1.  If its not playing send 'play'
            FSM playerFSM = FSM.findByFSMName("CDPLAYER:cdplayer1");

            if (playerFSM.getCurrentStateName() != CDPLAYER.States.Playing)
            {
                FSM.postEvent(this, CDPLAYER.Events.startPlaying, playerFSM);
            }
        }
Exemplo n.º 2
0
        private void createOMInstancesButton_Click(object sender, EventArgs e)
        {
            //create 3 CDPLayers and 4 ACTORS

            try {
                FSM_STT mySTTCD = FSM_STT.findByRefClassName("CDPLAYER");
                new CDPLAYER("cdplayer1", mySTTCD, FSMType.synch);
                new CDPLAYER("cdplayer2", mySTTCD, FSMType.synch);
                CDPLAYER  c3    = new CDPLAYER("cdplayer3", mySTTCD, FSMType.synch);
                FSM_Event newEv = new FSM_Event(this, CDPLAYER.Events.startPlaying, c3.getFSM());
                CDPLAYER.postEvent(newEv);

                FSM_STT mySTTACTOR = FSM_STT.findByRefClassName("ACTOR");
                ACTOR   a1         = new ACTOR("actor1", mySTTACTOR, FSMType.asynch);
                ACTOR   a2         = new ACTOR("actor2", mySTTACTOR, FSMType.asynch);
                ACTOR   a3         = new ACTOR("actor3", mySTTACTOR, FSMType.asynch);
                ACTOR   a4         = new ACTOR("actor4", mySTTACTOR, FSMType.asynch);
            } catch (Exception ex) {
                Debug.WriteLine(ex.Message);
            }
        }
Exemplo n.º 3
0
        // GuardMethod for transition Paused__stop__Stopped

        public bool Paused__stopGuard(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Paused__stopGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 4
0
        // Method for Exit

        public void Paused__onExit(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Paused__onExit() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 5
0
        // Method for Transition Playing__pause__Paused

        public void Playing__pause(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Playing__pause() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 6
0
        // GuardMethod for transition InWings__receiveCue__OnStage

        public bool InWings__receiveCueGuard(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.InWings__receiveCueGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 7
0
        // Method for Transition InWings__receiveCue__OnStage

        public void InWings__receiveCue(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.InWings__receiveCue() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 8
0
        // GuardMethod for transition Begin__startPlaying__Playing

        public bool Begin__startPlayingGuard(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Begin__startPlayingGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 9
0
        // Method for Transition Bowing__applauseStopped__Ended

        public void Bowing__applauseStopped(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Bowing__applauseStopped() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 10
0
        // Method for Exit

        public void Bowing__onExit(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Bowing__onExit() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 11
0
        // GuardMethod for transition Dried__endOfScene__InWings

        public bool Dried__endOfSceneGuard(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Dried__endOfSceneGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 12
0
        // Method for Transition Dried__endOfScene__InWings

        public void Dried__endOfScene(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Dried__endOfScene() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 13
0
        // GuardMethod for transition OnStage__forgetLine__Dried

        public bool OnStage__forgetLineGuard(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.OnStage__forgetLineGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 14
0
        // Method for Transition OnStage__forgetLine__Dried

        public void OnStage__forgetLine(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.OnStage__forgetLine() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 15
0
        // Method for Transition Stopped__startPlaying__Playing

        public void Stopped__startPlaying(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Stopped__startPlaying() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 16
0
 // Processes an event.  Passes it on to the FSM
 public static void postEvent(FSM_Event evt)
 {
     FSM.postEvent(evt);
 }
Exemplo n.º 17
0
        // GuardMethod for transition Bowing__applauseStopped__Ended

        public bool Bowing__applauseStoppedGuard(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Bowing__applauseStoppedGuard() allowing event " + evt.getEventName());
            return(true);
        }
Exemplo n.º 18
0
        // Method for Transition Begin__stop__Stopped

        public void Begin__stop(FSM_Event evt)
        {
            Debug.WriteLine("CDPLAYER.Begin__stop() Executing in response to event " + evt.getEventName());
        }
Exemplo n.º 19
0
        // Implementation of State Ended

        // Method for Entry

        public void Ended__onEntry(FSM_Event evt)
        {
            Debug.WriteLine("ACTOR.Ended__onEntry() Executing in response to event " + evt.getEventName());
            // delete references as this is an end state and the STT demands it
            this.dereferenceFSM();
        }