PutShelfJob.cs 1.6 KB
using DeviceLib.Model.AGV;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeviceLib.BLL
{
    internal class PutShelfJob : ImpJob
    {
        public PutShelfJob(JobParam jobParam) : base(jobParam)
        {
        }
        public override Job Run(Robot robot)
        {
            Job job = this;
            switch (JobRunStep.CurStep)
            {
                case RunStep.None:
                    ToNextStep(RunStep.PutAction_01_ReadyToPut, "开始放下料架");
                    PutDown(robot);
                    break;
                case RunStep.PutAction_01_ReadyToPut:
                    if (JobRunStep.IsTimeOut(60))
                    {
                        ToNextStep(RunStep.PutAction_02_PutTimeout, "放下料架超时");
                    }
                    else if (MissionIsOk())
                    {
                        ToNextStep(RunStep.PutAction_03_PutSuccess, "放下料架完成");
                    }
                    break;
                case RunStep.PutAction_02_PutTimeout:
                    if (MissionIsOk())
                    {
                        ToNextStep(RunStep.PutAction_03_PutSuccess, "结束放下料架");
                    }
                    break;

                case RunStep.PutAction_03_PutSuccess:
                    job = new DeliverShelfJob(JobParam);
                    job.ToNextStep(RunStep.DeliveryShelf_15_ActionSuccess, "放下料架完成");
                    break;
            }
            return job;
        }
    }
}