SteelLiftToStorageJob.cs 25.5 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
using Common;
using DeviceLibrary.manager;
using DeviceLibrary.service.model;
using System.Windows.Forms;

namespace DeviceLibrary.bean.job
{
    /// <summary>
    /// 钢网,电梯到立库
    /// </summary>
    public class SteelLiftToStorageJob : Job
    {
        /// <summary>
        /// 钢网,电梯到立库
        /// </summary>
        public SteelLiftToStorageJob(JobParam jobParam) : base(jobParam)
        {
        }
        public SteelLiftToStorageJob() : base()
        {

        }
        lift.LiftStatus liftStatus;
        public override Job Run(AgvInfo agv)
        {
            Job job = this;
            agv.SetJobContext(new bean.agv.JobContext()
            {
                MissionId = JobParam.GetMissionInfo().missionId,
                AgvTask = agv.TaskRunState.Task,
                JobFullName = this.ToString(),
                JobStep = JobRunStep.PreStep(),
                Name = agv.Name,
                JobParam = JobParam
            });
            if (JobRunStep.IsStep(RunStep.NONE))
            {
                JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_01_ToLift);
                runInfo = $"任务开始:去{JobParam.SrcNode.AliceName}";
                JobRunStep.Msg = runInfo;
                AllocateTask(agv, JobParam.SrcNode.Name);
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_01_ToLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_02_WaitLiftDoorOpen);
                    //上报运输状态
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.SrcNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"到达{JobParam.SrcNode.Name}"));

                    runInfo = $"到达{JobParam.SrcNode.AliceName},等待门开启";
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_02_WaitLiftDoorOpen))
            {
                if (lift.LiftContext.IsDoorOpen(JobParam.SrcNode.Name, JobParam.GetMissionInfo().destinationFloor, agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_03_EnterLift);
                    SetLiftOccupied(JobParam.SrcNode.Name, agv);
                    runInfo = $"{JobParam.SrcNode.AliceName}门已开启,进电梯取料点";
                    AllocateTask(agv, $"{JobParam.SrcNode.Name}_{SettingString.PutShelfOn}");
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.电梯到达, out string msg);
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_03_EnterLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_04_PutShelfOn);
                    runInfo = $"到达{JobParam.SrcNode.AliceName}取料点,准备拾取料车";
                    JobRunStep.Msg = runInfo;
                    PutLiftShelfOn(agv, JobParam.SrcNode.Name);
                    //AllocateTask(agv, $"{SettingString.PutShelfOn}_{JobParam.SrcNode.Name}");
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_04_PutShelfOn))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_05_LeaveLift);
                    //上报运输状态
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.SrcNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"电梯取车"));

                    runInfo = $"在{JobParam.SrcNode.AliceName}拾取料车完成,准备离开";
                    JobRunStep.Msg = runInfo;
                    AllocateTask(agv, $"{SettingString.Leave}_{JobParam.SrcNode.Name}");
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_05_LeaveLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_06_CloseLiftDoor);
                    //关门
                    bool rtn = lift.LiftContext.AGVLeave(JobParam.SrcNode.Name, agv, false);
                    runInfo = $"离开{JobParam.SrcNode.AliceName},关闭门:{rtn}";
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.离开电梯, out string msg);
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_06_CloseLiftDoor))
            {
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_13_ToLiku);
                    runInfo = $"关闭{JobParam.SrcNode.AliceName}门完成,去{JobParam.CurTargetNode.AliceName}的放料点";
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.送料, out string msg);
                    AllocateTask(agv, $"{GetTargetName(JobParam.CurTargetNode)}_{SettingString.TakeShelfOff}");
                    JobRunStep.Msg = runInfo;
                }

            }
            #region 未使用
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_07_ToLine))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    //确认按钮生效
                    JobParam.CurTargetNode.ExtendEquip.AllowConfirm();

                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_08_UpdateLocation);
                    runInfo = $"到达{JobParam.CurTargetNode.AliceName}";
                    JobRunStep.Msg = runInfo;
                    //上报位置
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"到达{JobParam.CurTargetNode.Name}"));
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_08_UpdateLocation))
            {
                if (NeedConfirm())
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_09_WaitConfirm);
                    runInfo = $"等待{JobParam.CurTargetNode.AliceName}的人员确认";
                    JobRunStep.Msg = runInfo;
                    PlaySound(agv);
                }
                else
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_10_CheckNextLine);
                    runInfo = $"{JobParam.CurTargetNode.AliceName}无需人员确认";
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_09_WaitConfirm))
            {
                if (OpManager.WaitConfirm.Line(JobParam.CurTargetNode))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_10_CheckNextLine);
                    runInfo = $"{JobParam.CurTargetNode.AliceName}的人员确认完成";
                    JobRunStep.Msg = runInfo;
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                    service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.agvButton,
                    $"卸货{JobParam.CurTargetNode.Name}"));
                    //重置确认信息
                    JobParam.CurTargetNode.ExtendEquip.Reset();
                    StopSound(agv);
                }
                else if (JobRunStep.IsTimeOut(WaitTimeOut, out double timeoutval))
                {
                    //报警,$"等待{JobParam.CurTargetNode.AliceName}的人员确认超时{timeoutval}分"
                   // manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                   //service.model.TransportStatus.TypeStr.error, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.agvButton,
                   // $"等待{JobParam.CurTargetNode.Name}确认超时{timeoutval.ToString("f2")}分"), true);
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_10_CheckNextLine))
            {
                if (JobParam.TargetNodes != null && JobParam.TargetNodes.Count > 0)
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_07_ToLine);
                    JobParam.CurTargetNode = JobParam.TargetNodes[0];
                    JobParam.TargetNodes.RemoveAt(0);
                    System.Threading.Thread.Sleep(1000);
                    runInfo = $"去下一线体{JobParam.CurTargetNode.AliceName}的放料点";
                    JobRunStep.Msg = runInfo;
                    AllocateTask(agv, $"{GetTargetName(JobParam.CurTargetNode)}_{SettingString.TakeShelfOff}");
                }
                else
                {

                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_11_ToShelfPlace);
                    runInfo = $"{JobParam.CurTargetNode.AliceName}是最后一个线体,分发结束,去{JobParam.SteelShelfNode.AliceName}的放料点";
                    AllocateTask(agv, $"{GetTargetName(JobParam.SteelShelfNode)}_{SettingString.TakeShelfOff}");
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_11_ToShelfPlace))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_12_TakeShelfOff);
                    runInfo = $"到达{JobParam.SteelShelfNode.AliceName},准备卸车";
                    //上报位置
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"到达{JobParam.SteelShelfNode.Name}"));
                    AllocateTask(agv, SettingString.TakeShelfOff);
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_12_TakeShelfOff))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.END);
                    runInfo = $"在{JobParam.CurTargetNode.AliceName}卸下料车完成";
                    JobRunStep.Msg = runInfo;
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.完成, out string msg);
                    //上报状态
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"卸车"));
                }

            }
            #endregion

            #region 钢网入库
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_13_ToLiku))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_14_Dock);
                    runInfo = $"到达{JobParam.CurTargetNode.AliceName}的放料点";//,开始停靠
                                                                          //AllocateTask(agv, $"{SettingString.Docking}");
                    DataBufferManager.SteelAgvInStorage = true;
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_14_Dock))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_15_CheckState);
                    runInfo = "等待立库停靠完成信号";
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_15_CheckState))
            {
                if (manager.DataBufferManager.DockingOk)
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_16_TakeOff);
                    runInfo = $"在{JobParam.CurTargetNode.AliceName}停靠完成";//,卸下料架
                                                                         //AllocateTask(agv, $"{SettingString.TakeShelfOff}");
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_16_TakeOff))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    manager.DataBufferManager.DetachShelf = true;
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_17_WaitShelfLeave);
                    runInfo = $"在{JobParam.CurTargetNode.AliceName}等待立库发送离开信号";//卸下料架,
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_17_WaitShelfLeave))
            {
                if (DataBufferManager.LeaveLiku)
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_18_PutOn);
                    runInfo = $"收到立库{JobParam.CurTargetNode.AliceName}发送的允许离开信号";//,拾取料架
                                                                                 // PutShelfOn(agv);
                    JobRunStep.Msg = runInfo;
                }
                else if (JobRunStep.IsTimeOut(60))
                {
                    //上报运输状态
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.error, agv.Name, JobParam.CurTargetNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"等待立库离开信号超时"));
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_18_PutOn))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_19_BackToLift);
                    MissionManager.ChangeSteelSrcNodes(JobParam.GetMissionInfo().missionId, "storage");
                    if (!string.IsNullOrEmpty(DataBufferManager.SteelTarget))
                    {
                        runInfo = $"收到钢网出库点:{DataBufferManager.SteelTarget}";
                        MissionManager.ChangeSteelTarNodes(JobParam.GetMissionInfo().missionId, DataBufferManager.SteelTarget);
                    }
                    else
                    {
                        runInfo = $"未收到钢网出库点";

                        MissionManager.ChangeSteelTarNodes(JobParam.GetMissionInfo().missionId, JobParam.GetMissionInfo().sourcePoint);
                    }
                    DataBufferManager.ResetSteelInfo();
                    if (TargetIsOccupied(agv, JobParam.SrcNode.Name))
                    {
                        JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_19_ToStandby);
                        runInfo += $",{JobParam.SrcNode.AliceName}有车,去停留点";
                        AllocateTask(agv, $"{SettingString.Standby}");
                    }
                    else
                    {
                        runInfo += $",返回{JobParam.SrcNode.AliceName}";
                        MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.返回电梯, out string msg);
                        JobParam.SetMissionInfo(MissionManager.GetMission(JobParam.GetMissionInfo().missionId));
                        AllocateTask(agv, JobParam.SrcNode.Name);
                    }
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_19_BackToLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {

                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_20_Request);
                    runInfo = $"到达{JobParam.SrcNode.AliceName},请求使用电梯并等待电梯门开";
                    JobRunStep.Msg = runInfo;
                    //上报位置
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.SrcNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"到达{JobParam.SrcNode.Name}"));
                    //请求电梯
                    lift.LiftContext.Request(JobParam.GetMissionInfo(), agv);
                    System.Threading.Thread.Sleep(1000);


                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_19_ToStandby))
            {
                if (TargetIsOccupied(agv, JobParam.SrcNode.Name))
                {
                }
                else
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_19_BackToLift);
                    runInfo = $"料车需返回,电梯口无料车,去电梯口";
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.返回电梯, out string msg);
                    AllocateTask(agv, JobParam.SrcNode.Name);
                    JobRunStep.Msg = runInfo;
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_20_Request))
            {
                JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_21_WaitDoorOpen);
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_21_WaitDoorOpen))
            {
                if (lift.LiftContext.IsDoorOpen(JobParam.SrcNode.Name, JobParam.GetMissionInfo().sourceFloor, agv))
                {
                    ChargePileManager.StopCharge(agv);
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_22_CheckLiftStatus);
                    runInfo = $"{JobParam.SrcNode.AliceName}门已开,检查电梯内该层是否有料车";
                    JobRunStep.Msg = runInfo;
                    //上报位置
                    System.Threading.Thread.Sleep(1000);
                }
                else if (JobRunStep.IsTimeOut(20) && !lift.LiftContext.CheckIfRequestOk(JobParam.SrcNode.Name, JobParam.GetMissionInfo()))
                {
                    if (agv?.Battery <= 10 && !agv.IsInCharge)
                    {
                        if (ChargePileManager.HasEmpty(agv, out ChargePile charge))
                        {
                            ChargePileManager.StartCharge(agv, charge.Name);
                            AllocateTask(agv, charge);
                            return job;
                        }
                    }
                    else if (agv.Battery > 50 && agv.IsInCharge&&HasMultiAgvs(agv))
                    {
                        ChargePileManager.StopCharge(agv);
                        ToStandby(agv); return job;
                    }
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_21_WaitDoorOpen);
                    //请求电梯
                    lift.LiftContext.Request(JobParam.GetMissionInfo(), agv);
                    //上报运输状态
                    //manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                    //    service.model.TransportStatus.TypeStr.error, agv.Name, JobParam.SrcNode.Name, service.model.TransportStatus.ModeStr.auto,
                    //    $"等待电梯到达超时"));
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_22_CheckLiftStatus))
            {
                if (lift.LiftContext.IsDoorOpen(JobParam.SrcNode.Name, JobParam.GetMissionInfo().sourceFloor, agv))
                {
                    ChargePileManager.StopCharge(agv);
                    if (lift.LiftContext.HasShelfNeedLeave(JobParam.SrcNode.Name, agv.Client, out liftStatus))
                    {
                        MissionInfo missionInfo = MissionManager.GetMission(JobParam.LiftStatus?.missionId ?? "");
                        if (missionInfo != null)
                        {
                            MissionManager.SetMissionOccupied(missionInfo, agv);
                            job = new SwitchShelfJob(JobParam);
                        }
                    }
                    else
                    {
                        JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_24_01_EnterLift);
                        lift.LiftContext.SetLiftNodeOccupied(agv, JobParam.SrcNode.Name);
                        runInfo = $"{JobParam.SrcNode.AliceName}无料车,去放料点";
                        JobRunStep.Msg = runInfo;
                        AllocateTask(agv, $"{JobParam.SrcNode.Name}_{SettingString.TakeShelfOff}");
                    }
                }
            }
            #region 电梯内无料车
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_24_01_EnterLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_24_02_TakeShelfOffAtLift);
                    runInfo = $"到达{JobParam.SrcNode.AliceName}放料点,准备卸下料车";
                    JobRunStep.Msg = runInfo;
                    AllocateTask(agv, $"{SettingString.TakeShelfOff}_{JobParam.SrcNode.Name}");
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_24_02_TakeShelfOffAtLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_24_03_LeaveLift);
                    runInfo = $"在{JobParam.SrcNode.AliceName}卸下料车完成,准备离开";
                    JobRunStep.Msg = runInfo;
                    ResetMissionOccupiedAgv(JobParam.GetMissionInfo());
                    AllocateTask(agv, $"{SettingString.Leave}_{JobParam.SrcNode.Name}");
                    //上报位置
                    manager.UploadManager.UploadTransportStatus(new service.model.TransportStatus(agv.CurJob.JobParam.GetMissionInfo().missionId,
                        service.model.TransportStatus.TypeStr.status, agv.Name, JobParam.SrcNode.Name, service.model.TransportStatus.ModeStr.auto,
                        $"电梯卸车"));
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.返回到达电梯内, out string msg);
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_24_03_LeaveLift))
            {
                if (agv.TaskRunState.CheckTaskFinished(agv))
                {
                    JobRunStep.ToNextStep(RunStep.Steel_LiftToLine_24_04_CloseLiftDoor);
                    bool rtn = lift.LiftContext.AGVLeave(JobParam.SrcNode.Name, agv);
                    runInfo = $"离开{JobParam.SrcNode.AliceName},关门: {rtn}";
                    JobRunStep.Msg = runInfo;
                    System.Threading.Thread.Sleep(1000);
                }
            }
            else if (JobRunStep.IsStep(RunStep.Steel_LiftToLine_24_04_CloseLiftDoor))
            {
                if (!lift.LiftContext.IsDoorOpen(JobParam.SrcNode.Name, JobParam.GetMissionInfo().sourceFloor, agv))
                {
                    JobRunStep.ToNextStep(RunStep.END);
                    //任务状态变更
                    MissionManager.SetMissionState(JobParam.GetMissionInfo().missionId, service.model.MissionState.返回电梯运行, out string msg);
                    runInfo = $"{JobName}结束:{JobParam.SrcNode.AliceName}已关门";
                    JobRunStep.Msg = runInfo;
                }
                else if (JobRunStep.IsTimeOut(0.5, out _))
                {
                    lift.LiftContext.AGVLeave(JobParam.SrcNode.Name, agv);
                    System.Threading.Thread.Sleep(1000);
                }
            }
            #endregion

            #endregion
            else if (JobRunStep.IsStep(RunStep.END))
            {
                JobRunStep.EndJob();
                return null;
            }
            return job;
        }
    }
}