fix(RobotJob): 修正机器人任务处理逻辑和注释错误
- 修正RobotSimpleCommandHandler中batteryarrived的注释说明
- 删除无用的调试日志代码和注释
- 统一RobotPrefixCommandHandler中换盘API的调用逻辑
- 修复RobotWorkflowOrchestrator中组盘任务的电池到位检查
- 修正Putbattery任务参数和条码处理逻辑
| | |
| | | // MaxDegreeOfParallelism = Math.Min(childDeviceCodes.Count, Environment.ProcessorCount * 2), |
| | | //}; |
| | | |
| | | //_logger.LogDebug("Executeï¼å¼å§å¹¶è¡å¤çè¾é线 {DeviceCode}ï¼åè®¾å¤æ°é: {Count}", conveyorLine.DeviceCode, childDeviceCodes.Count); |
| | | //QuartzLogger.Debug($"å¼å§å¹¶è¡å¤çè¾é线ï¼åè®¾å¤æ°é: {childDeviceCodes.Count}", conveyorLine.DeviceCode); |
| | | |
| | | // å¹¶è¡å¤çæ¯ä¸ªåè®¾å¤ |
| | | //Parallel.For(0, childDeviceCodes.Count, parallelOptions, i => |
| | | foreach (var childDeviceCode in childDeviceCodes) |
| | |
| | | using System.Net.Sockets; |
| | | using WIDESEAWCS_Common.HttpEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_Tasks.Workflow.Abstractions; |
| | |
| | | if (task != null) |
| | | task.RobotTaskTotalNum -= positions.Length; |
| | | |
| | | if (isFlowA) |
| | | { |
| | | // æµåAï¼ä¸è°ç¨ APIï¼ä»
éå¢è®¡æ° |
| | | } |
| | | else |
| | | { |
| | | // æµåBï¼è°ç¨æ¢ç API |
| | | // 两æµååè°ç¨æ¢ç API |
| | | var stockDTO = RobotTaskProcessor.BuildStockDTO(state, positions); |
| | | var result = _taskProcessor.PostGroupPalletAsync(nameof(ConfigKey.ChangePalletAsync), stockDTO); |
| | | putSuccess = result.Data.Status && result.IsSuccess; |
| | | } |
| | | |
| | | // åå Phase 1ï¼ç»§ç»åæ£å¸¸çµè¯ |
| | | state.ChangePalletPhase = 1; |
| | |
| | | { |
| | | if (isFlowA) |
| | | { |
| | | // æµåAï¼æ¾åçµè¯å°ç®æ æçï¼éå¢è®¡æ°ï¼è°ç¨æ¢ç API |
| | | // æµåAï¼æ¾åçµè¯å°ç®æ æçï¼ä»
éå¢è®¡æ°ï¼ä¸è°ç¨ API |
| | | state.RobotTaskTotalNum += positions.Length; |
| | | if (task != null) |
| | | task.RobotTaskTotalNum -= positions.Length; |
| | | |
| | | var stockDTO = RobotTaskProcessor.BuildStockDTO(state, positions); |
| | | var result = _taskProcessor.PostGroupPalletAsync(nameof(ConfigKey.ChangePalletAsync), stockDTO); |
| | | putSuccess = result.Data.Status && result.IsSuccess; |
| | | } |
| | | else |
| | | { |
| | |
| | | state.CurrentAction = "Putting"; |
| | | return true; |
| | | |
| | | // æèæ ç©æï¼æè空é²ï¼ |
| | | // æ¯å¦çµè¯å°ä½ |
| | | case "batteryarrived": |
| | | state.BatteryArrived = true; |
| | | return true; |
| | |
| | | { |
| | | if (state.IsScanNG) |
| | | { |
| | | taskString = $"Putbattery,4"; |
| | | taskString = $"Putbattery,1"; |
| | | } |
| | | else |
| | | { |
| | |
| | | // 妿æ¯ç»çä»»å¡ |
| | | if (task.RobotTaskType == RobotTaskTypeEnum.GroupPallet.GetHashCode()) |
| | | { |
| | | |
| | | //if (!stateForUpdate.BatteryArrived) |
| | | //{ |
| | | // return; |
| | | //} |
| | | // æ£æ¥çµæ± æ¯å¦å·²å°ä½ |
| | | if (!stateForUpdate.BatteryArrived) |
| | | { |
| | | return; |
| | | } |
| | | // 读å线ä½çµè¯æ¡ç |
| | | string trayBarcode1 = RobotBarcodeGenerator.GenerateTrayBarcode("DB40.990"); |
| | | string trayBarcode2 = RobotBarcodeGenerator.GenerateTrayBarcode("DB40.1020"); |
| | |
| | | // æ¡ç éå¤ï¼è®°å½é误æ¥å¿å¹¶åæ¢åç»æä½(åç»æ¾è´§æ¶ä¼ç¨å°è¿äºæ¡ç ä¿¡æ¯ï¼ä¾åç»æ¾è´§æ¶ä½¿ç¨ï¼è°è¯åå¯è½ä¼åæ¶æ¤é»è¾) |
| | | |
| | | // åéåè´§æä»¤ æ è®°æ«ç NGï¼æ¾è´§æ¶ä¸ä½¿ç¨è¿äºæ¡ç ï¼å¹¶æ¾å
¥NGå£ |
| | | //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | _logger.LogInformation("HandlePutFinishedStateAsyncï¼è¯»åçæçæ¡ç å¯ä¸ï¼ç»§ç»æ§è¡ï¼ä»»å¡å·: {TaskNum}", task.RobotTaskNum); |
| | | QuartzLogger.Info($"读åçæçæ¡ç å¯ä¸ï¼ç»§ç»æ§è¡", stateForUpdate.RobotCrane.DeviceName); |
| | | |
| | | // å°æ¡ç æ·»å å°ç¶æä¸ï¼ä¾åç»æ¾è´§æ¶ä½¿ç¨ |
| | | stateForUpdate.CellBarcode = new List<string>() |
| | | { |
| | | trayBarcode1,trayBarcode2 |
| | | }; |
| | | |
| | | // å°æ¡ç æ·»å å°ç¶æä¸ï¼ä¾åç»æ¾è´§æ¶ä½¿ç¨ |
| | | //stateForUpdate.CellBarcode.Add(trayBarcode1); |
| | | //stateForUpdate.CellBarcode.Add(trayBarcode2); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // åéåè´§æä»¤ æ è®°æ«ç NGï¼æ¾è´§æ¶ä¸ä½¿ç¨è¿äºæ¡ç ï¼å¹¶æ¾å
¥NGå£ |
| | | //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | return; |
| | | } |
| | | } |
| | |
| | | |
| | | // ========== æ£æ¥å åæºä»»å¡å®æç¶æ ========== |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted(); |
| | | //_logger.LogDebug("Executeï¼æ£æ¥ä»»å¡å®æç¶æï¼è®¾å¤: {DeviceCode}", _deviceCode); |
| | | //QuartzLogger.Debug($"æ£æ¥ä»»å¡å®æç¶æï¼è®¾å¤: {_deviceCode}", _deviceCode); |
| | | |
| | | // ========== æ£æ¥æ¯å¦å¯ä»¥åéæ°ä»»å¡ ========== |
| | | //if (!commonStackerCrane.IsCanSendTask(commonStackerCrane.Communicator, commonStackerCrane.DeviceProDTOs, commonStackerCrane.DeviceProtocolDetailDTOs)) |
| | | if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal /*&& commonStackerCrane.StackerCraneAutoStatusValue != StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneWorkStatusValue != StackerCraneWorkStatus.Standby*/) |
| | | if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal ) |
| | | { |
| | | // å åæºä¸å¯ç¨ï¼å¦æ£å¨æ§è¡ä¸ä¸ä»»å¡ï¼ï¼ç´æ¥è¿å |
| | | //_logger.LogDebug("Executeï¼å åæºä¸å¯ç¨ï¼è®¾å¤: {DeviceCode}", _deviceCode); |
| | | //QuartzLogger.Debug($"å åæºä¸å¯ç¨ï¼è®¾å¤: {_deviceCode}", _deviceCode); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | if (task == null) |
| | | { |
| | | // 没æå¯ç¨ä»»å¡ |
| | | //_logger.LogDebug("Executeï¼æ²¡æå¯ç¨ä»»å¡ï¼è®¾å¤: {DeviceCode}", _deviceCode); |
| | | //QuartzLogger.Debug($"没æå¯ç¨ä»»å¡ï¼è®¾å¤: {_deviceCode}", _deviceCode); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | //_logger.LogInformation("Executeï¼éæ©ä»»å¡ï¼è®¾å¤: {DeviceCode}ï¼ä»»å¡å·: {TaskNum}", _deviceCode, task.TaskNum); |
| | | //QuartzLogger.Info($"鿩任å¡ï¼ä»»å¡å·: {task.TaskNum}", _deviceCode); |
| | | |
| | | // ========== æå»ºå½ä»¤ ========== |
| | | // å½ä»¤æå»ºä¸æ²å°ä¸ç¨æå»ºå¨ |