| | |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | //ä¸åRGVä»»å¡ä¹åï¼å
读åä¸ä¸å®å
¨é¨ç¶æ |
| | | |
| | | //æ¥æ¾RGVè¿è¡ä¸åä»»å¡ |
| | | Dt_Task task = GetTask(speStackerCrane.DeviceCode); |
| | | Dt_Task task = GetTask(speStackerCrane.DeviceCode,getStackerObject); |
| | | if (task != null) |
| | | { |
| | | //è°ååå
¥RGVå°è½¦ä»»å¡ |
| | |
| | | } |
| | | else |
| | | { |
| | | int HCJGoodsplatform = 1170; //å®ä¹çæ¾è´§ç«å° |
| | | |
| | | //夿æ¯è½¦æ¯å¦éè¦è¿è¡ç§»å¨ |
| | | AGVStation GdZiche = _agvStationService.Corridorequipment(speStackerCrane.DeviceCode); |
| | | if(GdZiche.Station_Area == 1) |
| | | if(speStackerCrane.DeviceCode=="RGV101" || speStackerCrane.DeviceCode == "RGV101") |
| | | { |
| | | switch (getStackerObject.RGVCurrentlocation) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == GdZiche.MotherCarDeviceCode: //å¨ç¬¬ä¸ä¸ªæ¯è½¦ä¸ |
| | | RGVMovetask(HCJGoodsplatform, GdZiche.ChildPosiDeviceCode); |
| | | break; |
| | | case int Waddress when Waddress == GdZiche.MotherCardeputy: //å¨ç¬¬äºä¸ªæ¯è½¦ä¸ |
| | | OutNMotherCar(GdZiche.MotherCarDeviceCode); |
| | | break; |
| | | case int HCJaddress when HCJaddress == GdZiche.HCJStorageaddress: //å¨HCJç«å°ä¸ |
| | | OutHCJMotherCar(GdZiche); |
| | | break; |
| | | default: return null; |
| | | } |
| | | //彿²¡ä»»å¡çæ¶åï¼åè¿è¡ç§»å¨ |
| | | Returnposition(speStackerCrane.DeviceCode, getStackerObject.RGVCurrentlocation); |
| | | } |
| | | else |
| | | { |
| | | switch (getStackerObject.RGVCurrentlocation) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == GdZiche.MotherCarDeviceCode: //å¨ç¬¬ä¸ä¸ªæ¯è½¦ä¸ï¼éè¦å¤æå¤ä¾§å车æ¯å¦å¨HCJä¸ |
| | | OutinnerSideNMotherCar(GdZiche); |
| | | break; |
| | | case int Waddress when Waddress == GdZiche.MotherCardeputy: //å¨ç¬¬äºä¸ªæ¯è½¦ä¸ï¼éè¦å¤æå车ä¸å¤ä¾§æ¯è½¦æ¯å¦å¨è¿éä¸ |
| | | OutNMotherCar(GdZiche.MotherCarDeviceCode); |
| | | break; |
| | | default: return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private Dt_Task? GetTask(string DeviceCode) |
| | | private Dt_Task? GetTask(string DeviceCode, GetStackerObject getStackerObject) |
| | | { |
| | | Dt_Task task = _taskService.QueryStackerCraneTask(DeviceCode); |
| | | if (task == null) return null; |
| | | |
| | | return task.TaskType switch |
| | | // æ ¹æ®è®¾å¤åç§°ï¼è·åå°è®¾å¤ç¸å
³æ°æ® |
| | | AGVStation RGVTaskdevice = _agvStationService.Corridorequipment(DeviceCode); //æ ¹æ®è®¾å¤è·åå°å
容 |
| | | return RGVTaskdevice.Station_tasktype switch |
| | | { |
| | | (int)TaskInboundTypeEnum.Inbound => HandleInboundTask(task), |
| | | (int)TaskOutboundTypeEnum.Outbound => HandleOutboundTask(task), |
| | | (int)RGVTasktype.Inbound => HandleInboundTask(RGVTaskdevice, getStackerObject), |
| | | (int)RGVTasktype.Outbound => OutboundEquipmentTask(RGVTaskdevice, getStackerObject), |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | private Dt_Task? HandleInboundTask(Dt_Task task) |
| | | { |
| | | return task.TaskState switch |
| | | { |
| | | (int)TaskInStatusEnum.RGV_InNew => task, |
| | | (int)TaskInStatusEnum.RGV_InPickupFinish => HandlePickupFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InReleaseFinish => HandInneRouterSides(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheFinish => HandleZicheFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheReleaseFinish => task, |
| | | (int)TaskInStatusEnum.RGV_InZichemoveFinish => HandleZicheMoveFinish(task), |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | private Dt_Task? HandleOutboundTask(Dt_Task task) |
| | | { |
| | | // åºåºä»»å¡çç¶æå¤æç¸å¯¹ç®åï¼å¯ä»¥ç´æ¥è¿å |
| | | int[] validStates = |
| | | { |
| | | (int)TaskOutStatusEnum.OutNew, |
| | | (int)TaskOutStatusEnum.RGV_OutMothercarFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutZicheFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutZicheReleaseFinish, |
| | | (int)TaskOutStatusEnum.RGV_OutPickupFinish |
| | | }; |
| | | |
| | | return validStates.Contains(task.TaskState) ? task : null; |
| | | } |
| | | |
| | | #region å
¥åºæ¹æ³ |
| | | |
| | | #region å
¥åºå£åè´§å®æåï¼è¿è¡æ¾è´§ï¼HCJ,å¼å¸¸åºåºå£ï¼ |
| | | private Dt_Task? HandlePickupFinish(Dt_Task task) |
| | | private Dt_Task? HandleInboundTask(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | try |
| | | if(RGVTaskdevice.Station_material== (int)RGVEquipment.InRGVForklift && getStackerObject.RgvCraneStatusValue== RgvEquipmentStatus.NoCargo) |
| | | { |
| | | //è·åéè¦åºåæ¯å¦å»å
¥åºä¸å»ä¸åæ ¼è½½è´§å°ä»»å¡ |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000"); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | DeviceProDTO? deviceProDTO = GetDeviceAddress.GetDeviceProDTO(Commonstacker, task.NextAddress, "HCJ_GoodsStatus"); |
| | | int HCJGStatus = GetDeviceAddress.GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | if (HCJGStatus == 0) //为æ è´§ |
| | | { |
| | | return task; |
| | | } |
| | | return _taskService.GetInkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode, 1); |
| | | } |
| | | catch (Exception ex) |
| | | else if (RGVTaskdevice.Station_material == (int)RGVEquipment.InRGVForklift && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.HasCargo) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿HCJç«å°æ¯å¦æè´§ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | return _taskService.GetInkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode, 2); |
| | | }else if (RGVTaskdevice.Station_material == (int)RGVEquipment.Corridorcar && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.NoCargo) |
| | | { |
| | | return ZichePickUpAisle(RGVTaskdevice, getStackerObject); |
| | | }else if (RGVTaskdevice.Station_material == (int)RGVEquipment.Corridorcar && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.HasCargo) |
| | | { |
| | | return GoodsPlacedCorridor(RGVTaskdevice, getStackerObject); |
| | | } |
| | | else if (RGVTaskdevice.Station_material == (int)RGVEquipment.Corridorcar && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.NoCargo) |
| | | { |
| | | return ZicheMobile(RGVTaskdevice, getStackerObject); |
| | | } |
| | | else if (RGVTaskdevice.Station_material == (int)RGVEquipment.Mothertrailer && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.HasCargo) |
| | | { |
| | | return MotherVehicleMovement(RGVTaskdevice); |
| | | } |
| | | else { return null; } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å
¥åºå£æ¾è´§å®æåï¼è¿è¡åè´§å
容 |
| | | private Dt_Task? HandInneRouterSides(Dt_Task task) |
| | | #region è¿éå车è¿è¡åè´§ |
| | | public Dt_Task? ZichePickUpAisle(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | // æ ¹æ®è®¾å¤åç§°ï¼è·åå°è®¾å¤ç¸å
³æ°æ® |
| | | AGVStation currentStation = _agvStationService.Corridorequipment(task.Roadway); |
| | | |
| | | // è·åå车ä½ç½® |
| | | int zicheAddress = GetDeviceAddress.GetEquipmentlocation(currentStation.ChildPosiDeviceCode); |
| | | if (currentStation.Station_Area == 1) |
| | | //è·åå车åè´§ä»»å¡ |
| | | Dt_Task dt_Task = _taskService.GetInzicheTask(RGVTaskdevice.ChildPosiDeviceCode,1); |
| | | if(dt_Task.CurrentAddress== getStackerObject.RGVCurrentlocation.ToString()) |
| | | { |
| | | // æ ¹æ®å车ä½ç½®å¤çä¸åæ
åµ |
| | | switch (zicheAddress) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == int.Parse(task.CurrentAddress): |
| | | return task; |
| | | case int Waddress when Waddress == currentStation.MotherCarDeviceCode: |
| | | return task; |
| | | case int Naddress when Naddress == currentStation.MotherCardeputy: |
| | | return HandleMedialCase(task, currentStation.MotherCarDeviceCode); |
| | | case int HCJaddress when HCJaddress == currentStation.HCJStorageaddress: |
| | | return HandleMedialCase2(task, currentStation); |
| | | default: return null; |
| | | } |
| | | return dt_Task; |
| | | } |
| | | else |
| | | { |
| | | //åHCJä½çæå¤æ |
| | | switch (zicheAddress) |
| | | //妿ä¸çäºï¼åè¿è¡å¤æå车å¨åªä¸ªä½ç½® |
| | | if (RGVTaskdevice.Station_Area == 1) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == int.Parse(task.CurrentAddress): |
| | | return task; |
| | | case int Waddress when Waddress == currentStation.MotherCarDeviceCode: |
| | | return task; |
| | | case int Naddress when Naddress == currentStation.MotherCardeputy: |
| | | return HandleMedialCase(task, currentStation.MotherCarDeviceCode); |
| | | default: return null; |
| | | // æ ¹æ®å车ä½ç½®å¤çä¸åæ
åµ |
| | | switch (getStackerObject.RGVCurrentlocation) |
| | | { |
| | | case int Waddress when Waddress == RGVTaskdevice.MotherCarDeviceCode: |
| | | return dt_Task; |
| | | case int Naddress when Naddress == RGVTaskdevice.MotherCardeputy: |
| | | return HandleMedialCase(dt_Task, RGVTaskdevice.MotherCarDeviceCode); |
| | | case int HCJaddress when HCJaddress == RGVTaskdevice.HCJStorageaddress: |
| | | return HandleMedialCase2(dt_Task, RGVTaskdevice); |
| | | default: return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //åHCJä½çæå¤æ |
| | | switch (getStackerObject.RGVCurrentlocation) |
| | | { |
| | | case int Waddress when Waddress == RGVTaskdevice.MotherCarDeviceCode: |
| | | return dt_Task; |
| | | case int Naddress when Naddress == RGVTaskdevice.MotherCardeputy: |
| | | return HandleMedialCase(dt_Task, RGVTaskdevice.MotherCarDeviceCode); |
| | | default: return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 夿å¤ä¾§æ¯è½¦æ¯å¦å¨å
¥å£å£ |
| | | /// </summary> |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region åè´§å®æåï¼è¿è¡æ¾è´§æä½ |
| | | private Dt_Task? HandleZicheFinish(Dt_Task task) |
| | | #region è¿éå车è¿è¡æ¾è´§ |
| | | public Dt_Task? GoodsPlacedCorridor(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | // æ ¹æ®è®¾å¤åç§°ï¼è·åå°è®¾å¤ç¸å
³æ°æ® |
| | | AGVStation GdaoRgvStation = _agvStationService.Corridorequipment(task.Roadway); |
| | | Dt_Task task = _taskService.GetInzicheTask(RGVTaskdevice.ChildPosiDeviceCode, 2); |
| | | int nexaddres = int.Parse(task.NextAddress); |
| | | switch (nexaddres) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == GdaoRgvStation.MotherCarDeviceCode: //æ¾è´§ç¹å¨ç¬¬ä¸ä¸ªè¿éç¹ |
| | | return MotherCarMoves(task, GdaoRgvStation); |
| | | case int Waddress when Waddress == GdaoRgvStation.MotherCardeputy: //æ¾è´§ç¹å¨ç¬¬äºä¸ªè¿éç¹ |
| | | return MotherCarMovesinside(task, GdaoRgvStation); |
| | | case int HCJaddress when HCJaddress == GdaoRgvStation.HCJStorageaddress: //æ¾è´§ç¹å¨HCJä¸ |
| | | return HCJMotherCarMovesinside(task, GdaoRgvStation); |
| | | case int Whcjaddress when Whcjaddress == RGVTaskdevice.MotherCarDeviceCode: //æ¾è´§ç¹å¨ç¬¬ä¸ä¸ªè¿éç¹ |
| | | return MotherCarMoves(task, RGVTaskdevice); |
| | | case int Waddress when Waddress == RGVTaskdevice.MotherCardeputy: //æ¾è´§ç¹å¨ç¬¬äºä¸ªè¿éç¹ |
| | | return MotherCarMovesinside(task, RGVTaskdevice); |
| | | case int HCJaddress when HCJaddress == RGVTaskdevice.HCJStorageaddress: //æ¾è´§ç¹å¨HCJä¸ |
| | | return HCJMotherCarMovesinside(task, RGVTaskdevice); |
| | | default: return null; |
| | | } |
| | | } |
| | |
| | | private Dt_Task? MotherCarMoves(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.ZicheMotherinlaw); |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | if (motherCarAddress == Muche.ZicheMotherinlaw) return _Task; |
| | | RGVMovetask(Muche.ZicheMotherinlaw, aGVStation.ChildPosiDeviceCode); |
| | | if(motherCarAddress!=0) RGVMovetask(Muche.ZicheMotherinlaw, aGVStation.ChildPosiDeviceCode); |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy); //å
ä¾§æ¯è½¦ |
| | | |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode); |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(Muche2.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | if (motherCarAddress != Muche.Motherinlaw && motherCarAddress != 0) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.ZicheMotherinlaw) |
| | | if (motherCarAddress2 != Muche2.ZicheMotherinlaw && motherCarAddress2 != 0) |
| | | { |
| | | RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | |
| | | // æ¯è½¦å·²å¨æ£ç¡®ä½ç½® |
| | | return null; |
| | | } |
| | | /// <summary> |
| | | /// 夿æ¾å¨HCJä¸é¢ |
| | | /// </summary> |
| | | /// <param name="_Task"></param> |
| | | /// <param name="aGVStation"></param> |
| | | /// <returns></returns> |
| | | private Dt_Task? HCJMotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy); //å
ä¾§æ¯è½¦ |
| | | |
| | | AGVStation Ziche3 = _agvStationService.GetZicheDeep(aGVStation.HCJStorageaddress); //å
ä¾§å车 |
| | | |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode); |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentlocation(Ziche3.ChildPosiDeviceCode); |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(Muche2.ChildPosiDeviceCode); |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentInMuche(Ziche3.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | if (motherCarAddress != Muche.Motherinlaw && motherCarAddress != 0) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.Motherinlaw) |
| | | if (motherCarAddress2 != Muche2.Motherinlaw && motherCarAddress2 != 0) |
| | | { |
| | | RGVMovetask(Muche2.Motherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | | if(ZiCarAddress3== Ziche3.HCJStorageaddress) |
| | | if (ZiCarAddress3 == Ziche3.HCJStorageaddress && ZiCarAddress3!=0) |
| | | { |
| | | //å¤æç®æ ç«å°æ¯å
¥åºå°å å·å åæº |
| | | if (_Task.TargetAddress == "3") //å
¥åºè³3å·å åæº |
| | | { |
| | | //夿å¤ä¾§æ¯è½¦ä½ç½®ï¼2åºåï¼ |
| | | AGVStation MucheN = _agvStationService.GetMothervehicle(Ziche3.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | int motNCarAddress = GetDeviceAddress.GetEquipmentlocation(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if(MucheN.ZicheMotherinlaw== motNCarAddress) |
| | | int motNCarAddress = GetDeviceAddress.GetEquipmentInMuche(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (motNCarAddress!=0) |
| | | { |
| | | RGVMovetask(Ziche3.MotherCarDeviceCode, Ziche3.ChildPosiDeviceCode); |
| | | } |
| | | else |
| | | { |
| | | RGVMovetask(MucheN.ZicheMotherinlaw, MucheN.ChildPosiDeviceCode); |
| | | if (MucheN.ZicheMotherinlaw == motNCarAddress) |
| | | { |
| | | RGVMovetask(Ziche3.MotherCarDeviceCode, Ziche3.ChildPosiDeviceCode); |
| | | } |
| | | else |
| | | { |
| | | RGVMovetask(MucheN.ZicheMotherinlaw, MucheN.ChildPosiDeviceCode); |
| | | } |
| | | } |
| | | } |
| | | else if (_Task.TargetAddress == "4") //å
¥åºè³4å·å åæº |
| | | { |
| | | //夿å¤ä¾§æ¯è½¦ä½ç½®ï¼2åºåï¼ |
| | | AGVStation MucheN = _agvStationService.GetMothervehicle(Ziche3.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | int motNCarAddress = GetDeviceAddress.GetEquipmentlocation(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN.Motherinlaw != motNCarAddress) |
| | | int motNCarAddress = GetDeviceAddress.GetEquipmentInMuche(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN.Motherinlaw != motNCarAddress && motNCarAddress!=0) |
| | | { |
| | | RGVMovetask(MucheN.Motherinlaw, MucheN.ChildPosiDeviceCode); |
| | | } |
| | | AGVStation MucheN2 = _agvStationService.GetMothervehicle(Ziche3.MotherCardeputy); //å¤ä¾§æ¯è½¦ |
| | | int motNCarAddress2 = GetDeviceAddress.GetEquipmentlocation(MucheN2.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN2.ZicheMotherinlaw != motNCarAddress2) |
| | | int motNCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(MucheN2.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN2.ZicheMotherinlaw != motNCarAddress2 && motNCarAddress2!=0) |
| | | { |
| | | RGVMovetask(MucheN2.ZicheMotherinlaw, MucheN2.ChildPosiDeviceCode); |
| | | } |
| | | |
| | | if(MucheN.Motherinlaw == motNCarAddress && MucheN2.ZicheMotherinlaw == motNCarAddress2) |
| | | if (MucheN.Motherinlaw == motNCarAddress && MucheN2.ZicheMotherinlaw == motNCarAddress2) |
| | | { |
| | | RGVMovetask(Ziche3.MotherCardeputy, Ziche3.ChildPosiDeviceCode); |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¯è½¦ç§»å¨è³å
¥åºå£ |
| | | private Dt_Task? HandleZicheMoveFinish(Dt_Task task) |
| | | #region å车移å¨ä»»å¡(åç»å¯è½éè¦ä¼åä¸ä¸) |
| | | public Dt_Task? ZicheMobile(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | Dt_Task task = _taskService.GetInzicheTaskMobile(RGVTaskdevice.ChildPosiDeviceCode, 1); |
| | | return task; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¯è½¦ç§»å¨ä»»å¡ |
| | | public Dt_Task? MotherVehicleMovement(AGVStation RGVTaskdevice) |
| | | { |
| | | Dt_Task task = _taskService.GetInzicheTaskMobile(RGVTaskdevice.ChildPosiDeviceCode, 2); |
| | | int curradder = int.Parse(task.CurrentAddress); |
| | | AGVStation GdZiche = _agvStationService.GetMotheaisle(curradder); |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(GdZiche.ChildPosiDeviceCode); |
| | | if (motherCarAddress != curradder) return task; |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentInformation(GdZiche.ChildPosiDeviceCode); |
| | | if (motherCarAddress != curradder && motherCarAddress!=0) return task; |
| | | RGVMovetask(GdZiche.Motherinlaw, GdZiche.ChildPosiDeviceCode); |
| | | return null; |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region åºåºæ¹æ³ |
| | | public Dt_Task? OutboundEquipmentTask(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | return (RGVTaskdevice.Station_material, getStackerObject.RgvCraneStatusValue) switch |
| | | { |
| | | ((int)RGVEquipment.Mothertrailer, RgvEquipmentStatus.HasCargo) |
| | | => Mothertaskdistribution(RGVTaskdevice), |
| | | |
| | | ((int)RGVEquipment.Corridorcar, RgvEquipmentStatus.NoCargo) |
| | | => ChildPickupAddres(RGVTaskdevice), |
| | | |
| | | ((int)RGVEquipment.Corridorcar, RgvEquipmentStatus.HasCargo) |
| | | => Findshippingtask(RGVTaskdevice), |
| | | |
| | | ((int)RGVEquipment.OutRGVForklift, RgvEquipmentStatus.NoCargo) |
| | | => _taskService.GetOutkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode, |
| | | RGVTaskdevice.HCJStorageaddress.ToString(), 1), |
| | | |
| | | ((int)RGVEquipment.OutRGVForklift, RgvEquipmentStatus.HasCargo) |
| | | => _taskService.GetOutkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode, |
| | | RGVTaskdevice.HCJStorageaddress.ToString(), 2), |
| | | |
| | | _ => null |
| | | }; |
| | | } |
| | | |
| | | #region ä¸åæ¯è½¦ä»»å¡ï¼éè¦å¤æå½åè¡å°è½¦å¨åªä¸ªä½å |
| | | |
| | | private Dt_Task? Mothertaskdistribution(AGVStation GdZiche) |
| | | { |
| | | // æåæ£æ¥æ æçAreaå¼ |
| | | if (GdZiche.Station_Area < 1 || GdZiche.Station_Area > 4) |
| | | return null; |
| | | |
| | | AGVStation ZicheinnerSide = _agvStationService.GetMotheaisle(GdZiche.ZicheMotherinlaw); |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentInformation(ZicheinnerSide.ChildPosiDeviceCode); |
| | | |
| | | // 使ç¨switchè¯å¥æé«å¯è¯»æ§ |
| | | return GdZiche.Station_Area switch |
| | | { |
| | | 4 when ZiCarAddress3 != GdZiche.ZicheMotherinlaw |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | 3 when ZiCarAddress3 == ZicheinnerSide.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | 2 when ZiCarAddress3 != GdZiche.MotherCardeputy && ZiCarAddress3 != GdZiche.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | 1 when ZiCarAddress3 == ZicheinnerSide.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | _ => null |
| | | }; |
| | | } |
| | | #endregion |
| | | |
| | | #region å¤æå·²ç§»å¨åºæ¥çæ¯è½¦ï¼å夿å°è½¦ä½ç½® |
| | | public Dt_Task? ChildPickupAddres(AGVStation GdZiche) |
| | | { |
| | | if (GdZiche.Station_Area == 5) |
| | | return _taskService.ChildVehicleMission(GdZiche); |
| | | |
| | | var task = _taskService.ChildVehicleMission(GdZiche); |
| | | |
| | | // å¿«éè¿åæ¡ä»¶æ£æ¥ |
| | | if (task.CurrentAddress != GdZiche.HCJStorageaddress.ToString()) |
| | | return task; |
| | | |
| | | var innerStation = _agvStationService.GetZicheDeep(GdZiche.HCJStorageaddress); |
| | | if (GetDeviceAddress.GetEquipmentInformation(innerStation.ChildPosiDeviceCode) != innerStation.HCJStorageaddress) |
| | | return task; |
| | | |
| | | var motherStation = _agvStationService.GetMothervehicle(innerStation.MotherCarDeviceCode); |
| | | if (GetDeviceAddress.ReturnCurrentStatus(motherStation.ChildPosiDeviceCode)) |
| | | RGVMovetask(innerStation.MotherCarDeviceCode, innerStation.ChildPosiDeviceCode); |
| | | |
| | | return null; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¥æ¾å车æ¾è´§ä»»å¡ |
| | | public Dt_Task? Findshippingtask(AGVStation GdZiche) |
| | | { |
| | | Dt_Task task = _taskService.GetFinhuoTask(GdZiche.ChildPosiDeviceCode); |
| | | if (GetDeviceAddress.HCJIsstock(task.NextAddress)) return task; |
| | | return null; |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region åºåºå°è½¦ç§»å¨ä»»å¡ä¸å |
| | | public void Returnposition(string DeviceCode, int RGVCurrentlocation) |
| | | { |
| | | int HCJGoodsplatform = 1170; //å®ä¹çæ¾è´§ç«å° |
| | | //夿æ¯è½¦æ¯å¦éè¦è¿è¡ç§»å¨ |
| | | AGVStation GdZiche = _agvStationService.Corridorequipment(DeviceCode); |
| | | if (GdZiche.Station_Area == 1) |
| | | { |
| | | switch (RGVCurrentlocation) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == GdZiche.MotherCarDeviceCode: //å¨ç¬¬ä¸ä¸ªæ¯è½¦ä¸ |
| | | RGVMovetask(HCJGoodsplatform, GdZiche.ChildPosiDeviceCode); |
| | | break; |
| | | case int Waddress when Waddress == GdZiche.MotherCardeputy: //å¨ç¬¬äºä¸ªæ¯è½¦ä¸ |
| | | OutNMotherCar(GdZiche.MotherCarDeviceCode); |
| | | break; |
| | | case int HCJaddress when HCJaddress == GdZiche.HCJStorageaddress: //å¨HCJç«å°ä¸ |
| | | OutHCJMotherCar(GdZiche); |
| | | break; |
| | | default: break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (RGVCurrentlocation) |
| | | { |
| | | case int Whcjaddress when Whcjaddress == GdZiche.MotherCarDeviceCode: //å¨ç¬¬ä¸ä¸ªæ¯è½¦ä¸ï¼éè¦å¤æå¤ä¾§å车æ¯å¦å¨HCJä¸ |
| | | OutinnerSideNMotherCar(GdZiche); |
| | | break; |
| | | case int Waddress when Waddress == GdZiche.MotherCardeputy: //å¨ç¬¬äºä¸ªæ¯è½¦ä¸ï¼éè¦å¤æå车ä¸å¤ä¾§æ¯è½¦æ¯å¦å¨è¿éä¸ |
| | | OutinnerSideMotherCar(GdZiche); |
| | | break; |
| | | default: break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region å¤ä¾§å°è½¦åå½å°èµ·å§ç¹ä½ |
| | | /// <summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å¤ä¾§å°è½¦åå½å°èµ·å§ç¹ä½ |
| | | /// <summary> |
| | | /// å¨ç¬¬ä¸ä¸ªä½ç½®ï¼å夿å¤ä¾§å车æ¯å¦å¨HCJç«å°ä¸é¢ |
| | |
| | | /// <returns></returns> |
| | | private void OutinnerSideNMotherCar(AGVStation aGVStation) |
| | | { |
| | | AGVStation Ziche3 = _agvStationService.GetZicheDeep(aGVStation.HCJStorageaddress); //å
ä¾§å车 |
| | | AGVStation Ziche3 = _agvStationService.GetZicheOuterSide(aGVStation.HCJStorageaddress); //å¤ä¾§å车 |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentlocation(Ziche3.ChildPosiDeviceCode); |
| | | if (ZiCarAddress3 == Ziche3.HCJStorageaddress) |
| | | { |
| | | |
| | | OutHCJMotherCar(Ziche3); |
| | | } |
| | | else |
| | | { |
| | | //RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | RGVMovetask(aGVStation.HCJStorageaddress, aGVStation.ChildPosiDeviceCode); |
| | | } |
| | | } |
| | | private void OutinnerSideMotherCar(AGVStation aGVStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy); //å
ä¾§æ¯è½¦ |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.Motherinlaw) |
| | | { |
| | | RGVMovetask(Muche2.Motherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | | OutinnerSideNMotherCar(aGVStation); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | try |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceCode); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | |
| | | DeviceProDTO? deviceProDTO = GetDeviceAddress.GetDeviceProDTO(Commonstacker, DeviceCode, "RGV_Rgvtaskstutas"); |
| | | int MCGStatus = GetDeviceAddress.GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | DeviceProDTO? deviceProDTO = GetDeviceAddress.GetRGVDeviceProDTO(Commonstacker, DeviceCode, "RGV_Rgvtaskstutas"); |
| | | int MCGStatus = GetDeviceAddress.RGVGetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | |
| | | |
| | | if (Commonstacker.IsConnected) |
| | | { |
| | | if (MCGStatus == (int)RgvJobCraneStatus.Ready) |