张世豪
2 天以前 c9b1d33979b3972fe6a82fa427b4ba9a20989112
src/zhuye/Shouye.java
@@ -113,10 +113,13 @@
   private final Consumer<String> serialLineListener = line -> {
      SwingUtilities.invokeLater(() -> {
         updateDataPacketCountLabel();
         // 如果收到$GNGGA数据,立即更新拖尾
         if (line != null && line.trim().startsWith("$GNGGA")) {
            if (mapRenderer != null && !pathPreviewActive) {
               mapRenderer.forceUpdateIdleMowerTrail();
         // 如果收到GGA数据,立即更新拖尾
         if (line != null) {
            String trimmed = line.trim();
            if (trimmed.startsWith("$GNGGA") || trimmed.startsWith("$GPGGA") || trimmed.startsWith("$GBGGA")) {
               if (mapRenderer != null && !pathPreviewActive) {
                  mapRenderer.forceUpdateIdleMowerTrail();
               }
            }
         }
      });
@@ -4391,17 +4394,4 @@
        visualizationPanel.repaint();
    }
   // 测试方法
    public static void main(String[] args) {
        JFrame frame = new JFrame("AutoMow - 首页");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 800);
        frame.setLocationRelativeTo(null);
        Shouye shouye = new Shouye();
        frame.add(shouye);
        frame.setVisible(true);
        UDPServer.startAsync();//启动数据接收线程
    }
}