12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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<string, string> GetChamberList()
- {
- Dictionary<string, string> lst = new Dictionary<string, string>();
- lst["Transfer"] = "传送腔";
- lst["ReactorA"] = "A腔";
- lst["ReactorB"] = "B腔";
- lst["ReactorC"] = "C腔";
- lst["ReactorD"] = "D腔";
- return lst;
- }
- public Dictionary<string, string> GetRecipeChamberList()
- {
- Dictionary<string, string> lst = new Dictionary<string, string>();
- 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;
- }
- }
- }
|