张世豪
6 小时以前 a6077217e25f5804027194a5c2848e773eda1abd
src/chushihua/Chushihua.java
@@ -2,6 +2,9 @@
import java.io.File;
import java.util.List;
import dialog.Dingshidialog;
import dialog.Errlog;
import home.MachineConfig;
/**
@@ -66,7 +69,7 @@
            
            return true;
        } catch (Exception e) {
            System.err.println("系统初始化异常: " + e.getMessage());
            Errlog.logOperation("系统初始化异常: " + e.getMessage());
            e.printStackTrace();
            return false;
        }
@@ -83,7 +86,7 @@
                ////System.out.println("系统关闭:轮询查询已停止");
            }
        } catch (Exception e) {
            System.err.println("系统关闭异常: " + e.getMessage());
           Errlog.logOperation("系统关闭异常: " + e.getMessage());
        }
    }
    
@@ -96,7 +99,7 @@
            // 检查配置文件是否存在
            File configFile = new File(configFilePath);
            if (!configFile.exists()) {
                System.err.println("配置文件不存在: " + configFilePath);
                Errlog.logOperation("配置文件不存在: " + configFilePath);
                return false;
            }
            
@@ -119,7 +122,7 @@
            return true;
            
        } catch (Exception e) {
            System.err.println("系统初始化失败: " + e.getMessage());
            Errlog.logOperation("系统初始化失败: " + e.getMessage());
            e.printStackTrace();
            return false;
        }
@@ -176,7 +179,7 @@
     */
    public boolean saveConfig(String configFilePath) {
        if (machineConfig == null) {
            System.err.println("配置未加载,无法保存");
            Errlog.logOperation("配置未加载,无法保存");
            return false;
        }
        
@@ -185,7 +188,7 @@
            ////System.out.println("配置已保存到: " + configFilePath);
            return true;
        } catch (Exception e) {
            System.err.println("保存配置失败: " + e.getMessage());
            Errlog.logOperation("保存配置失败: " + e.getMessage());
            return false;
        }
    }
@@ -195,7 +198,7 @@
     */
    public MachineConfig getMachineConfig() {
        if (!initialized) {
            throw new IllegalStateException("系统未初始化,请先调用initialize()方法");
           Dingshidialog.showTimedDialog(null,10,"系统未初始化成功");
        }
        return machineConfig;
    }