Пример #1
0
        public List <PlotData> GetPlotData()
        {
            List <PlotData> _plotdataList = new List <PlotData>();

            foreach (xIMUData data in myData)
            {
                PlotData _plotdata = new PlotData();

                lock (data.Plotdata)
                {
                    while (data.Plotdata.DataToPlot.Count > 0)
                    {
                        _plotdata.DataToPlot.Enqueue(data.Plotdata.DataToPlot.Dequeue());
                    }
                    _plotdata.Type = data.Plotdata.Type;
                    _plotdataList.Add(_plotdata);
                    //data.Plotdata.DataToPlot.Clear();
                }
            }
            return(_plotdataList);
        }
Пример #2
0
        private void UpdateChart(Series chartX, Series chartY, Series chartZ, PlotData data)
        {
            float[] point    = new float[3];
            float   temTime  = (float)_timerCounter;
            float   interval = (float)_guiUpdateTimer.Interval / (1000 * data.DataToPlot.Count);

            while (data.DataToPlot.Count > 0)
            {
                temTime += interval;
                point    = data.DataToPlot.Dequeue();
                if (point != null)
                {
                    if (_clearSeries)
                    {
                        chartX.Points.Clear();
                        chartY.Points.Clear();
                        chartZ.Points.Clear();
                    }
                    chartX.Points.AddXY(temTime, point[0]);
                    chartY.Points.AddXY(temTime, point[1]);
                    chartZ.Points.AddXY(temTime, point[2]);
                }
            }
        }