| | |
| | | { |
| | | throw new Exception($"{task.NextAddress}AGVç«å°æªå®ä¹"); |
| | | } |
| | | if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt()) |
| | | if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.EmptyStackPlate.ObjToInt()) |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Finish); |
| | | PutFinish(oldAddress, task.TaskNum); |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.WFBYLInbound.ObjToInt()) |
| | | else if (task.TaskType == TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.WFBYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.WFBLMYLInbound.ObjToInt()) |
| | | { |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | } |
| | |
| | | MESResponse response = _taskService.MESAvgArriveNotice(requestAGVArriveDTO).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!response.Result) |
| | | { |
| | | throw new Exception($"è°ç¨MESå°è½¦å
许æ¾è´§æ¥é,MESè¿åä¿¡æ¯"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match => { |
| | | throw new Exception($"è°ç¨MESå°è½¦å
许æ¾è´§æ¥é,MESè¿åä¿¡æ¯"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match =>{ |
| | | return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString(); |
| | | })); |
| | | } |
| | |
| | | return content.Error("ç¦æ¢æ¾æ"); |
| | | } |
| | | } |
| | | else if (device.DeviceCode.Contains("TrussCarton"))//æ¡æ¶ |
| | | else if (device.DeviceCode.Contains("TrussDixieCup"))//æ¡æ¶ |
| | | { |
| | | bool RequestPut = otherDevice.GetValue<W_TrussCartonDB, bool>(GetCartonRequest(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (!RequestPut) |
| | | { |
| | | otherDevice.SetValue(GetCartonRequest(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | Thread.Sleep(1000); |
| | | } |
| | | bool AllowFinish = otherDevice.GetValue<R_TrussCartonDB, bool>(GetCarton(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (AllowFinish) |
| | | { |
| | | content.OK("å
è®¸æ¾æ"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ç¦æ¢æ¾æ"); |
| | | } |
| | | |
| | | bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (!RequestPut) |
| | | { |
| | | otherDevice.SetValue(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | Thread.Sleep(1000); |
| | | } |
| | | bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupPutOut(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (AllowFinish) |
| | | { |
| | | content.OK("å
è®¸æ¾æ"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ç¦æ¢æ¾æ"); |
| | | } |
| | | } |
| | | } |
| | | return content; |
| | |
| | | { |
| | | otherDevice.SetValue(RetractDB.Ret_PutFinish, true, stationManger.StationDeviceCode); |
| | | } |
| | | else if (device.DeviceCode.Contains("TrussCarton"))//çº¸ç®±æ¡æ¶ |
| | | else if (device.DeviceCode.Contains("TrussDixieCup"))//çº¸æ¯æ¡æ¶ |
| | | { |
| | | otherDevice.SetValue(GetCartonPut(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | otherDevice.SetValue(GetTrussDixieCupPuted(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | |
| | | /// <summary> |
| | | /// è·åæ¡æ¶æ¾æä¿¡å· |
| | | /// </summary> |
| | | private W_TrussCartonDB GetCartonPut(string StationCode) |
| | | private W_TrussDixieCupDB GetTrussDixieCupPuted(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return W_TrussCartonDB.W_CartonPut1; |
| | | return W_TrussDixieCupDB.W_DixieCupPuted1; |
| | | case "2": |
| | | return W_TrussCartonDB.W_CartonPut2; |
| | | return W_TrussDixieCupDB.W_DixieCupPuted2; |
| | | case "3": |
| | | return W_TrussCartonDB.W_CartonPut3; |
| | | return W_TrussDixieCupDB.W_DixieCupPuted3; |
| | | case "4": |
| | | return W_TrussCartonDB.W_CartonPut4; |
| | | case "5": |
| | | return W_TrussCartonDB.W_CartonPut5; |
| | | case "6": |
| | | return W_TrussCartonDB.W_CartonPut6; |
| | | return W_TrussDixieCupDB.W_DixieCupPuted4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·åæ¡æ¶è¯·æ±ä¿¡å· |
| | | /// è·åæ¡æ¶åææä¿¡å· |
| | | /// </summary> |
| | | private W_TrussCartonDB GetCartonRequest(string StationCode) |
| | | private W_TrussDixieCupDB GetTrussDixieCupTaked(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return W_TrussCartonDB.W_CartonRequest1; |
| | | return W_TrussDixieCupDB.W_DixieCupTaked1; |
| | | case "2": |
| | | return W_TrussCartonDB.W_CartonRequest2; |
| | | return W_TrussDixieCupDB.W_DixieCupTaked2; |
| | | case "3": |
| | | return W_TrussCartonDB.W_CartonRequest3; |
| | | return W_TrussDixieCupDB.W_DixieCupTaked3; |
| | | case "4": |
| | | return W_TrussCartonDB.W_CartonRequest4; |
| | | case "5": |
| | | return W_TrussCartonDB.W_CartonRequest5; |
| | | case "6": |
| | | return W_TrussCartonDB.W_CartonRequest6; |
| | | return W_TrussDixieCupDB.W_DixieCupTaked4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·åæ¡æ¶è¯·æ±è¿ä¿¡å· |
| | | /// </summary> |
| | | private W_TrussDixieCupDB GetTrussDixieCupOutReq(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return W_TrussDixieCupDB.W_DixieCupReqPut1; |
| | | case "2": |
| | | return W_TrussDixieCupDB.W_DixieCupReqPut2; |
| | | case "3": |
| | | return W_TrussDixieCupDB.W_DixieCupReqPut3; |
| | | case "4": |
| | | return W_TrussDixieCupDB.W_DixieCupReqPut4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·åæ¡æ¶è¯·æ±è¿ä¿¡å· |
| | | /// </summary> |
| | | private W_TrussDixieCupDB GetTrussDixieCupInReq(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return W_TrussDixieCupDB.W_DixieCupReqTake1; |
| | | case "2": |
| | | return W_TrussDixieCupDB.W_DixieCupReqTake2; |
| | | case "3": |
| | | return W_TrussDixieCupDB.W_DixieCupReqTake3; |
| | | case "4": |
| | | return W_TrussDixieCupDB.W_DixieCupReqTake4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | |
| | | /// <summary> |
| | | /// è·åæ¡æ¶è¿å
¥ä¿¡å· |
| | | /// </summary> |
| | | private R_TrussCartonDB GetCarton(string StationCode) |
| | | private R_TrussDixieCupDB GetDixieCupPutOut(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return R_TrussCartonDB.R_CartonAllow1; |
| | | return R_TrussDixieCupDB.R_DixieCupPutOut1; |
| | | case "2": |
| | | return R_TrussCartonDB.R_CartonAllow2; |
| | | return R_TrussDixieCupDB.R_DixieCupPutOut2; |
| | | case "3": |
| | | return R_TrussCartonDB.R_CartonAllow3; |
| | | return R_TrussDixieCupDB.R_DixieCupPutOut3; |
| | | case "4": |
| | | return R_TrussCartonDB.R_CartonAllow4; |
| | | case "5": |
| | | return R_TrussCartonDB.R_CartonAllow5; |
| | | case "6": |
| | | return R_TrussCartonDB.R_CartonAllow6; |
| | | return R_TrussDixieCupDB.R_DixieCupPutOut4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·åæ¡æ¶è¿å
¥ä¿¡å· |
| | | /// </summary> |
| | | private R_TrussDixieCupDB GetDixieCupTakeIn(string StationCode) |
| | | { |
| | | switch (StationCode) |
| | | { |
| | | case "1": |
| | | return R_TrussDixieCupDB.R_DixieCupTakeIn1; |
| | | case "2": |
| | | return R_TrussDixieCupDB.R_DixieCupTakeIn2; |
| | | case "3": |
| | | return R_TrussDixieCupDB.R_DixieCupTakeIn3; |
| | | case "4": |
| | | return R_TrussDixieCupDB.R_DixieCupTakeIn4; |
| | | default: |
| | | throw new Exception("æªå®ä¹å·¥ä½"); |
| | | } |
| | |
| | | return content.Error("ç¦æ¢åæ"); |
| | | } |
| | | } |
| | | else if (device.DeviceCode.Contains("TrussDixieCup")) |
| | | { |
| | | bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (!RequestPut) |
| | | { |
| | | otherDevice.SetValue(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | Thread.Sleep(1000); |
| | | } |
| | | bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupTakeIn(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (AllowFinish) |
| | | { |
| | | content.OK("å
许åæ"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ç¦æ¢åæ"); |
| | | } |
| | | } |
| | | } |
| | | return content; |
| | | } |
| | |
| | | { |
| | | otherDevice.SetValue(RetractDB.Ret_TakeFinish, true, stationManger.StationDeviceCode); |
| | | } |
| | | else if (device.DeviceCode.Contains("TrussDixieCup"))//çº¸æ¯æ¡æ¶ |
| | | { |
| | | otherDevice.SetValue(GetTrussDixieCupTaked(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | } |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |