| | |
| | | if (stateToUpdate != null) |
| | | { |
| | | stateToUpdate.CurrentTask = task; |
| | | stateToUpdate.CurrentTaskNum = task.RobotTaskNum; |
| | | |
| | | if (_stateManager.TryUpdateStateSafely(ipAddress, stateToUpdate)) |
| | | { |
| | |
| | | |
| | | QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:读取的电芯条码唯一,继续执行,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress); |
| | | |
| | | // 将条码添加到状态中,供后续放货时使用 |
| | | stateForUpdate.CellBarcode = new List<string>() |
| | | // 将条码累积到 CellBarcode(去重),并设置当前批次条码 |
| | | if (!stateForUpdate.CellBarcode.Contains(trayBarcode1)) |
| | | stateForUpdate.CellBarcode.Add(trayBarcode1); |
| | | if (!stateForUpdate.CellBarcode.Contains(trayBarcode2)) |
| | | stateForUpdate.CellBarcode.Add(trayBarcode2); |
| | | |
| | | // 设置当前批次条码,用于 WMS 提交 |
| | | stateForUpdate.CurrentBatchBarcodes = new List<string>() |
| | | { |
| | | trayBarcode1,trayBarcode2 |
| | | trayBarcode1, trayBarcode2 |
| | | }; |
| | | } |
| | | |
| | |
| | | // 目标数量为48:直接走原有逻辑,不进入批次模式 |
| | | if (targetNormalCount + currentCompletedCount == targetTotal) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:目标数量已达48,直接下发取货指令,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress); |
| | | await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate); |
| | | return; |
| | | } |
| | | |
| | | QuartzLogHelper.LogDebug(_logger,$"HandlePutFinishedStateAsync:换盘任务目标数量: {targetNormalCount},当前已完成数量: {currentCompletedCount},流向: {(isFlowA ? "A" : "B")},任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress); |
| | | |
| | | // 初始化批次模式 |
| | | if (stateForUpdate.ChangePalletPhase == 0) |
| | | { |