private void AddGraph_OnClick(object sender, RoutedEventArgs e)
        {
            var uid = ((Button)sender).Uid;
            var ods = InitSource();

            Plotter.AddLineGraph(ods, 1, uid);
            switch (uid)
            {
            case "GSource":
                ods.AppendMany(GSource);
                break;

            case "CssSource":
                ods.AppendMany(CssSource);
                break;

            case "CdSource":
                ods.AppendMany(CdSource);
                break;

            case "AddSource":
                ods.AppendMany(AddSource);
                break;

            case "AdsSource":
                ods.AppendMany(AdsSource);
                break;
            }
        }
Exemplo n.º 2
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //初始化Plotter
            Plotter.AddLineGraph(_dynamicDataDisplay.DataSource, Colors.Red, 2, "历史等待人数");

            //注册定时更新事件
            var timer = new DispatcherTimer(TimeSpan.FromSeconds(5), DispatcherPriority.Normal, updateTime_Tick,
                                            Dispatcher);

            timer.Start();
        }
Exemplo n.º 3
0
        private void ChkItemRecord_OnChecked(object sender, RoutedEventArgs e)
        {
            ToggleButton chkSelecttedItem = (ToggleButton)sender;

            if (chkSelecttedItem.Content != null)
            {
                string nameLine = chkSelecttedItem.Tag.ToString();
                var    source   = new ObservableDataSource <PointsGraph>();
                source.SetXMapping(x => SpanAxis.ConvertToDouble(x.TimeG));
                source.SetYMapping(y => y.PointG);
                var uid = ((string)chkSelecttedItem.Uid).Split('.').Last();
                _lstGraph.Add(new GraphInfo
                {
                    LineGraph = Plotter.AddLineGraph(source, 2, nameLine),
                    Source    = source,
                    Uid       = uid
                });
                AddToLog("Отображен график: " + nameLine);
            }
        }