Exemplo n.º 1
0
        public SearchHpicGraphView ShowSearchHpicGraphView(ListViewPanel panel, DataListener dataListener)
        {
            SearchHpicGraphView graphView = new SearchHpicGraphView();

            graphView.Interval = 30;

            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);
        }
Exemplo n.º 2
0
        // Real time graph
        public GraphView ShowGraphView(ListViewPanel panel, DataListener dataListener)
        {
            GraphView graphView = new GraphView();

            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; // Do nothing would be OK.
                }

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

            return(graphView);
        }
Exemplo n.º 3
0
        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);
        }