| | |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | | import com.zy.acs.manager.manager.entity.Loc; |
| | | import com.zy.acs.manager.manager.entity.Segment; |
| | | import com.zy.acs.manager.manager.entity.Sta; |
| | | import com.zy.acs.manager.manager.enums.CodeSpinType; |
| | | import com.zy.acs.manager.manager.service.ActionService; |
| | | import com.zy.acs.manager.manager.service.CodeService; |
| | | import com.zy.acs.manager.system.service.ConfigService; |
| | |
| | | } |
| | | |
| | | // 坐标货架阈值 todo:luxiaotao |
| | | public AgvDirectionType calculateAgvWorkDirection(Loc loc, Code code) { |
| | | public AgvDirectionType calculateAgvWorkDirectionByShelf(Loc loc, Code code) { |
| | | Integer compDirect = loc.getCompDirect(); |
| | | AgvDirectionType agvDirectionType = null; |
| | | if (compDirect == 0) { |
| | |
| | | return agvDirectionType; |
| | | } |
| | | |
| | | public Double getStaAngle(Sta sta, Double workDirection) { |
| | | if (null == sta) { |
| | | return null; |
| | | } |
| | | if (Cools.isEmpty(sta.getAngle())) { |
| | | return workDirection; |
| | | } |
| | | return Double.parseDouble(sta.getAngle()); |
| | | } |
| | | |
| | | public Double calculateAgvWorkDirectionByStation(Double staWorkDirection, Double lastDirection) { |
| | | return Math.abs(staWorkDirection - lastDirection) + 90.0D; |
| | | } |
| | | |
| | | public double calculateDistance(double x1, double y1, double x2, double y2) { |
| | | double deltaX = x2 - x1; |
| | | double deltaY = y2 - y1; |
| | | return Math.sqrt(deltaX * deltaX + deltaY * deltaY); |
| | | } |
| | | |
| | | public DirectionType calcDirectionType(int[] originIdx, int[] oppositeIdx) { |
| | | if (oppositeIdx[0] < originIdx[0] && oppositeIdx[1] == originIdx[1]) { |
| | | return DirectionType.TOP; |
| | | } |
| | | if (oppositeIdx[0] > originIdx[0] && oppositeIdx[1] == originIdx[1]) { |
| | | return DirectionType.BOTTOM; |
| | | } |
| | | if (oppositeIdx[0] == originIdx[0] && oppositeIdx[1] > originIdx[1]) { |
| | | return DirectionType.RIGHT; |
| | | } |
| | | if (oppositeIdx[0] == originIdx[0] && oppositeIdx[1] < originIdx[1]) { |
| | | return DirectionType.LEFT; |
| | | } |
| | | return DirectionType.NONE; |
| | | } |
| | | |
| | | public void lockPath(Integer lev, List<String> pathList, String agvNo) { |
| | |
| | | return turnMatrixNode == TurnNodeType.TURN.val; |
| | | } |
| | | |
| | | public CodeSpinType spinDirection(Code code) { |
| | | if (Cools.isEmpty(code)) { |
| | | return CodeSpinType.NA; |
| | | } |
| | | return CodeSpinType.of(code.getSpin()); |
| | | } |
| | | |
| | | /** |
| | | * That vehicle is walking if the dynamic node count > 1 |
| | | */ |