potential fix for the RTL-SDR not tuning (mayhaps?)

pull/168/head
Ryzerth 2021-07-12 16:53:59 +02:00
rodzic 6f409b59c8
commit 3d7cfffe13
2 zmienionych plików z 13 dodań i 4 usunięć

Wyświetl plik

@ -202,7 +202,7 @@ namespace ImGui {
window->DrawList->AddImage((void*)(intptr_t)textureId, wfMin, wfMax);
ImVec2 mPos = ImGui::GetMousePos();
if (IS_IN_AREA(mPos, wfMin, wfMax) && !gui::mainWindow.lockWaterfallControls) {
if (IS_IN_AREA(mPos, wfMin, wfMax) && !gui::mainWindow.lockWaterfallControls && !inputHandled) {
for (auto const& [name, vfo] : vfos) {
window->DrawList->AddRectFilled(vfo->wfRectMin, vfo->wfRectMax, vfo->color);
if (!vfo->lineVisible) { continue; }
@ -749,7 +749,7 @@ namespace ImGui {
}
// Handle fft resize
if (!gui::mainWindow.lockWaterfallControls) {
if (!gui::mainWindow.lockWaterfallControls && !inputHandled) {
ImVec2 winSize = ImGui::GetWindowSize();
ImVec2 mousePos = ImGui::GetMousePos();
mousePos.x -= widgetPos.x;
@ -1169,7 +1169,7 @@ namespace ImGui {
window->DrawList->AddLine(lineMin, lineMax, selected ? IM_COL32(255, 0, 0, 255) : IM_COL32(255, 255, 0, 255));
}
if (!gui::mainWindow.lockWaterfallControls) {
if (!gui::mainWindow.lockWaterfallControls && !gui::waterfall.inputHandled) {
ImVec2 mousePos = ImGui::GetMousePos();
if (reference != REF_LOWER && !bandwidthLocked && !leftClamped) {
if (IS_IN_AREA(mousePos, lbwSelMin, lbwSelMax)) { ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW); }

Wyświetl plik

@ -296,7 +296,16 @@ private:
static void tune(double freq, void* ctx) {
RTLSDRSourceModule* _this = (RTLSDRSourceModule*)ctx;
if (_this->running) {
rtlsdr_set_center_freq(_this->openDev, freq);
uint32_t newFreq = freq;
int i;
for (i = 0; i < 10; i++) {
rtlsdr_set_center_freq(_this->openDev, freq);
if (rtlsdr_get_center_freq(_this->openDev) == newFreq) { break; }
}
if (i > 1) {
spdlog::warn("RTL-SDR took {0} attempts to tune...", i);
}
}
_this->freq = freq;
spdlog::info("RTLSDRSourceModule '{0}': Tune: {1}!", _this->name, freq);