张世豪
2025-12-05 2144172c7b961d4112850692ed77b46f1ae5d373
src/zhuye/Shouye.java
@@ -4,6 +4,7 @@
import javax.swing.Timer;
import baseStation.BaseStation;
import set.Setsys;
import baseStation.BaseStationDialog;
import java.awt.*;
@@ -156,7 +157,8 @@
        add(controlPanel, BorderLayout.SOUTH);
        
        // 初始化地图渲染器
        mapRenderer = new MapRenderer(visualizationPanel);
    mapRenderer = new MapRenderer(visualizationPanel);
    applyIdleTrailDurationFromSettings();
        
        // 初始化对话框引用为null,延迟创建
        legendDialog = null;
@@ -171,6 +173,28 @@
        initializeDefaultAreaSelection();
        refreshMapForSelectedArea();
    }
    private void applyIdleTrailDurationFromSettings() {
        if (mapRenderer == null) {
            return;
        }
        int durationSeconds = MapRenderer.DEFAULT_IDLE_TRAIL_DURATION_SECONDS;
        String configuredValue = Setsys.getPropertyValue("idleTrailDurationSeconds");
        if (configuredValue != null) {
            String trimmed = configuredValue.trim();
            if (!trimmed.isEmpty()) {
                try {
                    int parsed = Integer.parseInt(trimmed);
                    if (parsed >= 5 && parsed <= 600) {
                        durationSeconds = parsed;
                    }
                } catch (NumberFormatException ignored) {
                    durationSeconds = MapRenderer.DEFAULT_IDLE_TRAIL_DURATION_SECONDS;
                }
            }
        }
        mapRenderer.setIdleTrailDurationSeconds(durationSeconds);
    }
    
    private void createHeaderPanel() {
        headerPanel = new JPanel(new BorderLayout());
@@ -624,8 +648,12 @@
            }
        }
        Device device = new Device();
        device.initFromProperties();
        Device device = Device.getGecaoji();
        if (device == null) {
            device = new Device();
            device.initFromProperties();
            Device.setGecaoji(device);
        }
        if (baseStationDialog == null) {
            baseStationDialog = new BaseStationDialog(dialogParent, THEME_COLOR, device, baseStation);
@@ -783,6 +811,15 @@
        rightPanel.setOpaque(false);
        fixQualityIndicator = new FixQualityIndicator();
        fixQualityIndicator.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        fixQualityIndicator.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                if (SwingUtilities.isLeftMouseButton(e) && mapRenderer != null) {
                    mapRenderer.showMowerInfo();
                }
            }
        });
        mowingProgressLabel = new JLabel("--%");
        mowingProgressLabel.setFont(new Font("微软雅黑", Font.BOLD, 12));
        mowingProgressLabel.setForeground(THEME_COLOR);