public void sendCommand()
        {
            AGVLog.WriteSendInfo("开始处理!", new StackFrame(true));
            TaskexeBean taskexeBean = TaskexeService.getInstance().getNextTaskexeBean();

            if (taskexeBean == null)
            {
                return;
            }
            string     cmd        = "cmd=set task by name;name=" + taskexeBean.getTaskid() + ".xml";
            SingleTask singleTask = AGVCacheData.getSingleTaskByID(taskexeBean.getTaskid());

            sendContinueCommand();

            Thread.Sleep(1000);

            int i = -2;

            if ("1".Equals(singleTask.getAllocOpType()))
            {
                while (string.IsNullOrEmpty(latestMsgFromClient) || latestMsgFromClient.IndexOf("task_isfinished=") < 0 || !"0".Equals(latestMsgFromClient.Substring(latestMsgFromClient.IndexOf("task_isfinished=") + "task_isfinished=".Length, 1)))
                {
                    send(cmd);
                    AGVLog.WriteSendInfo("发送命令:" + cmd, new StackFrame(true));
                    Thread.Sleep(3000);
                    if (!AGVEngine.getInstance().isAgvReady())
                    {
                        latestMsgFromClient = "task_isfinished=" + (i++) + ";";
                    }
                }
            }

            while (true)
            {
                AGVLog.WriteSendInfo("判断任务" + taskexeBean.getTaskid() + "是否Over!", new StackFrame(true));
                if ("Over".Equals(TaskexeDao.getDao().selectTaskexeByUuid(taskexeBean.getUuid()).getOpflag()))
                {
                    break;
                }
                Thread.Sleep(5000);
            }
            Thread.Sleep(1000);
        }
Ejemplo n.º 2
0
        public void sendTaskexeBean(TaskexeBean taskexeBean)
        {
            string sql = " update taskexe_s2c_task set opflag = 'Send' where `uuid` = '" + taskexeBean.getUuid() + "'";

            DBDao.getDao().DeleteWithSql(sql);
        }