コード例 #1
0
ファイル: GraphView.xaml.cs プロジェクト: oisy/scada
 public void AddDataListener(DataListener listener)
 {
     this.dataListener = listener;
     if (this.dataListener != null)
     {
         this.dataListener.OnDataArrivalBegin += this.OnDataArrivalBegin;
         this.dataListener.OnDataArrival += this.OnDataArrival;
         this.dataListener.OnDataArrivalEnd += this.OnDataArrivalEnd;
     }
 }
コード例 #2
0
ファイル: PanelManager.cs プロジェクト: oisy/scada
        // Search graph
        public SearchGraphView ShowSearchGraphView(ListViewPanel panel, DataListener dataListener, bool realTime)
        {
            SearchGraphView graphView = new SearchGraphView(realTime);
            graphView.Interval = 30;
            if (dataListener.DeviceKey == "scada.naidevice")
            {
                graphView.Interval = 60 * 5;
            }
            // graphView.AddDataListener(dataListener);

            var columnInfoList = dataListener.GetColumnsInfo();
            string deviceKey = dataListener.DeviceKey;

            foreach (var columnInfo in columnInfoList)
            {
                // Time would be deal as a Chart.
                if (columnInfo.BindingName.ToLower() == "time")
                {
                    continue;
                }

                if (columnInfo.DisplayInChart)
                {
                    graphView.AddLineName(deviceKey, columnInfo.BindingName, columnInfo.Header);
                }
            }

            return graphView;
        }
コード例 #3
0
ファイル: PanelManager.cs プロジェクト: oisy/scada
        public ListView ShowListView(ListViewPanel panel, DataListener dataListener)
        {
            // ListView
            ListView listView = new ListView();
            GridView gridView = new GridView();
            listView.View = gridView;

            // 
            var columnInfoList = dataListener.GetColumnsInfo(); // new List<ColumnInfo>();

            foreach (var columnInfo in columnInfoList)
            {
                GridViewColumn col = new GridViewColumn();
                col.Header = columnInfo.Header;
                string bindingName = string.Format("[{0}]", columnInfo.BindingName);
                col.DisplayMemberBinding = new Binding(bindingName.ToLower());
                col.Width = columnInfo.Width;
                gridView.Columns.Add(col);
            }

            return listView;
        }
コード例 #4
0
ファイル: ListViewPanel.xaml.cs プロジェクト: oisy/scada
		public void AddDataListener(DataListener listener)
		{
			this.dataListener = listener;
			if (this.dataListener != null)
			{
				this.dataListener.OnDataArrivalBegin += this.OnDataArrivalBegin;
				this.dataListener.OnDataArrival += this.OnDataArrival;
				this.dataListener.OnDataArrivalEnd += this.OnDataArrivalEnd;
			}

            // TODO: !!
            this.dataSource = new List<Dictionary<string, object>>();

            this.searchDataSource = new List<Dictionary<string, object>>();
		}