public AqiNoter(AqiManage manage) { name = "DefaultNoter"; am = manage; starttime = DateTime.Now; history = new Dictionary <string, AqiNoteNode>(); }
private DateTime starttime; //开始时间 #endregion Fields #region Constructors public AqiNoter(AqiManage manage) { name = "DefaultNoter"; am = manage; starttime = DateTime.Now; history = new Dictionary<string, AqiNoteNode>(); }
/// <summary> /// 一般构造 /// 独立运行模式使用 /// </summary> /// <param name="aqiManage"></param> /// <param name="srcUrls"></param> /// <param name="strName">名称一般同 数据源TAG</param> public AqiRunner(AqiManage aqiManage, Dictionary<string, ISrcUrl> srcUrls, string strName) { name = strName; sugtlist = SrcUrlGroupTimer.BuildList(srcUrls); ias = aqiManage.AqiSave; an = aqiManage.AqiNote; ar = aqiManage.AqiRetry; }
/// <summary> /// 默认构造 /// 合并运行模式使用 /// </summary> /// <param name="aqiManage"></param> /// <param name="srcUrls"></param> public AqiRunner(AqiManage aqiManage, Dictionary <string, ISrcUrl> srcUrls) { name = "DefaultRunner"; sugtlist = SrcUrlGroupTimer.BuildList(srcUrls); ias = aqiManage.AqiSave; an = aqiManage.AqiNote; ar = aqiManage.AqiRetry; }
public AqiFileSaver(AqiManage aqimanage) { string path = aqimanage.AqiSetting["AqiFileSaver.Path"]; if (!String.IsNullOrEmpty(path)) { basePath = path; } else { basePath = "D:\\AQI\\"; } if(!Directory.Exists(basePath)) { Directory.CreateDirectory(basePath); } Console.WriteLine("基本路径为:" + basePath); }
public AqiFileSaver(AqiManage aqimanage) { string path = aqimanage.AqiSetting["AqiFileSaver.Path"]; if (!String.IsNullOrEmpty(path)) { basePath = path; } else { basePath = "D:\\AQI\\"; } if (!Directory.Exists(basePath)) { Directory.CreateDirectory(basePath); } Console.WriteLine("基本路径为:" + basePath); }
private Thread thr; //线程引用 #endregion Fields #region Constructors public AqiRetryer(AqiManage manage) { name = "DefaultRetryer"; am = manage; history = new Dictionary<string, AqiRetryNode>(); historyLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); m_queue = Queue.Synchronized(new Queue()); m_eventReadAsync = new AutoResetEvent(false); m_eventWriteAsync = new AutoResetEvent(false); m_iCurrentCount = 0; m_iMaxCount = int.MaxValue - 1; int i = AqiManage.Setting.Get<int>("AqiRetryer.MaxQueue"); if (i > 0) { m_iMaxCount = i; } thr = new Thread(threadRun); thr.Start(); }
private int m_iMaxCount; //队列的最大元素数目 #endregion public AqiRetryer(AqiManage manage) { name = "DefaultRetryer"; am = manage; history = new Dictionary <string, AqiRetryNode>(); historyLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); m_queue = Queue.Synchronized(new Queue()); m_eventReadAsync = new AutoResetEvent(false); m_eventWriteAsync = new AutoResetEvent(false); m_iCurrentCount = 0; m_iMaxCount = int.MaxValue - 1; int i = AqiManage.Setting.Get <int>("AqiRetryer.MaxQueue"); if (i > 0) { m_iMaxCount = i; } thr = new Thread(threadRun); thr.Start(); }
public AqiRinger(AqiManage manage) { name = "DefaultRinger"; this.am = manage; }
/// <summary> /// 程序入口 /// </summary> /// <param name="args"></param> static void Main(string[] args) { Thread.CurrentThread.Name = "ConsoleMainThread"; am = new AqiManage(); stack.Push(am); Console.Write(getString()); Console.WriteLine("自动开启运行"); am.ManageEvent += new AqiManage.ManageEventHandler(Program.Log_Event); am.RunAll(); loop(); Environment.Exit(0); }