mirror of
				https://github.com/AlexandreRouma/SDRPlusPlus.git
				synced 2025-10-31 00:48:11 +01:00 
			
		
		
		
	Merge branch 'AlexandreRouma:master' into sdrplay-lowif
This commit is contained in:
		| @@ -412,8 +412,7 @@ private: | ||||
|         // Gain menus | ||||
|  | ||||
|         if (_this->gainMode == 0) { | ||||
|             ImGui::Text("Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Gain"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::SliderInt(CONCAT("##_airspy_sens_gain_", _this->name), &_this->sensitiveGain, 0, 21)) { | ||||
|                 if (_this->running) { | ||||
| @@ -427,8 +426,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|         else if (_this->gainMode == 1) { | ||||
|             ImGui::Text("Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Gain"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::SliderInt(CONCAT("##_airspy_lin_gain_", _this->name), &_this->linearGain, 0, 21)) { | ||||
|                 if (_this->running) { | ||||
| @@ -446,8 +444,7 @@ private: | ||||
|             float pos = ImGui::CalcTextSize("Mixer Gain").x + 10; | ||||
|  | ||||
|             if (_this->lnaAgc) { style::beginDisabled(); } | ||||
|             ImGui::Text("LNA Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("LNA Gain"); | ||||
|             ImGui::SetCursorPosX(pos); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::SliderInt(CONCAT("##_airspy_lna_gain_", _this->name), &_this->lnaGain, 0, 15)) { | ||||
| @@ -463,8 +460,7 @@ private: | ||||
|             if (_this->lnaAgc) { style::endDisabled(); } | ||||
|  | ||||
|             if (_this->mixerAgc) { style::beginDisabled(); } | ||||
|             ImGui::Text("Mixer Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Mixer Gain"); | ||||
|             ImGui::SetCursorPosX(pos); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::SliderInt(CONCAT("##_airspy_mix_gain_", _this->name), &_this->mixerGain, 0, 15)) { | ||||
| @@ -479,8 +475,7 @@ private: | ||||
|             } | ||||
|             if (_this->mixerAgc) { style::endDisabled(); } | ||||
|  | ||||
|             ImGui::Text("VGA Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("VGA Gain"); | ||||
|             ImGui::SetCursorPosX(pos); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::SliderInt(CONCAT("##_airspy_vga_gain_", _this->name), &_this->vgaGain, 0, 15)) { | ||||
|   | ||||
| @@ -303,8 +303,7 @@ private: | ||||
|  | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("AGC Mode"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("AGC Mode"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_airspyhf_agc_", _this->name), &_this->agcMode, AGG_MODES_STR)) { | ||||
|             if (_this->running) { | ||||
| @@ -320,21 +319,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("HF LNA"); | ||||
|         ImGui::SameLine(); | ||||
|         if (ImGui::Checkbox(CONCAT("##_airspyhf_lna_", _this->name), &_this->hfLNA)) { | ||||
|             if (_this->running) { | ||||
|                 airspyhf_set_hf_lna(_this->openDev, _this->hfLNA); | ||||
|             }       | ||||
|             if (_this->selectedSerStr != "") { | ||||
|                 config.acquire(); | ||||
|                 config.conf["devices"][_this->selectedSerStr]["lna"] = _this->hfLNA; | ||||
|                 config.release(true); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Attenuation"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Attenuation"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloatWithSteps(CONCAT("##_airspyhf_attn_", _this->name), &_this->atten, 0, 48, 6, "%.0f dB")) { | ||||
|             if (_this->running) { | ||||
| @@ -345,7 +330,18 @@ private: | ||||
|                 config.conf["devices"][_this->selectedSerStr]["attenuation"] = _this->atten; | ||||
|                 config.release(true); | ||||
|             } | ||||
|         }         | ||||
|         }    | ||||
|  | ||||
|         if (ImGui::Checkbox(CONCAT("HF LNA##_airspyhf_lna_", _this->name), &_this->hfLNA)) { | ||||
|             if (_this->running) { | ||||
|                 airspyhf_set_hf_lna(_this->openDev, _this->hfLNA); | ||||
|             }       | ||||
|             if (_this->selectedSerStr != "") { | ||||
|                 config.acquire(); | ||||
|                 config.conf["devices"][_this->selectedSerStr]["lna"] = _this->hfLNA; | ||||
|                 config.release(true); | ||||
|             } | ||||
|         }      | ||||
|     } | ||||
|  | ||||
|     static int callback(airspyhf_transfer_t* transfer) { | ||||
|   | ||||
| @@ -424,8 +424,7 @@ private: | ||||
|  | ||||
|         // Channel selection (only show if more than one channel) | ||||
|         if (_this->channelCount > 1) { | ||||
|             ImGui::Text("RX Channel"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("RX Channel"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             ImGui::Combo(CONCAT("##_balderf_ch_sel_", _this->name), &_this->chanId, _this->channelNamesTxt.c_str()); | ||||
|             if (_this->selectedSerial != "") { | ||||
| @@ -437,8 +436,7 @@ private: | ||||
|  | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Bandwidth"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Bandwidth"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_balderf_bw_sel_", _this->name), &_this->bwId, _this->bandwidthsTxt.c_str())) { | ||||
|             if (_this->running) { | ||||
| @@ -453,8 +451,7 @@ private: | ||||
|         } | ||||
|  | ||||
|         // General config BS | ||||
|         ImGui::Text("Gain control mode"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Gain control mode"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_balderf_gm_sel_", _this->name), &_this->gainMode, _this->gainModesTxt.c_str()) && _this->selectedSerial != "") { | ||||
|             if (_this->running) { | ||||
| @@ -472,8 +469,7 @@ private: | ||||
|         } | ||||
|  | ||||
|         if (_this->selectedSerial != "") { if (_this->gainModes[_this->gainMode].mode != BLADERF_GAIN_MANUAL) { style::beginDisabled(); } } | ||||
|         ImGui::Text("Gain"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Gain"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderInt("##_balderf_oag_sel_", &_this->overallGain, (_this->gainRange != NULL) ? _this->gainRange->min : 0, (_this->gainRange != NULL) ? _this->gainRange->max : 60)) { | ||||
|             if (_this->running) { | ||||
|   | ||||
| @@ -78,7 +78,7 @@ namespace core { | ||||
|         gui::waterfall.setViewOffset(0); | ||||
|         gui::waterfall.setViewBandwidth(effectiveSr); | ||||
|         sigpath::signalPath.setSampleRate(effectiveSr); | ||||
|         gui::mainWindow.setViewBandwidthSlider(effectiveSr); | ||||
|         gui::mainWindow.setViewBandwidthSlider(1.0); | ||||
|     } | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -39,6 +39,7 @@ namespace sdrpp_credits { | ||||
|         "Daniele D'Agnelli", | ||||
|         "EB3FRN", | ||||
|         "Eric Johnson", | ||||
|         "Flinger Films", | ||||
|         "W4IPA", | ||||
|         "Lee Donaghy", | ||||
|         "ON4MU", | ||||
|   | ||||
| @@ -176,7 +176,7 @@ void MainWindow::init() { | ||||
|     gui::freqSelect.frequencyChanged = false; | ||||
|     sigpath::sourceManager.tune(frequency); | ||||
|     gui::waterfall.setCenterFrequency(frequency); | ||||
|     bw = gui::waterfall.getBandwidth(); | ||||
|     bw = 1.0; | ||||
|     gui::waterfall.vfoFreqChanged = false; | ||||
|     gui::waterfall.centerFreqMoved = false; | ||||
|     gui::waterfall.selectFirstVFO(); | ||||
| @@ -598,12 +598,13 @@ void MainWindow::draw() { | ||||
|     ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Zoom").x / 2.0)); | ||||
|     ImGui::Text("Zoom"); | ||||
|     ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); | ||||
|     float minSliderBw = 1000.0; | ||||
|     float maxSliderBw = gui::waterfall.getBandwidth(); | ||||
|     if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, maxSliderBw, minSliderBw, "")) { | ||||
|         float normBw = bw / (maxSliderBw - minSliderBw); | ||||
|         float factor = normBw * normBw; | ||||
|         float finalBw = minSliderBw + bw * factor; | ||||
|     if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, 1.0, 0.0, "")) { | ||||
|         double factor = (double)bw * (double)bw; | ||||
|          | ||||
|         // Map 0.0 -> 1.0 to 1000.0 -> bandwidth | ||||
|         double wfBw = gui::waterfall.getBandwidth(); | ||||
|         double delta = wfBw - 1000.0; | ||||
|         double finalBw = std::min<double>(1000.0 + (factor * delta), wfBw); | ||||
|  | ||||
|         gui::waterfall.setViewBandwidth(finalBw); | ||||
|         if (vfo != NULL) { | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
| #include <gui/widgets/bandplan.h> | ||||
| #include <gui/gui.h> | ||||
| #include <core.h> | ||||
| #include <gui/style.h> | ||||
|  | ||||
| namespace bandplanmenu { | ||||
|     int bandplanId; | ||||
| @@ -44,8 +45,7 @@ namespace bandplanmenu { | ||||
|         } | ||||
|         ImGui::PopItemWidth(); | ||||
|  | ||||
|         ImGui::Text("Position"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Position"); | ||||
|         ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) { | ||||
|             gui::waterfall.setBandPlanPos(bandPlanPos); | ||||
|   | ||||
| @@ -6,6 +6,7 @@ | ||||
| #include <gui/gui.h> | ||||
| #include <gui/main_window.h> | ||||
| #include <signal_path/signal_path.h> | ||||
| #include <gui/style.h> | ||||
|  | ||||
| namespace displaymenu { | ||||
|     bool showWaterfall; | ||||
| @@ -105,8 +106,7 @@ namespace displaymenu { | ||||
|             core::configManager.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("FFT Framerate"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("FFT Framerate"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputInt("##sdrpp_fft_rate", &fftRate, 1, 10)) { | ||||
|             fftRate = std::max<int>(1, fftRate); | ||||
| @@ -116,8 +116,7 @@ namespace displaymenu { | ||||
|             core::configManager.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("FFT Size"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("FFT Size"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) { | ||||
|             gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]); | ||||
| @@ -126,8 +125,7 @@ namespace displaymenu { | ||||
|             core::configManager.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("FFT Window"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("FFT Window"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) { | ||||
|             gui::mainWindow.setFFTWindow(selectedWindow); | ||||
| @@ -137,8 +135,7 @@ namespace displaymenu { | ||||
|         } | ||||
|  | ||||
|         if (colorMapNames.size() > 0) { | ||||
|             ImGui::Text("Color Map"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Color Map"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) { | ||||
|                 colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]]; | ||||
|   | ||||
| @@ -168,8 +168,7 @@ namespace sourecmenu { | ||||
|             core::configManager.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Offset mode"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Offset mode"); | ||||
|         ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) { | ||||
|             updateOffset(); | ||||
| @@ -178,8 +177,7 @@ namespace sourecmenu { | ||||
|             core::configManager.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Offset"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Offset"); | ||||
|         ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); | ||||
|         if (offsetMode == OFFSET_MODE_CUSTOM) { | ||||
|             if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) { | ||||
| @@ -196,8 +194,7 @@ namespace sourecmenu { | ||||
|         } | ||||
|  | ||||
|         if (running) { style::beginDisabled(); } | ||||
|         ImGui::Text("Decimation"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Decimation"); | ||||
|         ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##source_decim", &decimationPower, decimationStages)) { | ||||
|             sigpath::signalPath.setDecimation(decimationPower); | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
| #include <gui/gui.h> | ||||
| #include <options.h> | ||||
| #include <core.h> | ||||
| #include <gui/style.h> | ||||
|  | ||||
| namespace thememenu { | ||||
|     int themeId; | ||||
| @@ -34,8 +35,7 @@ namespace thememenu { | ||||
|  | ||||
|     void draw(void* ctx) { | ||||
|         float menuWidth = ImGui::GetContentRegionAvailWidth(); | ||||
|         ImGui::Text("Theme"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Theme"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) { | ||||
|             gui::themeManager.applyTheme(themeNames[themeId]); | ||||
|   | ||||
| @@ -43,4 +43,14 @@ namespace style { | ||||
|         ImGui::PopItemFlag(); | ||||
|         ImGui::PopStyleColor(3); | ||||
|     } | ||||
| } | ||||
|  | ||||
| namespace ImGui { | ||||
|     void LeftLabel(char* text) { | ||||
|         float vpos = ImGui::GetCursorPosY(); | ||||
|         ImGui::SetCursorPosY(vpos + GImGui->Style.FramePadding.y); | ||||
|         ImGui::Text(text); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::SetCursorPosY(vpos); | ||||
|     } | ||||
| } | ||||
| @@ -12,4 +12,8 @@ namespace style { | ||||
|     void beginDisabled(); | ||||
|     void endDisabled(); | ||||
|     void testtt(); | ||||
| } | ||||
|  | ||||
| namespace ImGui { | ||||
|     void LeftLabel(char* text); | ||||
| } | ||||
| @@ -167,7 +167,7 @@ private: | ||||
|              | ||||
|             ImGui::TableNextRow(); | ||||
|             ImGui::TableSetColumnIndex(0); | ||||
|             ImGui::Text("Name"); | ||||
|             ImGui::LeftLabel("Name"); | ||||
|             ImGui::TableSetColumnIndex(1); | ||||
|             ImGui::SetNextItemWidth(200); | ||||
|             if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) { | ||||
| @@ -176,21 +176,21 @@ private: | ||||
|  | ||||
|             ImGui::TableNextRow(); | ||||
|             ImGui::TableSetColumnIndex(0); | ||||
|             ImGui::Text("Frequency"); | ||||
|             ImGui::LeftLabel("Frequency"); | ||||
|             ImGui::TableSetColumnIndex(1); | ||||
|             ImGui::SetNextItemWidth(200); | ||||
|             ImGui::InputDouble(("##freq_manager_edit_freq"+name).c_str(), &editedBookmark.frequency);         | ||||
|  | ||||
|             ImGui::TableNextRow(); | ||||
|             ImGui::TableSetColumnIndex(0); | ||||
|             ImGui::Text("Bandwidth"); | ||||
|             ImGui::LeftLabel("Bandwidth"); | ||||
|             ImGui::TableSetColumnIndex(1); | ||||
|             ImGui::SetNextItemWidth(200); | ||||
|             ImGui::InputDouble(("##freq_manager_edit_bw"+name).c_str(), &editedBookmark.bandwidth);          | ||||
|  | ||||
|             ImGui::TableNextRow(); | ||||
|             ImGui::TableSetColumnIndex(0); | ||||
|             ImGui::Text("Mode"); | ||||
|             ImGui::LeftLabel("Mode"); | ||||
|             ImGui::TableSetColumnIndex(1); | ||||
|             ImGui::SetNextItemWidth(200); | ||||
|  | ||||
| @@ -234,7 +234,7 @@ private: | ||||
|         strcpy(nameBuf, editedListName.c_str()); | ||||
|  | ||||
|         if (ImGui::BeginPopup(id.c_str(), ImGuiWindowFlags_NoResize)) { | ||||
|             ImGui::Text("Name"); | ||||
|             ImGui::LeftLabel("Name"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) { | ||||
|                 editedListName = nameBuf; | ||||
| @@ -569,8 +569,7 @@ private: | ||||
|             _this->selectListsOpen = true; | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Bookmark display mode"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Bookmark display mode"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(("##_freq_mgr_dms_" + _this->name).c_str(), &_this->bookmarkDisplayMode, bookmarkDisplayModesTxt)) { | ||||
|             config.acquire(); | ||||
|   | ||||
| @@ -305,8 +305,7 @@ private: | ||||
|  | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Bandwidth"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Bandwidth"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_hackrf_bw_sel_", _this->name), &_this->bwId, bandwidthsTxt)) { | ||||
|             if (_this->running) { | ||||
| @@ -317,6 +316,28 @@ private: | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::LeftLabel("LNA Gain"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloatWithSteps(CONCAT("##_hackrf_lna_", _this->name), &_this->lna, 0, 40, 8, "%.0fdB")) { | ||||
|             if (_this->running) { | ||||
|                 hackrf_set_lna_gain(_this->openDev, _this->lna); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["devices"][_this->selectedSerial]["lnaGain"] = (int)_this->lna; | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::LeftLabel("VGA Gain"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloatWithSteps(CONCAT("##_hackrf_vga_", _this->name), &_this->vga, 0, 62, 2, "%.0fdB")) { | ||||
|             if (_this->running) { | ||||
|                 hackrf_set_vga_gain(_this->openDev, _this->vga); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["devices"][_this->selectedSerial]["vgaGain"] = (int)_this->vga; | ||||
|             config.release(true); | ||||
|         }   | ||||
|  | ||||
|         if (ImGui::Checkbox(CONCAT("Bias-T##_hackrf_bt_", _this->name), &_this->biasT)) { | ||||
|             if (_this->running) { | ||||
|                 hackrf_set_antenna_enable(_this->openDev, _this->biasT); | ||||
| @@ -333,31 +354,7 @@ private: | ||||
|             config.acquire(); | ||||
|             config.conf["devices"][_this->selectedSerial]["amp"] = _this->amp; | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("LNA Gain"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloatWithSteps(CONCAT("##_hackrf_lna_", _this->name), &_this->lna, 0, 40, 8, "%.0fdB")) { | ||||
|             if (_this->running) { | ||||
|                 hackrf_set_lna_gain(_this->openDev, _this->lna); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["devices"][_this->selectedSerial]["lnaGain"] = (int)_this->lna; | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("VGA Gain"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloatWithSteps(CONCAT("##_hackrf_vga_", _this->name), &_this->vga, 0, 62, 2, "%.0fdB")) { | ||||
|             if (_this->running) { | ||||
|                 hackrf_set_vga_gain(_this->openDev, _this->vga); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["devices"][_this->selectedSerial]["vgaGain"] = (int)_this->vga; | ||||
|             config.release(true); | ||||
|         }    | ||||
|         }  | ||||
|     } | ||||
|  | ||||
|     static int callback(hackrf_transfer* transfer) { | ||||
|   | ||||
| @@ -411,8 +411,7 @@ private: | ||||
|         } | ||||
|  | ||||
|         if (_this->channelCount > 1) { | ||||
|             ImGui::Text("RX Channel"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("RX Channel"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo("##limesdr_ch_sel", &_this->chanId, _this->channelNamesTxt.c_str()) && _this->selectedDevName != "") { | ||||
|                 config.acquire(); | ||||
| @@ -423,8 +422,7 @@ private: | ||||
|  | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Antenna"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Antenna"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##limesdr_ant_sel", &_this->antennaId, _this->antennaListTxt.c_str())) { | ||||
|             if (_this->running) { | ||||
| @@ -437,8 +435,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Bandwidth"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Bandwidth"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo("##limesdr_bw_sel", &_this->bwId, _this->bandwidthsTxt.c_str())) { | ||||
|             if (_this->running) { | ||||
| @@ -451,8 +448,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Gain"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Gain"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderInt("##limesdr_gain_sel", &_this->gain, 0, 73, "%ddB")) { | ||||
|             if (_this->running) { | ||||
|   | ||||
| @@ -134,8 +134,7 @@ public: | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Protocol"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Protocol"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_network_sink_mode_", _streamName), &modeId, sinkModesTxt)) { | ||||
|             config.acquire(); | ||||
| @@ -145,8 +144,7 @@ public: | ||||
|  | ||||
|         if (listening) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Samplerate"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Samplerate"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_network_sink_sr_", _streamName), &srId, sampleRatesTxt.c_str())) { | ||||
|             sampleRate = sampleRates[srId]; | ||||
|   | ||||
| @@ -188,8 +188,7 @@ private: | ||||
|         float menuWidth = ImGui::GetContentRegionAvailWidth(); | ||||
|  | ||||
|         if (_this->running) { style::beginDisabled(); } | ||||
|         ImGui::Text("IP"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("IP"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16)) { | ||||
|             config.acquire(); | ||||
| @@ -197,8 +196,7 @@ private: | ||||
|             config.release(true); | ||||
|         } | ||||
|          | ||||
|         ImGui::Text("Samplerate"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Samplerate"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|          | ||||
|         if (ImGui::Combo(CONCAT("##_pluto_sr_", _this->name), &_this->srId, _this->sampleRatesTxt.c_str())) { | ||||
| @@ -210,8 +208,7 @@ private: | ||||
|         } | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Gain Mode"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Gain Mode"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_gainmode_select_", _this->name), &_this->gainMode, gainModesTxt)) { | ||||
|             if (_this->running) { | ||||
| @@ -222,8 +219,7 @@ private: | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("PGA Gain"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("PGA Gain"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (_this->gainMode) { style::beginDisabled(); } | ||||
|         if (ImGui::SliderFloat(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 76)) { | ||||
|   | ||||
| @@ -137,8 +137,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -148,8 +147,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_am_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -141,8 +141,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -152,8 +151,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_cw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -137,8 +137,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -148,8 +147,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_dsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -129,8 +129,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|          | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -140,8 +139,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_fm_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -137,8 +137,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -148,8 +147,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_lsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -90,8 +90,7 @@ public: | ||||
|     void showMenu() { | ||||
|         float menuWidth = ImGui::GetContentRegionAvailWidth(); | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -101,8 +100,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_raw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -137,8 +137,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -148,8 +147,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_usb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
| @@ -164,8 +164,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Snap Interval"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Snap Interval"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { | ||||
|             if (snapInterval < 1) { snapInterval = 1; } | ||||
| @@ -176,8 +175,7 @@ public: | ||||
|         } | ||||
|  | ||||
|          | ||||
|         ImGui::Text("De-emphasis"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("De-emphasis"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) { | ||||
|             setDeempIndex(deempId); | ||||
| @@ -186,8 +184,7 @@ public: | ||||
|             _config->release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("Squelch"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Squelch"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::SliderFloat(("##_radio_wfm_sqelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { | ||||
|             squelch.setLevel(squelchLevel); | ||||
|   | ||||
							
								
								
									
										11
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								readme.md
									
									
									
									
									
								
							| @@ -353,17 +353,18 @@ I will soon publish a contributing.md listing the code style to use. | ||||
|  | ||||
| ## Patrons | ||||
|  | ||||
| * [Croccydile](https://example.com/) | ||||
| * Croccydile | ||||
| * [Daniele D'Agnelli](https://linkedin.com/in/dagnelli) | ||||
| * [EB3FRN](https://www.eb3frn.net/) | ||||
| * [Eric Johnson](https://example.com/) | ||||
| * Eric Johnson | ||||
| * Flinger Films | ||||
| * [W4IPA](https://twitter.com/W4IPAstroke5) | ||||
| * [Lee Donaghy](https://github.com/github) | ||||
| * [ON4MU](https://github.com/) | ||||
| * Lee Donaghy | ||||
| * ON4MU | ||||
| * [Passion-Radio.com](https://passion-radio.com/) | ||||
| * [Scanner School](https://scannerschool.com/) | ||||
| * [SignalsEverywhere](https://signalseverywhere.com/) | ||||
| * [Syne Ardwin (WI9SYN)](https://example.com/) | ||||
| * Syne Ardwin (WI9SYN) | ||||
|  | ||||
| ## Contributors | ||||
|  | ||||
|   | ||||
| @@ -126,8 +126,7 @@ private: | ||||
|         } | ||||
|         if (listening) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Controlled VFO"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Controlled VFO"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         { | ||||
|             std::lock_guard lck(_this->vfoMtx); | ||||
| @@ -141,8 +140,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         ImGui::Text("Controlled Recorder"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Controlled Recorder"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         { | ||||
|             std::lock_guard lck(_this->vfoMtx); | ||||
|   | ||||
| @@ -352,8 +352,7 @@ private: | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         // Rest of rtlsdr config here | ||||
|         ImGui::Text("Direct Sampling"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Direct Sampling"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_rtlsdr_ds_", _this->name), &_this->directSamplingMode, directSamplingModesTxt)) { | ||||
|             if (_this->running) { | ||||
| @@ -378,8 +377,7 @@ private: | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("PPM Correction"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("PPM Correction"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputInt(CONCAT("##_rtlsdr_ppm_", _this->name), &_this->ppm, 1, 10)) { | ||||
|             _this->ppm = std::clamp<int>(_this->ppm, -1000000, 1000000); | ||||
| @@ -393,6 +391,21 @@ private: | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (_this->tunerAgc || _this->gainList.size() == 0) { style::beginDisabled(); } | ||||
|         ImGui::SetNextItemWidth(menuWidth); | ||||
|         if (ImGui::SliderInt(CONCAT("##_rtlsdr_gain_", _this->name), &_this->gainId, 0, _this->gainList.size() - 1, _this->dbTxt)) { | ||||
|             _this->updateGainTxt(); | ||||
|             if (_this->running) { | ||||
|                 rtlsdr_set_tuner_gain(_this->openDev, _this->gainList[_this->gainId]); | ||||
|             } | ||||
|             if (_this->selectedDevName != "") { | ||||
|                 config.acquire(); | ||||
|                 config.conf["devices"][_this->selectedDevName]["gain"] = _this->gainId; | ||||
|                 config.release(true); | ||||
|             } | ||||
|         } | ||||
|         if (_this->tunerAgc || _this->gainList.size() == 0) { style::endDisabled(); } | ||||
|  | ||||
|         if (ImGui::Checkbox(CONCAT("Bias T##_rtlsdr_rtl_biast_", _this->name), &_this->biasT)) { | ||||
|             if (_this->running) { | ||||
|                 rtlsdr_set_bias_tee(_this->openDev, _this->biasT); | ||||
| @@ -442,21 +455,6 @@ private: | ||||
|                 config.release(true); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (_this->tunerAgc || _this->gainList.size() == 0) { style::beginDisabled(); } | ||||
|         ImGui::SetNextItemWidth(menuWidth); | ||||
|         if (ImGui::SliderInt(CONCAT("##_rtlsdr_gain_", _this->name), &_this->gainId, 0, _this->gainList.size() - 1, _this->dbTxt)) { | ||||
|             _this->updateGainTxt(); | ||||
|             if (_this->running) { | ||||
|                 rtlsdr_set_tuner_gain(_this->openDev, _this->gainList[_this->gainId]); | ||||
|             } | ||||
|             if (_this->selectedDevName != "") { | ||||
|                 config.acquire(); | ||||
|                 config.conf["devices"][_this->selectedDevName]["gain"] = _this->gainId; | ||||
|                 config.release(true); | ||||
|             } | ||||
|         } | ||||
|         if (_this->tunerAgc || _this->gainList.size() == 0) { style::endDisabled(); } | ||||
|     } | ||||
|  | ||||
|     void worker() { | ||||
|   | ||||
| @@ -218,8 +218,7 @@ private: | ||||
|  | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         ImGui::Text("Direct Sampling"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Direct Sampling"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##_rtltcp_ds_", _this->name), &_this->directSamplingMode, "Disabled\0I branch\0Q branch\0")) { | ||||
|             if (_this->running) { | ||||
| @@ -231,8 +230,7 @@ private: | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         ImGui::Text("PPM Correction"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("PPM Correction"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::InputInt(CONCAT("##_rtltcp_ppm_", _this->name), &_this->ppm, 1, 10)) { | ||||
|             if (_this->running) { | ||||
| @@ -243,6 +241,18 @@ private: | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         if (_this->tunerAGC) { style::beginDisabled(); } | ||||
|         ImGui::SetNextItemWidth(menuWidth); | ||||
|         if (ImGui::SliderInt(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 28, "")) { | ||||
|             if (_this->running) { | ||||
|                 _this->client.setGainIndex(_this->gain); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["gainIndex"] = _this->gain; | ||||
|             config.release(true); | ||||
|         } | ||||
|         if (_this->tunerAGC) { style::endDisabled(); } | ||||
|  | ||||
|         if (ImGui::Checkbox(CONCAT("Bias-T##_biast_select_", _this->name), &_this->biasTee)) { | ||||
|             if (_this->running) { | ||||
|                 _this->client.setBiasTee(_this->biasTee); | ||||
| @@ -284,18 +294,6 @@ private: | ||||
|             config.conf["tunerAGC"] = _this->tunerAGC; | ||||
|             config.release(true); | ||||
|         } | ||||
|  | ||||
|         if (_this->tunerAGC) { style::beginDisabled(); } | ||||
|         ImGui::SetNextItemWidth(menuWidth); | ||||
|         if (ImGui::SliderInt(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 28, "")) { | ||||
|             if (_this->running) { | ||||
|                 _this->client.setGainIndex(_this->gain); | ||||
|             } | ||||
|             config.acquire(); | ||||
|             config.conf["gainIndex"] = _this->gain; | ||||
|             config.release(true); | ||||
|         } | ||||
|         if (_this->tunerAGC) { style::endDisabled(); } | ||||
|     } | ||||
|  | ||||
|     static void worker(void* ctx) { | ||||
|   | ||||
| @@ -744,8 +744,7 @@ private: | ||||
|  | ||||
|         if (_this->selectedName != "") { | ||||
|             ImGui::PushItemWidth(menuWidth - ImGui::CalcTextSize("LNA Gain").x - 10); | ||||
|             ImGui::Text("LNA Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("LNA Gain"); | ||||
|             float pos = ImGui::GetCursorPosX(); | ||||
|             if (ImGui::SliderInt(CONCAT("##sdrplay_lna_gain", _this->name), &_this->lnaGain, _this->lnaSteps - 1, 0, "")) { | ||||
|                 if (_this->running) { | ||||
| @@ -758,8 +757,7 @@ private: | ||||
|             } | ||||
|  | ||||
|             if (_this->agc > 0) { style::beginDisabled(); } | ||||
|             ImGui::Text("IF Gain"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("IF Gain"); | ||||
|             ImGui::SetCursorPosX(pos); | ||||
|             if (ImGui::SliderInt(CONCAT("##sdrplay_gain", _this->name), &_this->gain, 59, 20, "")) { | ||||
|                 if (_this->running) { | ||||
| @@ -773,8 +771,7 @@ private: | ||||
|             ImGui::PopItemWidth(); | ||||
|             if (_this->agc > 0) { style::endDisabled(); } | ||||
|  | ||||
|             ImGui::Text("AGC"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("AGC"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo(CONCAT("##sdrplay_agc", _this->name), &_this->agc, agcModesTxt)) { | ||||
|                 if (_this->running) { | ||||
| @@ -852,8 +849,7 @@ private: | ||||
|     } | ||||
|  | ||||
|     void RSP2Menu(float menuWidth) { | ||||
|         ImGui::Text("Antenna"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Antenna"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##sdrplay_rsp2_ant", name), &rsp2_antennaPort, rsp2_antennaPortsTxt)) { | ||||
|             if (running) { | ||||
| @@ -887,8 +883,7 @@ private: | ||||
|     } | ||||
|  | ||||
|     void RSPduoMenu(float menuWidth) { | ||||
|         ImGui::Text("Antenna"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Antenna"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|  | ||||
|         if (ImGui::Combo(CONCAT("##sdrplay_rspduo_ant", name), &rspduo_antennaPort, rspduo_antennaPortsTxt)) { | ||||
| @@ -938,8 +933,7 @@ private: | ||||
|     } | ||||
|  | ||||
|     void RSPdxMenu(float menuWidth) { | ||||
|         ImGui::Text("Antenna"); | ||||
|         ImGui::SameLine(); | ||||
|         ImGui::LeftLabel("Antenna"); | ||||
|         ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|         if (ImGui::Combo(CONCAT("##sdrplay_rspdx_ant", name), &rspdx_antennaPort, rspdx_antennaPortsTxt)) { | ||||
|             if (running) { | ||||
|   | ||||
| @@ -397,8 +397,7 @@ private: | ||||
|         if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|         if (_this->antennaList.size() > 1) { | ||||
|             ImGui::Text("Antenna"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Antenna"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo(CONCAT("##_antenna_select_", _this->name), &_this->uiAntennaId, _this->txtAntennaList.c_str())) { | ||||
|                 if (_this->running) | ||||
| @@ -433,9 +432,10 @@ private: | ||||
|         } | ||||
|  | ||||
|         int i = 0; | ||||
|         char buf[128]; | ||||
|         for (auto gain : _this->gainList) { | ||||
|             ImGui::Text("%s gain", gain.c_str()); | ||||
|             ImGui::SameLine(); | ||||
|             sprintf(buf, "%s gain", gain.c_str()); | ||||
|             ImGui::LeftLabel(buf); | ||||
|             ImGui::SetCursorPosX(gainNameLen); | ||||
|             ImGui::SetNextItemWidth(menuWidth - gainNameLen); | ||||
|             float step = _this->gainRanges[i].step(); | ||||
| @@ -454,12 +454,8 @@ private: | ||||
|             i++; | ||||
|         } | ||||
|         if(_this->bandwidthList.size() > 2) { | ||||
|             float bwLen = ImGui::CalcTextSize("Bandwidth").x + 5.0f; | ||||
|             ImGui::Text("Bandwidth"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::SetCursorPosX(bwLen); | ||||
|             ImGui::SetNextItemWidth(menuWidth - bwLen); | ||||
|          | ||||
|             ImGui::LeftLabel("Bandwidth"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo(CONCAT("##_bw_select_", _this->name), &_this->uiBandwidthId, _this->txtBwList.c_str())) { | ||||
|                 if(_this->running) { | ||||
|                     if(_this->bandwidthList[_this->uiBandwidthId] == -1) | ||||
|   | ||||
| @@ -231,8 +231,7 @@ private: | ||||
|  | ||||
|         if (connected) { | ||||
|             if (_this->running) { style::beginDisabled(); } | ||||
|             ImGui::Text("Samplerate"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Samplerate"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo("##spyserver_source_sr", &_this->srId, _this->sampleRatesTxt.c_str())) { | ||||
|                 _this->sampleRate = _this->sampleRates[_this->srId]; | ||||
| @@ -243,8 +242,7 @@ private: | ||||
|             } | ||||
|             if (_this->running) { style::endDisabled(); } | ||||
|  | ||||
|             ImGui::Text("Sample bit depth"); | ||||
|             ImGui::SameLine(); | ||||
|             ImGui::LeftLabel("Sample bit depth"); | ||||
|             ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); | ||||
|             if (ImGui::Combo("##spyserver_source_type", &_this->iqType, streamFormatStr)) { | ||||
|                 int srvBits = streamFormatsBitCount[_this->iqType]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user