| | |
| | | import javax.swing.Timer; |
| | | |
| | | import baseStation.BaseStation; |
| | | import set.Setsys; |
| | | import baseStation.BaseStationDialog; |
| | | |
| | | import java.awt.*; |
| | |
| | | add(controlPanel, BorderLayout.SOUTH); |
| | | |
| | | // 初始化地图渲染器 |
| | | mapRenderer = new MapRenderer(visualizationPanel); |
| | | mapRenderer = new MapRenderer(visualizationPanel); |
| | | applyIdleTrailDurationFromSettings(); |
| | | |
| | | // 初始化对话框引用为null,延迟创建 |
| | | legendDialog = null; |
| | |
| | | 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()); |
| | |
| | | } |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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); |