public UpdateLocationCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter) { if (commandString.Contains("NoFix")) { this.action = new Action(ActionType.invalid); } else { this.action = new Action(ActionType.updateLocation); SetupGeoLocation(); } }
public static Command getCommand(string commandString, CommandInterpreter interpreter) { String commandType; try { commandType = commandString.Substring(commandTypePositionStart, commandTypeLength); System.Diagnostics.Debug.Print("Building Command: " + commandString); if (commandType.Equals("txr")) { System.Diagnostics.Debug.Print("Txt Command Received"); return(new ReceiveTextCmd(commandString, interpreter)); } else if (commandType.Equals("gps")) { System.Diagnostics.Debug.Print("GPS Command Received"); return(new UpdateLocationCmd(commandString, interpreter)); } else if (commandType.Equals("pcr")) { System.Diagnostics.Debug.Print("Image Received"); return(new ReceiveImageCmd(commandString, interpreter)); } else if (commandType.Equals("bfc")) { System.Diagnostics.Debug.Print("Clear buffer, image incomming"); return(new ClearBufferCmd(commandString, interpreter)); } else { System.Diagnostics.Debug.Print("Invalid Command Received"); return(new InvalidCmd(commandString, interpreter)); } } catch (Exception ex) { System.Diagnostics.Debug.Print("Invalid Command Received: " + ex.ToString()); return(new InvalidCmd(commandString, interpreter)); } }
public ClearBufferCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter) { this.action = new Action(ActionType.startReceiveImageTimer); }
public ReceiveTextCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter) { this.action = new Action(ActionType.receiveText); SetupText(commandString); }
public InvalidCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter) { this.action = new Action(ActionType.invalid); }
public Command(String commandString, CommandInterpreter interpreter) { this.commandString = commandString; this.interpreter = interpreter; SetNode(); }
public ReceiveImageCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter) { this.action = new Action(ActionType.receiveImage); setupImage(); }