diff --git a/airspy_source/src/main.cpp b/airspy_source/src/main.cpp index 34be2a5..04f29ee 100644 --- a/airspy_source/src/main.cpp +++ b/airspy_source/src/main.cpp @@ -239,9 +239,7 @@ private: static void start(void* ctx) { AirspySourceModule* _this = (AirspySourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (_this->selectedSerial == 0) { spdlog::error("Tried to start Airspy source with null serial"); return; @@ -296,9 +294,7 @@ private: static void stop(void* ctx) { AirspySourceModule* _this = (AirspySourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); airspy_close(_this->openDev); diff --git a/airspyhf_source/src/main.cpp b/airspyhf_source/src/main.cpp index a0da5be..269e340 100644 --- a/airspyhf_source/src/main.cpp +++ b/airspyhf_source/src/main.cpp @@ -215,9 +215,7 @@ private: static void start(void* ctx) { AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (_this->selectedSerial == 0) { spdlog::error("Tried to start AirspyHF+ source with null serial"); return; @@ -248,9 +246,7 @@ private: static void stop(void* ctx) { AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); airspyhf_close(_this->openDev); diff --git a/bladerf_source/src/main.cpp b/bladerf_source/src/main.cpp index 16c1e54..7600cfe 100644 --- a/bladerf_source/src/main.cpp +++ b/bladerf_source/src/main.cpp @@ -313,9 +313,7 @@ private: static void start(void* ctx) { BladeRFSourceModule* _this = (BladeRFSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (_this->devCount == 0) { return; } // Open device @@ -360,9 +358,7 @@ private: static void stop(void* ctx) { BladeRFSourceModule* _this = (BladeRFSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); diff --git a/core/src/gui/menus/module_manager.cpp b/core/src/gui/menus/module_manager.cpp index e010f35..c2d3e28 100644 --- a/core/src/gui/menus/module_manager.cpp +++ b/core/src/gui/menus/module_manager.cpp @@ -24,33 +24,35 @@ namespace module_manager_menu { } void draw(void* ctx) { - ImGui::BeginTable("Module Manager Table", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg); - ImGui::TableSetupColumn("Name"); - ImGui::TableSetupColumn("Type"); - ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 10); - ImGui::TableHeadersRow(); + if (ImGui::BeginTable("Module Manager Table", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY, ImVec2(0, 200))) { + ImGui::TableSetupColumn("Name"); + ImGui::TableSetupColumn("Type"); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 10); + ImGui::TableHeadersRow(); - float height = ImGui::CalcTextSize("-").y; + float height = ImGui::CalcTextSize("-").y; - for (auto& [name, inst] : core::moduleManager.instances) { - ImGui::TableNextRow(); + for (auto& [name, inst] : core::moduleManager.instances) { + ImGui::TableNextRow(); - ImGui::TableSetColumnIndex(0); - ImGui::Text(name.c_str()); + ImGui::TableSetColumnIndex(0); + ImGui::Text(name.c_str()); - ImGui::TableSetColumnIndex(1); - ImGui::Text(inst.module.info->name); + ImGui::TableSetColumnIndex(1); + ImGui::Text(inst.module.info->name); - ImGui::TableSetColumnIndex(2); - ImVec2 origPos = ImGui::GetCursorPos(); - ImGui::SetCursorPos(ImVec2(origPos.x - 3, origPos.y)); - if (ImGui::Button(("##module_mgr_"+name).c_str(), ImVec2(height,height))) { - core::moduleManager.deleteInstance(name); + ImGui::TableSetColumnIndex(2); + ImVec2 origPos = ImGui::GetCursorPos(); + ImGui::SetCursorPos(ImVec2(origPos.x - 3, origPos.y)); + if (ImGui::Button(("##module_mgr_"+name).c_str(), ImVec2(height,height))) { + core::moduleManager.deleteInstance(name); + } + ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5)); + ImGui::Text("_"); } - ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5)); - ImGui::Text("_"); + ImGui::EndTable(); } - ImGui::EndTable(); + // Add module row with slightly different settings ImGui::BeginTable("Module Manager Add Table", 3); diff --git a/hackrf_source/src/main.cpp b/hackrf_source/src/main.cpp index b778a18..40ba6ef 100644 --- a/hackrf_source/src/main.cpp +++ b/hackrf_source/src/main.cpp @@ -223,9 +223,7 @@ private: static void start(void* ctx) { HackRFSourceModule* _this = (HackRFSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (_this->selectedSerial == "") { spdlog::error("Tried to start HackRF source with empty serial"); return; @@ -254,9 +252,7 @@ private: static void stop(void* ctx) { HackRFSourceModule* _this = (HackRFSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); // TODO: Stream stop diff --git a/limesdr_source/src/main.cpp b/limesdr_source/src/main.cpp index 2224ede..66acb5b 100644 --- a/limesdr_source/src/main.cpp +++ b/limesdr_source/src/main.cpp @@ -315,9 +315,7 @@ private: static void start(void* ctx) { LimeSDRSourceModule* _this = (LimeSDRSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } // Open device _this->openDev = NULL; @@ -355,9 +353,7 @@ private: static void stop(void* ctx) { LimeSDRSourceModule* _this = (LimeSDRSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->streamRunning = false; diff --git a/plutosdr_source/src/main.cpp b/plutosdr_source/src/main.cpp index 61d5d52..b27a57f 100644 --- a/plutosdr_source/src/main.cpp +++ b/plutosdr_source/src/main.cpp @@ -85,9 +85,7 @@ private: static void start(void* ctx) { PlutoSDRSourceModule* _this = (PlutoSDRSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } // TODO: INIT CONTEXT HERE _this->ctx = iio_create_context_from_uri(_this->ip); @@ -126,9 +124,7 @@ private: static void stop(void* ctx) { PlutoSDRSourceModule* _this = (PlutoSDRSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); _this->workerThread.join(); diff --git a/rtl_sdr_source/src/main.cpp b/rtl_sdr_source/src/main.cpp index 4365837..7b499ff 100644 --- a/rtl_sdr_source/src/main.cpp +++ b/rtl_sdr_source/src/main.cpp @@ -241,9 +241,7 @@ private: static void start(void* ctx) { RTLSDRSourceModule* _this = (RTLSDRSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (_this->selectedDevName == "") { spdlog::error("No device selected"); return; @@ -282,9 +280,7 @@ private: static void stop(void* ctx) { RTLSDRSourceModule* _this = (RTLSDRSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); rtlsdr_cancel_async(_this->openDev); diff --git a/rtl_tcp_source/src/main.cpp b/rtl_tcp_source/src/main.cpp index 880f537..cc0d889 100644 --- a/rtl_tcp_source/src/main.cpp +++ b/rtl_tcp_source/src/main.cpp @@ -119,9 +119,7 @@ private: static void start(void* ctx) { RTLTCPSourceModule* _this = (RTLTCPSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } if (!_this->client.connectToRTL(_this->ip, _this->port)) { spdlog::error("Could not connect to {0}:{1}", _this->ip, _this->port); return; @@ -142,9 +140,7 @@ private: static void stop(void* ctx) { RTLTCPSourceModule* _this = (RTLTCPSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); _this->workerThread.join(); diff --git a/sddc_source/src/main.cpp b/sddc_source/src/main.cpp index 545220f..d72560f 100644 --- a/sddc_source/src/main.cpp +++ b/sddc_source/src/main.cpp @@ -156,9 +156,7 @@ private: static void stop(void* ctx) { AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); diff --git a/sdrplay_source/src/main.cpp b/sdrplay_source/src/main.cpp index 82c6813..c028dc6 100644 --- a/sdrplay_source/src/main.cpp +++ b/sdrplay_source/src/main.cpp @@ -478,9 +478,7 @@ private: static void start(void* ctx) { SDRPlaySourceModule* _this = (SDRPlaySourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } // First, acquire device sdrplay_api_ErrT err; @@ -599,9 +597,7 @@ private: static void stop(void* ctx) { SDRPlaySourceModule* _this = (SDRPlaySourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->running = false; _this->stream.stopWriter(); diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index afd4783..e73a1f1 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -295,6 +295,7 @@ private: static void start(void* ctx) { SoapyModule* _this = (SoapyModule*)ctx; + if (_this->running) { return; } _this->dev = SoapySDR::Device::make(_this->devArgs); _this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate); @@ -329,6 +330,7 @@ private: static void stop(void* ctx) { SoapyModule* _this = (SoapyModule*)ctx; + if (!_this->running) { return; } _this->running = false; _this->dev->deactivateStream(_this->devStream); _this->dev->closeStream(_this->devStream); diff --git a/spyserver_source/src/main.cpp b/spyserver_source/src/main.cpp index cca2467..2fdc21b 100644 --- a/spyserver_source/src/main.cpp +++ b/spyserver_source/src/main.cpp @@ -119,9 +119,7 @@ private: static void start(void* ctx) { AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx; - if (_this->running) { - return; - } + if (_this->running) { return; } int srvBits = streamFormatsBitCount[_this->iqType]; _this->client->setSetting(SPYSERVER_SETTING_IQ_FORMAT, streamFormats[_this->iqType]); @@ -138,9 +136,7 @@ private: static void stop(void* ctx) { AirspyHFSourceModule* _this = (AirspyHFSourceModule*)ctx; - if (!_this->running) { - return; - } + if (!_this->running) { return; } _this->client->stopStream();