示例#1
0
 /// <summary>
 /// 停止摆渡车送货
 /// </summary>
 /// <param name="area"></param>
 /// <param name="tt"></param>
 /// <param name="goodsNum"></param>
 public bool IsStopGiving(string area, TaskTypeEnum tt)
 {
     try
     {
         bool res = false;
         if (devices.Exists(c => c.area == area && c.taskType == tt))
         {
             DevInfoARF arf = devices.Find(c => c.area == area && c.taskType == tt);
             if (arf._.GoodsStatus == GoodsEnum.辊台无货)
             {
                 if (arf._.ActionStatus == ActionEnum.停止 && arf._.FinishTask == TaskEnum.停止辊台任务)
                 {
                     if (!arf.isLock)
                     {
                         res = true;
                     }
                     else
                     {
                         // 送完货直接解锁
                         arf.IsLockUnlock(false);
                     }
                 }
                 else
                 {
                     arf.StopRoller();
                 }
             }
         }
         return(res);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        /// <summary>
        /// 是否有锁定摆渡车
        /// </summary>
        /// <returns></returns>
        public bool IsLockARF(string area, TaskTypeEnum tt, out int goods)
        {
            try
            {
                ChangeFlag(area);

                bool res = false;
                goods = 0;
                if (devices.Exists(c => c.isUseful && c.area == area && c.taskType == tt))
                {
                    DevInfoARF a = devices.Find(c => c.isUseful && c.area == area && c.taskType == tt);

                    if (ADS.mSocket.IsConnected(a.devName) &&
                        a._.CommandStatus != CommandEnum.命令错误 && a._.DeviceStatus != DeviceEnum.设备故障)
                    {
                        if (a._.CurrentTask == TaskEnum.辊台任务 && a._.FinishTask == TaskEnum.辊台任务)
                        {
                            a.StopRoller();
                        }
                        switch (a._.GoodsStatus)
                        {
                        case GoodsEnum.辊台1有货:
                        case GoodsEnum.辊台2有货:
                        case GoodsEnum.辊台中间有货:
                            goods = 1;
                            break;

                        case GoodsEnum.辊台满货:
                            goods = 2;
                            break;

                        default:
                            break;
                        }

                        if (a.isLock)
                        {
                            if (a._.GoodsStatus == GoodsEnum.辊台无货 && a._.RollerStatus == RollerStatusEnum.辊台停止)
                            {
                                // 停止&解锁
                                a.StopTask();
                                a.IsLockUnlock(false);
                            }
                            else
                            {
                                res = true;
                            }
                        }
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        /// <summary>
        /// 锁定摆渡车
        /// </summary>
        /// <param name="area"></param>
        /// <param name="tt"></param>
        /// <returns></returns>
        public bool IsLock(string area, TaskTypeEnum tt, string lockid)
        {
            try
            {
                bool res = false;
                if (devices.Exists(c => c.area == area && c.taskType == tt && c.isUseful))
                {
                    DevInfoARF a = devices.Find(c => c.area == area && c.taskType == tt && c.isUseful);
                    switch (tt)
                    {
                    case TaskTypeEnum.入库:
                        if (a.isLock && a.lockID == lockid)
                        {
                            res = true;
                        }
                        else if (a._.GoodsStatus == GoodsEnum.辊台无货)
                        {
                            a.IsLockUnlock(true, lockid);
                        }
                        break;

                    case TaskTypeEnum.出库:
                        if (a.isLock && a.lockID == lockid)
                        {
                            res = true;
                        }
                        else if (a._.GoodsStatus != GoodsEnum.辊台无货)
                        {
                            a.IsLockUnlock(true, lockid);
                        }
                        break;

                    default:
                        break;
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
        /// <summary>
        /// 是否有空闲摆渡车
        /// </summary>
        /// <returns></returns>
        public bool IsFreeARF(string area, TaskTypeEnum tt)
        {
            try
            {
                ChangeFlag(area);

                bool res = false;
                if (devices.Exists(c => c.area == area && c.taskType == tt && c.isUseful))
                {
                    DevInfoARF a = devices.Find(c => c.area == area && c.taskType == tt && c.isUseful);

                    if (ADS.mSocket.IsConnected(a.devName) &&
                        a._.CommandStatus != CommandEnum.命令错误 && a._.DeviceStatus != DeviceEnum.设备故障)
                    {
                        if (a._.CurrentTask == TaskEnum.辊台任务 && a._.FinishTask == TaskEnum.辊台任务)
                        {
                            a.StopRoller();
                        }
                        if (a.isLock)
                        {
                            if (a._.GoodsStatus == GoodsEnum.辊台无货 && a._.ActionStatus == ActionEnum.停止)
                            {
                                // 停止&解锁
                                a.StopTask();
                                a.IsLockUnlock(false);
                                res = true;
                            }
                        }
                        else
                        {
                            res = true;
                        }
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
        /// <summary>
        /// 锁定摆渡车
        /// </summary>
        /// <returns></returns>
        public bool LockARF(string area, TaskTypeEnum tt)
        {
            try
            {
                ChangeFlag(area);

                bool res = false;
                if (devices.Exists(c => c.isUseful && c.area == area && c.taskType == tt))
                {
                    DevInfoARF a = devices.Find(c => c.isUseful && c.area == area && c.taskType == tt);
                    if (ADS.mSocket.IsConnected(a.devName) &&
                        a._.CommandStatus == CommandEnum.命令正常 && a._.DeviceStatus == DeviceEnum.设备正常)
                    {
                        if (a._.CurrentTask == TaskEnum.辊台任务 && a._.FinishTask == TaskEnum.辊台任务)
                        {
                            a.StopRoller();
                        }
                        if (a._.GoodsStatus == GoodsEnum.辊台无货)
                        {
                            if (a._.ActionStatus == ActionEnum.停止)
                            {
                                res = true;
                            }
                        }
                        else
                        {
                            if (a.isLock)
                            {
                                res = true;
                            }
                            else
                            {
                                bool run = false;
                                switch (tt)
                                {
                                case TaskTypeEnum.入库:
                                    if ((a._.GoodsStatus == GoodsEnum.辊台满货 && a._.RollerStatus == RollerStatusEnum.辊台停止) ||
                                        (a._.GoodsStatus == GoodsEnum.辊台1有货 &&
                                         a._.RollerStatus != RollerStatusEnum.辊台1启动 && a._.RollerStatus != RollerStatusEnum.辊台全启动))
                                    {
                                        run = true;
                                    }
                                    break;

                                case TaskTypeEnum.出库:
                                    if ((a._.GoodsStatus == GoodsEnum.辊台满货 && a._.RollerStatus == RollerStatusEnum.辊台停止) ||
                                        (a._.GoodsStatus == GoodsEnum.辊台2有货 &&
                                         a._.RollerStatus != RollerStatusEnum.辊台2启动 && a._.RollerStatus != RollerStatusEnum.辊台全启动))
                                    {
                                        run = true;
                                    }
                                    break;

                                default:
                                    break;
                                }
                                if (run)
                                {
                                    // 停止 & 锁定
                                    a.StopTask();
                                    a.IsLockUnlock(true);
                                    res = true;
                                }
                                else
                                {
                                    if (a._.ActionStatus == ActionEnum.停止)
                                    {
                                        a.StartTakeRoll(tt, 2);
                                    }
                                }
                            }
                        }
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }