From d22349714c8d199c02f336f90fba841ef8f5cd39 Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期五, 21 十一月 2025 17:46:23 +0800
Subject: [PATCH] 优化内存后最终版202511211746

---
 src/xitongshezhi/ConfigSet.java |   90 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 75 insertions(+), 15 deletions(-)

diff --git a/src/xitongshezhi/ConfigSet.java b/src/xitongshezhi/ConfigSet.java
index 135de99..77c1313 100644
--- a/src/xitongshezhi/ConfigSet.java
+++ b/src/xitongshezhi/ConfigSet.java
@@ -3,7 +3,6 @@
 import javax.swing.*;
 import javax.swing.border.EmptyBorder;
 
-import chuankou.SystemDebugDialog;
 import chushihua.Chushihua;
 import chushihua.lunxun;
 
@@ -55,13 +54,13 @@
     private final MenuItemListener menuItemListener;
     
     public ConfigSet(JFrame parent) {
-        super(parent, "璁剧疆", true);
+        super(parent, "", true);
         configManager = Chushihua.getInstance();
         menuItemListener = new MenuItemListener();
-     // 璁板綍杩涘叆璁剧疆椤甸潰鍓嶇殑杞鐘舵��
+        // 璁板綍杩涘叆璁剧疆椤甸潰鍓嶇殑杞鐘舵��
         recordPollingStateBeforeEntering();
         initializeUI();
-     // 杩涘叆璁剧疆椤甸潰鏃舵殏鍋滆疆璇�
+        // 杩涘叆璁剧疆椤甸潰鏃舵殏鍋滆疆璇�
         pausePollingWhenEntering();
     }
     
@@ -80,7 +79,7 @@
         if (lunxun.isPolling() && !lunxun.isPaused()) {
             boolean paused = lunxun.setPollingPaused(true);
             if (paused) {
-                System.out.println("杩涘叆璁剧疆椤甸潰锛岃疆璇㈠凡鏆傚仠");
+                //System.out.println("杩涘叆璁剧疆椤甸潰锛岃疆璇㈠凡鏆傚仠");
             } else {
                 System.err.println("杩涘叆璁剧疆椤甸潰锛屾殏鍋滆疆璇㈠け璐�");
             }
@@ -99,7 +98,7 @@
                 if (lunxun.checkSerialConnection()) {
                     boolean resumed = lunxun.setPollingPaused(false);
                     if (resumed) {
-                        System.out.println("閫�鍑鸿缃〉闈紝杞宸叉仮澶�");
+                        //System.out.println("閫�鍑鸿缃〉闈紝杞宸叉仮澶�");
                     } else {
                         System.err.println("閫�鍑鸿缃〉闈紝鎭㈠杞澶辫触");
                     }
@@ -108,7 +107,7 @@
                 }
             }
         } else {
-            System.out.println("閫�鍑鸿缃〉闈紝淇濇寔鍘熸湁杞鐘舵�� - 杩愯: " + wasPollingRunning + ", 鏆傚仠: " + wasPollingPaused);
+            //System.out.println("閫�鍑鸿缃〉闈紝淇濇寔鍘熸湁杞鐘舵�� - 杩愯: " + wasPollingRunning + ", 鏆傚仠: " + wasPollingPaused);
         }
     }
    
@@ -136,7 +135,26 @@
         mainPanel.add(createHeaderPanel(), BorderLayout.NORTH);
         mainPanel.add(createMenuGridPanel(), BorderLayout.CENTER);
         
+        // 娣诲姞鐗堟潈淇℃伅鍦ㄥ簳閮�
+        mainPanel.add(createCopyrightPanel(), BorderLayout.SOUTH);
+        
         getContentPane().add(mainPanel);
+    }
+    
+ // 鍒涘缓鐗堟潈淇℃伅闈㈡澘
+    private JPanel createCopyrightPanel() {
+        JPanel copyrightPanel = new JPanel();
+        copyrightPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
+        copyrightPanel.setOpaque(true);
+        copyrightPanel.setBackground(DARK_COLOR);
+        copyrightPanel.setBorder(new EmptyBorder(10, 0, 5, 0));
+        
+        JLabel copyrightLabel = new JLabel("鍖椾含鍗庢槦鍖楁枟鏅烘帶鎶�鏈湁闄愬叕鍙� 鐗堟潈鎵�鏈� 2025");
+        copyrightLabel.setFont(new Font("Microsoft YaHei", Font.PLAIN, 12));
+        copyrightLabel.setForeground(new Color(160, 160, 160));
+        
+        copyrightPanel.add(copyrightLabel);
+        return copyrightPanel;
     }
     
     private JPanel createHeaderPanel() {
@@ -159,8 +177,11 @@
         closeButton.setOpaque(true); // 纭繚涓嶉�忔槑
         closeButton.setFocusPainted(false);
         closeButton.setBorder(BorderFactory.createEmptyBorder(10, 18, 10, 18));
-        closeButton.setIcon(getCachedIcon("鉁�", 16));
-        closeButton.addActionListener(e -> dispose());
+        closeButton.addActionListener(e -> {
+            // 寮哄埗寮�鍚疆璇㈡煡璇㈠姛鑳�
+            forceStartPolling();
+            dispose();
+        });
         
         // 娣诲姞鎮仠鏁堟灉
         closeButton.addMouseListener(new java.awt.event.MouseAdapter() {
@@ -345,7 +366,7 @@
             	kacaoguanli.showSlotManagementDialog((JFrame) getParent());            	
                 break;
             case "鍘嗗彶璁板綍":
-                showMessageDialog("鍘嗗彶璁板綍鍔熻兘寮�鍙戜腑...");
+            	lishijilu.showHistoryDialog((JFrame) getParent()); 
                 break;
             case "鍙傛暟璁剧疆":
             	canshushezhi.showSettingsDialog((JFrame) getParent()); 
@@ -357,10 +378,10 @@
             	mimaguanli.showPasswordManagementDialog((JFrame) getParent(), configManager);
                 break;
             case "鐗堟湰绠$悊":
-                showMessageDialog("鐗堟湰绠$悊鍔熻兘寮�鍙戜腑...");
+            	banbenguanli.showVersionManagementDialog((JFrame) getParent());
                 break;
             case "璇█璁剧疆":
-                showMessageDialog("璇█璁剧疆鍔熻兘寮�鍙戜腑...");
+                showMessageDialog("璇█璁剧疆涓嶅彲閫夋嫨");
                 break;
         }
     }
@@ -589,12 +610,13 @@
         return icon;
     }
     
-    private void showSystemDebugDialog() {
-        SystemDebugDialog.showSystemDebugDialog((JFrame) getParent());
-    }
+   
     
     @Override
     public void dispose() {
+        // 閫�鍑鸿缃〉闈㈡椂鎭㈠杞鎺у埗
+        SystemDebugDialog.setPollingControlEnabled(true);
+        
         // 閫�鍑鸿缃〉闈㈡椂鎭㈠杞
         resumePollingWhenExiting();
         
@@ -674,5 +696,43 @@
             configDialog.setVisible(true);
         });
     }    
+    /**
+     * 寮哄埗寮�鍚疆璇㈡煡璇㈠姛鑳斤紙鏃犺褰撳墠鐘舵�佸浣曪級
+     */
+    private void forceStartPolling() {
+        try {
+            // 濡傛灉杞鏈繍琛岋紝鍒欏惎鍔ㄨ疆璇�
+            if (!lunxun.isPolling()) {
+                boolean started = lunxun.startPolling();
+                if (started) {
+                    //System.out.println("寮哄埗寮�鍚細杞鏌ヨ宸插惎鍔�");
+                } else {
+                    System.err.println("寮哄埗寮�鍚細鍚姩杞鏌ヨ澶辫触");
+                }
+            } 
+            // 濡傛灉杞宸茶繍琛屼絾澶勪簬鏆傚仠鐘舵�侊紝鍒欐仮澶嶈疆璇�
+            else if (lunxun.isPaused()) {
+                boolean resumed = lunxun.resumePolling();
+                if (resumed) {
+                    //System.out.println("寮哄埗寮�鍚細杞鏌ヨ宸叉仮澶�");
+                } else {
+                    System.err.println("寮哄埗寮�鍚細鎭㈠杞鏌ヨ澶辫触");
+                }
+            }
+            // 濡傛灉杞宸茶繍琛屼笖鏈殏鍋滐紝鍒欐棤闇�鎿嶄綔
+            else {
+                //System.out.println("寮哄埗寮�鍚細杞鏌ヨ宸插湪杩愯涓�");
+            }
+            
+        } catch (Exception e) {
+            System.err.println("寮哄埗寮�鍚疆璇㈡煡璇㈡椂鍙戠敓寮傚父: " + e.getMessage());
+        }
+    }
     
+ // 鍦� showSystemDebugDialog 鏂规硶涓坊鍔�
+    private void showSystemDebugDialog() {
+        // 鍦ㄦ墦寮�璋冭瘯瀵硅瘽妗嗘椂绂佺敤杞鎺у埗
+        SystemDebugDialog.setPollingControlEnabled(false);
+        SystemDebugDialog.showSystemDebugDialog((JFrame) getParent());
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3