张世豪
2025-12-12 350782fa02a61cbe112d32905b4ecc39198710cb
src/zhuye/Shouye.java
@@ -16,6 +16,7 @@
import dikuai.addzhangaiwu;
import gecaoji.Device;
import set.Sets;
import set.debug;
import udpdell.UDPServer;
import zhangaiwu.AddDikuai;
import yaokong.Control04;
@@ -1137,17 +1138,15 @@
            stopButtonActive = false;
            updateStopButtonIcon();
         }
         if (!beginMowingSession()) {
            startButtonShowingPause = true;
            statusLabel.setText("待机");
            updateStartButtonAppearance();
            return;
         }
         Control04.sendStartCommandIfDebugSerialOpen();
      if (!beginMowingSession()) {
         startButtonShowingPause = true;
         statusLabel.setText("待机");
         updateStartButtonAppearance();
         return;
      }
      } else {
         statusLabel.setText("暂停中");
         pauseMowingSession();
         Control04.sendPauseCommandIfDebugSerialOpen();
      }
      updateStartButtonAppearance();
   }
@@ -1167,7 +1166,6 @@
         statusLabel.setText("已结束");
         startButtonShowingPause = false;
         stopMowingSession();
         Control04.sendStopCommandIfDebugSerialOpen();
      } else {
         statusLabel.setText("待机");
         startButtonShowingPause = true;
@@ -1459,19 +1457,15 @@
      if (bluetoothBtn == null) {
         return;
      }
      if (Bluelink.isConnected()) {
         Bluelink.disconnect();
         bluetoothConnected = false;
      } else {
         boolean success = Bluelink.connect();
         if (success) {
            bluetoothConnected = true;
         } else {
            bluetoothConnected = false;
            JOptionPane.showMessageDialog(this, "蓝牙连接失败,请重试", "提示", JOptionPane.WARNING_MESSAGE);
         }
      }
      updateBluetoothButtonIcon();
      // 弹出系统调试页面
      showDebugDialog();
   }
   private void showDebugDialog() {
      Window parentWindow = SwingUtilities.getWindowAncestor(this);
      debug debugDialog = new debug(parentWindow, THEME_COLOR);
      debugDialog.setLocationRelativeTo(this); // 居中显示在首页
      debugDialog.setVisible(true);
   }
   private void updateBluetoothButtonIcon() {