Beispiel #1
0
 public void OnUpdate(object stateInfo)
 {
     while (true)
     {
         Thread.Sleep(_updateRate);
         lock (this)
         {
             if (!_isActive || _isDisposed)
             {
                 return;
             }
             List <HistoryData> hdalist = new List <HistoryData>();
             foreach (short id in _activeList)
             {
                 ITag item = _server[id];
                 if (item != null)
                 {
                     if (item.Refresh() && DataChange != null)
                     {
                         hdalist.Add(new HistoryData(item.ID, item.Quality, item.Value, item.TimeStamp));
                     }
                 }
                 if (DataChange != null)
                 {
                     DataChange.BeginInvoke(this, new DataChangeEventArgs(1, hdalist), null, null);
                 }
             }
         }
     }
 }