张世豪
11 小时以前 13d032241e1a2938a8be4f64c9171e1240e9ea1e
src/dikuai/Dikuai.java
@@ -17,12 +17,18 @@
    private String landName;
    // 边界原始坐标
    private String boundaryOriginalCoordinates;
    // 边界原始XY坐标(相对于基准站的XY坐标)
    private String boundaryOriginalXY;
    // 边界坐标(存储多边形坐标点集合)
    private String boundaryCoordinates;
    // 规划路径(存储路径坐标点集合)
    private String plannedPath;
    // 返回点坐标
    private String returnPointCoordinates;
    // 往返路径坐标(割草机完成割草作业返回的路径坐标,格式:X1,Y1;X2,Y2;...;XN,YN)
    private String returnPathCoordinates;
    // 往返路径原始坐标
    private String returnPathRawCoordinates;
    // 边界点间隔
    private String boundaryPointInterval;
    // 角度阈值
@@ -47,6 +53,8 @@
    private String mowingBladeWidth;
    // 割草重叠距离(米),默认0.06米
    private String mowingOverlapDistance;
    // 割草安全距离(米)
    private String mowingSafetyDistance;
    // 存储多个地块的映射表,键为地块编号
    private static Map<String, Dikuai> dikuaiMap = new HashMap<>();
@@ -95,9 +103,12 @@
                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.returnPathCoordinates = landProps.getProperty("returnPathCoordinates", "-1");
                dikuai.returnPathRawCoordinates = landProps.getProperty("returnPathRawCoordinates", "-1");
                dikuai.boundaryPointInterval = landProps.getProperty("boundaryPointInterval", "-1");
                dikuai.angleThreshold = landProps.getProperty("angleThreshold", "-1");
                dikuai.intelligentSceneAnalysis = landProps.getProperty("intelligentSceneAnalysis", "-1");
@@ -110,6 +121,7 @@
                dikuai.mowingTrack = landProps.getProperty("mowingTrack", "-1");
                dikuai.mowingBladeWidth = landProps.getProperty("mowingBladeWidth", "0.40");
                dikuai.mowingOverlapDistance = landProps.getProperty("mowingOverlapDistance", "0.06");
                dikuai.mowingSafetyDistance = landProps.getProperty("mowingSafetyDistance", "-1");
                
                dikuaiMap.put(landNum, dikuai);
            }
@@ -192,6 +204,9 @@
            case "boundaryOriginalCoordinates":
                this.boundaryOriginalCoordinates = value;
                return true;
            case "boundaryOriginalXY":
                this.boundaryOriginalXY = value;
                return true;
            case "boundaryCoordinates":
                this.boundaryCoordinates = value;
                return true;
@@ -201,6 +216,12 @@
            case "returnPointCoordinates":
                this.returnPointCoordinates = value;
                return true;
            case "returnPathCoordinates":
                this.returnPathCoordinates = value;
                return true;
            case "returnPathRawCoordinates":
                this.returnPathRawCoordinates = value;
                return true;
            case "boundaryPointInterval":
                this.boundaryPointInterval = value;
                return true;
@@ -237,6 +258,9 @@
            case "mowingOverlapDistance":
                this.mowingOverlapDistance = value;
                return true;
            case "mowingSafetyDistance":
                this.mowingSafetyDistance = value;
                return true;
            default:
                System.err.println("未知字段: " + fieldName);
                return false;
@@ -258,9 +282,12 @@
            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.returnPathCoordinates != null) properties.setProperty(landNumber + ".returnPathCoordinates", dikuai.returnPathCoordinates);
            if (dikuai.returnPathRawCoordinates != null) properties.setProperty(landNumber + ".returnPathRawCoordinates", dikuai.returnPathRawCoordinates);
            if (dikuai.boundaryPointInterval != null) properties.setProperty(landNumber + ".boundaryPointInterval", dikuai.boundaryPointInterval);
            if (dikuai.angleThreshold != null) properties.setProperty(landNumber + ".angleThreshold", dikuai.angleThreshold);
            if (dikuai.intelligentSceneAnalysis != null) properties.setProperty(landNumber + ".intelligentSceneAnalysis", dikuai.intelligentSceneAnalysis);
@@ -273,6 +300,7 @@
            if (dikuai.mowingTrack != null) properties.setProperty(landNumber + ".mowingTrack", dikuai.mowingTrack);
            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);
        }
        
        try {
@@ -320,6 +348,14 @@
        this.boundaryOriginalCoordinates = boundaryOriginalCoordinates;
    }
    public String getBoundaryOriginalXY() {
        return boundaryOriginalXY;
    }
    public void setBoundaryOriginalXY(String boundaryOriginalXY) {
        this.boundaryOriginalXY = boundaryOriginalXY;
    }
    public String getBoundaryCoordinates() {
        return boundaryCoordinates;
    }
@@ -344,6 +380,22 @@
        this.returnPointCoordinates = returnPointCoordinates;
    }
    public String getReturnPathCoordinates() {
        return returnPathCoordinates;
    }
    public void setReturnPathCoordinates(String returnPathCoordinates) {
        this.returnPathCoordinates = returnPathCoordinates;
    }
    public String getReturnPathRawCoordinates() {
        return returnPathRawCoordinates;
    }
    public void setReturnPathRawCoordinates(String returnPathRawCoordinates) {
        this.returnPathRawCoordinates = returnPathRawCoordinates;
    }
    public String getBoundaryPointInterval() {
        return boundaryPointInterval;
    }
@@ -440,6 +492,14 @@
        this.mowingOverlapDistance = mowingOverlapDistance;
    }
    public String getMowingSafetyDistance() {
        return mowingSafetyDistance;
    }
    public void setMowingSafetyDistance(String mowingSafetyDistance) {
        this.mowingSafetyDistance = mowingSafetyDistance;
    }
    @Override
    public String toString() {
        return "Dikuai{" +
@@ -447,9 +507,12 @@
                ", landNumber='" + landNumber + '\'' +
                ", landName='" + landName + '\'' +
                ", boundaryOriginalCoordinates='" + boundaryOriginalCoordinates + '\'' +
                ", boundaryOriginalXY='" + boundaryOriginalXY + '\'' +
                ", boundaryCoordinates='" + boundaryCoordinates + '\'' +
                ", plannedPath='" + plannedPath + '\'' +
                ", returnPointCoordinates='" + returnPointCoordinates + '\'' +
                ", returnPathCoordinates='" + returnPathCoordinates + '\'' +
                ", returnPathRawCoordinates='" + returnPathRawCoordinates + '\'' +
                ", boundaryPointInterval='" + boundaryPointInterval + '\'' +
                ", angleThreshold='" + angleThreshold + '\'' +
                ", intelligentSceneAnalysis='" + intelligentSceneAnalysis + '\'' +