Exemplo n.º 1
0
            public void updateBitmap(ColorTable colortable, GridCalculator gridF, GridCalculator gridY, GridCalculator gridCol)
            {
                // Check whethter there is really something new
                if (missingLines == 0)
                {
                    return;
                }

                // Check whether complete redo is necessary
                Boolean redo      = false;
                int     newWidth  = (int)Math.Floor(gridF.high - gridF.low + 0.5);
                int     newHeight = (int)Math.Floor(gridY.low - gridY.high + 0.5);

                if ((newWidth != map.Width) || (newHeight != map.Height))
                {
                    redo = true;
                }
                if (colortable.changed)
                {
                    redo = true;
                }
                if ((gridF.min != gridFMin) || (gridF.max != gridFMax) || (gridF.logScale != gridFLogScale))
                {
                    redo = true;
                }
                if ((gridCol.min != gridColMin) || (gridCol.max != gridColMax))
                {
                    redo = true;
                }

                if (redo)
                {
                    redrawBitmap(colortable, gridF, gridY, gridCol);
                    return;
                }

                // Just an update
                // Shift Content
                Array.Copy(mapdata, missingLines * mapstride, mapdata, 0, (map.Height - missingLines) * mapstride);
                int y = map.Height - 1;
                int f = missingLines;
                int i = 0;

                while (f > 0)
                {
                    WaterfallLine wfl = get(i);
                    if (wfl != null)
                    {
                        wfl.drawToMap(colortable, gridF, gridCol, mapdata, y * mapstride, map.Width);
                    }
                    i++;
                    y--;
                    f--;
                }
                missingLines = 0;
            }
Exemplo n.º 2
0
 public WaterfallLineFIFO(WaterfallSpectrumScreen _root, int _size, int _initialblocksize, double _initialfmax, int _width, int _height)
 {
     size  = _size;
     root  = _root;
     lines = new WaterfallLine[size];
     for (int i = 0; i < size; i++)
     {
         lines[i] = new WaterfallLine(_root, _initialblocksize, _initialfmax);
     }
     write = 0;
     fill  = 0;
     newBitmap(_width, _height);
     missingLines = 0;
 }
Exemplo n.º 3
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (!ready)
            {
                return;
            }
            if (waterfallSpectrum == null)
            {
                return;
            }
            if (waterfallSpectrum.owner == null)
            {
                return;
            }

            int ipfill = input.fill();

            while (ipfill >= _blockSize)
            {
                if ((inputData == null) || (inputData.Length != _blockSize))
                {
                    inputData = new double[_blockSize];
                }
                input.retrieve(ref inputData);

                if (run)
                {
                    WaterfallLine l = waterfallLines.NewforWrite();
                    l.setSize(_blockSize / 2, waterfallSpectrum.owner.sampleRate / 2);
                    fftProcessor.runFFTdBFS(ref inputData, ref l.data);
                }

                ipfill -= _blockSize;
            }
            if (waterfallLines.missingLines > 0)
            {
                waterfallLines.updateBitmap(waterfallSpectrumScreen.colorTable,
                                            waterfallSpectrumScreen.gridF, waterfallSpectrumScreen.gridY,
                                            waterfallSpectrumScreen.gridCol);

                waterfallSpectrumScreen.Invalidate();
            }
        }
Exemplo n.º 4
0
            public void redrawBitmap(ColorTable colorTable, GridCalculator gridF, GridCalculator gridY, GridCalculator gridCol)
            {
                int newWidth  = (int)Math.Floor(gridF.high - gridF.low + 0.5);
                int newHeight = (int)Math.Floor(gridY.low - gridY.high + 0.5);

                if ((newWidth != map.Width) || (newHeight != map.Height))
                {
                    newBitmap(newWidth, newHeight);
                }

                gridFMin           = gridF.min;
                gridFMax           = gridF.max;
                gridFLogScale      = gridF.logScale;
                gridColMin         = gridCol.min;
                gridColMax         = gridCol.max;
                colorTable.changed = false;

                // Clear Map
                System.Array.Clear(mapdata, 0, mapdata.Length);

                int y = map.Height - 1;
                int f = fill;
                int i = 0;

                while ((y >= 0) && (f > 0))
                {
                    WaterfallLine wfl = get(i);
                    if (wfl != null)
                    {
                        wfl.drawToMap(colorTable, gridF, gridCol, mapdata, y * mapstride, map.Width);
                    }
                    i++;
                    y--;
                    f--;
                }
                missingLines = 0;
            }