| | |
| | | _agvStationService = agvStationService; |
| | | } |
| | | |
| | | public string ziche001 = "RGV104"; |
| | | public string ziche002 = "RGV107"; |
| | | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»»å¡ï¼ææ¶æ¹æ³ifå¤æï¼ |
| | | /// </summary> |
| | | /// <param name="DeviceCode"></param> |
| | | /// <param name="RGVCurrentlocation"></param> |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(string DeviceCode) |
| | | { |
| | | Dt_Task task; |
| | | task = _taskService.QueryStackerCraneTask(DeviceCode); |
| | | if (task != null) |
| | | Dt_Task task = _taskService.QueryStackerCraneTask(DeviceCode); |
| | | if (task == null) return null; |
| | | |
| | | return task.TaskType switch |
| | | { |
| | | //夿å
¥åºä»»å¡ |
| | | if(task.TaskType== (int)TaskInboundTypeEnum.Inbound) |
| | | { |
| | | if(task.TaskState== (int)TaskInStatusEnum.RGV_InNew) |
| | | { |
| | | return task; |
| | | }else if(task.TaskState== (int)TaskInStatusEnum.RGV_InPickupFinish) //åè´§å®æåï¼è¿è¡æ¾è´§çæµç¨ |
| | | { |
| | | //å¤æè¯¥HCJæ¯å¦å¯æ¾è´§ |
| | | bool Currebool = QueryCurrentAdder(task); //夿HCJæ¯å¦å¯ä»¥æ¾è´§ |
| | | if (Currebool) |
| | | { |
| | | return task; |
| | | } |
| | | else { return null; } |
| | | }else if (task.TaskState == (int)TaskInStatusEnum.RGV_InReleaseFinish) //æ¾è´§å®æåï¼è¿è¡å车åè´§æµç¨ |
| | | { |
| | | //é»è®¤å车å¨åè´§çå°æ¹ |
| | | return task; |
| | | } |
| | | else if (task.TaskState == (int)TaskInStatusEnum.RGV_InZicheFinish) //å车åè´§å®æåï¼è¿è¡æ¾è´§æµç¨ |
| | | { |
| | | //è·åéè¦æ¾è´§çç«å° |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); //è·åå°è¿éç«å°æ¾è´§ä¿¡æ¯ |
| | | if (aGVStation.Station_Area == 1) //表示å¨å¤æµ |
| | | { |
| | | bool muchebool=MotherCarMoves(task, aGVStation); |
| | | if (muchebool) |
| | | { |
| | | return task; |
| | | }else { return null; } |
| | | } |
| | | else if(aGVStation.Station_Area == 2) //表示å¨å
ä¾§ |
| | | { |
| | | bool muchebool = MotherCarMovesinside(task, aGVStation); |
| | | if (muchebool) |
| | | { |
| | | return task; |
| | | } |
| | | else { return null; } |
| | | }else if (aGVStation.Station_Area == 3) //æ¾å¨è¿éHCJ |
| | | { |
| | | bool muchebool = HCJMotherCarMovesinside(task, aGVStation); |
| | | if (muchebool) |
| | | { |
| | | return task; |
| | | } |
| | | else { return null; } |
| | | } |
| | | }else if (task.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish) //å车æ¾è´§å®æ |
| | | { |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); |
| | | if(aGVStation.Station_Area == 1) |
| | | { |
| | | return task; |
| | | /*RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(task, "1021"); |
| | | bool sendFlag = SendCommand2(standardCommands, ziche001); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | }*/ |
| | | } |
| | | else if (aGVStation.Station_Area == 2) |
| | | { |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(task, "1021"); //注æï¼ï¼ï¼ï¼è¯¥å车éè¦å¾
å®å»å |
| | | bool sendFlag = SendCommand2(standardCommands, ziche002); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | |
| | | //è¿è¡ç§»å¨å车 |
| | | |
| | | } |
| | | else if(task.TaskState == (int)TaskInStatusEnum.RGV_InZichemoveFinish) //å车移å¨å®æåï¼è¿è¡ |
| | | { |
| | | //è·åéè¦æ¾è´§çç«å° |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); //è·åå
¥åºç«å°ä¿¡æ¯ |
| | | if (aGVStation.Station_Area == 1) //å
¥åºå£åºåç1表示åå
¥åºå®ç1å·å车104 |
| | | { |
| | | //夿å车å¨åªä¸ªä½ç½® |
| | | int zicheadder = GetZichelocation(task, ziche001); |
| | | if(zicheadder!= int.Parse(aGVStation.ZicheMotherinlaw)) |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | else if(aGVStation.Station_Area == 2) //å
¥åºå£åºåç1表示åå
¥åºå®ç1å·å车107 |
| | | { |
| | | int zicheadder = GetZichelocation(task, ziche002); |
| | | if (zicheadder != int.Parse(aGVStation.ZicheMotherinlaw)) |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if(task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | if (task.TaskState == (int)TaskOutStatusEnum.OutNew) |
| | | { |
| | | return task; |
| | | }else if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutMothercarFinish) |
| | | { |
| | | return task; |
| | | } |
| | | else if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutZicheFinish) |
| | | { |
| | | return task; |
| | | }else if(task.TaskState == (int)TaskOutStatusEnum.RGV_OutZicheReleaseFinish) |
| | | { |
| | | return task; |
| | | }else if(task.TaskState == (int)TaskOutStatusEnum.RGV_OutPickupFinish && task.CurrentAddress != "") |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | (int)TaskInboundTypeEnum.Inbound => HandleInboundTask(task), |
| | | (int)TaskOutboundTypeEnum.Outbound => HandleOutboundTask(task), |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | //夿å¤ä¾§æ¯è½¦ä½ç½® |
| | | private bool MotherCarMoves(Dt_Task _Task, AGVStation aGVStation) |
| | | private Dt_Task? HandleInboundTask(Dt_Task task) |
| | | { |
| | | int mcadder = GetMothercarlocation(_Task, aGVStation.Motherinlaw); |
| | | if(mcadder != 0) |
| | | return task.TaskState switch |
| | | { |
| | | if (mcadder == int.Parse(_Task.CurrentAddress)) //夿å车è¦å»çä½ç½®ï¼æ¯è½¦æ¯å¦å¨è¯¥ä½ç½® |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //ä¸åæ¯è½¦ç§»å¨åºæ¥æ¥è´§ä»»å¡ |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(_Task, _Task.CurrentAddress); |
| | | |
| | | bool sendFlag = SendCommand2(standardCommands, aGVStation.ChildPosiDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(_Task); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | (int)TaskInStatusEnum.RGV_InNew => task, |
| | | (int)TaskInStatusEnum.RGV_InPickupFinish => HandlePickupFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InReleaseFinish => task, //éè¦å¤æå车æ¯å
ä¾§åºè¿æ¯å¤ä¾§åè´§ï¼å¾
å®æï¼ |
| | | (int)TaskInStatusEnum.RGV_InZicheFinish => HandleZicheFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheReleaseFinish => HandleZicheReleaseFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZichemoveFinish => HandleZicheMoveFinish(task), |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | //夿å
ä¾§æ¯è½¦ä½ç½® |
| | | private bool MotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | private Dt_Task? HandleOutboundTask(Dt_Task task) |
| | | { |
| | | //è·åå¤ä¾§æ¯è½¦ä½ç½® |
| | | int mcadder = GetMothercarlocation(_Task, aGVStation.MotherCarDeviceCode); |
| | | //è·åå
ä¾§æ¯è½¦ä½ç½® |
| | | int ncadder = GetMothercarlocation(_Task, _Task.CurrentAddress); //ä¼ å
¥è¿éçå°å |
| | | |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder == aGVStation.Station_code) //夿å¤ä¾§æ¯è½¦ä½ç½® |
| | | // åºåºä»»å¡çç¶æå¤æç¸å¯¹ç®åï¼å¯ä»¥ç´æ¥è¿å |
| | | int[] validStates = |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (mcadder == int.Parse(aGVStation.MotherCarDeviceCode)) //å¤ä¾§æ¯è½¦éè¦ç§»å¨ |
| | | { |
| | | //ä¸åæ¯è½¦å¾éé¢èµ°çä»»å¡ |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCarDeviceCode); //å åæºå
¥åºå£ |
| | | (int)TaskOutStatusEnum.OutNew, |
| | | (int)TaskOutStatusEnum.RGV_OutMothercarFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutZicheFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutZicheReleaseFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutPickupFinish |
| | | }; |
| | | |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(_Task, aGVSta.Station_code.ToString()); //ä¸åæ¯è½¦ç§»å¨è³å
¥åºç«å°ä½ |
| | | bool sendFlag = SendCommand2(standardCommands, aGVSta.ChildPosiDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(_Task); |
| | | } |
| | | } |
| | | |
| | | if (ncadder != aGVStation.Station_code) //ä¸åæ¯è½¦ |
| | | { |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(_Task, aGVStation.Station_code.ToString()); |
| | | bool sendFlag = SendCommand2(standardCommands, aGVStation.ChildPosiDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(_Task); |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | private bool HCJMotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) //ä¼ è¿æ¥çç«å°ä¸ºHCJ |
| | | { |
| | | //è·åå¤ä¾§æ¯è½¦ä½ç½® |
| | | int mcadder = GetMothercarlocation(_Task, aGVStation.MotherCarDeviceCode); |
| | | //è·åå
ä¾§æ¯è½¦ä½ç½® |
| | | int ncadder = GetMothercarlocation(_Task, aGVStation.MotherCardeputy); |
| | | |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder != int.Parse(aGVStation.MotherCardeputy)) //夿å¤ä¾§æ¯è½¦ä½ç½® |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (mcadder == int.Parse(aGVStation.MotherCarDeviceCode)) //å¤ä¾§æ¯è½¦éè¦ç§»å¨ |
| | | { |
| | | //ä¸åæ¯è½¦å¾éé¢èµ°çä»»å¡ |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCarDeviceCode); //å åæºå
¥åºå£ |
| | | |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(_Task, aGVSta.Station_code.ToString()); //ä¸åæ¯è½¦ç§»å¨è³å
¥åºç«å°ä½ |
| | | bool sendFlag = SendCommand2(standardCommands, aGVSta.ChildPosiDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(_Task); |
| | | } |
| | | } |
| | | |
| | | if (ncadder == int.Parse(aGVStation.MotherCardeputy)) //ä¸åæ¯è½¦ |
| | | { |
| | | //ä¸åæ¯è½¦å¾éé¢èµ°çä»»å¡ |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCardeputy); //å åæºå
¥åºå£ |
| | | |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(_Task, aGVSta.Station_code.ToString()); //ä¸åæ¯è½¦ç§»å¨è³å
¥åºç«å°ä½ |
| | | bool sendFlag = SendCommand2(standardCommands, aGVSta.ChildPosiDeviceCode); |
| | | if (sendFlag) |
| | | { |
| | | //è®°å½ä¸åè¿æ¯è½¦ç§»å¨ä»»å¡ |
| | | _taskService.UpdateTaskStatusToNext(_Task); |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | return validStates.Contains(task.TaskState) ? task : null; |
| | | } |
| | | |
| | | |
| | | |
| | | public bool QueryCurrentAdder(Dt_Task task) |
| | | #region å
¥åºæ¹æ³ |
| | | private Dt_Task? HandlePickupFinish(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | //è·åéè¦åºåæ¯å¦å»å
¥åºä¸å»ä¸åæ ¼è½½è´§å°ä»»å¡ |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000"); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, task.CurrentAddress, "HCJ_GoodsStatus"); |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, task.NextAddress, "HCJ_GoodsStatus"); |
| | | int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | if (HCJGStatus == 0) //为æ è´§ |
| | | { |
| | | return true; |
| | | return task; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum,$"夿HCJç«å°æ¯å¦æè´§ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿HCJç«å°æ¯å¦æè´§ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private Dt_Task? HandleZicheFinish(Dt_Task task) |
| | | { |
| | | //è·åæ¾è´§å°å |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.NextAddress)); |
| | | |
| | | //å3åºåè¿è¡æ¾è´§ |
| | | return aGVStation.Station_Area switch |
| | | { |
| | | 1 => CheckMotherCarMove(task, aGVStation, MotherCarMoves), //å¤ä¾§æ¾è´§ |
| | | 2 => CheckMotherCarMove(task, aGVStation, MotherCarMovesinside), //å
ä¾§æ¾è´§ |
| | | 3 => CheckMotherCarMove(task, aGVStation, HCJMotherCarMovesinside), //交æ¥ç¹æ¾è´§ |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | private Dt_Task? CheckMotherCarMove(Dt_Task task, AGVStation station, Func<Dt_Task, AGVStation, bool> moveFunc) |
| | | { |
| | | return moveFunc(task, station) ? task : null; |
| | | } |
| | | |
| | | private Dt_Task? HandleZicheReleaseFinish(Dt_Task task) |
| | | { |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); //å½åå°åï¼æ¯è½¦ä¸ï¼ä¸ä¸ä¸ªå°åå åæºåè´§å£ |
| | | if (aGVStation.Station_Area == 1 && aGVStation.Station_Area == 2) |
| | | { |
| | | return task; //è¿åå车移å¨ä»»å¡ |
| | | } |
| | | else if (aGVStation.Station_Area == 3) //å½åå°å为HCJç«å°ï¼ä¸AGVä»»å¡ä¸ºåè´§ |
| | | { |
| | | return task; //å»åè´§ï¼éè¦å¤æå车å½åä½åï¼ï¼åç»ä¼åï¼ |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private Dt_Task? HandleZicheMoveFinish(Dt_Task task) |
| | | { |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); |
| | | int zicheAddress = GetZichelocation(task, task.CurrentAddress); |
| | | |
| | | //妿åè½¦å¨æ¯è½¦ä¸ï¼åéè¦ç§»åºæ¯è½¦ï¼å¾
ä¼åï¼ |
| | | return zicheAddress != int.Parse(aGVStation.ZicheMotherinlaw) ? task : null; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | //åºåä¸å¤ææ¯è½¦æ¯å¦å°ä½ï¼å¯ç«å³æ¾è´§ |
| | | private bool MotherCarMoves(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | int mcadder = GetMothercarlocation(_Task.TaskNum, aGVStation.Motherinlaw); //è·åå°æ¯è½¦å¤ä¾§ä½ç½® |
| | | if(mcadder != 0) |
| | | { |
| | | if (mcadder == int.Parse(_Task.CurrentAddress)) |
| | | { |
| | | return true; |
| | | } |
| | | RGVMovetask(_Task.CurrentAddress, aGVStation.ChildPosiDeviceCode,_Task.TaskId); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åæ¯è½¦ç§»å¨ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="RGVAdders">ç®æ å°å</param> |
| | | /// <param name="ChildPosiDeviceCode">设å¤ç¼å·</param> |
| | | /// <returns></returns> |
| | | private bool RGVMovetask(string RGVAdders,string ChildPosiDeviceCode,int taskid) |
| | | { |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(RGVAdders); |
| | | bool sendFlag = SendCommand2(standardCommands, ChildPosiDeviceCode); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskid, $"ç³»ç»èªå¨æµç¨ï¼æ§è¡æ¯è½¦ç§»å¨ä»»å¡ï¼æ¯è½¦ç¼å·ï¼{ChildPosiDeviceCode}ï¼ç§»å¨å°åï¼{RGVAdders}ï¼æ¯å¦ä¸åæåï¼{sendFlag}"); |
| | | |
| | | return sendFlag; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿å
ä¾§æ¯è½¦ä½ç½® |
| | | /// </summary> |
| | | /// <param name="_Task"></param> |
| | | /// <param name="aGVStation"></param> |
| | | /// <returns></returns> |
| | | private bool MotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | //è·åå¤ä¾§æ¯è½¦ä½ç½® |
| | | int mcadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCarDeviceCode); |
| | | //è·åå
ä¾§æ¯è½¦ä½ç½® |
| | | int ncadder = GetMothercarlocation(_Task.TaskNum, _Task.NextAddress); |
| | | |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder == aGVStation.Station_code) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (mcadder == int.Parse(aGVStation.MotherCarDeviceCode)) |
| | | { |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCarDeviceCode); |
| | | |
| | | RGVMovetask(aGVSta.ChildPosiDeviceCode, aGVSta.Station_code.ToString(), _Task.TaskId); |
| | | |
| | | } |
| | | |
| | | if (ncadder != aGVStation.Station_code) |
| | | { |
| | | RGVMovetask(aGVStation.ChildPosiDeviceCode, aGVStation.Station_code.ToString(), _Task.TaskId); |
| | | |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | private bool HCJMotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | //è·åå¤ä¾§æ¯è½¦ä½ç½® |
| | | int mcadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCarDeviceCode); |
| | | //è·åå
ä¾§æ¯è½¦ä½ç½® |
| | | int ncadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCardeputy); |
| | | |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder != int.Parse(aGVStation.MotherCardeputy)) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (mcadder == int.Parse(aGVStation.MotherCarDeviceCode)) |
| | | { |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCarDeviceCode); |
| | | |
| | | RGVMovetask(aGVSta.ChildPosiDeviceCode, aGVSta.Station_code.ToString(), _Task.TaskId); |
| | | |
| | | } |
| | | |
| | | if (ncadder == int.Parse(aGVStation.MotherCardeputy)) |
| | | { |
| | | AGVStation aGVSta = _agvStationService.GetMothercarCode(aGVStation.MotherCardeputy); |
| | | |
| | | RGVMovetask(aGVSta.ChildPosiDeviceCode, aGVSta.Station_code.ToString(), _Task.TaskId); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | //夿æ¯å¦ |
| | | public bool GetMotherCarCurrentAdder(Dt_Task task) |
| | |
| | | /// <param name="task"></param> |
| | | /// <param name="MotherCarDeviceCode">è¿éå°å</param> |
| | | /// <returns></returns> |
| | | public int GetMothercarlocation(Dt_Task task,string MotherCarDeviceCode) |
| | | public int GetMothercarlocation(int TaskNum, string MotherCarDeviceCode) |
| | | { |
| | | try |
| | | { |
| | | //å©ç¨å
¥åºç«å°å°åè·åæ¯è½¦plc |
| | | AGVStation aGVStation =_agvStationService.GetMothercarCode(MotherCarDeviceCode); |
| | | AGVStation aGVStation =_agvStationService.GetMothercarCode(MotherCarDeviceCode); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == aGVStation.ChildPosiDeviceCode); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, aGVStation.ChildPosiDeviceCode, "RGVCurrentlocation"); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿æ¯è½¦ä½ç½®ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | _taskService.UpdateTaskExceptionMessage(TaskNum, $"夿æ¯è½¦ä½ç½®ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | |
| | | public RgvCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | RgvCraneTaskCommand stackerCraneTaskCommand = new RgvCraneTaskCommand(); |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = short.Parse(task.CurrentAddress); |
| | | stackerCraneTaskCommand.RGV_RGVtasktype = 2; |
| | | stackerCraneTaskCommand.RGV_Rgvtaskid = 1; //rgvä»»å¡å· |
| | | stackerCraneTaskCommand.RGV_Lanjiantaskid = 0; //å
°åä»»å¡id |
| | | short locaticurr = task.RGVTaskType switch |
| | | { |
| | | _ when task.RGVTaskType == (short)RGVTaskTypeEnum.PickingUp || |
| | | task.RGVTaskType == (short)RGVTaskTypeEnum.TravelingOnly |
| | | => short.Parse(task.CurrentAddress), |
| | | _ when task.RGVTaskType == (short)RGVTaskTypeEnum.Placing |
| | | => short.Parse(task.NextAddress), |
| | | _ => (short)0 |
| | | }; |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = locaticurr; |
| | | stackerCraneTaskCommand.RGV_RGVtasktype = (short)task.RGVTaskType; |
| | | stackerCraneTaskCommand.RGV_Rgvtaskid = (short)task.TaskNum; |
| | | stackerCraneTaskCommand.RGV_Lanjiantaskid = (short)task.TaskNum; |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | |
| | |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public RgvCraneTaskCommand? ConvertMotherCarTaskCommand([NotNull] Dt_Task task,string CurrentAddress) |
| | | public RgvCraneTaskCommand? ConvertMotherCarTaskCommand(string RGVAddress) |
| | | { |
| | | RgvCraneTaskCommand stackerCraneTaskCommand = new RgvCraneTaskCommand(); |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = short.Parse(CurrentAddress); |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = short.Parse(RGVAddress); |
| | | stackerCraneTaskCommand.RGV_RGVtasktype = 3; |
| | | stackerCraneTaskCommand.RGV_Rgvtaskid = 999; //rgvä»»å¡å· |
| | | stackerCraneTaskCommand.RGV_Lanjiantaskid = 999; //å
°åä»»å¡id |