Esempio n. 1
0
        // Search graph
        public SearchGraphView ShowSearchGraphView(ListViewPanel panel, DataListener dataListener)
        {
            SearchGraphView graphView = new SearchGraphView();

            if (dataListener.DeviceKey == DataProvider.DeviceKey_NaI)
            {
                graphView.Interval = 60 * 5;
            }
            else
            {
                graphView.Interval = 30;
            }
            /// 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);
        }
Esempio n. 2
0
        // 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;
        }