From 6c9349bd065a99bf2066b6ae3f09691270720c9b Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期一, 22 十二月 2025 13:48:27 +0800
Subject: [PATCH] 解决了手动绘制边界的bug,所有返回按钮采用公用方法创建
---
shoudongbianjie.properties | 6 +-
dikuai.properties | 62 ++++++--------------
.classpath | 8 +-
src/bianjie/shudongdraw.java | 7 +-
set.properties | 30 +++++-----
src/zhuye/Shouye.java | 19 +++--
6 files changed, 57 insertions(+), 75 deletions(-)
diff --git a/.classpath b/.classpath
index f494121..6d3f076 100644
--- a/.classpath
+++ b/.classpath
@@ -6,9 +6,9 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="lib" path="D:/eclipseworkspace/GIT/GeCaoAPP/lib/jSerialComm-2.10.4.jar"/>
- <classpathentry kind="lib" path="D:/eclipseworkspace/GIT/GeCaoAPP/lib/jts-core-1.19.0.jar"/>
- <classpathentry kind="lib" path="D:/eclipseworkspace/GIT/GeCaoAPP/lib/slf4j-api-1.7.30.jar"/>
- <classpathentry kind="lib" path="D:/eclipseworkspace/GIT/GeCaoAPP/lib/slf4j-simple-1.7.30.jar"/>
+ <classpathentry kind="lib" path="E:/Users/hxzk/eclipse-workspace/GeCaoAPP/lib/jSerialComm-2.10.4.jar"/>
+ <classpathentry kind="lib" path="E:/Users/hxzk/eclipse-workspace/GeCaoAPP/lib/jts-core-1.19.0.jar"/>
+ <classpathentry kind="lib" path="E:/Users/hxzk/eclipse-workspace/GeCaoAPP/lib/slf4j-api-1.7.30.jar"/>
+ <classpathentry kind="lib" path="E:/Users/hxzk/eclipse-workspace/GeCaoAPP/lib/slf4j-simple-1.7.30.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/dikuai.properties b/dikuai.properties
index b6eab9a..256b9de 100644
--- a/dikuai.properties
+++ b/dikuai.properties
@@ -1,46 +1,24 @@
#Dikuai Properties
-#Sun Dec 21 11:15:33 GMT+08:00 2025
-LAND2.boundaryCoordinates=5.38,-6.41;-11.15,-8.94;-12.75,-4.68;-12.23,-3.28;-11.12,-3.17;-9.29,-3.53;-7.46,-3.89;-5.62,-4.25;-3.79,-4.61;-1.96,-4.97;-0.12,-5.33;1.71,-5.69;3.54,-6.05;5.38,-6.41
-LAND1.intelligentSceneAnalysis=-1
-LAND1.mowingSafetyDistance=-1
-LAND1.landArea=26.75
-LAND1.returnPointCoordinates=-1
-LAND1.landNumber=LAND1
-LAND2.landName=1452
-LAND2.userId=-1
-LAND2.intelligentSceneAnalysis=-1
-LAND2.mowingOverlapDistance=0.06
-LAND2.landArea=55.11
-LAND2.returnPathRawCoordinates=38.12,1.53;36.68,1.24;35.24,0.94;33.80,0.59;32.43,0.16;31.15,-0.38;30.26,-1.26;30.03,-2.37;30.12,-3.81;30.34,-5.22;30.59,-6.60;30.87,-7.98;31.10,-9.36;31.33,-10.77;31.57,-12.20;31.82,-13.68;32.07,-15.16;32.28,-16.60;32.52,-17.92;32.78,-19.37;33.07,-20.80;33.35,-22.37;33.62,-23.91;33.89,-25.35;34.16,-26.79;34.23,-28.32;33.75,-29.45;32.72,-30.03;31.41,-30.28;30.15,-30.22;29.26,-29.73;28.93,-28.62;28.72,-27.16;28.54,-25.66;28.26,-24.17;28.01,-22.74
-LAND1.returnPathCoordinates=-1
-LAND1.mowingPattern=骞宠绾�
-LAND1.mowingOverlapDistance=0.06
-LAND2.updateTime=2025-12-21 11\:15\:33
-LAND1.returnPathRawCoordinates=-1
-LAND2.createTime=2025-12-20 12\:24\:28
-LAND1.mowingWidth=34
-LAND2.returnPathCoordinates=38.12,1.53;33.80,0.59;31.15,-0.38;30.26,-1.26;30.03,-2.37;30.34,-5.22;34.16,-26.79;34.23,-28.32;33.75,-29.45;32.72,-30.03;31.41,-30.28;30.15,-30.22;29.26,-29.73;28.93,-28.62;28.01,-22.74
+#Mon Dec 22 13:08:01 CST 2025
LAND2.angleThreshold=-1
-LAND2.boundaryPointInterval=-1
-LAND2.mowingWidth=34
-LAND1.plannedPath=-5.830841,-2.644443;-12.323966,-4.153883;-12.276978,-4.492026;-6.161845,-3.070456;-6.492848,-3.496470;-12.229991,-4.830169;-12.183003,-5.168312;-6.823852,-3.922484;-7.154855,-4.348497;-12.136016,-5.506455;-12.089028,-5.844598;-7.487144,-4.774810;-7.821079,-5.201505;-12.042040,-6.182741;-11.995053,-6.520885;-8.155014,-5.628200;-8.700347,-6.104039;-11.948065,-6.859028;-11.901077,-7.197171;-10.070186,-6.771548;-11.440025,-7.439057;-11.854090,-7.535314
-LAND1.updateTime=2025-12-19 19\:44\:17
-LAND2.mowingSafetyDistance=0.50
-LAND2.plannedPath=-12.031,-3.808;-10.774,-3.615;-9.790,-3.809;-12.167,-4.172;-12.302,-4.537;-8.807,-4.002;-7.823,-4.196;-12.280,-4.878;-12.158,-5.203;-6.838,-4.389;-5.852,-4.582;-12.036,-5.528;-11.914,-5.854;-4.868,-4.775;-3.884,-4.969;-11.792,-6.179;-11.670,-6.504;-2.901,-5.162;-1.917,-5.355;-11.547,-6.829;-11.425,-7.155;-0.931,-5.548;0.055,-5.741;-11.303,-7.480;-11.181,-7.805;1.038,-5.935;2.022,-6.128;-11.059,-8.130;-10.937,-8.456;3.005,-6.322
-LAND1.baseStationCoordinates=3949.89151752,N,11616.79267501,E
-LAND2.boundaryOriginalCoordinates=39.831468,116.279941,49.29;39.831465,116.279925,49.33;39.831463,116.279908,49.34;39.831462,116.279891,49.35;39.831461,116.279874,49.33;39.831458,116.279859,49.34;39.831456,116.279843,49.32;39.831454,116.279827,49.32;39.831452,116.279813,49.42;39.831450,116.279798,49.41;39.831448,116.279783,49.36;39.831447,116.279769,49.26;39.831445,116.279757,49.24;39.831445,116.279747,49.38;39.831448,116.279741,49.27;39.831455,116.279736,49.26;39.831463,116.279733,49.26;39.831473,116.279731,49.26;39.831483,116.279729,49.25;39.831491,116.279730,49.26;39.831496,116.279735,49.22;39.831497,116.279748,49.27
-LAND1.boundaryPointInterval=-1
-LAND1.createTime=2025-12-19 18\:31\:53
-LAND2.returnPointCoordinates=-1
-LAND2.mowingTrack=-1
-LAND1.userId=-1
-LAND1.angleThreshold=-1
-LAND2.mowingBladeWidth=0.40
-LAND1.landName=21233
-LAND1.mowingTrack=-1
LAND2.baseStationCoordinates=3949.89151752,N,11616.79267501,E
-LAND1.boundaryOriginalCoordinates=39.831445,116.279757,49.24;39.831445,116.279747,49.38;39.831448,116.279741,49.27;39.831455,116.279736,49.26;39.831463,116.279733,49.26;39.831473,116.279731,49.26;39.831483,116.279729,49.25;39.831491,116.279730,49.26;39.831496,116.279735,49.22;39.831497,116.279748,49.27;39.831498,116.279762,49.27;39.831500,116.279776,49.34;39.831502,116.279791,49.32;39.831504,116.279805,49.27;39.831507,116.279820,49.28
-LAND1.boundaryCoordinates=-10.36,-8.92;-12.10,-7.80;-12.66,-3.77;-4.96,-1.98;-6.04,-3.37;-7.12,-4.76;-8.20,-6.14;-9.28,-7.53;-10.36,-8.92
-LAND2.mowingPattern=骞宠绾�
+LAND2.boundaryCoordinates=5.38,-6.41;-11.15,-8.94;-12.75,-4.68;-12.23,-3.28;-11.12,-3.17;-9.29,-3.53;-7.46,-3.89;-5.62,-4.25;-3.79,-4.61;-1.96,-4.97;-0.12,-5.33;1.71,-5.69;3.54,-6.05;5.38,-6.41
+LAND2.boundaryOriginalCoordinates=39.831468,116.279941,49.29;39.831465,116.279925,49.33;39.831463,116.279908,49.34;39.831462,116.279891,49.35;39.831461,116.279874,49.33;39.831458,116.279859,49.34;39.831456,116.279843,49.32;39.831454,116.279827,49.32;39.831452,116.279813,49.42;39.831450,116.279798,49.41;39.831448,116.279783,49.36;39.831447,116.279769,49.26;39.831445,116.279757,49.24;39.831445,116.279747,49.38;39.831448,116.279741,49.27;39.831455,116.279736,49.26;39.831463,116.279733,49.26;39.831473,116.279731,49.26;39.831483,116.279729,49.25;39.831491,116.279730,49.26;39.831496,116.279735,49.22;39.831497,116.279748,49.27
+LAND2.boundaryPointInterval=-1
+LAND2.createTime=2025-12-20 12\:24\:28
+LAND2.intelligentSceneAnalysis=-1
+LAND2.landArea=55.11
+LAND2.landName=1452
LAND2.landNumber=LAND2
-LAND1.mowingBladeWidth=0.40
+LAND2.mowingBladeWidth=0.40
+LAND2.mowingOverlapDistance=0.06
+LAND2.mowingPattern=骞宠绾�
+LAND2.mowingSafetyDistance=0.50
+LAND2.mowingTrack=-1
+LAND2.mowingWidth=34
+LAND2.plannedPath=-12.031,-3.808;-10.774,-3.615;-9.790,-3.809;-12.167,-4.172;-12.302,-4.537;-8.807,-4.002;-7.823,-4.196;-12.280,-4.878;-12.158,-5.203;-6.838,-4.389;-5.852,-4.582;-12.036,-5.528;-11.914,-5.854;-4.868,-4.775;-3.884,-4.969;-11.792,-6.179;-11.670,-6.504;-2.901,-5.162;-1.917,-5.355;-11.547,-6.829;-11.425,-7.155;-0.931,-5.548;0.055,-5.741;-11.303,-7.480;-11.181,-7.805;1.038,-5.935;2.022,-6.128;-11.059,-8.130;-10.937,-8.456;3.005,-6.322
+LAND2.returnPathCoordinates=38.12,1.53;33.80,0.59;31.15,-0.38;30.26,-1.26;30.03,-2.37;30.34,-5.22;34.16,-26.79;34.23,-28.32;33.75,-29.45;32.72,-30.03;31.41,-30.28;30.15,-30.22;29.26,-29.73;28.93,-28.62;28.01,-22.74
+LAND2.returnPathRawCoordinates=38.12,1.53;36.68,1.24;35.24,0.94;33.80,0.59;32.43,0.16;31.15,-0.38;30.26,-1.26;30.03,-2.37;30.12,-3.81;30.34,-5.22;30.59,-6.60;30.87,-7.98;31.10,-9.36;31.33,-10.77;31.57,-12.20;31.82,-13.68;32.07,-15.16;32.28,-16.60;32.52,-17.92;32.78,-19.37;33.07,-20.80;33.35,-22.37;33.62,-23.91;33.89,-25.35;34.16,-26.79;34.23,-28.32;33.75,-29.45;32.72,-30.03;31.41,-30.28;30.15,-30.22;29.26,-29.73;28.93,-28.62;28.72,-27.16;28.54,-25.66;28.26,-24.17;28.01,-22.74
+LAND2.returnPointCoordinates=-1
+LAND2.updateTime=2025-12-21 11\:15\:33
+LAND2.userId=-1
diff --git a/set.properties b/set.properties
index 00d235c..b41aff2 100644
--- a/set.properties
+++ b/set.properties
@@ -1,19 +1,19 @@
#Mower Configuration Properties - Updated
-#Sun Dec 21 20:48:14 GMT+08:00 2025
+#Mon Dec 22 13:47:46 CST 2025
appVersion=-1
-simCardNumber=-1
-currentWorkLandNumber=LAND2
-serialBaudRate=115200
boundaryLengthVisible=false
-idleTrailDurationSeconds=60
-handheldMarkerId=1872
-viewCenterX=-37.40
-viewCenterY=0.91
-manualBoundaryDrawingMode=false
-mowerId=860
-serialPortName=COM15
-serialAutoConnect=true
-mapScale=11.61
-measurementModeEnabled=false
-firmwareVersion=-1
+currentWorkLandNumber=LAND2
cuttingWidth=200
+firmwareVersion=-1
+handheldMarkerId=1872
+idleTrailDurationSeconds=60
+manualBoundaryDrawingMode=false
+mapScale=25.45
+measurementModeEnabled=false
+mowerId=860
+serialAutoConnect=true
+serialBaudRate=115200
+serialPortName=COM15
+simCardNumber=-1
+viewCenterX=-27.62
+viewCenterY=-15.01
diff --git a/shoudongbianjie.properties b/shoudongbianjie.properties
index b08be21..e01b3b4 100644
--- a/shoudongbianjie.properties
+++ b/shoudongbianjie.properties
@@ -1,11 +1,11 @@
#\u624B\u52A8\u7ED8\u5236\u8FB9\u754C\u5750\u6807 - \u683C\u5F0F: x1,y1;x2,y2;...;xn,yn (\u5355\u4F4D:\u7C73,\u7CBE\u786E\u5230\u5C0F\u6570\u70B9\u540E2\u4F4D)
-#Fri Dec 19 19:18:05 CST 2025
-boundaryCoordinates=-7.66,-10.73;-9.27,-9.14;-5.87,-8.78
+#Mon Dec 22 13:04:43 CST 2025
+boundaryCoordinates=35.56,-10.63;28.61,2.02;34.81,9.97;45.73,-6.54;43.75,-13.48
email=789
language=zh
lastLoginTime=-1
password=123
-pointCount=3
+pointCount=5
registrationTime=-1
status=-1
userId=-1
diff --git a/src/bianjie/shudongdraw.java b/src/bianjie/shudongdraw.java
index 022e3d5..e96c923 100644
--- a/src/bianjie/shudongdraw.java
+++ b/src/bianjie/shudongdraw.java
@@ -26,6 +26,7 @@
// 棰滆壊瀹氫箟
private static final Color MANUAL_BOUNDARY_COLOR = new Color(255, 0, 0); // 绾㈣壊
+ private static final Color MANUAL_BOUNDARY_LINE_COLOR = new Color(0, 100, 0); // 澧ㄧ豢鑹�
private static final Color MANUAL_BOUNDARY_FILL_COLOR = new Color(255, 0, 0, 50); // 鍗婇�忔槑绾㈣壊濉厖
private static final Color MOUSE_POSITION_COLOR = new Color(255, 0, 0, 128); // 鍗婇�忔槑绾㈣壊锛堥紶鏍囦綅缃級
@@ -126,7 +127,7 @@
// 缁樺埗杈圭晫绾匡紙鑷冲皯闇�瑕�2涓偣锛�
if (points.size() >= 2) {
g2d.setStroke(new BasicStroke(strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
- g2d.setColor(MANUAL_BOUNDARY_COLOR);
+ g2d.setColor(MANUAL_BOUNDARY_LINE_COLOR);
Path2D.Double borderPath = new Path2D.Double();
borderPath.moveTo(points.get(0).x, points.get(0).y);
@@ -144,7 +145,7 @@
// 鍗充娇鍙湁涓�涓偣涔熻缁樺埗
if (points.size() >= 1) {
// 灏嗙嚎鏉″搴﹁浆鎹负涓栫晫鍧愭爣鐨勭洿寰勶紝鐩村緞鏄嚎鏉″搴︾殑2鍊�
- double pointDiameter = (strokeWidth * 2) / scale;
+ double pointDiameter = strokeWidth * 2;
g2d.setColor(MANUAL_BOUNDARY_COLOR);
for (Point2D.Double point : points) {
Ellipse2D.Double marker = new Ellipse2D.Double(
@@ -182,7 +183,7 @@
// 璁$畻绾挎潯瀹藉害
float strokeWidth = (float) (3 / Math.max(0.5, scale));
// 榧犳爣浣嶇疆鍦嗗湀鐩村緞鏄嚎鏉″搴︾殑2鍊�
- double mouseCircleDiameter = (strokeWidth * 2) / scale;
+ double mouseCircleDiameter = strokeWidth * 2;
// 缁樺埗榧犳爣浣嶇疆鐨勫渾鍦堬紙浣跨敤鍗婇�忔槑棰滆壊锛�
g2d.setColor(MOUSE_POSITION_COLOR);
diff --git a/src/zhuye/Shouye.java b/src/zhuye/Shouye.java
index 97dddac..27a166d 100644
--- a/src/zhuye/Shouye.java
+++ b/src/zhuye/Shouye.java
@@ -35,6 +35,7 @@
import java.awt.geom.Point2D;
import publicway.Gpstoxuzuobiao;
+import publicway.Fanhuibutton;
/**
* 棣栭〉鐣岄潰 - 閫傞厤6.5瀵哥珫灞忥紝浣跨敤鐙珛鐨凪apRenderer杩涜缁樺埗
@@ -561,7 +562,7 @@
private void showSettingsReturnButton() {
ensureFloatingButtonInfrastructure();
if (settingsReturnButton == null) {
- settingsReturnButton = createFloatingTextButton("杩斿洖");
+ settingsReturnButton = Fanhuibutton.createReturnButton(null);
settingsReturnButton.setToolTipText("杩斿洖绯荤粺璁剧疆");
settingsReturnButton.addActionListener(e -> {
// 鍏抽棴鎵�鏈夌浉鍏虫ā寮�
@@ -1411,6 +1412,8 @@
remoteBtn.addActionListener(e -> showRemoteControlDialog());
areaSelectBtn.addActionListener(e -> {
// 鐐瑰嚮鈥滃湴鍧椻�濈洿鎺ユ墦寮�鍦板潡绠$悊瀵硅瘽妗嗭紙鑻ラ渶瑕佸彲浼犲叆鐗瑰畾鍦板潡缂栧彿锛�
+// Dikuaiguanli.showDikuaiManagement(this, null);
+ // 鐩存帴杩涘叆鍦板潡绠$悊鐣岄潰
Dikuaiguanli.showDikuaiManagement(this, null);
});
baseStationBtn.addActionListener(e -> showBaseStationDialog());
@@ -3115,15 +3118,16 @@
enterDrawingControlMode();
// 闅愯棌杩斿洖璁剧疆鎸夐挳锛堝鏋滄樉绀虹粯鍒舵寜閽紝鍒欎笉搴旇鏄剧ず杩斿洖鎸夐挳锛�
- if (settingsReturnButton != null) {
- settingsReturnButton.setVisible(false);
- }
+// if (settingsReturnButton != null) {
+// settingsReturnButton.setVisible(false);
+// }
// 鏄剧ず"姝e湪缁樺埗杈圭晫"鎻愮ず
if (drawingBoundaryLabel != null) {
// 濡傛灉鏄線杩旇矾寰勭粯鍒讹紝涓嶆樉绀烘鏍囩锛堢姸鎬佹爮宸叉樉绀�"姝e湪缁樺埗寰�杩旇矾寰�"锛�
- boolean isReturnPathDrawing = returnPathDrawer != null && returnPathDrawer.isActive();
- drawingBoundaryLabel.setVisible(!isReturnPathDrawing);
+// boolean isReturnPathDrawing = returnPathDrawer != null && returnPathDrawer.isActive();
+// drawingBoundaryLabel.setVisible(!isReturnPathDrawing);
+ drawingBoundaryLabel.setVisible(true);
}
boolean enableCircleGuidance = drawingShape != null
@@ -3840,9 +3844,8 @@
endDrawingButton.setVisible(false);
}
if (pathPreviewReturnButton == null) {
- pathPreviewReturnButton = createFloatingTextButton("杩斿洖");
+ pathPreviewReturnButton = Fanhuibutton.createReturnButton(e -> handlePathPreviewReturn());
pathPreviewReturnButton.setToolTipText("杩斿洖鏂板鍦板潡姝ラ");
- pathPreviewReturnButton.addActionListener(e -> handlePathPreviewReturn());
}
pathPreviewReturnButton.setVisible(true);
if (floatingButtonPanel != null) {
--
Gitblit v1.10.0