Exemple #1
0
 public AqiNoter(AqiManage manage)
 {
     name      = "DefaultNoter";
     am        = manage;
     starttime = DateTime.Now;
     history   = new Dictionary <string, AqiNoteNode>();
 }
Exemple #2
0
        private DateTime starttime; //开始时间

        #endregion Fields

        #region Constructors

        public AqiNoter(AqiManage manage)
        {
            name = "DefaultNoter";
            am = manage;
            starttime = DateTime.Now;
            history = new Dictionary<string, AqiNoteNode>();
        }
Exemple #3
0
 /// <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;
 }
Exemple #4
0
 /// <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;
 }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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();
        }
Exemple #8
0
        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();
        }
Exemple #9
0
 public AqiRinger(AqiManage manage)
 {
     name = "DefaultRinger";
     this.am = manage;
 }
Exemple #10
0
 public AqiRinger(AqiManage manage)
 {
     name    = "DefaultRinger";
     this.am = manage;
 }
Exemple #11
0
 /// <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);
 }