Beispiel #1
0
        public DataLineFile1D(string name, Stream1DReader reader, int samplerate, TimeStamp begin)
        {
            _zoomLevels = new [] { 64, 128, 256, 512, 1024, 2048, 4096, 8192, 2 * 8192 };

            var biggestScreen = System.Windows.Forms.Screen.AllScreens.Max(screen => screen.WorkingArea.Size);
            var bufferSize    = biggestScreen.Width * _zoomLevels.First();

            _begin         = begin;
            _reader        = reader;
            _samplerate    = samplerate;
            _floatTemp     = new float[bufferSize];
            _doubleTemp    = new double[bufferSize];
            _minMaxTemp    = new MinMax[bufferSize];
            _ringBuffer    = new VertexRingBuffer(bufferSize);
            _ringBufferMax = new VertexRingBuffer(bufferSize);
            _ringBufferMin = new VertexRingBuffer(bufferSize);

            Name = name;

            ReadFile();
        }
Beispiel #2
0
        /// <summary>
        /// Continuous-time stream of data
        /// </summary>
        /// <param name="size">number of samples the buffer can hold</param>
        public DataLine1D(string name, int size, int samplerate)
        {
            _zoomLevels = new[] {
                1 << 6,
                    1 << 7,
                    1 << 8,
                    1 << 9,
                    1 << 10,
                    1 << 11,
                    1 << 12,
                    1 << 13,
                    1 << 14,
                    1 << 15,
                    1 << 16
            };



            _ringBuffer    = new VertexRingBuffer(size);
            _ringBufferMax = new VertexRingBuffer(size);
            _ringBufferMin = new VertexRingBuffer(size);
            _floatTemp     = new float[size];
            _minMaxTemp    = new MinMax[size];

            Name = name;

            SamplesPerSecond = samplerate;
            _signalBuffer    = new GenericRingBuffer <float>(size)
            {
                FixedSize = true
            };
            _minMax    = MinMaxCache.CreateCascade(_zoomLevels, size);
            _minMaxFst = (MinMaxCacheFirstStage)_minMax[0];

            // init as -2 because -1 is for fully zoomed in and 0-.. is for other zoom levels.
            // -2 so that in Render() a level change occurs
            _level = -2;
        }