/// <summary>
 /// 处理
 /// </summary>
 /// <param name="ip">IP</param>
 /// <param name="instructionTask">指令任务</param>
 /// <returns></returns>
 public virtual ProcessResult Process(string ip, InstructionTask instructionTask)
 {
     ProcessResult result = new ProcessResult();
     return result;
 }
        /// <summary>
        /// 处理任务
        /// </summary>
        /// <param name="ip">IP</param>
        /// <param name="instruction">指令</param>
        /// <returns></returns>
        private ProcessResult ProcessTask(string ip, AbstractInstruction instruction)
        {
            ProcessResult result = null;

            InstructionTask instructionTask = new InstructionTask();
            if (AbstractInstruction.InstructionTasks != null)
            {
                bool has = false;
                for (int i = AbstractInstruction.InstructionTasks.Count - 1; i >= 0; i--)
                {
                    if (AbstractInstruction.InstructionTasks[i].Done)
                    {
                        AbstractInstruction.InstructionTasks.RemoveAt(i);
                    }
                }
                for (int i = 0; i < AbstractInstruction.InstructionTasks.Count; i++)
                {
                    if ((AbstractInstruction.InstructionTasks[i].Ip == ip) && (AbstractInstruction.InstructionTasks[i].Type == instruction.GetType().FullName) && (AbstractInstruction.InstructionTasks[i].Instructions.Count == instruction.Serial))
                    {
                        instructionTask = AbstractInstruction.InstructionTasks[i];
                        has = true;
                        break;
                    }
                }
                if (!has)
                {
                    instructionTask.Ip = ip;
                    instructionTask.Type = instruction.GetType().FullName;
                    instructionTask.Instructions = new List<AbstractInstruction>();
                    instructionTask.Done = false;
                    AbstractInstruction.InstructionTasks.Add(instructionTask);
                }
                instructionTask.Instructions.Add(instruction);

                if ((instructionTask.Instructions.Count - 1) == instruction.Count)
                {
                    instructionTask.Done = true;
                    result = instruction.Process(ip, instructionTask);
                }
            }

            return result;
        }