| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic && |
| | | getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction) |
| | | { |
| | | |
| | | //ä¸åRGVä»»å¡ä¹åï¼å
读åä¸ä¸å®å
¨é¨ç¶æ |
| | | |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | (int)TaskInStatusEnum.RGV_InNew => task, |
| | | (int)TaskInStatusEnum.RGV_InPickupFinish => HandlePickupFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InReleaseFinish => task, //éè¦å¤æå车æ¯å
ä¾§åºè¿æ¯å¤ä¾§åè´§ï¼å¾
å®æï¼ |
| | | (int)TaskInStatusEnum.RGV_InReleaseFinish => HandInneRouterSides(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheFinish => HandleZicheFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZicheReleaseFinish => HandleZicheReleaseFinish(task), |
| | | (int)TaskInStatusEnum.RGV_InZichemoveFinish => HandleZicheMoveFinish(task), |
| | |
| | | } |
| | | |
| | | #region å
¥åºæ¹æ³ |
| | | private Dt_Task? HandInneRouterSides(Dt_Task task) |
| | | { |
| | | // éªè¯è¾å
¥ |
| | | if (task == null) throw new ArgumentNullException(nameof(task)); |
| | | if (string.IsNullOrEmpty(task.CurrentAddress)) return null; |
| | | |
| | | // è·åå½åç«å°ä¿¡æ¯ |
| | | AGVStation currentStation = _agvStationService.GetAllStationByDeviceCode(int.Parse(task.CurrentAddress)); |
| | | if (currentStation == null) return null; |
| | | |
| | | // åªå¤çç¹å®ç±»åçç«å° |
| | | if (currentStation.Station_material != (int)AgvStationEnum.HCJAisleplatform) |
| | | return task; |
| | | |
| | | // è·åå车ä½ç½® |
| | | int zicheAddress = GetZichelocation(task, task.CurrentAddress); |
| | | if (zicheAddress == 0) return null; |
| | | |
| | | AGVStation zicheStation = _agvStationService.GetAllStationByDeviceCode(zicheAddress); |
| | | if (zicheStation == null) return null; |
| | | |
| | | // æ ¹æ®å车ä½ç½®å¤çä¸åæ
åµ |
| | | switch (zicheStation.Station_material) |
| | | { |
| | | case (int)AgvStationEnum.Aisleplatform_Outside: |
| | | // å车å¨å¤ä¾§ - ç´æ¥è¿åä»»å¡ |
| | | return task; |
| | | |
| | | case (int)AgvStationEnum.Aisleplatform_Medial: |
| | | // å车å¨å
ä¾§ - æ£æ¥æ¯è½¦ä½ç½® |
| | | return HandleMedialCase(task, currentStation, zicheStation); |
| | | |
| | | default: |
| | | // æªç¥çå车ä½ç½®ç¶æ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private Dt_Task? HandleMedialCase(Dt_Task task, AGVStation currentStation, AGVStation zicheStation) |
| | | { |
| | | int motherCarAddress = GetMothercarlocation(task.TaskNum, currentStation.MotherCarDeviceCode); |
| | | if (motherCarAddress == 0) return null; |
| | | |
| | | // 妿æ¯è½¦ä¸å¨é¢æä½ç½®ï¼ä¸åç§»å¨ä»»å¡ |
| | | if (motherCarAddress != int.Parse(currentStation.MotherCarDeviceCode)) |
| | | { |
| | | RGVMovetask(zicheStation.Motherinlaw, currentStation.ChildPosiDeviceCode, task.TaskId); |
| | | return null; // æ¯è½¦éè¦ç§»å¨ï¼æä¸è¿åä»»å¡ |
| | | } |
| | | |
| | | // æ¯è½¦å·²å¨æ£ç¡®ä½ç½® |
| | | return task; |
| | | } |
| | | |
| | | private Dt_Task? HandlePickupFinish(Dt_Task task) |
| | | { |
| | | try |
| | |
| | | } |
| | | else if (aGVStation.Station_Area == 3) //å½åå°å为HCJç«å°ï¼ä¸AGVä»»å¡ä¸ºåè´§ |
| | | { |
| | | return task; //å»åè´§ï¼éè¦å¤æå车å½åä½åï¼ï¼åç»ä¼åï¼ |
| | | return task; //å»åè´§ä½ï¼éè¦å¤æå车å½åä½åï¼ï¼åç»ä¼åï¼ |
| | | } |
| | | |
| | | return null; |
| | |
| | | private bool MotherCarMoves(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | int mcadder = GetMothercarlocation(_Task.TaskNum, aGVStation.Motherinlaw); //è·åå°æ¯è½¦å¤ä¾§ä½ç½® |
| | | if(mcadder != 0) |
| | | if (mcadder != 0) |
| | | { |
| | | if (mcadder == int.Parse(_Task.CurrentAddress)) |
| | | { |
| | | return true; |
| | | } |
| | | RGVMovetask(_Task.CurrentAddress, aGVStation.ChildPosiDeviceCode,_Task.TaskId); |
| | | RGVMovetask(_Task.CurrentAddress, aGVStation.ChildPosiDeviceCode, _Task.TaskId); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | /// <param name="RGVAdders">ç®æ å°å</param> |
| | | /// <param name="ChildPosiDeviceCode">设å¤ç¼å·</param> |
| | | /// <returns></returns> |
| | | private bool RGVMovetask(string RGVAdders,string ChildPosiDeviceCode,int taskid) |
| | | private bool RGVMovetask(string RGVAdders, string ChildPosiDeviceCode, int taskid) |
| | | { |
| | | RgvCraneTaskCommand standardCommands = ConvertMotherCarTaskCommand(RGVAdders); |
| | | bool sendFlag = SendCommand2(standardCommands, ChildPosiDeviceCode); |
| | |
| | | } |
| | | return false; |
| | | } |
| | | private bool HCJMotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | private bool HCJMotherCarMovesinside(Dt_Task _Task, AGVStation aGVStation) |
| | | { |
| | | //è·åå¤ä¾§æ¯è½¦ä½ç½® |
| | | int mcadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCarDeviceCode); |
| | | //è·åå
ä¾§æ¯è½¦ä½ç½® |
| | | int ncadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCardeputy); |
| | | int ncadder = GetMothercarlocation(_Task.TaskNum, aGVStation.MotherCardeputy); |
| | | |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder != int.Parse(aGVStation.MotherCardeputy)) |
| | | if (mcadder != int.Parse(aGVStation.MotherCarDeviceCode) && ncadder != int.Parse(aGVStation.MotherCardeputy)) |
| | | { |
| | | return true; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //夿æ¯å¦ |
| | | public bool GetMotherCarCurrentAdder(Dt_Task task) |
| | |
| | | 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"); |
| | |
| | | /// <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"); |
| | | return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == Interactivet && x.DeviceProParamType == "ReadDeviceCommand"); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹å°å读åè¾éçº¿ä¿¡æ¯ |
| | |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceCode); |
| | | CommonStackerCrane Commonstacker = (CommonStackerCrane)device; |
| | | |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, DeviceCode, "RGV_Rgvtaskstutas"); |
| | | DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, DeviceCode, "RGV_Rgvtaskstutas"); |
| | | int MCGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress); |
| | | if (Commonstacker.IsConnected) |
| | | { |