From 6700283f9103a45bc087838ebf3eeeeb9022dd98 Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期五, 19 十二月 2025 12:11:45 +0800
Subject: [PATCH] 新增了割草机长宽和割草安全距离属性

---
 src/gecaoji/Device.java |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/src/gecaoji/Device.java b/src/gecaoji/Device.java
index fd7cae4..d37e21f 100644
--- a/src/gecaoji/Device.java
+++ b/src/gecaoji/Device.java
@@ -83,6 +83,12 @@
     // 鍓茶崏鏈虹伅寮�鍏崇姸鎬侊細1寮�鍚紝0鍏抽棴锛�-1鏈煡
     private String mowerBladeHeight = "-1";
     // 鍓茶崏鏈哄垁鐩橀珮搴︼細-1鏈煡
+    private String mowerWidth;
+    // 鍓茶崏鏈哄搴︼紝鍗曚綅绫�
+    private String mowerLength;
+    // 鍓茶崏鏈洪暱搴︼紝鍗曚綅绫�
+    private String mowingSafetyDistance;
+    // 鍓茶崏瀹夊叏璺濈锛屽崟浣嶇背
 
     private static final double METERS_PER_DEGREE_LAT = 111320.0d;
     
@@ -155,6 +161,9 @@
         if (mowerStartStatus != null) properties.setProperty("mowerStartStatus", mowerStartStatus);
         if (mowerLightStatus != null) properties.setProperty("mowerLightStatus", mowerLightStatus);
         if (mowerBladeHeight != null) properties.setProperty("mowerBladeHeight", mowerBladeHeight);
+        if (mowerWidth != null) properties.setProperty("mowerWidth", mowerWidth);
+        if (mowerLength != null) properties.setProperty("mowerLength", mowerLength);
+        if (mowingSafetyDistance != null) properties.setProperty("mowingSafetyDistance", mowingSafetyDistance);
         
         // 淇濆瓨鍒版枃浠�
         try (FileOutputStream output = new FileOutputStream("device.properties");
@@ -198,6 +207,9 @@
         target.mowerStartStatus = properties.getProperty("mowerStartStatus", "-1");
         target.mowerLightStatus = properties.getProperty("mowerLightStatus", "-1");
         target.mowerBladeHeight = properties.getProperty("mowerBladeHeight", "-1");
+        target.mowerWidth = properties.getProperty("mowerWidth", "-1");
+        target.mowerLength = properties.getProperty("mowerLength", "-1");
+        target.mowingSafetyDistance = properties.getProperty("mowingSafetyDistance", "-1");
     }
 
     private void applyDefaults(Device target) {
@@ -233,6 +245,9 @@
         target.mowerStartStatus = "-1";
         target.mowerLightStatus = "-1";
         target.mowerBladeHeight = "-1";
+        target.mowerWidth = "-1";
+        target.mowerLength = "-1";
+        target.mowingSafetyDistance = "-1";
     }
 
     public static synchronized Device initializeActiveDevice(String mowerId) { // 鏍规嵁璁惧ID鍒濆鍖栨椿璺冭澶�
@@ -343,6 +358,15 @@
             case "mowerBladeHeight":
                 this.mowerBladeHeight = value;
                 return true;
+            case "mowerWidth":
+                this.mowerWidth = value;
+                return true;
+            case "mowerLength":
+                this.mowerLength = value;
+                return true;
+            case "mowingSafetyDistance":
+                this.mowingSafetyDistance = value;
+                return true;
             default:
                 System.err.println("鏈煡瀛楁: " + fieldName);
                 return false;
@@ -835,6 +859,30 @@
         this.mowerBladeHeight = mowerBladeHeight;
     }
 
+    public String getMowerWidth() { // 鑾峰彇鍓茶崏鏈哄搴�
+        return mowerWidth;
+    }
+
+    public void setMowerWidth(String mowerWidth) { // 璁剧疆鍓茶崏鏈哄搴�
+        this.mowerWidth = mowerWidth;
+    }
+
+    public String getMowerLength() { // 鑾峰彇鍓茶崏鏈洪暱搴�
+        return mowerLength;
+    }
+
+    public void setMowerLength(String mowerLength) { // 璁剧疆鍓茶崏鏈洪暱搴�
+        this.mowerLength = mowerLength;
+    }
+
+    public String getMowingSafetyDistance() { // 鑾峰彇鍓茶崏瀹夊叏璺濈
+        return mowingSafetyDistance;
+    }
+
+    public void setMowingSafetyDistance(String mowingSafetyDistance) { // 璁剧疆鍓茶崏瀹夊叏璺濈
+        this.mowingSafetyDistance = mowingSafetyDistance;
+    }
+
     @Override
     public String toString() { // 杈撳嚭瀵硅薄淇℃伅
         return "Device{" +
@@ -866,6 +914,9 @@
                 ", mowerStartStatus='" + mowerStartStatus + '\'' +
                 ", mowerLightStatus='" + mowerLightStatus + '\'' +
                 ", mowerBladeHeight='" + mowerBladeHeight + '\'' +
+                ", mowerWidth='" + mowerWidth + '\'' +
+                ", mowerLength='" + mowerLength + '\'' +
+                ", mowingSafetyDistance='" + mowingSafetyDistance + '\'' +
                 '}';
     }
 }
\ No newline at end of file

--
Gitblit v1.10.0