| | |
| | | { |
| | | 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"); |
| | |
| | | { |
| | | _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); |
| | | } |
| | | |
| | | |
| | | // 记录日志:读取托盘条码成功 |
| | | _logger.LogInformation("HandlePutFinishedStateAsync:读取托盘条码成功: {Barcode1}+{Barcode2},任务号: {TaskNum}", trayBarcode1, trayBarcode2, task.RobotTaskNum); |
| | |
| | | else |
| | | { |
| | | // 条码读取失败,记录错误日志 |
| | | _logger.LogError("HandlePutFinishedStateAsync:读取托盘条码失败,任务号: {TaskNum}", task.RobotTaskNum); |
| | | QuartzLogger.Error($"读取托盘条码失败", stateForUpdate.RobotCrane.DeviceName); |
| | | _logger.LogError("HandlePutFinishedStateAsync:读取托盘条码失败,任务号: {TaskNum},一号位: {trayBarcode1},二号位: {trayBarcode2}", task.RobotTaskNum,trayBarcode1,trayBarcode2); |
| | | QuartzLogger.Error($"读取托盘条码失败,一号位:{trayBarcode1},二号位:{trayBarcode2}", stateForUpdate.RobotCrane.DeviceName); |
| | | |
| | | |
| | | // 发送取货指令 标记扫码NG,放货时不使用这些条码,并放入NG口 |