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; } }
// 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; }
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; }
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>>(); }