Merge branch 'AlexandreRouma:master' into sdrplay-lowif

This commit is contained in:
arkhnchul 2021-09-14 14:56:14 +03:00 committed by GitHub
commit daa26e8e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 75 additions and 41 deletions

View File

@ -35,6 +35,7 @@ namespace sdrpp_credits {
}; };
const char* patrons[] = { const char* patrons[] = {
"Bob Logan",
"Croccydile", "Croccydile",
"Daniele D'Agnelli", "Daniele D'Agnelli",
"EB3FRN", "EB3FRN",

View File

@ -46,6 +46,7 @@ namespace dsp {
if (running) { return; } if (running) { return; }
xlator.start(); xlator.start();
resamp.start(); resamp.start();
running = true;
} }
void stop() { void stop() {
@ -53,6 +54,7 @@ namespace dsp {
if (!running) { return; } if (!running) { return; }
xlator.stop(); xlator.stop();
resamp.stop(); resamp.stop();
running = false;
} }
void setInSampleRate(float inSampleRate) { void setInSampleRate(float inSampleRate) {

View File

@ -188,6 +188,7 @@ void MainWindow::init() {
gui::waterfall.setFFTHeight(fftHeight); gui::waterfall.setFFTHeight(fftHeight);
tuningMode = core::configManager.conf["centerTuning"] ? tuner::TUNER_MODE_CENTER : tuner::TUNER_MODE_NORMAL; tuningMode = core::configManager.conf["centerTuning"] ? tuner::TUNER_MODE_CENTER : tuner::TUNER_MODE_NORMAL;
gui::waterfall.VFOMoveSingleClick = (tuningMode == tuner::TUNER_MODE_CENTER);
core::configManager.release(); core::configManager.release();
@ -397,6 +398,7 @@ void MainWindow::draw() {
ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn")); ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn"));
if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
tuningMode = tuner::TUNER_MODE_NORMAL; tuningMode = tuner::TUNER_MODE_NORMAL;
gui::waterfall.VFOMoveSingleClick = false;
core::configManager.acquire(); core::configManager.acquire();
core::configManager.conf["centerTuning"] = false; core::configManager.conf["centerTuning"] = false;
core::configManager.release(true); core::configManager.release(true);
@ -407,6 +409,7 @@ void MainWindow::draw() {
ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn")); ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn"));
if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) { if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
tuningMode = tuner::TUNER_MODE_CENTER; tuningMode = tuner::TUNER_MODE_CENTER;
gui::waterfall.VFOMoveSingleClick = true;
tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency); tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency);
core::configManager.acquire(); core::configManager.acquire();
core::configManager.conf["centerTuning"] = true; core::configManager.conf["centerTuning"] = true;
@ -525,6 +528,8 @@ void MainWindow::draw() {
firstMenuRender = true; firstMenuRender = true;
} }
ImGui::Checkbox("WF Single Click", &gui::waterfall.VFOMoveSingleClick);
ImGui::Spacing(); ImGui::Spacing();
} }

View File

@ -246,6 +246,7 @@ namespace ImGui {
ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick); ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_PressedOnClick);
bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused(); bool draging = ImGui::IsMouseDragging(ImGuiMouseButton_Left) && ImGui::IsWindowFocused();
mouseInFFTResize = (dragOrigin.x > widgetPos.x && dragOrigin.x < widgetPos.x + widgetSize.x && dragOrigin.y >= widgetPos.y + newFFTAreaHeight - 2 && dragOrigin.y <= widgetPos.y + newFFTAreaHeight + 2);
mouseInFreq = IS_IN_AREA(dragOrigin, freqAreaMin, freqAreaMax); mouseInFreq = IS_IN_AREA(dragOrigin, freqAreaMin, freqAreaMax);
mouseInFFT = IS_IN_AREA(dragOrigin, fftAreaMin, fftAreaMax); mouseInFFT = IS_IN_AREA(dragOrigin, fftAreaMin, fftAreaMax);
mouseInWaterfall = IS_IN_AREA(dragOrigin, wfMin, wfMax); mouseInWaterfall = IS_IN_AREA(dragOrigin, wfMin, wfMax);
@ -266,15 +267,31 @@ namespace ImGui {
// Deselect everything if the mouse is released // Deselect everything if the mouse is released
if (!ImGui::IsMouseDown(ImGuiMouseButton_Left)) { if (!ImGui::IsMouseDown(ImGuiMouseButton_Left)) {
if (fftResizeSelect) {
FFTAreaHeight = newFFTAreaHeight;
onResize();
}
fftResizeSelect = false;
freqScaleSelect = false; freqScaleSelect = false;
vfoSelect = false; vfoSelect = false;
vfoBorderSelect = false; vfoBorderSelect = false;
lastDrag = 0; lastDrag = 0;
} }
// If mouse was clicked, check what was clicked bool targetFound = false;
if (mouseClicked) {
bool targetFound = false; // If the mouse was clicked anywhere in the waterfall, check if the resize was clicked
if (mouseInFFTResize) {
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
fftResizeSelect = true;
targetFound = true;
}
}
// If mouse was clicked inside the central part, check what was clicked
if (mouseClicked && !targetFound) {
mouseDownPos = mousePos; mouseDownPos = mousePos;
// First, check if a VFO border was selected // First, check if a VFO border was selected
@ -311,6 +328,16 @@ namespace ImGui {
} }
} }
// If the FFT resize bar was selected, resize FFT accordingly
if (fftResizeSelect) {
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
newFFTAreaHeight = mousePos.y - widgetPos.y;
newFFTAreaHeight = std::clamp<float>(newFFTAreaHeight, 150, widgetSize.y - 50);
ImGui::GetForegroundDrawList()->AddLine(ImVec2(widgetPos.x, newFFTAreaHeight + widgetPos.y), ImVec2(widgetEndPos.x, newFFTAreaHeight + widgetPos.y),
ImGui::GetColorU32(ImGuiCol_SeparatorActive));
return;
}
// If a vfo border is selected, resize VFO accordingly // If a vfo border is selected, resize VFO accordingly
if (vfoBorderSelect) { if (vfoBorderSelect) {
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW); ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW);
@ -418,7 +445,7 @@ namespace ImGui {
} }
// Finally, if nothing else was selected, just move the VFO // Finally, if nothing else was selected, just move the VFO
if (ImGui::IsMouseDown(ImGuiMouseButton_Left) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) { if ((VFOMoveSingleClick ? ImGui::IsMouseClicked(ImGuiMouseButton_Left) : ImGui::IsMouseDown(ImGuiMouseButton_Left)) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) {
if (selVfo != NULL) { if (selVfo != NULL) {
int refCenter = mousePos.x - (widgetPos.x + 50); int refCenter = mousePos.x - (widgetPos.x + 50);
if (refCenter >= 0 && refCenter < dataWidth) { if (refCenter >= 0 && refCenter < dataWidth) {
@ -808,33 +835,6 @@ namespace ImGui {
return; return;
} }
// Handle fft resize
if (!gui::mainWindow.lockWaterfallControls && !inputHandled) {
ImVec2 winSize = ImGui::GetWindowSize();
ImVec2 mousePos = ImGui::GetMousePos();
mousePos.x -= widgetPos.x;
mousePos.y -= widgetPos.y;
bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left);
bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left);
if (draggingFW) {
newFFTAreaHeight = mousePos.y;
newFFTAreaHeight = std::clamp<float>(newFFTAreaHeight, 150, widgetSize.y - 50);
ImGui::GetForegroundDrawList()->AddLine(ImVec2(widgetPos.x, newFFTAreaHeight + widgetPos.y), ImVec2(widgetEndPos.x, newFFTAreaHeight + widgetPos.y),
ImGui::GetColorU32(ImGuiCol_SeparatorActive));
}
if (mousePos.y >= newFFTAreaHeight - 2 && mousePos.y <= newFFTAreaHeight + 2 && mousePos.x > 0 && mousePos.x < widgetSize.x) {
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
if (click) {
draggingFW = true;
}
}
if(!down && draggingFW) {
draggingFW = false;
FFTAreaHeight = newFFTAreaHeight;
onResize();
}
}
buf_mtx.unlock(); buf_mtx.unlock();
} }

View File

@ -137,6 +137,7 @@ namespace ImGui {
bool bandplanEnabled = false; bool bandplanEnabled = false;
bandplan::BandPlan_t* bandplan = NULL; bandplan::BandPlan_t* bandplan = NULL;
bool mouseInFFTResize = false;
bool mouseInFreq = false; bool mouseInFreq = false;
bool mouseInFFT = false; bool mouseInFFT = false;
bool mouseInWaterfall = false; bool mouseInWaterfall = false;
@ -175,6 +176,7 @@ namespace ImGui {
}; };
bool inputHandled = false; bool inputHandled = false;
bool VFOMoveSingleClick = false;
Event<InputHandlerArgs> onInputProcess; Event<InputHandlerArgs> onInputProcess;
enum { enum {
@ -279,6 +281,7 @@ namespace ImGui {
int bandPlanPos = BANDPLAN_POS_BOTTOM; int bandPlanPos = BANDPLAN_POS_BOTTOM;
// UI Select elements // UI Select elements
bool fftResizeSelect = false;
bool freqScaleSelect = false; bool freqScaleSelect = false;
bool vfoSelect = false; bool vfoSelect = false;
bool vfoBorderSelect = false; bool vfoBorderSelect = false;

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUIL
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk1-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk1-dev, librtaudio-dev'

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'

View File

@ -40,4 +40,4 @@ make -j2
# Generate package # Generate package
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk1-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk1-dev, librtaudio-dev'

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'

View File

@ -21,4 +21,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make -j2 make -j2
cd .. cd ..
sh make_debian_package.sh ./build libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'

View File

@ -194,7 +194,7 @@ private:
} }
const float bwMax = 15000; const float bwMax = 15000;
const float bwMin = 6000; const float bwMin = 1000;
const float bbSampRate = 15000; const float bbSampRate = 15000;
std::string uiPrefix; std::string uiPrefix;

View File

@ -183,7 +183,7 @@ private:
} }
const float bwMax = 50000; const float bwMax = 50000;
const float bwMin = 6000; const float bwMin = 1000;
const float bbSampRate = 50000; const float bbSampRate = 50000;
std::string uiPrefix; std::string uiPrefix;

View File

@ -338,7 +338,7 @@ To solve, this, simply downgrade to libusb1.3
If you also have the SoapySDR module loaded (not necessarily enabled), this is a bug in libhackrf. It's caused by libhackrf not checking if it's already initialized. If you also have the SoapySDR module loaded (not necessarily enabled), this is a bug in libhackrf. It's caused by libhackrf not checking if it's already initialized.
The solution until a fixed libhackrf version is released is to completely remove the soapy_source module from SDR++. To do this, delete `modules/soapy_source.dll` on windows The solution until a fixed libhackrf version is released is to completely remove the soapy_source module from SDR++. To do this, delete `modules/soapy_source.dll` on windows
or `/usr/share/sdrpp/plugins/soapy_source.so` on linux. or `/usr/lib/sdrpp/plugins/soapy_source.so` on linux.
## Issue not listed here? ## Issue not listed here?
@ -353,6 +353,7 @@ I will soon publish a contributing.md listing the code style to use.
## Patrons ## Patrons
* Bob Logan
* Croccydile * Croccydile
* [Daniele D'Agnelli](https://linkedin.com/in/dagnelli) * [Daniele D'Agnelli](https://linkedin.com/in/dagnelli)
* [EB3FRN](https://www.eb3frn.net/) * [EB3FRN](https://www.eb3frn.net/)

22
rpi_install.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
[ $(id -u) = 0 ] && echo "Please do not run this script as root" && exit 100
echo "Installing dependencies"
sudo apt update
sudo apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libairspy-dev \
libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget
echo "Preparing build"
mkdir -p build
cd build
cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON
echo "Building"
make
echo "Installing"
sudo make install
echo "Done!"