AC_BOX_Bean_Shelf.cs 4.2 KB
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnlineStore.DeviceLibrary
{
    /// <summary>
    /// 料架新增的出入库逻辑
    /// </summary>
    partial class AC_BOX_Bean
    {

        /// <summary>
        /// 开始入库移动移动
        /// </summary> 
        public void StartShelfInStore()
        {

            if (storeRunStatus == StoreRunStatus.Runing)
            {
                if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
                {
                    LogInfo(" 空闲中,检测到入料口有信号,料架入库:入料口移门打开,");
                    storeRunStatus = StoreRunStatus.Busy;
                    storeStatus = StoreStatus.InStoreExecute;
                    MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
                    MoveInfo.NextMoveStep(StoreMoveStep.SI_S02_DoorOpen);
                    CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);

                }
            }
        }
        private void ShelfInStoreProcess()
        {
            if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S01_LineIn_Check))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S02_DoorOpen);
                InStoreLog("SI_S02_DoorOpen:料架入库:入料口移门打开");
                CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S02_DoorOpen))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S03_LineRun);
                InStoreLog("SI_S03_LineRun:料架入库:线体正转,等待取料位检测到信号");
                IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
                IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);

                MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.LOW));
                MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineTake_Check, IO_VALUE.HIGH));
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S03_LineRun))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S04_LineStop);
                InStoreLog("SI_S04_LineStop:料架入库:取料位检测到信号,停止线体正转");
                IOMove(IO_Type.Line_Run, IO_VALUE.LOW);

            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S04_LineStop))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S05_DoorClose);
                InStoreLog("SI_S05_DoorClose:料架入库:入料口移门关闭");
                CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S05_DoorClose))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S06_LocationUp);
                InStoreLog("SI_S06_LocationUp:料架入库:定位装置上升");
                CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S06_LocationUp))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S07_TopCylinderUp);
                InStoreLog("SI_S07_TopCylinderUp:料架入库:顶升装置上升");
                CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S07_TopCylinderUp))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_S08_StartGetTray);
                InStoreLog("SI_S07_TopCylinderUp:料架入库:开始循环从第一个空位逐个取料盘,扫码入库");
                CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
            }
            else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SI_S08_StartGetTray))
            {

            }
            else
            {

                LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
            }

        }

    }
}