| | |
| | | |
| | | bool isFlowA = task.RobotSourceAddressLineCode is "11001" or "11010"; |
| | | |
| | | await _taskProcessor.SendSocketRobotNumAsync(task, state, false); |
| | | Thread.Sleep(500); |
| | | |
| | | // ==================== Phase 2: 放正常电芯到目标托盘(两流向相同)==================== |
| | | // PickFinished 到达:Phase 1 的 Pick 命令完成,现在下发 Put 命令放正常电芯 |
| | | if (state?.ChangePalletPhase == 2) |
| | |
| | | return; |
| | | } |
| | | |
| | | // 非批次模式或其他阶段不下发指令 |
| | | return; |
| | | } |
| | | |
| | | // 非换盘任务:使用原有格式 |
| | |
| | | |
| | | if (_stateManager.TryUpdateStateSafely(ipAddress, stateToUpdate)) |
| | | { |
| | | await _robotTaskService.UpdateRobotTaskAsync(task); |
| | | //await _robotTaskService.UpdateRobotTaskAsync(task); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 如果条码生成成功 |
| | | if (!string.IsNullOrEmpty(trayBarcode1) && !string.IsNullOrEmpty(trayBarcode2)) |
| | | { |
| | | if (stateForUpdate.CellBarcode.Contains(trayBarcode1) || stateForUpdate.CellBarcode.Contains(trayBarcode2)) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:读取的电芯条码已存在,可能存在重复,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress); |
| | | //if (stateForUpdate.CellBarcode.Contains(trayBarcode1) || stateForUpdate.CellBarcode.Contains(trayBarcode2)) |
| | | //{ |
| | | // QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:读取的电芯条码已存在,可能存在重复,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress); |
| | | |
| | | // 发送取货指令 标记扫码NG,放货时不使用这些条码,并放入NG口 |
| | | //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | return; |
| | | } |
| | | else |
| | | // // 发送取货指令 标记扫码NG,放货时不使用这些条码,并放入NG口 |
| | | // //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true); |
| | | // return; |
| | | //} |
| | | //else |
| | | { |
| | | if (trayBarcode1.Length < 13 || trayBarcode2.Length < 13) |
| | | { |
| | |
| | | // 判断流向(null-safe) |
| | | bool isFlowA = task.RobotSourceAddressLineCode is "11001" or "11010"; |
| | | |
| | | await _taskProcessor.SendSocketRobotNumAsync(task, stateForUpdate); |
| | | Thread.Sleep(500); |
| | | |
| | | // 目标数量为48:直接走原有逻辑,不进入批次模式 |
| | | if (targetNormalCount == targetTotal) |
| | | if (targetNormalCount + currentCompletedCount == targetTotal) |
| | | { |
| | | await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate); |
| | | return; |