using System; using Microsoft.SPOT; using System.Text; namespace abstractState { abstract public class StateBase { //ABSTRACT METHODS public abstract int doStateActions(); public abstract Program.CPFStates checkEvents(); public abstract Program.CPFStates doTimeoutAction(); //INHERITED METHODS protected static int basicStateEntry() { Debug.Print("Doing basic state entry"); Elmo.stopMotor(); //EngrLogger.writeToColumns(sbStateEntry); SV.runPVPID = false; //I'm pretty sure these should be private to the scend class and dealt with in their entry and exit methods //sbScendStateName.Clear(); //sbScendStateName.Append(sbScendNameNone); return (1); } //COMMON PROPERTIES //This is the execution constraint time out that the state must complete in public int ECTimeout{get; protected set;} public readonly StringBuilder stateName = new StringBuilder(32); protected static StringBuilder sbTemp = new StringBuilder(128); //TODO It would be good to add properites to these fields as well as set the default value public struct SV { public static bool runPVPID = false; public static bool parked = false; public static int profileNum = -1; public static double pressure = double.NaN; public static double bellowsPosition = double.NaN; } } }