//public void AppenData(int[] data)
        public void UpdateHeatmapDataSeries(int[] data)
        {
            WvlLogger.Log(LogType.TraceAll, "UpdateHeatmapDataSeries()");
            //WvlLogger.Log(LogType.TraceAll,"UpdateHeatmapDataSeries - Width : " + width.ToString() + " - Height : " + height.ToString());
            WvlLogger.Log(LogType.TraceValues, "UpdateHeatmapDataSeries() - Data before Array.Copy() : " + Data.Sum().ToString());

            var spectrogramSize = width * height;
            var fftSize         = data.Length;
            var offset          = spectrogramSize - fftSize;

            xChart2count = samplesUpdatedCount * data.Length;

            WvlLogger.Log(LogType.TraceValues, "UpdateHeatmapDataSeries() - set offset : " + offset.ToString());

            try
            {
                Array.Copy(Data, fftSize, Data, 0, offset);
                Array.Copy(data, 0, Data, offset, fftSize);
                WvlLogger.Log(LogType.TraceValues, "UpdateHeatmapDataSeries() - Data after Array.Copy() : " + Data.Sum().ToString());

                heatmapSeries.UpdateZValues(Data);
                WvlLogger.Log(LogType.TraceAll, "UpdateSamplesDataSeries() - UpdateZValues()");
            }
            catch (Exception e)
            {
                WvlLogger.Log(LogType.TraceExceptions, "UpdateSamplesDataSeries() - exception : " + e.ToString());
            }
        }
Exemplo n.º 2
0
        private void OnTick(object sender, ElapsedEventArgs e)
        {
            var values = _valuesList[_timerIndex % SeriesPerPeriod];

            _dataSeries.UpdateZValues(values);

            _timerIndex++;
        }
        protected override void OnElementChanged(ElementChangedEventArgs <SciChartSurfaceView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                SetNativeControl(new SciChartSurface(Android.App.Application.Context));
            }

            if (Control != null)
            {
                var view = (e.NewElement as SciChartSurfaceView);
                view.NativeHandle         = Control.Handle;
                view.OnDataSeriesUpdated += (s, arg) =>
                {
                    switch (Element.ChartSeries.SeriesType)
                    {
                    case RenderableSeriesType.Line:
                        var lineSeries = Element.ChartSeries as LineRenderableSeries;
                        if (lineSeries == null)
                        {
                            break;
                        }
                        UpdateSamplesDataSeries(lineSeries.DataSeries);
                        break;

                    case RenderableSeriesType.Column:
                        var columnSeries = Element.ChartSeries as ColumnRenderableSeries;
                        if (columnSeries == null)
                        {
                            break;
                        }
                        UpdateFFTDataSeries(columnSeries.DataSeries);
                        break;

                    case RenderableSeriesType.Heatmap:
                        var renderSeries = Element.ChartSeries as HeatmapRenderableSeries;
                        if (renderSeries == null)
                        {
                            break;
                        }
                        spectrogramDataSeries.UpdateZValues(renderSeries.Data);
                        break;

                    default:
                        break;
                    }

                    //Control.InvalidateElement();
                };
            }

            if (e.OldElement != null)
            {
                (e.NewElement as SciChartSurfaceView).NativeHandle = IntPtr.Zero;
            }
        }
Exemplo n.º 4
0
        private void UpdateDataSeries(int index)
        {
            var values = ValuesList[index % ValuesList.Count];

            _dataSeries.UpdateZValues(values);
        }
Exemplo n.º 5
0
        private void UpdateDataSeries(int index)
        {
            var values = _valuesList[_timerIndex % SeriesPerPeriod];

            _dataSeries.UpdateZValues(values);
        }
Exemplo n.º 6
0
        protected override void OnElementChanged(ElementChangedEventArgs <SciChartSurfaceView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                SetNativeControl(new SCIChartSurface());
            }

            if (Control != null)
            {
                var view = (e.NewElement as SciChartSurfaceView);
                view.NativeHandle = Control.Handle;

                view.OnDataSeriesUpdated += (s, arg) =>
                {
                    // Get the data and set to the data series and re-invalidate

                    switch (Element.ChartSeries.SeriesType)
                    {
                    case RenderableSeriesType.Line:
                        var lineSeries = Element.ChartSeries as LineRenderableSeries;
                        if (lineSeries == null)
                        {
                            break;
                        }
                        UpdateDataSeries(lineSeries.DataSeries);
                        break;

                    case RenderableSeriesType.Column:
                        var columnSeries = Element.ChartSeries as ColumnRenderableSeries;
                        if (columnSeries == null)
                        {
                            break;
                        }
                        UpdateDataSeries(columnSeries.DataSeries);
                        break;

                    case RenderableSeriesType.Heatmap:
                        var renderSeries = Element.ChartSeries as HeatmapRenderableSeries;
                        if (renderSeries == null)
                        {
                            break;
                        }
                        spectrogramDataSeries.UpdateZValues(renderSeries.Data);
                        break;

                    default:
                        break;
                    }
                };
            }

            if (e.NewElement != null)
            {
                SetSize();
            }

            if (Control != null)
            {
                (e.NewElement as SciChartSurfaceView).NativeHandle = Control.Handle;
            }

            if (e.OldElement != null)
            {
                (e.NewElement as SciChartSurfaceView).NativeHandle = IntPtr.Zero;
            }
        }