From 10733f7a5d742ad69d94d5cc25beddbb3dc4ea37 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 16 Nov 2021 13:23:52 -0600 Subject: [PATCH] Added pip command and fixed waterfall bug --- .github/workflows/build_all.yml | 2 +- core/src/gui/widgets/waterfall.cpp | 36 ------------------------------ core/src/gui/widgets/waterfall.h | 36 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 51e9e153..98322691 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -87,7 +87,7 @@ jobs: run: brew update - name: Install dependencies - run: brew install fftw glew glfw airspy airspyhf portaudio hackrf rtl-sdr libbladerf codec2 + run: brew install fftw glew glfw airspy airspyhf portaudio hackrf rtl-sdr libbladerf codec2 && pip3 install mako - name: Install volk run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake .. && make && sudo make install && cd ../../ diff --git a/core/src/gui/widgets/waterfall.cpp b/core/src/gui/widgets/waterfall.cpp index bb6da738..b7a16b5d 100644 --- a/core/src/gui/widgets/waterfall.cpp +++ b/core/src/gui/widgets/waterfall.cpp @@ -25,42 +25,6 @@ float DEFAULT_COLOR_MAP[][3] = { {0x4A, 0x00, 0x00} }; -inline void doZoom(int offset, int width, int outWidth, float* data, float* out, bool fast) { - // NOTE: REMOVE THAT SHIT, IT'S JUST A HACKY FIX - if (offset < 0) { - offset = 0; - } - if (width > 524288) { - width = 524288; - } - - float factor = (float)width / (float)outWidth; - - if (fast) { - for (int i = 0; i < outWidth; i++) { - out[i] = data[(int)(offset + ((float)i * factor))]; - } - } - else { - float sFactor = ceilf(factor); - float uFactor; - float id = offset; - float val, maxVal; - int sId; - uint32_t maxId; - for (int i = 0; i < outWidth; i++) { - maxVal = -INFINITY; - sId = (int)id; - uFactor = (sId + sFactor > width) ? sFactor - ((sId + sFactor) - width) : sFactor; - for (int j = 0; j < uFactor; j++) { - if (data[sId + j] > maxVal) { maxVal = data[sId + j]; } - } - out[i] = maxVal; - id += factor; - } - } -} - // TODO: Fix this hacky BS double freq_ranges[] = { diff --git a/core/src/gui/widgets/waterfall.h b/core/src/gui/widgets/waterfall.h index 3f505c1e..0cbc4e4e 100644 --- a/core/src/gui/widgets/waterfall.h +++ b/core/src/gui/widgets/waterfall.h @@ -81,6 +81,42 @@ namespace ImGui { float* getFFTBuffer(); void pushFFT(); + inline void doZoom(int offset, int width, int outWidth, float* data, float* out, bool fast) { + // NOTE: REMOVE THAT SHIT, IT'S JUST A HACKY FIX + if (offset < 0) { + offset = 0; + } + if (width > 524288) { + width = 524288; + } + + float factor = (float)width / (float)outWidth; + + if (fast) { + for (int i = 0; i < outWidth; i++) { + out[i] = data[(int)(offset + ((float)i * factor))]; + } + } + else { + float sFactor = ceilf(factor); + float uFactor; + float id = offset; + float val, maxVal; + int sId; + uint32_t maxId; + for (int i = 0; i < outWidth; i++) { + maxVal = -INFINITY; + sId = (int)id; + uFactor = (sId + sFactor > rawFFTSize) ? sFactor - ((sId + sFactor) - rawFFTSize) : sFactor; + for (int j = 0; j < uFactor; j++) { + if (data[sId + j] > maxVal) { maxVal = data[sId + j]; } + } + out[i] = maxVal; + id += factor; + } + } + } + void updatePallette(float colors[][3], int colorCount); void updatePalletteFromArray(float* colors, int colorCount);