internal override void _NoticeRedirect(NDCItem i) { NoticeRedirect?.Invoke(i); }
/// <summary> /// 检查任务进程 /// </summary> /// <param name="index"></param> /// <param name="magic"></param> private void CheckMagic(NDCItem item, Message_s s) { int index = item._mTask.ORDERINDEX; switch (item.Magic) { case 2: //确定生成任务 item._mTask.NDCLOADSITE = item.s.Magic2 + ""; item._mTask.NDCUNLOADSITE = item.s.Magic3 + ""; break; case 4: //小车到达接货点 if (item.DirectStatus != NDCItemStatus.HasDirectInfo) { item.DirectStatus = NDCItemStatus.CanRedirect; } if (!ReDirectList.Contains(item._mTask.ORDERINDEX)) { ReDirectList.Add(item._mTask.ORDERINDEX); } //TODO 告诉WCS 车已经到达 //准备好装货了 item.PLCStatus = NDCPlcStatus.LoadReady; break; case 6: //小车接货完成 if (item.DirectStatus == NDCItemStatus.CanRedirect || item.DirectStatus == NDCItemStatus.Init) { if (item.HadDirectInfo) { item.DirectStatus = NDCItemStatus.HasDirectInfo; } else { item.DirectStatus = NDCItemStatus.NeedRedirect; } } if (!ReDirectList.Contains(item._mTask.ORDERINDEX)) { ReDirectList.Add(item._mTask.ORDERINDEX); } //装货完成 item.PLCStatus = NDCPlcStatus.Loaded; item._mTask.HADLOAD = true; if (item.DirectStatus == NDCItemStatus.NeedRedirect) { NoticeRedirect?.Invoke(item); } break; case 254: //重新定位成功 item.DirectStatus = NDCItemStatus.Redirected; ReDirectList.Remove(item._mTask.ORDERINDEX); break; case 8: //到达卸货点 //准备好卸货了 item.PLCStatus = NDCPlcStatus.UnloadReady; break; case 10: //卸货完成 //卸货完成 item.PLCStatus = NDCPlcStatus.Unloaded; item._mTask.HADUNLOAD = true; break; case 11: //任务完成 item.IsFinish = true; item.finishTime = DateTime.Now; break; default: break; } GetTempInfo(item); }