private void GenerateXML() { while (true) { Thread.Sleep(30 * 60 * 1000); //10分钟 SysConfig.DTU_StationConfig.GenerateFromDbToXML(); SysConfig.DTU_StationConfig.ReadConfig(); V88CommunicationThread.getInstance().readConfig(); DTU_ClientManager.Update(); } }
private void dbToXML() { DateTime start = DateTime.Now; LogMg.AddDebug("准备开始从数据库生成站点和检测点配置"); //if (SysConfig.DTU_StationConfig.GenerateFromDbToXML() == true) if (SysConfig.DTU_StationConfig.GenerateFromDbToXML() == true && SysConfig.GD_Config.GenerateConfig() == true) { LogMg.AddDebug("从数据库生成站点和检测点配置到XML成功"); //MessageBox.Show(""); SysConfig.ReadConfig(); DTU_ClientManager.Update(); BeginInvoke(new Action <String>(showMessageBox), "已成功从数据库生成配置"); } else { LogMg.AddDebug("从数据库生成站点和检测点配置失败"); BeginInvoke(new Action <String>(showMessageBox), "从数据库生成站点和检测点配置失败,请查看日志文件"); } DateTime end = DateTime.Now; LogMg.AddInfo("生成xml并读取配置到内存耗时:" + DateUtil.datediff(start, end)); }