From 64e0880d2d81ce2b3f0e366b1537c5efe2f2c4ea Mon Sep 17 00:00:00 2001
From: 826220679@qq.com <826220679@qq.com>
Date: 星期日, 21 十二月 2025 20:49:24 +0800
Subject: [PATCH] 需改优化了绘制往返路径

---
 src/zhuye/WangfanDraw.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/zhuye/WangfanDraw.java b/src/zhuye/WangfanDraw.java
index 464cedf..c56abf5 100644
--- a/src/zhuye/WangfanDraw.java
+++ b/src/zhuye/WangfanDraw.java
@@ -23,6 +23,7 @@
     // 缁樺埗鐘舵��
     private boolean drawingActive = false;
     private boolean paused = false;
+    private boolean isHandheldMode = false;  // 鏄惁浣跨敤鎵嬫寔璁惧妯″紡
     
     // 鍩哄噯鍧愭爣
     private double[] baseLatLon;
@@ -63,9 +64,10 @@
     /**
      * 鍚姩寰�杩旇矾寰勭粯鍒�
      * @param finishCallback 瀹屾垚缁樺埗鏃剁殑鍥炶皟
+     * @param isHandheld 鏄惁浣跨敤鎵嬫寔璁惧妯″紡
      * @return 鏄惁鎴愬姛鍚姩
      */
-    public boolean start(Runnable finishCallback) {
+    public boolean start(Runnable finishCallback, boolean isHandheld) {
         if (mapRenderer == null || helper == null) {
             return false;
         }
@@ -83,6 +85,12 @@
         paused = false;
         this.finishCallback = finishCallback;
         this.baseLatLon = baseLatLonCandidate;
+        this.isHandheldMode = isHandheld;
+        
+        // 濡傛灉鏄墜鎸佽澶囨ā寮忥紝鍒囨崲鍥炬爣
+        if (isHandheld && shouye != null) {
+            shouye.setHandheldMowerIconActive(true);
+        }
 
         // 娓呯┖璺緞鐐�
         synchronized (returnPathPoints) {
@@ -101,6 +109,12 @@
         if (helper != null) {
             helper.enterDrawingControlMode();
         }
+        
+        // 璁剧疆鐘舵�佹彁绀轰负"姝e湪缁樺埗寰�杩旇矾寰�"
+        if (shouye != null) {
+            shouye.setStatusLabelText("姝e湪缁樺埗寰�杩旇矾寰�");
+        }
+        
         startMonitor();
         return true;
     }
@@ -245,6 +259,12 @@
         if (helper != null) {
             helper.exitDrawingControlMode();
         }
+        
+        // 鎭㈠鍓茶崏鏈哄浘鏍�
+        if (isHandheldMode && shouye != null) {
+            shouye.setHandheldMowerIconActive(false);
+        }
+        isHandheldMode = false;
     }
     
     /**

--
Gitblit v1.10.0