using System; using System.Collections.Generic; using System.Linq; using System.Text; using DataAnalysisControl.Core; using Aitex.DataAnalysis.Log; namespace DataAnalysisControl.Core { class DefaultContext : IDataAnalysisControlContext { LogManager _log = new LogManager(); public DefaultContext() { } public Dictionary GetChamberList() { Dictionary lst = new Dictionary(); lst["Transfer"] = "传送腔"; lst["ReactorA"] = "A腔"; lst["ReactorB"] = "B腔"; lst["ReactorC"] = "C腔"; lst["ReactorD"] = "D腔"; return lst; } public Dictionary GetRecipeChamberList() { Dictionary lst = new Dictionary(); lst["ReactorA"] = "A腔"; lst["ReactorB"] = "B腔"; lst["ReactorC"] = "C腔"; lst["ReactorD"] = "D腔"; return lst; } public void Write(string info) { _log.Info(info); } public void Write(Exception ex,string error) { _log.Error(error, ex); } public string GetDBConnString() { string connString = string.Empty; try { connString = System.Configuration.ConfigurationManager.ConnectionStrings["DataAnalysisPostgreSQL"].ConnectionString; } catch (Exception ex) { LOG.Write(ex); } if (string.IsNullOrEmpty(connString)) connString = "Server=localhost;Port=5432;User Id=postgres;Password=123456;Database=postgres;Enlist=true;"; return connString; } } }