| | |
| | | using SqlSugar.Extensions; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | } |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | //commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | if (commonStackerCrane.CurrentTaskNum > 0 && (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.WorkCompleted || commonStackerCrane.Communicator.Read<short>("DB1000.40.0") == 3)) |
| | | { |
| | | StackerCraneTaskCompletedEventArgs e = new StackerCraneTaskCompletedEventArgs(commonStackerCrane.CurrentTaskNum); |
| | | CommonStackerCrane_StackerCraneTaskCompletedEventHandler(commonStackerCrane, e); |
| | | } |
| | | else if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | { |
| | | short stackerError = commonStackerCrane.Communicator.Read<short>("DB1000.54.0"); |
| | | if (stackerError == 0) |
| | |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress && x.StackerCraneCode==deviceCode); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode==deviceCode); |
| | | if (stationManger == null) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | //夿æ¯å¦ææ£æ§è¡çä»»å¡ï¼å¦ææåä¸ä¸å |
| | | Dt_Task? taskOld = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.Roadway == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()); |
| | | if (taskOld!=null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | if (device != null) |
| | | { |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode)==3)//åºåºç«å°æªè¢«å ç¨ |
| | | short command = client.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode); |
| | | if (command==3)//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | //task.NextAddress = stationManger.StackerCraneStationCode; |
| | | //_taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | task.ExceptionMessage = "åºåºç«å°æ æ³ä¸å"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//夿æ¯å¦æ¯åºåºä»»å¡ |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode == task.DeviceCode); |
| | | string[] targetCodes = stationManger.StackerCraneStationCode.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |