Ejemplo n.º 1
0
        private void UpdateChart(object sender, ChartDataEventArgs e)
        {
            if (e.LeftRawInputYs != null)
            {
                var leftRawInputPlot = (SignalPlot)SignalView.Plot.GetPlottables()[0];
                leftRawInputPlot.Ys = e.LeftRawInputYs;
            }
            if (e.LeftDebouncedInputYs != null)
            {
                var leftDebouncedInputPlot = (SignalPlot)SignalView.Plot.GetPlottables()[1];
                leftDebouncedInputPlot.Ys = e.LeftDebouncedInputYs;
            }

            if (e.RightRawInputYs != null)
            {
                var rightRawInputPlot = (SignalPlot)SignalView.Plot.GetPlottables()[2];
                rightRawInputPlot.Ys = e.RightRawInputYs;
            }
            if (e.RightDebouncedInputYs != null)
            {
                var rightDebouncedInputPlot = (SignalPlot)SignalView.Plot.GetPlottables()[3];
                rightDebouncedInputPlot.Ys = e.RightDebouncedInputYs;
            }

            countersPlotted = new bool[5000];
            // clear all text
            var allText = SignalView.Plot.GetPlottables().Where((plot) => plot.GetType() == typeof(Text));

            foreach (IPlottable text in allText)
            {
                SignalView.Plot.Remove(text);
            }
            countersPlotted = new bool[5000];
            if (SignalView.Plot.GetAxisLimits().XSpan < COUNTER_VISIBLE_THRESHOLD)
            {
                PlotCounters();
            }

            SignalView.Render();
        }