Example #1
0
        private void DoAppendLoop(Random random)
        {
            using (Surface.SuspendUpdates())
            {
                _xValues.Clear();
                _firstYValues.Clear();
                _secondYValues.Clear();
                _thirdYValues.Clear();

                for (var i = 0; i < BufferSize; i++)
                {
                    _xValue++;
                    _yValue += random.NextDouble() - 0.5;

                    _xValues.Add(_xValue);
                    _firstYValues.Add((float)_yValue);
                    _secondYValues.Add((float)_maLow.Push(_yValue).Current);
                    _thirdYValues.Add((float)_maHigh.Push(_yValue).Current);
                }

                _mainSeries.Append(_xValues, _firstYValues);
                _maLowSeries.Append(_xValues, _secondYValues);
                _maHighSeries.Append(_xValues, _thirdYValues);

                var count = _mainSeries.Count + _maLowSeries.Count + _maHighSeries.Count;
                var text  = "Amount of points: " + count;

                // need to set text from UI thread to prevent exception
                _uiThreadHandler.Post(() =>
                {
                    _textView.SetText(text, TextView.BufferType.Normal);
                });
            }
        }
Example #2
0
        private void DoAppendLoop()
        {
            using (Surface.SuspendUpdates())
            {
                _xValues.Clear();
                _firstYValues.Clear();
                _secondYValues.Clear();
                _thirdYValues.Clear();

                for (var i = 0; i < BufferSize; i++)
                {
                    _xValue++;
                    _yValue += _random.NextDouble() - 0.5;

                    _xValues.Add(_xValue);
                    _firstYValues.Add((float)_yValue);
                    _secondYValues.Add((float)_maLow.Push(_yValue).Current);
                    _thirdYValues.Add((float)_maHigh.Push(_yValue).Current);
                }

                _mainSeries.Append(_xValues, _firstYValues);
                _maLowSeries.Append(_xValues, _secondYValues);
                _maHighSeries.Append(_xValues, _thirdYValues);
            }
        }
            public override void Update()
            {
                var xyRenderPassData = (OhlcRenderPassData)RenderableSeries.CurrentRenderPassData;
                var xValues          = xyRenderPassData.XValues;

                var x1 = (double)_annotation.X1Value;
                var x2 = (double)_annotation.X2Value;

                var min = Math.Min(x1, x2);
                var max = Math.Max(x1, x2);

                _colors.Clear();
                for (int i = 0; i < xyRenderPassData.PointsCount(); i++)
                {
                    var value = xValues.Get(i);
                    if (value > min && value < max)
                    {
                        _colors.Add(_color);
                    }
                    else
                    {
                        _colors.Add(DefaultColor);
                    }
                }
            }
Example #4
0
        private void AccelY_doAppendLoop(double[] dataMean, double[] dataVar)
        {
            int len = dataMean.Length;

            IntegerValues XValues      = new IntegerValues(len);
            FloatValues   YValues_mean = new FloatValues(len);
            FloatValues   YValues_var  = new FloatValues(len);

            using (g_accelY_Surface.SuspendUpdates())
            {
                g_accelY_XValue++;

                XValues.Clear();
                YValues_mean.Clear();
                YValues_var.Clear();

                for (var i = 0; i < dataMean.Length; i++)
                {
                    XValues.Add(g_accelY_XValue);
                    YValues_mean.Add((float)dataMean[i]);
                    YValues_var.Add((float)dataVar[i]);
                }

                g_accelY_MeanSeries.Append(XValues, YValues_mean);
                g_accelY_VarSeries.Append(XValues, YValues_var);
            }
        }
            public override void Update()
            {
                _colors.Clear();

                var pointsCount = RenderableSeries.CurrentRenderPassData.PointsCount();

                for (int i = 0; i < pointsCount; i++)
                {
                    _colors.Add((int)_desiredColors[i % 3]);
                }
            }