| | |
| | | case ORI_STA: |
| | | // 站点取货 |
| | | Sta oriSta = staService.getById(task.getOriSta()); |
| | | Double oriStaWorkDirection = mapService.getStaAngle(oriSta, workDirection); |
| | | Double angle = oriSta.getAngle() == null ? mapService.getStaAngle(oriSta, workDirection) : Double.valueOf(oriSta.getAngle()); |
| | | // 检验方向 |
| | | if (!lastDirection.equals(oriStaWorkDirection)) { |
| | | if (!lastDirection.equals(Double.valueOf(angle))) { |
| | | if (!lastCode.getCornerBool()) { |
| | | throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | (double) MapService.calcSpinDirection(lastCode, lastDirection, oriStaWorkDirection).val, // 属性值 |
| | | (double) MapService.calcSpinDirection(lastCode, lastDirection, angle).val, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(oriStaWorkDirection), // 动作参数 |
| | | String.valueOf(angle), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | lastDirection = oriStaWorkDirection; |
| | | lastDirection = angle; |
| | | } |
| | | // 计算货叉工作方向 |
| | | actuatorDirectionType = ActuatorDirectionType.fromVal(oriSta.getActDir()); |
| | |
| | | case DEST_STA: |
| | | // 站点放货 |
| | | Sta destSta = staService.getById(task.getDestSta()); |
| | | Double destStaWorkDirection = mapService.getStaAngle(destSta, workDirection); |
| | | angle = destSta.getAngle() == null ? mapService.getStaAngle(destSta, workDirection) : Double.valueOf(destSta.getAngle()); |
| | | // 检验方向 |
| | | if (!lastDirection.equals(destStaWorkDirection)) { |
| | | if (!lastDirection.equals(angle)) { |
| | | if (!lastCode.getCornerBool()) { |
| | | throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | (double) MapService.calcSpinDirection(lastCode, lastDirection, destStaWorkDirection).val, // 属性值 |
| | | (double) MapService.calcSpinDirection(lastCode, lastDirection, angle).val, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(destStaWorkDirection), // 动作参数 |
| | | String.valueOf(angle), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | lastDirection = destStaWorkDirection; |
| | | lastDirection = angle; |
| | | } |
| | | // 背篓取货 |
| | | if (backupAction) { |