| | |
| | | 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; |
| | |
| | | using System.Diagnostics.Eventing.Reader; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.Log; |
| | |
| | | GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane); |
| | | |
| | | //读å设å¤å®æä¿¡æ¯ |
| | | if (getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Completed && getStackerObject.CurrentRgvtaskid!=0) |
| | | if (getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Completed && getStackerObject.CurrentRgvtaskid != 0) |
| | | { |
| | | _taskService.UpdateTaskStatus(getStackerObject.CurrentRgvtaskid); |
| | | _taskService.UpdateTaskStatus(getStackerObject.CurrentRgvtaskid,2); |
| | | } |
| | | |
| | | |
| | | |
| | | if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic && |
| | | getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction) |
| | |
| | | |
| | | //ä¸åRGVä»»å¡ä¹åï¼å
读åä¸ä¸å®å
¨é¨ç¶æ |
| | | |
| | | |
| | | |
| | | //æ¥æ¾RGVè¿è¡ä¸åä»»å¡ |
| | | Dt_Task task = GetTask(speStackerCrane.DeviceCode); |
| | | Dt_Task task = GetTask(speStackerCrane.DeviceCode,getStackerObject); |
| | | if (task != null) |
| | | { |
| | | //è°ååå
¥RGVå°è½¦ä»»å¡ |
| | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if(speStackerCrane.DeviceCode=="RGV101" || speStackerCrane.DeviceCode == "RGV101") |
| | | { |
| | | //彿²¡ä»»å¡çæ¶åï¼åè¿è¡ç§»å¨ |
| | | Returnposition(speStackerCrane.DeviceCode, getStackerObject.RGVCurrentlocation); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | 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 => task, //éè¦å¤æå车æ¯å
ä¾§åºè¿æ¯å¤ä¾§åè´§ï¼å¾
å®æï¼ |
| | | (int)TaskInStatusEnum.RGV_InZicheFinish => HandleZicheFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheReleaseFinish => HandleZicheReleaseFinish(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 å
¥åºæ¹æ³ |
| | | 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 = GetDeviceProDTO(Commonstacker, task.NextAddress, "HCJ_GoodsStatus"); |
| | | int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | if (HCJGStatus == 0) //为æ è´§ |
| | | return _taskService.GetInkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode, 1); |
| | | } |
| | | else if (RGVTaskdevice.Station_material == (int)RGVEquipment.InRGVForklift && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.HasCargo) |
| | | { |
| | | 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; } |
| | | |
| | | } |
| | | |
| | | |
| | | #region è¿éå车è¿è¡åè´§ |
| | | public Dt_Task? ZichePickUpAisle(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | //è·åå车åè´§ä»»å¡ |
| | | Dt_Task dt_Task = _taskService.GetInzicheTask(RGVTaskdevice.ChildPosiDeviceCode,1); |
| | | if(dt_Task.CurrentAddress== getStackerObject.RGVCurrentlocation.ToString()) |
| | | { |
| | | return dt_Task; |
| | | } |
| | | else |
| | | { |
| | | //妿ä¸çäºï¼åè¿è¡å¤æå车å¨åªä¸ªä½ç½® |
| | | if (RGVTaskdevice.Station_Area == 1) |
| | | { |
| | | return task; |
| | | // æ ¹æ®å车ä½ç½®å¤çä¸åæ
åµ |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | } |
| | | /// <summary> |
| | | /// 夿å¤ä¾§æ¯è½¦æ¯å¦å¨å
¥å£å£ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <param name="currentStation"></param> |
| | | /// <returns></returns> |
| | | private Dt_Task? HandleMedialCase(Dt_Task task, int currentStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(currentStation); |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | if (motherCarAddress == Muche.Motherinlaw) return task; |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | return null; |
| | | } |
| | | /// <summary> |
| | | /// 夿å
å¤ä¾§æ¯è½¦æ¯å¦å¨å
¥åºå£ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <param name="currentStation"></param> |
| | | /// <returns></returns> |
| | | private Dt_Task? HandleMedialCase2(Dt_Task task, AGVStation currentStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(currentStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | AGVStation Muche2 = _agvStationService.GetMothervehicle(currentStation.MotherCardeputy); //å
ä¾§æ¯è½¦ |
| | | |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode); |
| | | if (motherCarAddress == 0 || motherCarAddress2 == 0) return null; |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿HCJç«å°æ¯å¦æè´§ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.Motherinlaw) |
| | | { |
| | | RGVMovetask(Muche2.Motherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress == Muche.Motherinlaw && motherCarAddress2 == Muche2.Motherinlaw) return task; |
| | | // æ¯è½¦å·²å¨æ£ç¡®ä½ç½® |
| | | return null; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region è¿éå车è¿è¡æ¾è´§ |
| | | public Dt_Task? GoodsPlacedCorridor(AGVStation RGVTaskdevice, GetStackerObject getStackerObject) |
| | | { |
| | | Dt_Task task = _taskService.GetInzicheTask(RGVTaskdevice.ChildPosiDeviceCode, 2); |
| | | int nexaddres = int.Parse(task.NextAddress); |
| | | switch (nexaddres) |
| | | { |
| | | 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.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | if (motherCarAddress == Muche.ZicheMotherinlaw) return _Task; |
| | | if(motherCarAddress!=0) RGVMovetask(Muche.ZicheMotherinlaw, aGVStation.ChildPosiDeviceCode); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private Dt_Task? HandleZicheFinish(Dt_Task task) |
| | | /// <summary> |
| | | /// 夿æ¾ç¬¬äºä¸ªæ¯è½¦ä½ç½® |
| | | /// </summary> |
| | | /// <param name="_Task"></param> |
| | | /// <param name="aGVStation"></param> |
| | | /// <returns></returns> |
| | | private Dt_Task? MotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | //è·åæ¾è´§å°å |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.NextAddress)); |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy); //å
ä¾§æ¯è½¦ |
| | | |
| | | //å3åºåè¿è¡æ¾è´§ |
| | | return aGVStation.Station_Area switch |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(Muche2.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw && motherCarAddress != 0) |
| | | { |
| | | 1 => CheckMotherCarMove(task, aGVStation, MotherCarMoves), //å¤ä¾§æ¾è´§ |
| | | 2 => CheckMotherCarMove(task, aGVStation, MotherCarMovesinside), //å
ä¾§æ¾è´§ |
| | | 3 => CheckMotherCarMove(task, aGVStation, HCJMotherCarMovesinside), //交æ¥ç¹æ¾è´§ |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.ZicheMotherinlaw && motherCarAddress2 != 0) |
| | | { |
| | | RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress == Muche.Motherinlaw && motherCarAddress2 == Muche2.ZicheMotherinlaw) return _Task; |
| | | // æ¯è½¦å·²å¨æ£ç¡®ä½ç½® |
| | | 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.GetEquipmentInMuche(Muche.ChildPosiDeviceCode); |
| | | int motherCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(Muche2.ChildPosiDeviceCode); |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentInMuche(Ziche3.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw && motherCarAddress != 0) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | if (motherCarAddress2 != Muche2.Motherinlaw && motherCarAddress2 != 0) |
| | | { |
| | | RGVMovetask(Muche2.Motherinlaw, Muche2.ChildPosiDeviceCode); |
| | | } |
| | | if (ZiCarAddress3 == Ziche3.HCJStorageaddress && ZiCarAddress3!=0) |
| | | { |
| | | //å¤æç®æ ç«å°æ¯å
¥åºå°å å·å åæº |
| | | if (_Task.TargetAddress == "3") //å
¥åºè³3å·å åæº |
| | | { |
| | | //夿å¤ä¾§æ¯è½¦ä½ç½®ï¼2åºåï¼ |
| | | AGVStation MucheN = _agvStationService.GetMothervehicle(Ziche3.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | int motNCarAddress = GetDeviceAddress.GetEquipmentInMuche(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (motNCarAddress!=0) |
| | | { |
| | | 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.GetEquipmentInMuche(MucheN.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN.Motherinlaw != motNCarAddress && motNCarAddress!=0) |
| | | { |
| | | RGVMovetask(MucheN.Motherinlaw, MucheN.ChildPosiDeviceCode); |
| | | } |
| | | AGVStation MucheN2 = _agvStationService.GetMothervehicle(Ziche3.MotherCardeputy); //å¤ä¾§æ¯è½¦ |
| | | int motNCarAddress2 = GetDeviceAddress.GetEquipmentInMuche(MucheN2.ChildPosiDeviceCode); //è·åå°æ¯è½¦å½åä½ç½® |
| | | if (MucheN2.ZicheMotherinlaw != motNCarAddress2 && motNCarAddress2!=0) |
| | | { |
| | | RGVMovetask(MucheN2.ZicheMotherinlaw, MucheN2.ChildPosiDeviceCode); |
| | | } |
| | | |
| | | if (MucheN.Motherinlaw == motNCarAddress && MucheN2.ZicheMotherinlaw == motNCarAddress2) |
| | | { |
| | | RGVMovetask(Ziche3.MotherCardeputy, Ziche3.ChildPosiDeviceCode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (motherCarAddress == Muche.Motherinlaw && motherCarAddress2 == Muche2.Motherinlaw && ZiCarAddress3 != Ziche3.HCJStorageaddress) return _Task; |
| | | // æ¯è½¦å·²å¨æ£ç¡®ä½ç½® |
| | | return null; |
| | | } |
| | | #endregion |
| | | |
| | | #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.GetEquipmentInformation(GdZiche.ChildPosiDeviceCode); |
| | | if (motherCarAddress != curradder && motherCarAddress!=0) return task; |
| | | RGVMovetask(GdZiche.Motherinlaw, GdZiche.ChildPosiDeviceCode); |
| | | return null; |
| | | } |
| | | #endregion |
| | | |
| | | #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 |
| | | }; |
| | | } |
| | | |
| | | private Dt_Task? CheckMotherCarMove(Dt_Task task, AGVStation station, Func<Dt_Task, AGVStation, bool> moveFunc) |
| | | { |
| | | return moveFunc(task, station) ? task : null; |
| | | } |
| | | #region ä¸åæ¯è½¦ä»»å¡ï¼éè¦å¤æå½åè¡å°è½¦å¨åªä¸ªä½å |
| | | |
| | | private Dt_Task? HandleZicheReleaseFinish(Dt_Task task) |
| | | private Dt_Task? Mothertaskdistribution(AGVStation GdZiche) |
| | | { |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); //å½åå°åï¼æ¯è½¦ä¸ï¼ä¸ä¸ä¸ªå°åå åæºåè´§å£ |
| | | if (aGVStation.Station_Area == 1 && aGVStation.Station_Area == 2) |
| | | // æåæ£æ¥æ æç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 |
| | | { |
| | | return task; //è¿åå车移å¨ä»»å¡ |
| | | } |
| | | else if (aGVStation.Station_Area == 3) //å½åå°å为HCJç«å°ï¼ä¸AGVä»»å¡ä¸ºåè´§ |
| | | { |
| | | return task; //å»åè´§ï¼éè¦å¤æå车å½åä½åï¼ï¼åç»ä¼åï¼ |
| | | } |
| | | 4 when ZiCarAddress3 != GdZiche.ZicheMotherinlaw |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | return null; |
| | | } |
| | | 3 when ZiCarAddress3 == ZicheinnerSide.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | private Dt_Task? HandleZicheMoveFinish(Dt_Task task) |
| | | { |
| | | AGVStation aGVStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); |
| | | int zicheAddress = GetZichelocation(task, task.CurrentAddress); |
| | | 2 when ZiCarAddress3 != GdZiche.MotherCardeputy && ZiCarAddress3 != GdZiche.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | //妿åè½¦å¨æ¯è½¦ä¸ï¼åéè¦ç§»åºæ¯è½¦ï¼å¾
ä¼åï¼ |
| | | return zicheAddress != int.Parse(aGVStation.ZicheMotherinlaw) ? task : null; |
| | | 1 when ZiCarAddress3 == ZicheinnerSide.HCJStorageaddress |
| | | => _taskService.QueryStackerCraneTask(GdZiche.ChildPosiDeviceCode), |
| | | |
| | | _ => null |
| | | }; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | //åºåä¸å¤ææ¯è½¦æ¯å¦å°ä½ï¼å¯ç«å³æ¾è´§ |
| | | private bool MotherCarMoves(Dt_Task _Task, AGVStation aGVStation) |
| | | #region å¤æå·²ç§»å¨åºæ¥çæ¯è½¦ï¼å夿å°è½¦ä½ç½® |
| | | public Dt_Task? ChildPickupAddres(AGVStation GdZiche) |
| | | { |
| | | 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; |
| | | 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> |
| | | /// 夿æ¾ç¬¬äºä¸ªæ¯è½¦ä½ç½® |
| | | /// </summary> |
| | | /// <param name="_Task"></param> |
| | | /// <param name="aGVStation"></param> |
| | | /// <returns></returns> |
| | | private void OutNMotherCar(int MotherCarDeviceCode) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | } |
| | | private void OutHCJMotherCar(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); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¤ä¾§å°è½¦åå½å°èµ·å§ç¹ä½ |
| | | /// <summary> |
| | | /// å¨ç¬¬ä¸ä¸ªä½ç½®ï¼å夿å¤ä¾§å车æ¯å¦å¨HCJç«å°ä¸é¢ |
| | | /// </summary> |
| | | /// <param name="_Task"></param> |
| | | /// <param name="aGVStation"></param> |
| | | /// <returns></returns> |
| | | private void OutinnerSideNMotherCar(AGVStation aGVStation) |
| | | { |
| | | AGVStation Ziche3 = _agvStationService.GetZicheOuterSide(aGVStation.HCJStorageaddress); //å¤ä¾§å车 |
| | | int ZiCarAddress3 = GetDeviceAddress.GetEquipmentlocation(Ziche3.ChildPosiDeviceCode); |
| | | if (ZiCarAddress3 == Ziche3.HCJStorageaddress) |
| | | { |
| | | OutHCJMotherCar(Ziche3); |
| | | } |
| | | else |
| | | { |
| | | RGVMovetask(aGVStation.HCJStorageaddress, aGVStation.ChildPosiDeviceCode); |
| | | } |
| | | } |
| | | private void OutinnerSideMotherCar(AGVStation aGVStation) |
| | | { |
| | | AGVStation Muche = _agvStationService.GetMothervehicle(aGVStation.MotherCarDeviceCode); //å¤ä¾§æ¯è½¦ |
| | | int motherCarAddress = GetDeviceAddress.GetEquipmentlocation(Muche.ChildPosiDeviceCode); |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != Muche.Motherinlaw) |
| | | { |
| | | RGVMovetask(Muche.Motherinlaw, Muche.ChildPosiDeviceCode); |
| | | } |
| | | OutinnerSideNMotherCar(aGVStation); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// åæ¯è½¦ç§»å¨ä»»å¡ |
| | |
| | | /// <param name="RGVAdders">ç®æ å°å</param> |
| | | /// <param name="ChildPosiDeviceCode">设å¤ç¼å·</param> |
| | | /// <returns></returns> |
| | | private bool RGVMovetask(string RGVAdders,string ChildPosiDeviceCode,int taskid) |
| | | private bool RGVMovetask(int RGVAdders, string ChildPosiDeviceCode) |
| | | { |
| | | 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) |
| | | { |
| | | try |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000"); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, task.CurrentAddress, "HCJ_GoodsStatus"); |
| | | int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | if (HCJGStatus == 0) //为æ è´§ |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿HCJç«å°æ¯å¦æè´§ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¼ å
¥è¿éå°åï¼è·åæ¯è½¦ä½ç½® |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <param name="MotherCarDeviceCode">è¿éå°å</param> |
| | | /// <returns></returns> |
| | | public int GetMothercarlocation(int TaskNum, string MotherCarDeviceCode) |
| | | { |
| | | try |
| | | { |
| | | //å©ç¨å
¥åºç«å°å°åè·åæ¯è½¦plc |
| | | 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"); |
| | | int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | return HCJGStatus; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(TaskNum, $"夿æ¯è½¦ä½ç½®ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¼ å
¥è¿éå°åï¼è·åå车车ä½ç½® |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <param name="MotherCarDeviceCode">å
¥åºç«å°å°å</param> |
| | | /// <returns></returns> |
| | | public int GetZichelocation(Dt_Task task, string ChildPosiDeviceCode) |
| | | { |
| | | try |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == ChildPosiDeviceCode); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, ChildPosiDeviceCode, "RGVCurrentlocation"); |
| | | int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | return HCJGStatus; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //è®°å½å¼å¸¸æ
åµ |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"夿å车ä½ç½®ä¿¡æ¯åºéï¼åºéä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | |
| | | short locaticurr = task.RGVTaskType switch |
| | | { |
| | | _ when task.RGVTaskType == (short)RGVTaskTypeEnum.PickingUp || |
| | | task.RGVTaskType == (short)RGVTaskTypeEnum.TravelingOnly |
| | | (task.RGVTaskType == (short)RGVTaskTypeEnum.TravelingOnly && task.TaskType != (int)TaskInStatusEnum.RGV_InZichemoveFinish) |
| | | => short.Parse(task.CurrentAddress), |
| | | _ when task.RGVTaskType == (short)RGVTaskTypeEnum.Placing |
| | | _ when task.RGVTaskType == (short)RGVTaskTypeEnum.Placing || (task.RGVTaskType == (short)RGVTaskTypeEnum.TravelingOnly && task.TaskType== (int)TaskInStatusEnum.RGV_InZichemoveFinish) |
| | | => 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; |
| | | 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(string RGVAddress) |
| | | public RgvCraneTaskCommand? ConvertMotherCarTaskCommand(int RGVAddress) |
| | | { |
| | | RgvCraneTaskCommand stackerCraneTaskCommand = new RgvCraneTaskCommand(); |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = short.Parse(RGVAddress); |
| | | stackerCraneTaskCommand.RGV_RGVTasklocation = (short)RGVAddress; |
| | | stackerCraneTaskCommand.RGV_RGVtasktype = 3; |
| | | stackerCraneTaskCommand.RGV_Rgvtaskid = 999; //rgvä»»å¡å· |
| | | stackerCraneTaskCommand.RGV_Lanjiantaskid = 999; //å
°åä»»å¡id |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | |
| | | |
| | | public void wcsWriteLog(string SCLLinStack, string Logtype, string Magessadd) |
| | | { |
| | | WriteLog.Write_Log("RGV", SCLLinStack + "å·RGV", Logtype, new { ä¿¡æ¯ = Magessadd }); |
| | | } |
| | | |
| | | |
| | | |
| | | //===========================================================HCJåè®®è¯»åæ¥============================================================================= |
| | | /// <summary> |
| | | /// æ¥è¯¢å
·ä½å°å |
| | | /// </summary> |
| | | /// <param name="Commonstacker"></param> |
| | | /// <param name="SCAddress"></param> |
| | | /// <param name="Interactivet"></param> |
| | | /// <returns></returns> |
| | | public DeviceProDTO? GetDeviceProDTO(CommonStackerCrane Commonstacker, string SCAddress, string Interactivet) |
| | | { |
| | | return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == Interactivet && x.DeviceProParamType== "ReadDeviceCommand"); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹å°å读åè¾éçº¿ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="conveyorLine"></param> |
| | | /// <param name="DeviceProDataBlock"></param> |
| | | /// <returns></returns> |
| | | public int GetLine(CommonStackerCrane Commonstacker, string DeviceProDataBlock) |
| | | { |
| | | return Commonstacker.Communicator.Read<short>(DeviceProDataBlock); |
| | | } |
| | | //===========================================================HCJåè®®è¯»åæ¥=============================================================================== |
| | | |
| | | |
| | | public bool SendCommand2(RgvCraneTaskCommand command, string DeviceCode) |
| | | { |
| | | try |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceCode); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, DeviceCode, "RGV_Rgvtaskstutas"); |
| | | int MCGStatus = 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) |