| | |
| | | initialize(DEFAULT_CONFIG_PATH); |
| | | |
| | | // 移除自动启动轮询的逻辑,由Homein统一管理 |
| | | System.out.println("系统配置初始化完成,轮询将由主启动类统一管理"); |
| | | ////System.out.println("系统配置初始化完成,轮询将由主启动类统一管理"); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | |
| | | // 停止轮询查询 |
| | | if (lunxun.isPolling()) { |
| | | lunxun.stopPolling(); |
| | | System.out.println("系统关闭:轮询查询已停止"); |
| | | ////System.out.println("系统关闭:轮询查询已停止"); |
| | | } |
| | | } catch (Exception e) { |
| | | System.err.println("系统关闭异常: " + e.getMessage()); |
| | |
| | | // 标记初始化完成 |
| | | initialized = true; |
| | | |
| | | System.out.println("系统初始化完成,配置已加载"); |
| | | System.out.println("设备编号: " + machineConfig.getMachineId()); |
| | | System.out.println("服务器地址: " + machineConfig.getServerAddress() + ":" + machineConfig.getServerPort()); |
| | | System.out.println("卡槽总数: " + machineConfig.getTotalSlots()); |
| | | System.out.println("轮询间隔: " + machineConfig.getPollingInterval() + "ms"); |
| | | System.out.println("波特率: " + machineConfig.getBaudrate()); |
| | | ////System.out.println("系统初始化完成,配置已加载"); |
| | | ////System.out.println("设备编号: " + machineConfig.getMachineId()); |
| | | ////System.out.println("服务器地址: " + machineConfig.getServerAddress() + ":" + machineConfig.getServerPort()); |
| | | ////System.out.println("卡槽总数: " + machineConfig.getTotalSlots()); |
| | | ////System.out.println("轮询间隔: " + machineConfig.getPollingInterval() + "ms"); |
| | | ////System.out.println("波特率: " + machineConfig.getBaudrate()); |
| | | |
| | | return true; |
| | | |
| | |
| | | |
| | | try { |
| | | machineConfig.saveToFile(configFilePath); |
| | | System.out.println("配置已保存到: " + configFilePath); |
| | | ////System.out.println("配置已保存到: " + configFilePath); |
| | | return true; |
| | | } catch (Exception e) { |
| | | System.err.println("保存配置失败: " + e.getMessage()); |