예제 #1
0
파일: AqiNoter.cs 프로젝트: mswlive/AQISet
 public AqiNoter(AqiManage manage)
 {
     name      = "DefaultNoter";
     am        = manage;
     starttime = DateTime.Now;
     history   = new List <NoteNode>();
 }
예제 #2
0
        private DateTime starttime; //开始时间

        #endregion Fields

        #region Constructors

        public AqiNoter(AqiManage manage)
        {
            name = "DefaultNoter";
            am = manage;
            starttime = DateTime.Now;
            history = new List<NoteNode>();
        }
예제 #3
0
 /// <summary>
 /// 一般构造
 ///     独立运行模式使用
 /// </summary>
 /// <param name="aqiManage"></param>
 /// <param name="listSrcUrl"></param>
 /// <param name="name">名称一般同 数据源tag</param>
 public AqiRunner(AqiManage aqiManage, List<ISrcUrl> listSrcUrl, string name)
 {
     this.name = name;
     this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action<object, ElapsedEventArgs>(this.timer_RunEvent));
     this.ias = aqiManage.AqiSave;
     this.an = aqiManage.AqiNote;
     this.ar = aqiManage.AqiRetry;
     this.thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
 }
예제 #4
0
        private ReaderWriterLockSlim thisLock; //读写锁

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 默认构造
        ///     合并运行模式使用
        /// </summary>
        /// <param name="manage"></param>
        /// <param name="listSrcUrl"></param>
        public AqiRunner(AqiManage manage, List<ISrcUrl> listSrcUrl)
        {
            this.name = "DefaultRunner";
            this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action<object, System.Timers.ElapsedEventArgs>(this.timer_RunEvent));
            this.ias = manage.AqiSave;
            this.an = manage.AqiNote;
            this.ar = manage.AqiRetry;
            this.thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
        }
예제 #5
0
 /// <summary>
 /// 一般构造
 ///     独立运行模式使用
 /// </summary>
 /// <param name="aqiManage"></param>
 /// <param name="listSrcUrl"></param>
 /// <param name="name">名称一般同 数据源tag</param>
 public AqiRunner(AqiManage aqiManage, List <ISrcUrl> listSrcUrl, string name)
 {
     this.name      = name;
     this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action <object, ElapsedEventArgs>(this.timer_RunEvent));
     this.ias       = aqiManage.AqiSave;
     this.an        = aqiManage.AqiNote;
     this.ar        = aqiManage.AqiRetry;
     this.thisLock  = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
 }
예제 #6
0
        private ReaderWriterLockSlim thisLock;                   //读写锁

        #endregion

        #region 构造

        /// <summary>
        /// 默认构造
        ///     合并运行模式使用
        /// </summary>
        /// <param name="manage"></param>
        /// <param name="listSrcUrl"></param>
        public AqiRunner(AqiManage manage, List <ISrcUrl> listSrcUrl)
        {
            this.name      = "DefaultRunner";
            this.dictTimer = SrcUrlGroupTimer.CreateList(listSrcUrl, new Action <object, System.Timers.ElapsedEventArgs>(this.timer_RunEvent));
            this.ias       = manage.AqiSave;
            this.an        = manage.AqiNote;
            this.ar        = manage.AqiRetry;
            this.thisLock  = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
        }
예제 #7
0
        private Thread thr; //线程引用

        #endregion Fields

        #region Constructors

        public AqiRetryer(AqiManage manage)
        {
            name = "DefaultRetryer";
            am = manage;

            history = new Dictionary<string, RetryNode>();
            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();
        }
예제 #8
0
        private int m_iMaxCount;                        //队列的最大元素数目

        #endregion

        public AqiRetryer(AqiManage manage)
        {
            name = "DefaultRetryer";
            am   = manage;

            history     = new Dictionary <string, RetryNode>();
            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();
        }
예제 #9
0
 public AqiRinger(AqiManage manage)
 {
     name = "DefaultRinger";
     this.am = manage;
 }
예제 #10
0
파일: AqiRinger.cs 프로젝트: mswlive/AQISet
 public AqiRinger(AqiManage manage)
 {
     name    = "DefaultRinger";
     this.am = manage;
 }