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