Exemplo n.º 1
0
        /// <summary>
        /// 窑头卸载区的AGV去充电
        /// </summary>
        private void PlcHeadCharge()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑头卸载等待区);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.卸货充电点);

            // 让电量低于60且未充电的AGV去充电
            if (agv != null && agv.Electicity <= ConstSetBA.最低电量 && !F_AGV.IsLock(agv.Id) &&
                //agv.ChargeStatus == EnumChargeStatus.未充电  &&
                agv1 == null)
            {
                _PlcHeadNeedCharge = true;

                F_ExcTask task = new F_ExcTask(null, EnumOper.充电, ConstSetBA.窑头卸载等待区, ConstSetBA.卸货充电点);

                F_AGV.AgvLock(agv.Id);

                task.Id = agv.Id;

                F_DataCenter.MTask.IStartTask(task);

                sendServerLog(agv.Id + ",去到窑头充电点充电");

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

            // 有未上锁的、充电完成的AGV,且窑尾装载点有货、AGV上无货
            if (agv != null && !F_AGV.IsLock(agv.Id) && agv.ChargeStatus == EnumChargeStatus.充电完成)
            {
                if (// _plcEnd.Sta_Material == EnumSta_Material.有货 &&
                    //agv.Sta_Material == EnumSta_Material.无货
                    true)
                {
                    _PlcEndChargeSuc = true;

                    F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.取货, ConstSetBA.接货充电点, ConstSetBA.窑尾装载点);

                    F_AGV.AgvLock(agv.Id);

                    _plcEnd.IsLock = true;

                    task.Id = agv.Id;

                    F_DataCenter.MTask.IStartTask(task);

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

                    LogFactory.LogDispatch(agv.Id, "充电完成", "派充电完成的车去接货");
                }
            }
            else
            {
                _PlcEndChargeSuc = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 窑头放货任务
        /// </summary>
        private void TaskPlcHeadPut()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑头卸载等待区);

            ///窑头无货 窑头AGV未锁定 并且 此次任务没有被响应
            if (!_plcHead.IsLock
                //&& _plcHead.Sta_Material == EnumSta_Material.无货
                && agv != null && !F_AGV.IsLock(agv.Id))
            {
                //窑头等待区的车不需要充电、没有充电完成的车、没有回卸载点的车
                if (!_PlcHeadNeedCharge && !_PlcHeadChargeSuc && !_ToPlcHead)
                {
                    ///派发一个从窑头卸载等待区到窑头卸载点的任务
                    if (F_DataCenter.MTask.IStartTask(new F_ExcTask(_plcHead, EnumOper.放货, ConstSetBA.窑头卸载等待区, ConstSetBA.窑头卸载点)))
                    {
                        _plcHead.IsLock = true;

                        F_AGV.AgvLock(agv.Id);

                        sendServerLog(agv.Id + "从窑头卸载等待区到窑头卸载点的任务");

                        LogFactory.LogDispatch(agv.Id, "卸货", "从窑头卸载等待区到窑头卸载点的任务");
                    }
                }
                else
                {
                    _ToPlcHead = false;
                }
            }
        }
Exemplo n.º 4
0
        public void ExitPlcHeadChargeSuc()
        {
            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(_plcHead, EnumOper.对接完成, ConstSetBA.出窑头充电点, ConstSetBA.窑头对接完成点);

                    F_AGV.AgvLock(agv.Id);

                    _plcHead.ExitFlag = false;
                    //task.Id = agv.Id;

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

                    sendServerLog(agv.Id + ExitPlcHeadChargeSucMsg);

                    LogFactory.LogDispatch(agv.Id, "充电完成", ExitPlcHeadChargeSucMsg);
                }
            }
            else
            {
                _ExitPlcHeadChargeSuc = false;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 窑尾取货任务
        /// </summary>
        private void TaskPlcEndGet()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑尾装载等待区);

            ///窑尾有货 窑尾等待点的AGV没有锁定 并且 此次任务没有被响应
            if (!_plcEnd.IsLock && agv != null && !F_AGV.IsLock(agv.Id)
                //&& _plcEnd.Sta_Material == EnumSta_Material.有货
                )
            {
                //窑尾等待区的车不需要充电、没有充电完成的车 、没有初始化时要去窑尾装载点的车
                if (!_PlcEndNeedCharge && !_PlcEndChargeSuc && !_ToPlcEnd)
                {
                    ///派发一个从窑尾装载等待区到窑尾装载点取货的任务
                    if (F_DataCenter.MTask.IStartTask(new F_ExcTask(_plcEnd, EnumOper.取货, ConstSetBA.窑尾装载等待区, _plcEnd.Site)))
                    {
                        _plcEnd.IsLock = true;

                        F_AGV.AgvLock(agv.Id);

                        sendServerLog(agv.Id + "从窑尾装载等待区到窑尾装载点取货");

                        LogFactory.LogDispatch(agv.Id, "到窑尾取货", "从窑尾装载等待区到窑尾装载点取货");
                    }
                }
                else
                {
                    _ToPlcEnd = false;
                }
            }
        }
Exemplo n.º 6
0
        private void TaskEndToExitBattery()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(_plcEnd.Site);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑尾充电点);

            if (agv != null && agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                (ParamControl.IgnoreAgvLoadTask || agv.Sta_Material == EnumSta_Material.货))
            {
                // 判断窑尾可出站标志是否为True
                if (_plcEnd.ExitFlag)
                {
                    // 判断窑尾接货完成的车是否需要充电,且出窑尾充电站没有车、未被锁定
                    if (agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() && agv1 == null && !_plcEnd.IsExitBatteryLock)
                    {
                        F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.充电, ConstSetBA.窑尾装载点, ConstSetBA.出窑尾充电点);

                        F_AGV.AgvLock(agv.Id);

                        task.Id = agv.Id;

                        _plcEnd.IsExitBatteryLock = true;

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

                        sendServerLog(agv.Id + TaskEndToExitBatteryMsg);

                        LogFactory.LogDispatch(agv.Id, "AGV出窑尾充电", TaskEndToExitBatteryMsg);
                    }
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 窑尾等 到 进窑尾充
        /// </summary>
        private void TaskEndToEnterBattery()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑尾装载等待区);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.进窑尾充电点);

            if (agv1 != null)
            {
                ParamControl.Do_EnterEndChargeLock = false;
            }

            // 让未上锁的、电量低于60且未充电的AGV去充电,且接货充电点没有AGV
            if (agv != null && agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() &&
                agv.ChargeStatus == EnumChargeStatus.未充电 &&
                agv1 == null &&
                !_plcEnd.IsEnterBatteryLock && ParamControl.Do_EnterEndChargeLock)
            {
                _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;

                task.Id = agv.Id;

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

                sendServerLog(agv.Id + PlcEndChargeMsg);

                LogFactory.LogDispatch(agv.Id, "充电", PlcEndChargeMsg);
            }
            else
            {
                _PlcEndNeedCharge = false;

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

                    _plcEnd.EnterChargeAgv = agv1.Id;
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 窑尾对接完成点到窑头等待点
        /// </summary>
        private void TaskEndSucToHeadWait()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑尾对接完成点);

            if (agv != null && agv.IsFree && !F_AGV.IsLock(agv.Id))
            {
                F_ExcTask task1 = new F_ExcTask(null, EnumOper.无动作, ConstSetBA.窑尾对接完成点, ConstSetBA.窑头卸载等待区);

                F_AGV.AgvLock(agv.Id);

                task1.Id = agv.Id;

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

                sendServerLog(agv.Id + TaskEndSucToHeadWaitMsg);

                LogFactory.LogDispatch(agv.Id, " ", TaskEndSucToHeadWaitMsg);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 进窑头充 到 窑头卸
        /// </summary>
        public void TaskEnterHeadChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.进窑头充电点);

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

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

                    F_AGV.AgvLock(agv.Id);

                    //去卸货,锁定窑头
                    _plcHead.IsLock             = true;
                    ParamControl.Do_HeadPlcLock = false;

                    task.Id = agv.Id;

                    Thread.Sleep(2000);

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

                    sendServerLog(agv.Id + PlcHeadChargeSucMsg);

                    //LogFactory.LogDispatch(agv.Id, "充电完成", PlcHeadChargeSucMsg);
                    FLog.Log(agv.Id + PlcHeadChargeSucMsg);
                }
            }
            else
            {
                _EnterPlcHeadChargeSuc = false;
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 窑头卸货完成Agv从窑头卸载点到窑尾装载等待区
        /// </summary>
        private void TaskEndToEndWait()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(_plcHead.Site);

            if (agv != null && agv.IsFree && !F_AGV.IsLock(agv.Id)
                //&& agv.Sta_Material == EnumSta_Material.无货
                )
            {
                F_ExcTask task = new F_ExcTask(null, EnumOper.无动作, ConstSetBA.窑头卸载点, ConstSetBA.窑尾装载等待区);

                F_AGV.AgvLock(agv.Id);

                task.Id = agv.Id;

                F_DataCenter.MTask.IStartTask(task);

                sendServerLog(agv.Id + "从窑头卸载点到窑尾装载等待区");

                LogFactory.LogDispatch(agv.Id, "接货", "从窑头卸载点到窑尾装载等待区");
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 进窑尾充 到 窑尾取
        /// </summary>
        public void TaskEnterEndChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.进窑尾充电点);

            // 有未上锁的、充电完成的AGV,且窑尾装载点有货、AGV上无货
            if ((ParamControl.Do_EndPlcLock && !_plcEnd.IsLock) && agv != null && agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                agv.ChargeStatus == EnumChargeStatus.充电完成)
            {
                if (_plcEnd.Sta_Material == EnumSta_Material.货 &&
                    agv.Sta_Material == EnumagvSta_Material.无货
                    )
                {
                    _EnterPlcEndChargeSuc = true;

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

                    F_AGV.AgvLock(agv.Id);

                    //去取货,锁定窑尾
                    _plcEnd.IsLock             = true;
                    ParamControl.Do_EndPlcLock = false;

                    task.Id = agv.Id;

                    Thread.Sleep(2000);

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

                    sendServerLog(agv.Id + PlcEndChargeSucMsg);

                    LogFactory.LogDispatch(agv.Id, "充电完成", PlcEndChargeSucMsg);
                }
            }
            else
            {
                _EnterPlcEndChargeSuc = false;
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 窑头放 到 出窑头充电站
        /// </summary>
        private void TaskHeadToExitBattery()
        {
            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 == EnumagvSta_Material.无货))
            {
                // 判断窑头可出站标志是否为True
                if (_plcHead.ExitFlag)
                {
                    // 判断窑头接货完成的车是否需要充电,且出窑头充电站没有车、未被锁定
                    if (agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() && agv.ChargeStatus == EnumChargeStatus.未充电 &&
                        agv1 == null && (!_plcHead.IsExitBatteryLock && ParamControl.Do_ExitHeadChargeLock))
                    {
                        F_ExcTask task = new F_ExcTask(_plcHead, EnumOper.充电, ConstSetBA.窑头卸载点, ConstSetBA.出窑头充电点);

                        F_AGV.AgvLock(agv.Id);

                        task.Id = agv.Id;

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

                        _plcHead.ExitChargeAgv = agv.Id;

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

                        sendServerLog(agv.Id + TaskHeadToExitBatteryMsg);

                        LogFactory.LogDispatch(agv.Id, "AGV出窑头充电", TaskHeadToExitBatteryMsg);
                    }
                }
            }
        }
Exemplo n.º 13
0
        public void PlcHeadChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.进窑头充电点);

            // 有充电完成的AGV,且窑头卸载点没货
            if (agv != null && agv.IsFree &&
                agv.ChargeStatus == EnumChargeStatus.充电完成 &&
                !F_AGV.IsLock(agv.Id)
                )
            {
                _EnterPlcHeadChargeSuc = 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, agv.Id + PlcHeadChargeSucMsg);

                    sendServerLog(agv.Id + PlcHeadChargeSucMsg);

                    LogFactory.LogDispatch(agv.Id, "充电完成", PlcHeadChargeSucMsg);
                }
            }
            else
            {
                _EnterPlcHeadChargeSuc = false;
            }
        }
Exemplo n.º 14
0
        private void PlcHeadCharge()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑头卸载等待区);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.进窑头充电点);

            // 让电量低于60且未充电的AGV去充电
            if (agv != null && agv.IsFree &&
                agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity() &&
                agv.Electicity <= 80 &&
                !F_AGV.IsLock(agv.Id) &&
                agv.ChargeStatus == EnumChargeStatus.未充电 &&
                agv1 == null &&
                !_plcHead.IsEnterBatteryLock)
            {
                _PlcHeadNeedCharge = true;

                F_ExcTask task = new F_ExcTask(null, EnumOper.充电, ConstSetBA.窑头卸载等待区, ConstSetBA.进窑头充电点);

                F_AGV.AgvLock(agv.Id);

                //task.Id = agv.Id;

                _plcHead.IsEnterBatteryLock = true;

                _plcHead.EnterChargeAgv = agv.Id;

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

                sendServerLog(agv.Id + PlcHeadChargeMsg);

                LogFactory.LogDispatch(agv.Id, "充电", PlcHeadChargeMsg);
            }
            else
            {
                _PlcHeadNeedCharge = false;
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 窑尾到窑尾对接完成点
        /// </summary>
        private void TaskEndToEndSuc()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(_plcEnd.Site);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑尾充电点);

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

                        F_AGV.AgvLock(agv.Id);

                        task1.Id = agv.Id;


                        _plcEnd.ExitFlag = false;


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

                        sendServerLog(agv.Id + TaskEndToEndSucMsg);

                        LogFactory.LogDispatch(agv.Id, "取货完成", TaskEndToEndSucMsg);
                    }
                }
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 出窑尾充 到 窑尾对接完成点
        /// </summary>
        public void TaskExitEndChargeSuc()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑尾充电点);

            // 有未上锁的、充电完成的AGV,且窑尾装载点有货、AGV上无货
            if (agv != null && agv.IsFree &&
                !F_AGV.IsLock(agv.Id) &&
                agv.ChargeStatus == EnumChargeStatus.充电完成)
            {
                if (_plcEnd.ExitFlag &&
                    true)
                {
                    _ExitPlcEndChargeSuc = true;

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

                    F_AGV.AgvLock(agv.Id);

                    _plcEnd.ExitFlag = false;

                    task.Id = agv.Id;

                    Thread.Sleep(2000);

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

                    sendServerLog(agv.Id + ExitPlcEndChargeSucMsg);

                    //LogFactory.LogDispatch(agv.Id, "充电完成", ExitPlcEndChargeSucMsg);
                    FLog.Log(agv.Id + ExitPlcEndChargeSucMsg);
                }
            }
            else
            {
                _ExitPlcEndChargeSuc = false;
            }
        }