using System; using Microsoft.SPOT; using System.Text; namespace abstractState { public class InitProfile : StateBase { private enum Action : int { stateEntry = 0, lastAction } private Action currentAction = Action.stateEntry; public InitProfile(string name) { stateName.Clear(); stateName.Append(name); ECTimeout = 5 * 1000; //milliseconds } public override int doStateActions() { //Probably would be better to make this look just like the SM loop in Program.cs switch (currentAction) { case (Action.stateEntry): Debug.Print("InitMission State Entry"); basicStateEntry(); //These should probably be inside class constructor //sbConsoleCommand.Clear(); //sbConsoleCommand.Append("NONE"); currentAction = Action.lastAction; break; case (Action.lastAction): break; } return (1); } public override Program.CPFStates checkEvents() { if (currentAction == Action.lastAction) { currentAction = Action.stateEntry; return (Program.CPFStates.descend); } else return (Program.CPFStates.initProfile); } public override Program.CPFStates doTimeoutAction() { return (Program.CPFStates.descend); } } }