Ejemplo n.º 1
0
        /// <summary>
        /// 出窑头充 到 窑头对接完成点
        /// </summary>
        public void TaskExitHeadChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑头充电点);

            // 有未上锁的、充电完成的AGV
            if (agv != null && agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                agv.ChargeStatus == EnumChargeStatus.充电完成)
            {
                if (_plcHead.ExitFlag &&
                    true)
                {
                    _ExitPlcHeadChargeSuc = true;

                    F_ExcTask task = new F_ExcTask(null, EnumOper.对接完成, ConstSetBA.出窑头充电点, ConstSetBA.窑头对接完成点);

                    F_AGV.AgvLock(agv.Id);

                    _plcHead.ExitFlag = false;

                    task.Id = agv.Id;

                    Thread.Sleep(2000);

                    F_DataCenter.MTask.IStartTask(task, agv.Id + ExitPlcHeadChargeSucMsg);

                    sendServerLog(agv.Id + ExitPlcHeadChargeSucMsg);

                    LogFactory.LogDispatch(agv.Id, "充电完成", ExitPlcHeadChargeSucMsg);
                }
            }
            else
            {
                _ExitPlcHeadChargeSuc = false;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///窑头充电点有充电完成的AGV
        ///优先派充电完成的车去卸货
        /// </summary>
        public void PlcHeadChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.卸货充电点);

            // 有充电完成的AGV,且窑头卸载点没货
            if (agv != null &&
                //&& agv.ChargeStatus == EnumChargeStatus.充电完成 &&
                !F_AGV.IsLock(agv.Id))
            {
                _PlcHeadChargeSuc = true;

                if (//_plcHead.Sta_Material == EnumSta_Material.无货
                    //&&  agv.Sta_Material == EnumSta_Material.有货
                    true
                    )
                {
                    F_ExcTask task = new F_ExcTask(_plcHead, EnumOper.放货, ConstSetBA.卸货充电点, ConstSetBA.窑头卸载点);

                    F_AGV.AgvLock(agv.Id);

                    _plcHead.IsLock = true;

                    task.Id = agv.Id;

                    F_DataCenter.MTask.IStartTask(task);

                    sendServerLog(agv.Id + ",充电完成,派充电完成的车去卸货");

                    LogFactory.LogDispatch(agv.Id, "充电完成", "派充电完成的车去卸货");
                }
            }
            else
            {
                _PlcHeadChargeSuc = false;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 窑头机械手3 去 窑头等待8 
        /// </summary>
        public void HolderToHeadWait()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(Site.窑头3);

            // 判断窑头机械手是否完成的状态 
            if (agv != null && agv.IsFree && !agv.IsLock
                && agv.Sta_Material == EnumSta_AGV.AGV有货
                && _plcHeadHolder.Sta_Material_HeadMLP == EnumSta_Material_HeadMLP.窑头机械手完成
                )
            {
                // 从窑头机械手3 到窑头8
                F_ExcTask task = new F_ExcTask(_plcHeadHolder, EnumOper.无动作, Site.窑头3, Site.窑头8);

                task.Id = agv.Id;

                agv.IsLock = true;

                F_DataCenter.MTask.IStartTask(task);

                sendServerLog(agv.Id + ", 从窑头夹具点3 去 窑头等待8 ");

                LogFactory.LogDispatch(agv.Id, "卸货", "从窑头夹具点3去窑头等待8");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 窑尾取货完成Agv从窑尾夹具2 到 窑头卸载等待点7
        /// </summary>
        private void EndHolderToHeadWait()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(Site.窑尾2);

            // 判断窑尾机械手2号是否完成
            if (agv != null && agv.IsFree && !agv.IsLock &&
                agv.Sta_Material == EnumSta_Material.AGV有货 &&
                _plcEnd.Sta_Material == EnumSta_Material.窑尾2号机械手完成
                )
            {
                F_ExcTask task = new F_ExcTask(null, EnumOper.无动作, Site.窑尾2, Site.窑头7);

                task.Id = agv.Id;

                agv.IsLock = true;

                F_DataCenter.MTask.IStartTask(task);


                sendServerLog(agv.Id + "窑尾取货完成Agv从窑尾夹具2 到 窑头等待点7");

                LogFactory.LogDispatch(agv.Id, "送货", "窑尾取货完成Agv从窑尾夹具2 到 窑头等待点7");
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 窑头去窑头对接完成点
        /// </summary>
        private void TaskHeadToHeadSuc()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(_plcHead.Site);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑头充电点);

            if (agv != null &&
                agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                (ParamControl.IgnoreAgvUnloadTask || agv.Sta_Material == EnumSta_Material.无货)
                )
            {
                // 判断窑头可出站标志是否为True
                if (_plcHead.ExitFlag)
                {
                    // 如果需要充电但是充电桩有车、被锁,或者不需要充电直接去到对接完成点
                    if ((agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() && agv1 != null && _plcHead.IsExitBatteryLock) ||
                        agv.Electicity > F_DataCenter.MDev.IGetDevElectricity())
                    {
                        // 从窑头到窑头对接完成点
                        F_ExcTask task1 = new F_ExcTask(_plcHead, EnumOper.对接完成, ConstSetBA.窑头卸载点, ConstSetBA.窑头对接完成点);

                        F_AGV.AgvLock(agv.Id);

                        task1.Id = agv.Id;

                        _plcHead.ExitFlag = false;

                        F_DataCenter.MTask.IStartTask(task1, agv.Id + TaskHeadToHeadSucMsg);

                        sendServerLog(agv.Id + TaskHeadToHeadSucMsg);

                        LogFactory.LogDispatch(agv.Id, "卸货完成", TaskHeadToHeadSucMsg);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 事务处理
        /// </summary>
        public String DoWork()
        {
            if (_isSuc)
            {
                return("");
            }

            _taskDispatch = JTWcfHelper.WcfMainHelper.GetDispatch(Id);

            if (_taskDispatch == null)
            {
                DispatchOrderObj dis = new DispatchOrderObj();

                dis.DisGuid = Id;

                dis.EndSite = _endSite;


                if (!string.IsNullOrEmpty(_startSite))
                {
                    dis.StartSiteList.Add(_startSite);
                }

                string back = "";

                JTWcfHelper.WcfMainHelper.StartDispatch(dis, out back);
                return(back);
            }
            else
            {
                ///确定此时任务的AGV
                if (_agv == null)
                {
                    _agv = new F_AGV(_taskDispatch.DisDevId);
                }

                ///此次调度任务已经完成
                if (_taskDispatch.OrderStatue == ResultTypeEnum.Suc)
                {
                    if (_operType == EnumOper.取货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if (//_plc.Sta_Material == EnumSta_Material.有货 &&
                                //(_agv.Sta_Material == EnumSta_Material.无货 || _agv.Sta_Material == EnumSta_Material.传送中)&&
                                true)
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台允许下料);
                            }


                            if (//_plc.Sta_Material == EnumSta_Material.无货 &&
                                //_agv.Sta_Material == EnumSta_Material.有货 &&
                                true)
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);

                                if (true
                                    //&&_agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.放货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if (//(_plc.Sta_Material == EnumSta_Material.有货 || _plc.Sta_Material == EnumSta_Material.无货 )&&
                                //(_agv.Sta_Material == EnumSta_Material.传送中 || _agv.Sta_Material == EnumSta_Material.有货) &&
                                true)
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料中);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                            }


                            if (//_plc.Sta_Material == EnumSta_Material.有货 &&
                                //_agv.Sta_Material == EnumSta_Material.无货 &&
                                true)
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);


                                if (true
                                    //&& _agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.充电)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                    else if (_operType == EnumOper.无动作)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                }
                return("");
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 事务处理
        /// </summary>
        public String DoWork()
        {
            if (_isSuc)
            {
                return("");
            }

            if (!_isStart)
            {
                if (++_triggerCounter > F_DataCenter.ClearTime)
                {
                    _isOverTime = true;
                }
            }

            if (_agv != null)
            {
                if (_agv.IsAlive)
                {
                    _disAliveCounter = 0;
                }
                else
                {
                    if (++_disAliveCounter > F_DataCenter.ClearTime)
                    {
                        _isDisaliveOverTime = true;
                    }
                }
            }
            else
            {
                if (++_triggerCounter > F_DataCenter.ClearTime)
                {
                    _isOverTime = true;
                }
            }

            _taskDispatch = WcfMainHelper.GetDispatch(Id);

            if (_taskDispatch == null)
            {
                FDispatchOrder dis = new FDispatchOrder();

                dis.NavigationType = EnumNavigationType.Magnet;

                dis.Id = Id;

                dis.EndSite = _endSite;

                if (!string.IsNullOrEmpty(_startSite))
                {
                    dis.StartSiteList.Add(_startSite);
                }

                ///修改By fujun
                dis.DevList.Add(Id);

                string back = "";

                WcfMainHelper.StartDispatch(dis, out back);

                return(back);
            }
            else
            {
                ///修改By fujun
                _isStart = true;

                #region 滚筒逻辑
                ///确定此时任务的AGV
                if (_agv == null)
                {
                    _agv = new F_AGV(_taskDispatch.Dev);
                }

                ///此次调度任务已经完成
                if (_taskDispatch.Statue == EnumResultType.Suc)
                {
                    if (_operType == EnumOper.取货)       //窑尾
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            FLog.Log(_agv.Id + "到达窑尾,开始取货");
                            if (_agv != null && _plc.EnterChargeAgv == _agv.Id)
                            {
                                if (_plc.IsEnterBatteryLock
                                    //&& !ParamControl.Do_EnterEndChargeLock
                                    )
                                {
                                    _plc.IsEnterBatteryLock = false;

                                    ParamControl.Do_EnterEndChargeLock = true;

                                    ParamControl.EndChargeLock = _plc.IsEnterBatteryLock;

                                    _plc.EnterChargeAgv = null;
                                }
                            }

                            //如果界面打开忽略《窑尾》AGV货物状态和Plc货物状态则 直接发送棍台转动命令
                            if (ParamControl.Is_IgnoreTailUnloadStatus ||
                                (_plc.Sta_Material == EnumSta_Material.货 &&
                                 (_agv.Sta_Material == EnumagvSta_Material.无货 || _agv.Sta_Material == EnumagvSta_Material.送中)))
                            {
                                if (_agv.Sta_Monitor != EnumSta_Monitor.电机反转)
                                {
                                    _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);
                                    FLog.Log(_agv.Id + "启动车载辊台");
                                }
                                else
                                {
                                    if (BeginTime == null)
                                    {
                                        BeginTime = System.DateTime.Now;
                                    }
                                    _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);

                                    _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台允许下料);

                                    FLog.Log(_agv.Id + "启动车载辊台,启动窑尾辊台");
                                }
                            }

                            //如果界面打开忽略《窑尾》AGV货物状态,并且上面已经发送了指定时间的棍台转动时间
                            if ((ParamControl.Is_IgnoreTailUnloadStatus && IsTailRunTimeFinish()) ||
                                (//_plc.Sta_Material == EnumSta_Material.无货  &&
                                    _agv.Sta_Material == EnumagvSta_Material.货))
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);
                                FLog.Log(_agv.Id + "停止车载辊台,停止窑尾辊台");
                                //如果界面打开忽略《窑尾》AGV棍台状态,则进去结束任务
                                if (ParamControl.Is_IgnoreTailStaStatus ||
                                    _agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    //取货完成,解锁窑尾
                                    if (_plc != null
                                        // && !ParamControl.Do_EndPlcLock
                                        )
                                    {
                                        _plc.IsLock = false;

                                        ParamControl.Do_EndPlcLock = true;
                                    }

                                    ISetTaskSuc();
                                }
                            }
                        }
                        else
                        {
                            ISetTaskSuc();
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.放货)      //窑头
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            FLog.Log(_agv.Id + "到达窑头,开始放货");
                            if (_agv != null && _plc.EnterChargeAgv == _agv.Id)
                            {
                                if (_plc.IsEnterBatteryLock
                                    )
                                {
                                    _plc.IsEnterBatteryLock = false;

                                    _plc.EnterChargeAgv = null;
                                }
                            }
                            //如果界面打开忽略《窑头》AGV货物状态和Plc货物状态则 直接发送棍台转动命令
                            if (ParamControl.Is_IgnoreHeadUnloadStatus ||
                                ((_plc.Sta_Material == EnumSta_Material.允许下料 || _plc.Sta_Material == EnumSta_Material.无货 ||
                                  _plc.Sta_Material == EnumSta_Material.未知) &&
                                 (_agv.Sta_Material == EnumagvSta_Material.送中 || _agv.Sta_Material == EnumagvSta_Material.货)))
                            {
                                if (_agv.Sta_Monitor != EnumSta_Monitor.电机反转)
                                {
                                    _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                                    FLog.Log(_agv.Id + "启动车载辊台");
                                }
                                else
                                {
                                    if (BeginTime == null)
                                    {
                                        BeginTime = System.DateTime.Now;
                                    }
                                    _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料中);

                                    _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                                    FLog.Log(_agv.Id + "启动车载辊台,启动窑头辊台");
                                }
                            }

                            //如果界面打开忽略《窑头》AGV货物状态,并且上面已经发送了指定时间的棍台转动时间
                            if ((ParamControl.Is_IgnoreHeadUnloadStatus && IsHeadRunTimeFinish()) ||
                                (//(_plc.Sta_Material == EnumSta_Material.允许下料 || _plc.Sta_Material == EnumSta_Material.未知) &&
                                    _agv.Sta_Material == EnumagvSta_Material.无货))
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                FLog.Log(_agv.Id + "停止车载辊台,停止窑头辊台");
                                //如果界面打开忽略《窑头》AGV棍台状态,则进去结束任务
                                if (ParamControl.Is_IgnoreHeadStaStatus ||
                                    _agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    //放货完成,解锁窑头
                                    if (_plc != null
                                        //&& !ParamControl.Do_HeadPlcLock
                                        )
                                    {
                                        _plc.IsLock = false;

                                        ParamControl.Do_HeadPlcLock = true;
                                    }

                                    ISetTaskSuc();
                                }
                            }
                        }
                        else
                        {
                            ISetTaskSuc();
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.充电)
                    {
                        if (!_plc.ExitFlag)
                        {
                            _plc.ExitFlag = true;
                        }
                        ISetTaskSuc();

                        return("");
                    }
                    else if (_operType == EnumOper.无动作)
                    {
                        ISetTaskSuc();

                        return("");
                    }
                    else if (_operType == EnumOper.对接完成)
                    {
                        if (_plc.IsExitBatteryLock && _plc.ExitChargeAgv == _agv.Id)
                        {
                            if (_plc.Site == "14")
                            {
                                ParamControl.Do_ExitHeadChargeLock = true;
                            }
                            //else if (_plc.Site == "11")
                            //{
                            //    ParamControl.Do_ExitEndChargeLock = true ;
                            //}

                            _plc.IsExitBatteryLock = false;

                            _plc.ExitChargeAgv = null;

                            ParamControl.HeadChargeAGV  = _plc.ExitChargeAgv;
                            ParamControl.HeadChargeLock = _plc.IsExitBatteryLock;
                        }

                        if (!_plc.ExitFlag)
                        {
                            _plc.ExitFlag = true;
                        }
                        ISetTaskSuc();
                        return("");
                    }
                }
                return("");

                #endregion
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 事务处理
        /// </summary>
        public String DoWork()
        {
            if (_isSuc)
            {
                return("");
            }

            if (!_isStart)
            {
                if (++_triggerCounter > F_DataCenter.ClearTime)
                {
                    _isOverTime = true;
                }
            }

            if (_agv != null)
            {
                if (_agv.IsAlive)
                {
                    _disAliveCounter = 0;
                }
                else
                {
                    if (++_disAliveCounter > F_DataCenter.ClearTime)
                    {
                        _isDisaliveOverTime = true;
                    }
                }
            }
            else
            {
                if (++_triggerCounter > F_DataCenter.ClearTime)
                {
                    _isOverTime = true;
                }
            }

            _taskDispatch = JTWcfHelper.WcfMainHelper.GetDispatch(Id);

            if (_taskDispatch == null)
            {
                DispatchOrderObj dis = new DispatchOrderObj();

                dis.DisGuid = Id;

                dis.EndSite = _endSite;


                if (!string.IsNullOrEmpty(_startSite))
                {
                    dis.StartSiteList.Add(_startSite);
                }

                ///修改By fujun
                dis.DevList.Add(Id);

                string back = "";

                JTWcfHelper.WcfMainHelper.StartDispatch(dis, out back);
                return(back);
            }
            else
            {
                ///修改By fujun
                _isStart = true;

                ///确定此时任务的AGV
                if (_agv == null)
                {
                    _agv = new F_AGV(_taskDispatch.DisDevId);
                }

                ///此次调度任务已经完成
                if (_taskDispatch.OrderStatue == ResultTypeEnum.Suc)
                {
                    if (_operType == EnumOper.取货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            // 判断窑尾PLC的货物状态和AGV货物状态
                            if (
                                (_plc.Sta_Material_End == EnumSta_Material_End.窑尾传输中
                                 //|| _plc.Sta_Material_End == EnumSta_Material_End.状态未知
                                 || _plc.Sta_Material_End == EnumSta_Material_End.窑尾有货) &&
                                (_agv.Sta_Material == EnumSta_AGV.AGV无货 ||
                                 _agv.Sta_Material == EnumSta_AGV.AGV传输中)
                                )
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台启动);
                            }

                            // // 判断窑尾是否出料完成
                            if (//_plc.Sta_Material_End == EnumSta_Material_End.窑尾出料完成 &&
                                _agv.Sta_Material == EnumSta_AGV.AGV有货 &&
                                true)
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台停止);

                                if (true &&
                                    _agv.Sta_Monitor == EnumSta_AGVMonitor.AGV电机停止
                                    )
                                {
                                    //取货完成,解锁窑尾
                                    if (_plc != null)
                                    {
                                        _plc.IsLock = false;
                                    }
                                    ISetTaskSuc();
                                }
                            }
                        }
                        else
                        {
                            ISetTaskSuc();
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.放货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if ((_plc.Sta_Material_Head == EnumSta_Material_Head.窑头无货 ||
                                 _plc.Sta_Material_Head == EnumSta_Material_Head.窑头传输中) &&
                                (_agv.Sta_Material == EnumSta_AGV.AGV传输中 ||
                                 _agv.Sta_Material == EnumSta_AGV.AGV有货) &&
                                true)
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台启动);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                            }


                            if (//_plc.Sta_Material_Head == EnumSta_Material_Head.窑头接料完成 &&
                                _agv.Sta_Material == EnumSta_AGV.AGV无货 &&
                                true)
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台停止);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                if (_agv.Sta_Monitor == EnumSta_AGVMonitor.AGV电机停止 &&
                                    true)
                                {
                                    //放货完成,解锁窑头
                                    if (_plc != null)
                                    {
                                        _plc.IsLock = false;
                                    }

                                    Thread.Sleep(5000);
                                    ISetTaskSuc();
                                }
                            }
                        }
                        else
                        {
                            ISetTaskSuc();
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.充电)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                    else if (_operType == EnumOper.窑尾1号机械手)
                    {
                        ///当前AGV的地标是否为窑尾1号机械手位置
                        if (_agv.Site == _plc.Site)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾1号机械手启动);

                            if (_plc.Sta_Material_End == EnumSta_Material_End.窑尾1号机械手完成 &&
                                true
                                )
                            {
                                //1号机械手完成动作
                                ISetTaskSuc();
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.窑尾2号机械手)
                    {
                        ///当前AGV的地标是否为窑尾2号机械手位置
                        if (_agv.Site == Site.窑尾2)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾2号机械手启动);

                            if (_plc.Sta_Material_End == EnumSta_Material_End.窑尾2号机械手完成 &&
                                true
                                )
                            {
                                ISetTaskSuc();
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.窑头机械手)
                    {
                        ///当前AGV的地标是否为窑头机械手位置
                        if (_agv.Site == Site.窑头3)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑头机械手启动);

                            if (true &&
                                _plc.Sta_Material_HeadMLP == EnumSta_Material_HeadMLP.窑头机械手完成
                                )
                            {
                                ISetTaskSuc();
                            }
                        }

                        return("");
                    }
                    else if (_operType == EnumOper.无动作)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                }
                return("");
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 事务处理
        /// </summary>
        public String DoWork()
        {
            if (_isSuc)
            {
                return("");
            }

            _taskDispatch = JTWcfHelper.WcfMainHelper.GetDispatch(Id);

            if (_taskDispatch == null)
            {
                DispatchOrderObj dis = new DispatchOrderObj();

                dis.DisGuid = Id;

                dis.EndSite = _endSite;


                if (!string.IsNullOrEmpty(_startSite))
                {
                    dis.StartSiteList.Add(_startSite);
                }

                string back = "";

                JTWcfHelper.WcfMainHelper.StartDispatch(dis, out back);
                return(back);
            }
            else
            {
                ///确定此时任务的AGV
                if (_agv == null)
                {
                    _agv = new F_AGV(_taskDispatch.DisDevId);
                }

                ///此次调度任务已经完成
                if (_taskDispatch.OrderStatue == ResultTypeEnum.Suc)
                {
                    if (_operType == EnumOper.取货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            // 判断窑尾PLC的货物状态和AGV货物状态
                            if ((_plc.Sta_Material == EnumSta_Material.窑尾传输中 || _plc.Sta_Material == EnumSta_Material.AGV未知 || _plc.Sta_Material == EnumSta_Material.窑尾有货) &&
                                (_agv.Sta_Material == EnumSta_Material.AGV无货 || _agv.Sta_Material == EnumSta_Material.AGV传输中))
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台启动);
                            }

                            // // 判断窑尾是否出料完成
                            if (_plc.Sta_Material == EnumSta_Material.窑尾出料完成 &&
                                _agv.Sta_Material == EnumSta_Material.AGV有货 &&
                                true)
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台停止);

                                if (true &&
                                    _agv.Sta_Monitor == EnumSta_Monitor.AGV电机停止
                                    )
                                {
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.放货)
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if ((_plc.Sta_Material == EnumSta_Material.窑头无货 || _plc.Sta_Material == EnumSta_Material.窑头无货 || _plc.Sta_Material == EnumSta_Material.窑头传输中) &&
                                (_agv.Sta_Material == EnumSta_Material.AGV传输中 || _agv.Sta_Material == EnumSta_Material.AGV有货))
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台启动);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                            }


                            if (_plc.Sta_Material == EnumSta_Material.窑头接料完成 &&
                                _agv.Sta_Material == EnumSta_Material.AGV无货 &&
                                true)
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台停止);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                if (_agv.Sta_Monitor == EnumSta_Monitor.AGV电机停止 &&
                                    true)
                                {
                                    Thread.Sleep(5000);
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.充电)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                    else if (_operType == EnumOper.窑尾1号机械手)
                    {
                        ///当前AGV的地标是否为窑尾1号机械手位置
                        if (_agv.Site == _plc.Site)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾1号机械手启动);

                            if (_plc.Sta_Material == EnumSta_Material.窑尾1号机械手完成 &&
                                true
                                )
                            {
                                //1号机械手完成动作
                                ISetTaskSuc();
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.窑尾2号机械手)
                    {
                        ///当前AGV的地标是否为窑尾2号机械手位置
                        if (_agv.Site == Site.窑尾2)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾2号机械手启动);

                            if (_plc.Sta_Material == EnumSta_Material.窑尾2号机械手完成 &&
                                true
                                )
                            {
                                ISetTaskSuc();
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.窑头机械手)
                    {
                        ///当前AGV的地标是否为窑头机械手位置
                        if (_agv.Site == Site.窑头3)
                        {
                            _plc.SendOrdr(EnumType.料操作, EnumPara.窑头机械手启动);

                            if (true &&
                                _plc.Sta_Material == EnumSta_Material.窑头机械手完成
                                )
                            {
                                ISetTaskSuc();
                            }
                        }

                        return("");
                    }
                    else if (_operType == EnumOper.无动作)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                }
                return("");
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 初始化,让AGV回到相应的点或者执行相应的任务
        /// </summary>
        private void InitToAllAGV()
        {
            List <F_AGV> agvs = F_DataCenter.MDev.InitGetDevNot(agvid);

            PLCEndTrafficSite.AddRange(new string[] { "26", "16", "21", "11" });
            PLCHeadTrafficSite.AddRange(new string[] { "23", "13", "24", "14" });
            PLCEndToHeadWaitSite.AddRange(new string[] { "12", "62" });
            PLCHeadToEndWaitSite.AddRange(new string[] { "15", "65" });

            if (agvs != null)
            {
                foreach (F_AGV agv in agvs)
                {
                    // 窑尾交通管制点是否有车
                    if (PLCEndTrafficSite.Contains(agv.Site))
                    {
                        if (agv.Site == ConstSetBA.窑尾装载点)
                        {
                            // 初始化,在窑尾装载点且有货,去到窑尾对接完成点
                            if (agv.Sta_Material == EnumagvSta_Material.货)
                            {
                                F_ExcTask task = new F_ExcTask(null, EnumOper.对接完成, agv.Site, ConstSetBA.窑尾对接完成点);

                                task.Id = agv.Id;

                                F_DataCenter.MTask.IStartTask(task, agv.Id + initToEndSucMsg);

                                sendServerLog(agv.Id + initToEndSucMsg);

                                LogFactory.LogDispatch(agv.Id, "车辆初始化", initToEndSucMsg);
                            }
                            // 初始化,在窑尾装载点且无货,执行取货任务
                            else
                            {
                                _ToPlcEnd = true;

                                F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.取货, agv.Site, ConstSetBA.窑尾装载点);

                                F_AGV.AgvLock(agv.Id);

                                task.Id = agv.Id;

                                F_DataCenter.MTask.IStartTask(task, agv.Id + toEndGrtMsg);

                                sendServerLog(agv.Id + "初始化,位于装载点且无货的AGV,执行取货任务");

                                LogFactory.LogDispatch(agv.Id, "车辆初始化", "位于装载点且无货的AGV,执行取货任务");
                            }
                        }
                        // 不在装载点的车,判断地标是否为正反卡的21,若为取货完成的车去到窑尾对接完成点
                        else if (agv.Site == ConstSetBA.窑尾装载点的前一地标 && agv.Sta_Material == EnumagvSta_Material.货)
                        {
                            F_ExcTask task = new F_ExcTask(null, EnumOper.对接完成, agv.Site, ConstSetBA.窑尾对接完成点);

                            task.Id = agv.Id;

                            F_DataCenter.MTask.IStartTask(task, agv.Id + initToEndSucMsg);

                            sendServerLog(agv.Id + initToEndSucMsg);

                            LogFactory.LogDispatch(agv.Id, "车辆初始化 ,有货的AGV", initToEndSucMsg);
                        }
                        else
                        {
                            // 准备取货的AGV,去到窑尾装载点取货
                            _ToPlcEnd = true;

                            F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.取货, agv.Site, ConstSetBA.窑尾装载点);

                            F_AGV.AgvLock(agv.Id);

                            task.Id = agv.Id;

                            F_DataCenter.MTask.IStartTask(task, agv.Id + toEndGrtMsg);

                            sendServerLog(agv.Id + "初始化,准备取货的AGV,去到窑尾装载点取货");

                            LogFactory.LogDispatch(agv.Id, "车辆初始化", "准备取货的AGV,去到窑尾装载点取货");
                        }
                    }
                    // 窑头交通管制点是否有车
                    else if (PLCHeadTrafficSite.Contains(agv.Site))
                    {
                        if (agv.Site == ConstSetBA.窑头卸载点)
                        {
                            // 初始化,在窑头卸载点且无货,去到窑头对接完成点
                            if (agv.Sta_Material == EnumagvSta_Material.无货)
                            {
                                F_ExcTask task = new F_ExcTask(null, EnumOper.对接完成, agv.Site, ConstSetBA.窑头对接完成点);

                                task.Id = agv.Id;

                                F_DataCenter.MTask.IStartTask(task, agv.Id + initToHeadSucMsg);

                                sendServerLog(agv.Id + TaskHeadToHeadSucMsg);

                                LogFactory.LogDispatch(agv.Id, "车辆初始化", initToHeadSucMsg);
                            }
                            // 初始化,在窑头卸载点且无货,执行放货任务
                            else
                            {
                                _ToPlcHead = true;

                                F_ExcTask task = new F_ExcTask(_plcHead, EnumOper.放货, agv.Site, ConstSetBA.窑头卸载点);

                                F_AGV.AgvLock(agv.Id);

                                task.Id = agv.Id;

                                F_DataCenter.MTask.IStartTask(task, agv.Id + toHeadGrtMsg);

                                sendServerLog(agv.Id + "初始化,位于窑头卸载点且有货,执行放货任务");

                                LogFactory.LogDispatch(agv.Id, "车辆初始化", "位于窑头卸载点且有货,执行放货任务");
                            }
                        }
                        // 不在卸载点的车,判断地标是否为正反卡的24,若为放货完成的车去到窑头对接完成点
                        else if (agv.Site == ConstSetBA.窑头卸载点的前一地标 && agv.Sta_Material == EnumagvSta_Material.无货)
                        {
                            F_ExcTask task = new F_ExcTask(null, EnumOper.对接完成, agv.Site, ConstSetBA.窑头对接完成点);

                            task.Id = agv.Id;

                            F_DataCenter.MTask.IStartTask(task, agv.Id + initToHeadSucMsg);

                            sendServerLog(agv.Id + initToHeadSucMsg);

                            LogFactory.LogDispatch(agv.Id, "车辆初始化 ,无货的AGV", initToHeadSucMsg);
                        }
                        else
                        {
                            // 准备卸货的AGV,去到窑头卸载点放货
                            _ToPlcEnd = true;

                            F_ExcTask task = new F_ExcTask(_plcHead, EnumOper.放货, agv.Site, ConstSetBA.窑头卸载点);

                            F_AGV.AgvLock(agv.Id);

                            task.Id = agv.Id;

                            F_DataCenter.MTask.IStartTask(task, agv.Id + toHeadGrtMsg);

                            sendServerLog(agv.Id + "初始化, 准备卸货的AGV,去到窑头卸载点放货");

                            LogFactory.LogDispatch(agv.Id, "车辆初始化", " 准备卸货的AGV,去到窑头卸载点放货");
                        }
                    }
                    /// 不在任何交通管制点的车,去到相应的等待点
                    /// 窑头卸货完成的车,直接去到窑尾装载等待点
                    else if (PLCHeadToEndWaitSite.Contains(agv.Site) && agv.Sta_Material == EnumagvSta_Material.无货)
                    {
                        F_ExcTask task = new F_ExcTask(null, EnumOper.无动作, agv.Site, ConstSetBA.窑尾装载等待区);

                        task.Id = agv.Id;

                        F_DataCenter.MTask.IStartTask(task, agv.Id + initToEndWaitMsg);

                        sendServerLog(agv.Id + initToEndWaitMsg);

                        LogFactory.LogDispatch(agv.Id, "车辆初始化 ,窑头交管解除点的AGV", initToEndWaitMsg);
                    }
                    ///  窑尾取货完成的车,直接去到窑头卸载等待点
                    else if (PLCEndToHeadWaitSite.Contains(agv.Site) && agv.Sta_Material == EnumagvSta_Material.货)
                    {
                        F_ExcTask task = new F_ExcTask(null, EnumOper.无动作, agv.Site, ConstSetBA.窑头卸载等待区);

                        task.Id = agv.Id;

                        F_DataCenter.MTask.IStartTask(task, agv.Id + initToHeadWaitMsg);

                        sendServerLog(agv.Id + initToHeadWaitMsg);

                        LogFactory.LogDispatch(agv.Id, "车辆初始化 ,窑尾交管解除点的AGV", initToHeadWaitMsg);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 窑尾等 到 进窑尾充
        /// </summary>
        private void TaskEndToEnterBattery()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑尾装载等待区);

            //查找是否存在目标站点是进窑尾充电站的AGV
            F_AGV d_agv  = F_DataCenter.MDev.IGetDevOnDestination(ConstSetBA.充电桩站);
            F_AGV d_agv2 = F_DataCenter.MDev.IGetAliveDevOnSite(ConstSetBA.进窑尾充电点);

            //去进窑尾充电站的车是否是窑尾的车
            if (d_agv != null && (d_agv.Site != "26" && d_agv.Site != "36"))
            {
                d_agv = null;
            }

            if (d_agv != null || d_agv2 != null)
            {
                ParamControl.Do_EnterEndChargeLock = false;

                if (d_agv != null)
                {
                    _plcEnd.IsEnterBatteryLock = true;

                    _plcEnd.EnterChargeAgv = d_agv.Id;

                    ParamControl.EndChargeLock = _plcEnd.IsEnterBatteryLock;
                    ParamControl.EndChargeAGV  = _plcEnd.EnterChargeAgv;
                }
                else if (d_agv2 != null)
                {
                    _plcEnd.IsEnterBatteryLock = true;

                    _plcEnd.EnterChargeAgv     = d_agv2.Id;
                    ParamControl.EndChargeLock = _plcEnd.IsEnterBatteryLock;
                    ParamControl.EndChargeAGV  = _plcEnd.EnterChargeAgv;
                }
            }

            // 让未上锁的、电量低于60且未充电的AGV去充电,且接货充电点没有AGV
            if (agv != null && agv.IsFree &&
                agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() &&
                agv.ChargeStatus == EnumChargeStatus.未充电 &&
                (d_agv == null && d_agv2 == null) &&
                !_plcEnd.IsEnterBatteryLock
                //&& ParamControl.Do_EnterEndChargeLock
                && agv.Electicity <= ParamControl.MinElectricityCharge //低于最低充电量的车才能去充电
                )
            {
                _PlcEndNeedCharge = true;

                F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.充电, ConstSetBA.窑尾装载等待区, ConstSetBA.进窑尾充电点);

                F_AGV.AgvLock(agv.Id);

                //进窑尾充电,锁定进窑尾充电桩
                _plcEnd.IsEnterBatteryLock = true;

                ParamControl.Do_EnterEndChargeLock = false;

                _plcEnd.EnterChargeAgv = agv.Id;

                ParamControl.EndChargeLock = _plcEnd.IsEnterBatteryLock;

                ParamControl.EndChargeAGV = _plcEnd.EnterChargeAgv;

                task.Id = agv.Id;

                F_DataCenter.MTask.IStartTask(task, agv.Id + PlcEndChargeMsg);

                sendServerLog(agv.Id + PlcEndChargeMsg);

                //LogFactory.LogDispatch(agv.Id, "充电", PlcEndChargeMsg);
                FLog.Log(agv.Id + PlcEndChargeMsg);
            }
            else
            {
                _PlcEndNeedCharge = false;
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 窑头放 到 出窑头充电站
        /// </summary>
        private void TaskHeadToExitBattery()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑头卸载点);

            //查找是否存在目标站点是出窑头充电站的AGV
            F_AGV d_agv  = F_DataCenter.MDev.IGetDevOnDestination(ConstSetBA.充电桩站); //目的站点
            F_AGV d_agv2 = F_DataCenter.MDev.IGetAliveDevOnSite(ConstSetBA.出窑头充电点); //地标

            //去出窑头充电站的车是否是窑头的车
            if (d_agv != null && (d_agv.Site != "24" && d_agv.Site != "65" && d_agv.Site != "25" && d_agv.Site != "14"))
            {
                d_agv = null;
            }

            if (d_agv != null)
            {
                _plcHead.IsExitBatteryLock         = true;
                ParamControl.Do_ExitHeadChargeLock = false;

                _plcHead.ExitChargeAgv = d_agv.Id;



                ParamControl.HeadChargeAGV  = _plcHead.ExitChargeAgv;
                ParamControl.HeadChargeLock = _plcHead.IsExitBatteryLock;
            }
            else if (d_agv2 != null)
            {
                _plcHead.IsExitBatteryLock         = true;
                ParamControl.Do_ExitHeadChargeLock = false;

                _plcHead.ExitChargeAgv = d_agv2.Id;

                ParamControl.HeadChargeAGV  = _plcHead.ExitChargeAgv;
                ParamControl.HeadChargeLock = _plcHead.IsExitBatteryLock;
            }

            if (agv != null &&
                agv.IsFree &&
                agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() &&
                agv.Sta_Material == EnumagvSta_Material.无货 &&
                agv.ChargeStatus == EnumChargeStatus.未充电 &&
                agv.Electicity <= ParamControl.MinElectricityCharge    //低于最低充电量的车才能去充电
                )
            {
                // 判断出窑头充电站是否被锁
                if ((!_plcHead.IsExitBatteryLock) &&
                    (d_agv == null && d_agv2 == null)
                    )
                {
                    F_ExcTask task = new F_ExcTask(_plcHead, EnumOper.充电, ConstSetBA.窑头卸载点, ConstSetBA.出窑头充电点);

                    task.Id = agv.Id;

                    //出窑头充电,锁定出窑头充电桩
                    _plcHead.IsExitBatteryLock = true;

                    ParamControl.Do_ExitHeadChargeLock = false;

                    _plcHead.ExitChargeAgv = agv.Id;

                    ParamControl.HeadChargeAGV  = _plcHead.ExitChargeAgv;
                    ParamControl.HeadChargeLock = _plcHead.IsExitBatteryLock;

                    _plcHead.ExitFlag = false;

                    F_DataCenter.MTask.IStartTask(task, agv.Id + TaskHeadToExitBatteryMsg);

                    sendServerLog(agv.Id + TaskHeadToExitBatteryMsg);

                    //LogFactory.LogDispatch(agv.Id, "AGV出窑头充电", TaskHeadToExitBatteryMsg);
                    FLog.Log(agv.Id + TaskHeadToExitBatteryMsg);
                }
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 事务处理
        /// </summary>
        public String DoWork()
        {
            if (_isSuc)
            {
                return("");
            }

            _taskDispatch = WcfMainHelper.GetDispatch(Id);

            if (_taskDispatch == null)
            {
                FDispatchOrder dis = new FDispatchOrder();

                dis.NavigationType = EnumNavigationType.Magnet;

                dis.Id = Id;

                dis.EndSite = _endSite;


                if (!string.IsNullOrEmpty(_startSite))
                {
                    dis.StartSiteList.Add(_startSite);
                }

                string back = "";

                WcfMainHelper.StartDispatch(dis, out back);

                return(back);
            }
            else
            {
                ///确定此时任务的AGV
                if (_agv == null)
                {
                    _agv = new F_AGV(_taskDispatch.Dev);
                }

                ///此次调度任务已经完成
                if (_taskDispatch.Statue == EnumResultType.Suc)
                {
                    if (_operType == EnumOper.取货)       //窑尾
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if (_agv != null && _plc.EnterChargeAgv == _agv.Id)
                            {
                                if (_plc.IsEnterBatteryLock)
                                {
                                    _plc.IsEnterBatteryLock = false;
                                }
                            }

                            //如果界面打开忽略《窑尾》AGV货物状态和Plc货物状态则 直接发送棍台转动命令
                            if (ParamControl.Is_IgnoreTailUnloadStatus ||
                                (_plc.Sta_Material == EnumSta_Material.货 &&
                                 (_agv.Sta_Material == EnumSta_Material.无货 || _agv.Sta_Material == EnumSta_Material.送中)))
                            {
                                if (BeginTime == null)
                                {
                                    BeginTime = System.DateTime.Now;
                                }
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv上料启动);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑尾辊台允许下料);
                            }

                            //如果界面打开忽略《窑尾》AGV货物状态,并且上面已经发送了指定时间的棍台转动时间
                            if ((ParamControl.Is_IgnoreTailUnloadStatus && IsTailRunTimeFinish()) ||
                                (_plc.Sta_Material == EnumSta_Material.无货 && _agv.Sta_Material == EnumSta_Material.货))
                            {
                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);

                                //如果界面打开忽略《窑尾》AGV棍台状态,则进去结束任务
                                if (ParamControl.Is_IgnoreTailStaStatus ||
                                    _agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.放货)      //窑头
                    {
                        ///当前AGV的到达的地标 与 棍台绑定地标一致
                        if (_agv.Site == _plc.Site)
                        {
                            if (_agv != null && _plc.EnterChargeAgv == _agv.Id)
                            {
                                if (_plc.IsEnterBatteryLock)
                                {
                                    _plc.IsEnterBatteryLock = false;
                                }
                            }

                            //如果界面打开忽略《窑头》AGV货物状态和Plc货物状态则 直接发送棍台转动命令
                            if (ParamControl.Is_IgnoreHeadUnloadStatus ||
                                ((_plc.Sta_Material == EnumSta_Material.货 || _plc.Sta_Material == EnumSta_Material.无货) &&
                                 (_agv.Sta_Material == EnumSta_Material.送中 || _agv.Sta_Material == EnumSta_Material.货)))
                            {
                                if (BeginTime == null)
                                {
                                    BeginTime = System.DateTime.Now;
                                }
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料中);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv下料启动);
                            }

                            //如果界面打开忽略《窑头》AGV货物状态,并且上面已经发送了指定时间的棍台转动时间
                            if ((ParamControl.Is_IgnoreHeadUnloadStatus && IsHeadRunTimeFinish()) ||
                                (_plc.Sta_Material == EnumSta_Material.货 &&
                                 _agv.Sta_Material == EnumSta_Material.无货))
                            {
                                _plc.SendOrdr(EnumType.料操作, EnumPara.窑头辊台上料完成);

                                _agv.SendOrdr(EnumType.料操作, EnumPara.agv辊台停止);

                                //如果界面打开忽略《窑头》AGV棍台状态,则进去结束任务
                                if (ParamControl.Is_IgnoreHeadStaStatus ||
                                    _agv.Sta_Monitor == EnumSta_Monitor.电机停止
                                    )
                                {
                                    ISetTaskSuc();
                                }
                            }
                        }
                        return("");
                    }
                    else if (_operType == EnumOper.充电)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                    else if (_operType == EnumOper.无动作)
                    {
                        ISetTaskSuc();
                        return("");
                    }
                    else if (_operType == EnumOper.对接完成)
                    {
                        if (_plc.IsExitBatteryLock && _plc.ExitChargeAgv == _agv.Id)
                        {
                            _plc.IsExitBatteryLock = false;
                        }
                        if (_plc.ExitFlag)
                        {
                            _plc.ExitFlag = true;
                        }
                        ISetTaskSuc();
                        return("");
                    }
                }
                return("");
            }
        }