From 48ee74129bb09a817a0bbbabe860c4007b74c66b Mon Sep 17 00:00:00 2001
From: 826220679@qq.com <826220679@qq.com>
Date: 星期日, 21 十二月 2025 12:37:44 +0800
Subject: [PATCH] 新增了往返路径

---
 src/yaokong/Control02.java |   26 +++-----------------------
 1 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/src/yaokong/Control02.java b/src/yaokong/Control02.java
index afe55be..5cef25c 100644
--- a/src/yaokong/Control02.java
+++ b/src/yaokong/Control02.java
@@ -3,6 +3,8 @@
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
+import publicway.Gpstoxuzuobiao;
+
 public class Control02 {
     
     /**
@@ -98,29 +100,7 @@
      * 渚嬪锛�3949.90238860 -> 39.83170647666667
      */
     private static double parseDMToDecimal(String dmm, String direction) {
-        try {
-            // 鎵惧埌灏忔暟鐐圭殑浣嶇疆
-            int dotIndex = dmm.indexOf('.');
-            if (dotIndex < 2) {
-                throw new IllegalArgumentException("搴﹀垎鏍煎紡閿欒: " + dmm);
-            }
-            
-            // 鎻愬彇搴﹀拰鍒�
-            int degrees = Integer.parseInt(dmm.substring(0, dotIndex - 2));
-            double minutes = Double.parseDouble(dmm.substring(dotIndex - 2));
-            
-            // 杞崲涓哄崄杩涘埗
-            double decimal = degrees + minutes / 60.0;
-            
-            // 鏍规嵁鏂瑰悜璋冩暣姝h礋
-            if ("S".equalsIgnoreCase(direction) || "W".equalsIgnoreCase(direction)) {
-                decimal = -decimal;
-            }
-            
-            return decimal;
-        } catch (Exception e) {
-            throw new IllegalArgumentException("鍧愭爣鏍煎紡瑙f瀽閿欒: " + dmm, e);
-        }
+        return Gpstoxuzuobiao.parseDMToDecimal(dmm, direction);
     }
     
     private static String bytesToHex(byte[] bytes) {

--
Gitblit v1.10.0