예제 #1
0
        private async void Realtimer_Tick(object sender, EventArgs e)
        {
            await Task.Run(() =>
            {
                try
                {
                    //获取读取实时值
                    IOCenterManager.QueryFormManager.ReadRealDevice(this.Server, this.Communication, this.Device);

                    for (int i = 0; i < this.listView.Items.Count; i++)
                    {
                        IORealListViewItem lvi = this.listView.Items[i] as IORealListViewItem;
                        lvi.RefreshParaValue();
                    }
                    this.listView.Refresh();
                    ///刷新曲线数据
                    for (int i = 0; i < IOSeries.Count; i++)
                    {
                        IOSeries[i].RefreshRealData();
                    }
                }
                catch (Exception ex)
                {
                    IOCenterManager.QueryFormManager.DisplyException(ex);
                }
            });
        }