826220679@qq.com
2 天以前 48ee74129bb09a817a0bbbabe860c4007b74c66b
src/dikuai/Dikuai.java
@@ -23,6 +23,10 @@
    private String plannedPath;
    // 返回点坐标
    private String returnPointCoordinates;
    // 往返路径坐标(割草机完成割草作业返回的路径坐标,格式:X1,Y1;X2,Y2;...;XN,YN)
    private String returnPathCoordinates;
    // 往返路径原始坐标
    private String returnPathRawCoordinates;
    // 边界点间隔
    private String boundaryPointInterval;
    // 角度阈值
@@ -43,6 +47,12 @@
    private String mowingPattern;
    // 割草宽度
    private String mowingWidth;
    // 割草机割刀宽度(米),默认0.40米
    private String mowingBladeWidth;
    // 割草重叠距离(米),默认0.06米
    private String mowingOverlapDistance;
    // 割草安全距离(米)
    private String mowingSafetyDistance;
    // 存储多个地块的映射表,键为地块编号
    private static Map<String, Dikuai> dikuaiMap = new HashMap<>();
@@ -94,6 +104,8 @@
                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");
@@ -104,6 +116,9 @@
                dikuai.mowingPattern = landProps.getProperty("mowingPattern", "-1");
                dikuai.mowingWidth = landProps.getProperty("mowingWidth", "-1");
                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);
            }
@@ -195,6 +210,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;
@@ -225,6 +246,15 @@
            case "mowingTrack":
                this.mowingTrack = value;
                return true;
            case "mowingBladeWidth":
                this.mowingBladeWidth = value;
                return true;
            case "mowingOverlapDistance":
                this.mowingOverlapDistance = value;
                return true;
            case "mowingSafetyDistance":
                this.mowingSafetyDistance = value;
                return true;
            default:
                System.err.println("未知字段: " + fieldName);
                return false;
@@ -249,6 +279,8 @@
            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);
@@ -259,6 +291,9 @@
            if (dikuai.mowingPattern != null) properties.setProperty(landNumber + ".mowingPattern", dikuai.mowingPattern);
            if (dikuai.mowingWidth != null) properties.setProperty(landNumber + ".mowingWidth", dikuai.mowingWidth);
            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 {
@@ -330,6 +365,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;
    }
@@ -410,6 +461,30 @@
        this.mowingTrack = mowingTrack;
    }
    public String getMowingBladeWidth() {
        return mowingBladeWidth;
    }
    public void setMowingBladeWidth(String mowingBladeWidth) {
        this.mowingBladeWidth = mowingBladeWidth;
    }
    public String getMowingOverlapDistance() {
        return mowingOverlapDistance;
    }
    public void setMowingOverlapDistance(String mowingOverlapDistance) {
        this.mowingOverlapDistance = mowingOverlapDistance;
    }
    public String getMowingSafetyDistance() {
        return mowingSafetyDistance;
    }
    public void setMowingSafetyDistance(String mowingSafetyDistance) {
        this.mowingSafetyDistance = mowingSafetyDistance;
    }
    @Override
    public String toString() {
        return "Dikuai{" +
@@ -420,6 +495,8 @@
                ", boundaryCoordinates='" + boundaryCoordinates + '\'' +
                ", plannedPath='" + plannedPath + '\'' +
                ", returnPointCoordinates='" + returnPointCoordinates + '\'' +
                ", returnPathCoordinates='" + returnPathCoordinates + '\'' +
                ", returnPathRawCoordinates='" + returnPathRawCoordinates + '\'' +
                ", boundaryPointInterval='" + boundaryPointInterval + '\'' +
                ", angleThreshold='" + angleThreshold + '\'' +
                ", intelligentSceneAnalysis='" + intelligentSceneAnalysis + '\'' +