private void AppendData(Random random) { _yValue += random.NextDouble() - 0.5; _dataSeries.Append(_t, _yValue); _t += OneOverTimeInteval; if (_t > VisibleRangeMax) { _xVisibleRange.SetMinMax(_xVisibleRange.Min + OneOverTimeInteval, _xVisibleRange.Max + OneOverTimeInteval); } }
private void OnTick(object sender, ElapsedEventArgs e) { lock (_timer) { _yValue += _random.NextDouble() - 0.5; _dataSeries.Append(_t, _yValue); _t += OneOverTimeInteval; if (_t > VisibleRangeMax) { _xVisibleRange.SetMinMax(_xVisibleRange.Min + OneOverTimeInteval, _xVisibleRange.Max + OneOverTimeInteval); } } }
private void AppendData(Random random) { var y1 = 3.0 * Math.Sin(2 * Math.PI * 1.4 * _t) + random.NextDouble() * 0.5; var y2 = 2.0 * Math.Cos(2 * Math.PI * 0.8 * _t) + random.NextDouble() * 0.5; var y3 = 1.0 * Math.Sin(2 * Math.PI * 2.2 * _t) + random.NextDouble() * 0.5; _ds1.Append(_t, y1); _ds2.Append(_t, y2); _ds3.Append(_t, y3); _t += OneOverTimeInteval; if (_t > VisibleRangeMax) { _xVisibleRange.SetMinMax(_xVisibleRange.Min + OneOverTimeInteval, _xVisibleRange.Max + OneOverTimeInteval); } }
private void OnTick(object sender, ElapsedEventArgs e) { lock (_timer) { var y1 = 3.0 * Math.Sin(((2 * Math.PI) * 1.4) * _t) + _random.NextDouble() * 0.5; var y2 = 2.0 * Math.Cos(((2 * Math.PI) * 0.8) * _t) + _random.NextDouble() * 0.5; var y3 = 1.0 * Math.Sin(((2 * Math.PI) * 2.2) * _t) + _random.NextDouble() * 0.5; _ds1.Append(_t, y1); _ds2.Append(_t, y2); _ds3.Append(_t, y3); _t += OneOverTimeInteval; if (_t > VisibleRangeMax) { _xVisibleRange.SetMinMax(_xVisibleRange.Min + OneOverTimeInteval, _xVisibleRange.Max + OneOverTimeInteval); } } }