| | |
| | | private String landName; |
| | | // 边界原始坐标 |
| | | private String boundaryOriginalCoordinates; |
| | | // 边界原始XY坐标(相对于基准站的XY坐标) |
| | | private String boundaryOriginalXY; |
| | | // 边界坐标(存储多边形坐标点集合) |
| | | private String boundaryCoordinates; |
| | | // 规划路径(存储路径坐标点集合) |
| | |
| | | private String mowingOverlapDistance; |
| | | // 割草安全距离(米) |
| | | private String mowingSafetyDistance; |
| | | // 障碍物坐标 |
| | | private String obstacleCoordinates; |
| | | |
| | | // 存储多个地块的映射表,键为地块编号 |
| | | private static Map<String, Dikuai> dikuaiMap = new HashMap<>(); |
| | |
| | | dikuai.userId = landProps.getProperty("userId", "-1"); |
| | | dikuai.landName = landProps.getProperty("landName", "-1"); |
| | | dikuai.boundaryOriginalCoordinates = landProps.getProperty("boundaryOriginalCoordinates", "-1"); |
| | | dikuai.boundaryOriginalXY = landProps.getProperty("boundaryOriginalXY", "-1"); |
| | | dikuai.boundaryCoordinates = landProps.getProperty("boundaryCoordinates", "-1"); |
| | | dikuai.plannedPath = landProps.getProperty("plannedPath", "-1"); |
| | | dikuai.returnPointCoordinates = landProps.getProperty("returnPointCoordinates", "-1"); |
| | |
| | | dikuai.mowingBladeWidth = landProps.getProperty("mowingBladeWidth", "0.40"); |
| | | dikuai.mowingOverlapDistance = landProps.getProperty("mowingOverlapDistance", "0.06"); |
| | | dikuai.mowingSafetyDistance = landProps.getProperty("mowingSafetyDistance", "-1"); |
| | | dikuai.obstacleCoordinates = landProps.getProperty("obstacleCoordinates", "-1"); |
| | | |
| | | dikuaiMap.put(landNum, dikuai); |
| | | } |
| | |
| | | case "boundaryOriginalCoordinates": |
| | | this.boundaryOriginalCoordinates = value; |
| | | return true; |
| | | case "boundaryOriginalXY": |
| | | this.boundaryOriginalXY = value; |
| | | return true; |
| | | case "boundaryCoordinates": |
| | | this.boundaryCoordinates = value; |
| | | return true; |
| | |
| | | case "mowingSafetyDistance": |
| | | this.mowingSafetyDistance = value; |
| | | return true; |
| | | case "obstacleCoordinates": |
| | | this.obstacleCoordinates = value; |
| | | return true; |
| | | default: |
| | | System.err.println("未知字段: " + fieldName); |
| | | return false; |
| | |
| | | if (dikuai.landNumber != null) properties.setProperty(landNumber + ".landNumber", dikuai.landNumber); |
| | | if (dikuai.landName != null) properties.setProperty(landNumber + ".landName", dikuai.landName); |
| | | if (dikuai.boundaryOriginalCoordinates != null) properties.setProperty(landNumber + ".boundaryOriginalCoordinates", dikuai.boundaryOriginalCoordinates); |
| | | if (dikuai.boundaryOriginalXY != null) properties.setProperty(landNumber + ".boundaryOriginalXY", dikuai.boundaryOriginalXY); |
| | | if (dikuai.boundaryCoordinates != null) properties.setProperty(landNumber + ".boundaryCoordinates", dikuai.boundaryCoordinates); |
| | | if (dikuai.plannedPath != null) properties.setProperty(landNumber + ".plannedPath", dikuai.plannedPath); |
| | | if (dikuai.returnPointCoordinates != null) properties.setProperty(landNumber + ".returnPointCoordinates", dikuai.returnPointCoordinates); |
| | |
| | | if (dikuai.mowingBladeWidth != null) properties.setProperty(landNumber + ".mowingBladeWidth", dikuai.mowingBladeWidth); |
| | | if (dikuai.mowingOverlapDistance != null) properties.setProperty(landNumber + ".mowingOverlapDistance", dikuai.mowingOverlapDistance); |
| | | if (dikuai.mowingSafetyDistance != null) properties.setProperty(landNumber + ".mowingSafetyDistance", dikuai.mowingSafetyDistance); |
| | | if (dikuai.obstacleCoordinates != null) properties.setProperty(landNumber + ".obstacleCoordinates", dikuai.obstacleCoordinates); |
| | | } |
| | | |
| | | try { |
| | |
| | | this.boundaryOriginalCoordinates = boundaryOriginalCoordinates; |
| | | } |
| | | |
| | | public String getBoundaryOriginalXY() { |
| | | return boundaryOriginalXY; |
| | | } |
| | | |
| | | public void setBoundaryOriginalXY(String boundaryOriginalXY) { |
| | | this.boundaryOriginalXY = boundaryOriginalXY; |
| | | } |
| | | |
| | | public String getBoundaryCoordinates() { |
| | | return boundaryCoordinates; |
| | | } |
| | |
| | | this.mowingSafetyDistance = mowingSafetyDistance; |
| | | } |
| | | |
| | | public String getObstacleCoordinates() { |
| | | return obstacleCoordinates; |
| | | } |
| | | |
| | | public void setObstacleCoordinates(String obstacleCoordinates) { |
| | | this.obstacleCoordinates = obstacleCoordinates; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Dikuai{" + |
| | |
| | | ", landNumber='" + landNumber + '\'' + |
| | | ", landName='" + landName + '\'' + |
| | | ", boundaryOriginalCoordinates='" + boundaryOriginalCoordinates + '\'' + |
| | | ", boundaryOriginalXY='" + boundaryOriginalXY + '\'' + |
| | | ", boundaryCoordinates='" + boundaryCoordinates + '\'' + |
| | | ", plannedPath='" + plannedPath + '\'' + |
| | | ", returnPointCoordinates='" + returnPointCoordinates + '\'' + |
| | |
| | | ", updateTime='" + updateTime + '\'' + |
| | | ", mowingPattern='" + mowingPattern + '\'' + |
| | | ", mowingWidth='" + mowingWidth + '\'' + |
| | | ", obstacleCoordinates='" + obstacleCoordinates + '\'' + |
| | | '}'; |
| | | } |
| | | } |