using FSM.Machines; using FSM.Recipes; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FSM.States { class PausedState : IEquipmentState { private Recipe _currentRecipe; public PausedState(Recipe recipe) { _currentRecipe = recipe; } public void Enter() { Console.WriteLine("Entering PausedState"); } public void Exit() { Console.WriteLine("Exiting PausedState"); } public bool HandleEvent(EquipmentEvent equipmentEvent, Machines.EquipmentStateMachine machine) { switch (equipmentEvent) { case EquipmentEvent.Resume: machine.SetState(new RunningState(_currentRecipe)); return true; case EquipmentEvent.Stop: machine.SetState(new IdleState()); return true; case EquipmentEvent.EmergencyStop: machine.SetState(new EmergencyStoppedState()); return true; default: return false; } } } }