Beispiel #1
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;
            }
        }
Beispiel #2
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;
                }
            }
        }
Beispiel #3
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;
            }
        }
Beispiel #4
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;
            }
        }
Beispiel #5
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);
                    }
                }
            }
        }
Beispiel #6
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;
                }
            }
        }
Beispiel #7
0
        /// <summary>
        /// 窑尾等 到 窑尾取
        /// </summary>
        private void TaskPlcEndGet()
        {
            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.窑尾装载点);

            F_AGV d_agv3 = F_DataCenter.MDev.IGetAliveDevOnSite(ConstSetBA.进窑尾充电点);


            ///窑尾有货 窑尾等待点的AGV没有锁定 并且 此次任务没有被响应
            if (//(ParamControl.Do_EndPlcLock && !_plcEnd.IsLock) &&
                (d_agv == null
                 //&& d_agv2 == null
                ) &&
                agv != null && agv.IsFree &&
                (agv.Electicity > F_DataCenter.MDev.IGetDevElectricity() || (agv.Electicity > ParamControl.MinElectricityCharge) || //高于最低充电量的车不能去充电
                 (!ParamControl.Do_EnterEndCharge || _plcEnd.IsEnterBatteryLock && _plcEnd.EnterChargeAgv != agv.Id))
                //&& _plcEnd.IsLock == false
                && (d_agv3 == null || (d_agv3 != null && d_agv3.ChargeStatus != EnumChargeStatus.充电完成))
                )
            {
                //窑尾等待区的车不需要充电、没有充电完成的车 、没有初始化时要去窑尾装载点的车
                if (//!_PlcEndNeedCharge && !_EnterPlcEndChargeSuc && !_ToPlcEnd
                    true)
                {
                    ///派发一个从窑尾装载等待区到窑尾装载点取货的任务
                    F_ExcTask task = new F_ExcTask(_plcEnd, EnumOper.取货, ConstSetBA.窑尾装载等待区, _plcEnd.Site);

                    task.Id = agv.Id;

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

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

                    ParamControl.Do_EndPlcLock = false;

                    F_AGV.AgvLock(agv.Id);

                    sendServerLog(agv.Id + TaskPlcEndGetMsg);

                    //LogFactory.LogDispatch(agv.Id, "到窑尾取货", TaskPlcEndGetMsg);
                    FLog.Log(agv.Id + TaskPlcEndGetMsg);
                }
                else
                {
                    //_ToPlcEnd = false;
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// 窑头去窑头对接完成点
        /// </summary>
        private void TaskHeadToHeadSuc()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(_plcHead.Site);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑头充电点);

            //查找是否存在目标站点是窑头对接完成点的AGV
            F_AGV d_agv = F_DataCenter.MDev.IGetDevOnDestination(ConstSetBA.窑头对接完成点);

            if (agv1 != null)
            {
                ParamControl.Do_ExitHeadChargeLock = false;
            }
            if (agv != null &&
                agv.IsFree
                //&&! F_AGV.IsLock(agv.Id)
                && (ParamControl.IgnoreAgvUnloadTask || agv.Sta_Material == EnumagvSta_Material.无货)
                )
            {
                // 判断是否存在目标站点是对接完成点的车
                if (//_plcHead.ExitFlag
                    d_agv == null
                    )
                {
                    // 如果需要充电但是充电桩有车、被锁,或者不需要充电直接去到对接完成点
                    if (//(agv.Electicity <= F_DataCenter.MDev.IGetDevElectricity()
                        //&& agv1 != null
                        //&& (//_plcHead.IsExitBatteryLock &&
                        // !ParamControl.Do_ExitHeadChargeLock))
                        //|| agv.Electicity > F_DataCenter.MDev.IGetDevElectricity()
                        true
                        )
                    {
                        // 从窑头到窑头对接完成点
                        F_ExcTask task1 = new F_ExcTask(null, 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);
                    }
                }
            }
        }
Beispiel #9
0
        /// <summary>
        /// 进窑尾充 到 窑尾取
        /// </summary>
        public void TaskEnterEndChargeSuc()
        {
            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.窑尾装载点);

            // 有未上锁的、充电完成的AGV,且窑尾装载点有货、AGV上无货
            if (//(ParamControl.Do_EndPlcLock && !_plcEnd.IsLock)&&
                //(d_agv == null && d_agv2 == null)
                agv != null && agv.IsFree
                //&& !F_AGV.IsLock(agv.Id)
                && agv.ChargeStatus == EnumChargeStatus.充电完成
                //&& _plcEnd.IsLock == false
                )
            {
                if (//_plcEnd.Sta_Material == EnumSta_Material.有货 &&
                    //agv.Sta_Material == EnumagvSta_Material.无货
                    true
                    )
                {
                    _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(5000);

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

                    sendServerLog(agv.Id + PlcEndChargeSucMsg);

                    //LogFactory.LogDispatch(agv.Id, "充电完成", PlcEndChargeSucMsg);
                    FLog.Log(agv.Id + PlcEndChargeSucMsg);
                }
            }
            else
            {
                _EnterPlcEndChargeSuc = false;
            }
        }
Beispiel #10
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;
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// 窑头等 到 窑头卸
        /// </summary>
        private void TaskPlcHeadPut()
        {
            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.窑头卸载点);


            ///窑头无货 窑头AGV未锁定 并且 此次任务没有被响应
            if (//ParamControl.Do_HeadPlcLock &&
                (d_agv == null && d_agv2 == null) &&// !_plcHead.IsLock
                agv != null && agv.IsFree
                //&& !F_AGV.IsLock(agv.Id)
                //&& agv.Electicity > F_DataCenter.MDev.IGetDevElectricity()
                //&& (//ParamControl.IgnoreHeadUnloadTask ||
                //_plcHead.Sta_Material == EnumSta_Material.允许下料
                //|| _plcHead.Sta_Material == EnumSta_Material.未知                )
                )
            {
                //窑头等待区的车不需要充电、没有充电完成的车、没有回卸载点的车
                if (true
                    //!_EnterPlcHeadChargeSuc && !_ToPlcHead
                    )
                {
                    ///派发一个从窑头卸载等待区到窑头卸载点的任务

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

                    task.Id = agv.Id;

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

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

                    ParamControl.Do_HeadPlcLock = false;

                    F_AGV.AgvLock(agv.Id);

                    sendServerLog(agv.Id + TaskPlcHeadPutMsg);

                    LogFactory.LogDispatch(agv.Id, "卸货", TaskPlcHeadPutMsg);
                }
                else
                {
                    // _ToPlcHead = false;
                }
            }
        }
Beispiel #12
0
        /// <summary>
        /// 窑尾等 到 窑尾取
        /// </summary>
        private void TaskPlcEndGet()
        {
            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.窑尾装载点);

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

                    task.Id = agv.Id;

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

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

                    ParamControl.Do_EndPlcLock = false;

                    F_AGV.AgvLock(agv.Id);

                    sendServerLog(agv.Id + TaskPlcEndGetMsg);

                    LogFactory.LogDispatch(agv.Id, "到窑尾取货", TaskPlcEndGetMsg);
                }
                else
                {
                    //_ToPlcEnd = false;
                }
            }
        }
Beispiel #13
0
        /// <summary>
        /// 窑尾到窑尾对接完成点
        /// </summary>
        private void TaskEndToEndSuc()
        {
            F_AGV agv  = F_DataCenter.MDev.IGetDevOnSite(_plcEnd.Site);
            F_AGV agv1 = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.出窑尾充电点);


            F_AGV d_agv = F_DataCenter.MDev.IGetDevOnDestination(ConstSetBA.窑尾对接完成点);

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

                        F_AGV.AgvLock(agv.Id);

                        task.Id = agv.Id;

                        _plcEnd.ExitFlag = false;

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

                        sendServerLog(agv.Id + TaskEndToEndSucMsg);

                        //LogFactory.LogDispatch(agv.Id, "取货完成", TaskEndToEndSucMsg);
                        FLog.Log(agv.Id + TaskEndToEndSucMsg);
                    }
                }
            }
        }
Beispiel #14
0
        /// <summary>
        /// 窑尾对接完成点到窑头等待点
        /// </summary>
        private void TaskEndSucToHeadWait()
        {
            F_AGV agv = F_DataCenter.MDev.IGetDevOnSite(ConstSetBA.窑尾对接完成点);

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

                F_AGV.AgvLock(agv.Id);

                task.Id = agv.Id;

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

                sendServerLog(agv.Id + TaskEndSucToHeadWaitMsg);

                LogFactory.LogDispatch(agv.Id, " ", TaskEndSucToHeadWaitMsg);
            }
        }
Beispiel #15
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;
            }
        }
Beispiel #16
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, "接货", "从窑头卸载点到窑尾装载等待区");
            }
        }
Beispiel #17
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;
            }
        }
Beispiel #18
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);
                    }
                }
            }
        }
Beispiel #19
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;
            }
        }
Beispiel #20
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;
            }
        }
Beispiel #21
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;
            }
        }
Beispiel #22
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);
                    }
                }
            }
        }
Beispiel #23
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);
                    }
                }
            }
        }
Beispiel #24
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;
            }
        }