Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
 public ClearBufferCmd(String commandString, CommandInterpreter interpreter)
     : base(commandString, interpreter)
 {
     this.action = new Action(ActionType.startReceiveImageTimer);
 }
Ejemplo n.º 4
0
 public ReceiveTextCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter)
 {
     this.action = new Action(ActionType.receiveText);
     SetupText(commandString);
 }
Ejemplo n.º 5
0
 public InvalidCmd(String commandString, CommandInterpreter interpreter) : base(commandString, interpreter)
 {
     this.action = new Action(ActionType.invalid);
 }
Ejemplo n.º 6
0
 public Command(String commandString, CommandInterpreter interpreter)
 {
     this.commandString = commandString;
     this.interpreter   = interpreter;
     SetNode();
 }
Ejemplo n.º 7
0
 public ReceiveImageCmd(String commandString, CommandInterpreter interpreter)
     : base(commandString, interpreter)
 {
     this.action = new Action(ActionType.receiveImage);
     setupImage();
 }