예제 #1
0
 public QueueListSource(int capacity)
 {
     _capacity  = capacity;
     collection = new QueueCollection <T>(capacity);
     this.collection.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnCollectionChanged);
     handle = new FIFOHandler(FIFO);
     if (typeof(T) == typeof(Point))
     {
         this.xyMapping = ((T t) => (Point)((object)t));
     }
 }
예제 #2
0
 public DAServer()
 {
     /*hda = new HDAQueue(MAXHDACAP);历史数据均保存于服务器;本机如需查询,需复制历史数据文件到指定文件夹。
      * 历史数据在服务器上分包(1024字节)发送,客户端每接收一条记录,异步附加或yield return*/
     if (!EventLog.SourceExists(SERVICELOGSOURCE))
     {
         EventLog.CreateEventSource(SERVICELOGSOURCE, SERVICELOGNAME);
     }
     Log         = new EventLog(SERVICELOGNAME);
     Log.Source  = SERVICELOGSOURCE;
     ALARMLIMIT  = ConfigCache.AlarmLimit;
     CYCLE       = ConfigCache.Cycle;
     _scales     = new List <Scaling>();
     _linkedList = new QueueCollection <AlarmItem>(ALARMLIMIT + 10);
     reval       = new ExpressionEval(this);
     InitClient();
     InitServerByDatabase();
     InitConnection();
 }
예제 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            collection = App.Server.AlarmList as QueueCollection <AlarmItem>;
            if (collection != null)
            {
                list2.ItemsSource             = collection;
                collection.CollectionChanged += new NotifyCollectionChangedEventHandler(collection_CollectionChanged);
                //run3.Text = list2.Items.Count.ToString();
            }
            list0.ItemsSource = App.Server.ActivedConditionList;
            //run1.Text = list0.Items.Count.ToString();
            list3.ItemsSource = App.Events;
            var brush = Background as SolidColorBrush;

            if (brush != null)
            {
                colorpicker.SelectedColor = brush.Color;
            }
        }