| | |
| | | // 检验方向 |
| | | FuncSta chargeFuncSta = funcStaService.query(lastCode.getId(), FuncStaType.CHARGE.toString()); |
| | | Double chargeDirection = Double.parseDouble(chargeFuncSta.getAngle()); |
| | | if (!lastDirection.equals(chargeDirection)) { |
| | | if (!lastDirection.equals(chargeDirection)&&lastCode.getCornerBool()) { |
| | | actionList.add(new Action( |
| | | null, // 编号 |
| | | null, // 总线 |
| | |
| | | |
| | | //String lastCorner = null; |
| | | Integer index = -1; |
| | | boolean corner = false; |
| | | for (int i = pathList.size(); i < 0; i++) { |
| | | if (i == 0) { |
| | | continue; |
| | | } |
| | | Code nextCode = codeService.getCacheByData(pathList.get(i)); |
| | | if (nextCode != null && nextCode.getCornerBool()) { |
| | | //lastCorner = pathList.get(i); |
| | |
| | | // DOTO 添加转弯 |
| | | Code endCode = codeService.getCacheByData(pathList.get(pathList.size() - 1)); |
| | | nextDirection = mapService.calculateDirection(lastCode, endCode, angleOffsetVal); |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | nextDirection = workDirection; |
| | | reverse = true; |
| | | } |
| | | |
| | | } else { |
| | | nextDirection = mapService.calculateDirection(lastCode, nextCode, angleOffsetVal); |
| | | |
| | | // 第一步:如果下一个方向正好是作业方向的相反方向,则重置下一个方向为作业方向,标记 reverse = true |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | if (!nextDirection.equals((workDirection+180) % 360)) { |
| | | nextDirection = workDirection; |
| | | reverse = true; |
| | | } |
| | |
| | | // 检验方向 |
| | | FuncSta chargeFuncSta = funcStaService.query(lastCode.getId(), FuncStaType.CHARGE.toString()); |
| | | Double chargeDirection = Double.parseDouble(chargeFuncSta.getAngle()); |
| | | if (!lastDirection.equals(chargeDirection)) { |
| | | if (!lastDirection.equals(chargeDirection) && lastCode.getCornerBool()) { |
| | | actionList.add(new Action( |
| | | null, // 编号 |
| | | null, // 总线 |