Merge branch 'AlexandreRouma:master' into sdrplay-lowif

This commit is contained in:
arkhnchul 2021-08-31 20:48:46 +03:00 committed by GitHub
commit 11c6377c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 169 additions and 220 deletions

View File

@ -412,8 +412,7 @@ private:
// Gain menus // Gain menus
if (_this->gainMode == 0) { if (_this->gainMode == 0) {
ImGui::Text("Gain"); ImGui::LeftLabel("Gain");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt(CONCAT("##_airspy_sens_gain_", _this->name), &_this->sensitiveGain, 0, 21)) { if (ImGui::SliderInt(CONCAT("##_airspy_sens_gain_", _this->name), &_this->sensitiveGain, 0, 21)) {
if (_this->running) { if (_this->running) {
@ -427,8 +426,7 @@ private:
} }
} }
else if (_this->gainMode == 1) { else if (_this->gainMode == 1) {
ImGui::Text("Gain"); ImGui::LeftLabel("Gain");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt(CONCAT("##_airspy_lin_gain_", _this->name), &_this->linearGain, 0, 21)) { if (ImGui::SliderInt(CONCAT("##_airspy_lin_gain_", _this->name), &_this->linearGain, 0, 21)) {
if (_this->running) { if (_this->running) {
@ -446,8 +444,7 @@ private:
float pos = ImGui::CalcTextSize("Mixer Gain").x + 10; float pos = ImGui::CalcTextSize("Mixer Gain").x + 10;
if (_this->lnaAgc) { style::beginDisabled(); } if (_this->lnaAgc) { style::beginDisabled(); }
ImGui::Text("LNA Gain"); ImGui::LeftLabel("LNA Gain");
ImGui::SameLine();
ImGui::SetCursorPosX(pos); ImGui::SetCursorPosX(pos);
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt(CONCAT("##_airspy_lna_gain_", _this->name), &_this->lnaGain, 0, 15)) { 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->lnaAgc) { style::endDisabled(); }
if (_this->mixerAgc) { style::beginDisabled(); } if (_this->mixerAgc) { style::beginDisabled(); }
ImGui::Text("Mixer Gain"); ImGui::LeftLabel("Mixer Gain");
ImGui::SameLine();
ImGui::SetCursorPosX(pos); ImGui::SetCursorPosX(pos);
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt(CONCAT("##_airspy_mix_gain_", _this->name), &_this->mixerGain, 0, 15)) { if (ImGui::SliderInt(CONCAT("##_airspy_mix_gain_", _this->name), &_this->mixerGain, 0, 15)) {
@ -479,8 +475,7 @@ private:
} }
if (_this->mixerAgc) { style::endDisabled(); } if (_this->mixerAgc) { style::endDisabled(); }
ImGui::Text("VGA Gain"); ImGui::LeftLabel("VGA Gain");
ImGui::SameLine();
ImGui::SetCursorPosX(pos); ImGui::SetCursorPosX(pos);
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt(CONCAT("##_airspy_vga_gain_", _this->name), &_this->vgaGain, 0, 15)) { if (ImGui::SliderInt(CONCAT("##_airspy_vga_gain_", _this->name), &_this->vgaGain, 0, 15)) {

View File

@ -303,8 +303,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("AGC Mode"); ImGui::LeftLabel("AGC Mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_airspyhf_agc_", _this->name), &_this->agcMode, AGG_MODES_STR)) { if (ImGui::Combo(CONCAT("##_airspyhf_agc_", _this->name), &_this->agcMode, AGG_MODES_STR)) {
if (_this->running) { if (_this->running) {
@ -320,21 +319,7 @@ private:
} }
} }
ImGui::Text("HF LNA"); ImGui::LeftLabel("Attenuation");
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::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloatWithSteps(CONCAT("##_airspyhf_attn_", _this->name), &_this->atten, 0, 48, 6, "%.0f dB")) { if (ImGui::SliderFloatWithSteps(CONCAT("##_airspyhf_attn_", _this->name), &_this->atten, 0, 48, 6, "%.0f dB")) {
if (_this->running) { if (_this->running) {
@ -346,6 +331,17 @@ private:
config.release(true); 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) { static int callback(airspyhf_transfer_t* transfer) {

View File

@ -424,8 +424,7 @@ private:
// Channel selection (only show if more than one channel) // Channel selection (only show if more than one channel)
if (_this->channelCount > 1) { if (_this->channelCount > 1) {
ImGui::Text("RX Channel"); ImGui::LeftLabel("RX Channel");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
ImGui::Combo(CONCAT("##_balderf_ch_sel_", _this->name), &_this->chanId, _this->channelNamesTxt.c_str()); ImGui::Combo(CONCAT("##_balderf_ch_sel_", _this->name), &_this->chanId, _this->channelNamesTxt.c_str());
if (_this->selectedSerial != "") { if (_this->selectedSerial != "") {
@ -437,8 +436,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Bandwidth"); ImGui::LeftLabel("Bandwidth");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_balderf_bw_sel_", _this->name), &_this->bwId, _this->bandwidthsTxt.c_str())) { if (ImGui::Combo(CONCAT("##_balderf_bw_sel_", _this->name), &_this->bwId, _this->bandwidthsTxt.c_str())) {
if (_this->running) { if (_this->running) {
@ -453,8 +451,7 @@ private:
} }
// General config BS // General config BS
ImGui::Text("Gain control mode"); ImGui::LeftLabel("Gain control mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_balderf_gm_sel_", _this->name), &_this->gainMode, _this->gainModesTxt.c_str()) && _this->selectedSerial != "") { if (ImGui::Combo(CONCAT("##_balderf_gm_sel_", _this->name), &_this->gainMode, _this->gainModesTxt.c_str()) && _this->selectedSerial != "") {
if (_this->running) { if (_this->running) {
@ -472,8 +469,7 @@ private:
} }
if (_this->selectedSerial != "") { if (_this->gainModes[_this->gainMode].mode != BLADERF_GAIN_MANUAL) { style::beginDisabled(); } } if (_this->selectedSerial != "") { if (_this->gainModes[_this->gainMode].mode != BLADERF_GAIN_MANUAL) { style::beginDisabled(); } }
ImGui::Text("Gain"); ImGui::LeftLabel("Gain");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); 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 (ImGui::SliderInt("##_balderf_oag_sel_", &_this->overallGain, (_this->gainRange != NULL) ? _this->gainRange->min : 0, (_this->gainRange != NULL) ? _this->gainRange->max : 60)) {
if (_this->running) { if (_this->running) {

View File

@ -78,7 +78,7 @@ namespace core {
gui::waterfall.setViewOffset(0); gui::waterfall.setViewOffset(0);
gui::waterfall.setViewBandwidth(effectiveSr); gui::waterfall.setViewBandwidth(effectiveSr);
sigpath::signalPath.setSampleRate(effectiveSr); sigpath::signalPath.setSampleRate(effectiveSr);
gui::mainWindow.setViewBandwidthSlider(effectiveSr); gui::mainWindow.setViewBandwidthSlider(1.0);
} }
}; };

View File

@ -39,6 +39,7 @@ namespace sdrpp_credits {
"Daniele D'Agnelli", "Daniele D'Agnelli",
"EB3FRN", "EB3FRN",
"Eric Johnson", "Eric Johnson",
"Flinger Films",
"W4IPA", "W4IPA",
"Lee Donaghy", "Lee Donaghy",
"ON4MU", "ON4MU",

View File

@ -176,7 +176,7 @@ void MainWindow::init() {
gui::freqSelect.frequencyChanged = false; gui::freqSelect.frequencyChanged = false;
sigpath::sourceManager.tune(frequency); sigpath::sourceManager.tune(frequency);
gui::waterfall.setCenterFrequency(frequency); gui::waterfall.setCenterFrequency(frequency);
bw = gui::waterfall.getBandwidth(); bw = 1.0;
gui::waterfall.vfoFreqChanged = false; gui::waterfall.vfoFreqChanged = false;
gui::waterfall.centerFreqMoved = false; gui::waterfall.centerFreqMoved = false;
gui::waterfall.selectFirstVFO(); gui::waterfall.selectFirstVFO();
@ -598,12 +598,13 @@ void MainWindow::draw() {
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Zoom").x / 2.0)); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - (ImGui::CalcTextSize("Zoom").x / 2.0));
ImGui::Text("Zoom"); ImGui::Text("Zoom");
ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.0) - 10);
float minSliderBw = 1000.0; if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, 1.0, 0.0, "")) {
float maxSliderBw = gui::waterfall.getBandwidth(); double factor = (double)bw * (double)bw;
if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, maxSliderBw, minSliderBw, "")) {
float normBw = bw / (maxSliderBw - minSliderBw); // Map 0.0 -> 1.0 to 1000.0 -> bandwidth
float factor = normBw * normBw; double wfBw = gui::waterfall.getBandwidth();
float finalBw = minSliderBw + bw * factor; double delta = wfBw - 1000.0;
double finalBw = std::min<double>(1000.0 + (factor * delta), wfBw);
gui::waterfall.setViewBandwidth(finalBw); gui::waterfall.setViewBandwidth(finalBw);
if (vfo != NULL) { if (vfo != NULL) {

View File

@ -2,6 +2,7 @@
#include <gui/widgets/bandplan.h> #include <gui/widgets/bandplan.h>
#include <gui/gui.h> #include <gui/gui.h>
#include <core.h> #include <core.h>
#include <gui/style.h>
namespace bandplanmenu { namespace bandplanmenu {
int bandplanId; int bandplanId;
@ -44,8 +45,7 @@ namespace bandplanmenu {
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::Text("Position"); ImGui::LeftLabel("Position");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) { if (ImGui::Combo("##_bandplan_pos_", &bandPlanPos, bandPlanPosTxt)) {
gui::waterfall.setBandPlanPos(bandPlanPos); gui::waterfall.setBandPlanPos(bandPlanPos);

View File

@ -6,6 +6,7 @@
#include <gui/gui.h> #include <gui/gui.h>
#include <gui/main_window.h> #include <gui/main_window.h>
#include <signal_path/signal_path.h> #include <signal_path/signal_path.h>
#include <gui/style.h>
namespace displaymenu { namespace displaymenu {
bool showWaterfall; bool showWaterfall;
@ -105,8 +106,7 @@ namespace displaymenu {
core::configManager.release(true); core::configManager.release(true);
} }
ImGui::Text("FFT Framerate"); ImGui::LeftLabel("FFT Framerate");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputInt("##sdrpp_fft_rate", &fftRate, 1, 10)) { if (ImGui::InputInt("##sdrpp_fft_rate", &fftRate, 1, 10)) {
fftRate = std::max<int>(1, fftRate); fftRate = std::max<int>(1, fftRate);
@ -116,8 +116,7 @@ namespace displaymenu {
core::configManager.release(true); core::configManager.release(true);
} }
ImGui::Text("FFT Size"); ImGui::LeftLabel("FFT Size");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) { if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) {
gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]); gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]);
@ -126,8 +125,7 @@ namespace displaymenu {
core::configManager.release(true); core::configManager.release(true);
} }
ImGui::Text("FFT Window"); ImGui::LeftLabel("FFT Window");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) { if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) {
gui::mainWindow.setFFTWindow(selectedWindow); gui::mainWindow.setFFTWindow(selectedWindow);
@ -137,8 +135,7 @@ namespace displaymenu {
} }
if (colorMapNames.size() > 0) { if (colorMapNames.size() > 0) {
ImGui::Text("Color Map"); ImGui::LeftLabel("Color Map");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) { if (ImGui::Combo("##_sdrpp_color_map_sel", &colorMapId, colorMapNamesTxt.c_str())) {
colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]]; colormaps::Map map = colormaps::maps[colorMapNames[colorMapId]];

View File

@ -168,8 +168,7 @@ namespace sourecmenu {
core::configManager.release(true); core::configManager.release(true);
} }
ImGui::Text("Offset mode"); ImGui::LeftLabel("Offset mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) { if (ImGui::Combo("##_sdrpp_offset_mode", &offsetMode, offsetModesTxt)) {
updateOffset(); updateOffset();
@ -178,8 +177,7 @@ namespace sourecmenu {
core::configManager.release(true); core::configManager.release(true);
} }
ImGui::Text("Offset"); ImGui::LeftLabel("Offset");
ImGui::SameLine();
ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX());
if (offsetMode == OFFSET_MODE_CUSTOM) { if (offsetMode == OFFSET_MODE_CUSTOM) {
if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) { if (ImGui::InputDouble("##freq_offset", &customOffset, 1.0, 100.0)) {
@ -196,8 +194,7 @@ namespace sourecmenu {
} }
if (running) { style::beginDisabled(); } if (running) { style::beginDisabled(); }
ImGui::Text("Decimation"); ImGui::LeftLabel("Decimation");
ImGui::SameLine();
ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##source_decim", &decimationPower, decimationStages)) { if (ImGui::Combo("##source_decim", &decimationPower, decimationStages)) {
sigpath::signalPath.setDecimation(decimationPower); sigpath::signalPath.setDecimation(decimationPower);

View File

@ -2,6 +2,7 @@
#include <gui/gui.h> #include <gui/gui.h>
#include <options.h> #include <options.h>
#include <core.h> #include <core.h>
#include <gui/style.h>
namespace thememenu { namespace thememenu {
int themeId; int themeId;
@ -34,8 +35,7 @@ namespace thememenu {
void draw(void* ctx) { void draw(void* ctx) {
float menuWidth = ImGui::GetContentRegionAvailWidth(); float menuWidth = ImGui::GetContentRegionAvailWidth();
ImGui::Text("Theme"); ImGui::LeftLabel("Theme");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) { if (ImGui::Combo("##theme_select_combo", &themeId, themeNamesTxt.c_str())) {
gui::themeManager.applyTheme(themeNames[themeId]); gui::themeManager.applyTheme(themeNames[themeId]);

View File

@ -44,3 +44,13 @@ namespace style {
ImGui::PopStyleColor(3); 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);
}
}

View File

@ -13,3 +13,7 @@ namespace style {
void endDisabled(); void endDisabled();
void testtt(); void testtt();
} }
namespace ImGui {
void LeftLabel(char* text);
}

View File

@ -167,7 +167,7 @@ private:
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Name"); ImGui::LeftLabel("Name");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);
if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) { if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) {
@ -176,21 +176,21 @@ private:
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Frequency"); ImGui::LeftLabel("Frequency");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);
ImGui::InputDouble(("##freq_manager_edit_freq"+name).c_str(), &editedBookmark.frequency); ImGui::InputDouble(("##freq_manager_edit_freq"+name).c_str(), &editedBookmark.frequency);
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Bandwidth"); ImGui::LeftLabel("Bandwidth");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);
ImGui::InputDouble(("##freq_manager_edit_bw"+name).c_str(), &editedBookmark.bandwidth); ImGui::InputDouble(("##freq_manager_edit_bw"+name).c_str(), &editedBookmark.bandwidth);
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
ImGui::Text("Mode"); ImGui::LeftLabel("Mode");
ImGui::TableSetColumnIndex(1); ImGui::TableSetColumnIndex(1);
ImGui::SetNextItemWidth(200); ImGui::SetNextItemWidth(200);
@ -234,7 +234,7 @@ private:
strcpy(nameBuf, editedListName.c_str()); strcpy(nameBuf, editedListName.c_str());
if (ImGui::BeginPopup(id.c_str(), ImGuiWindowFlags_NoResize)) { if (ImGui::BeginPopup(id.c_str(), ImGuiWindowFlags_NoResize)) {
ImGui::Text("Name"); ImGui::LeftLabel("Name");
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) { if (ImGui::InputText(("##freq_manager_edit_name"+name).c_str(), nameBuf, 1023)) {
editedListName = nameBuf; editedListName = nameBuf;
@ -569,8 +569,7 @@ private:
_this->selectListsOpen = true; _this->selectListsOpen = true;
} }
ImGui::Text("Bookmark display mode"); ImGui::LeftLabel("Bookmark display mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(("##_freq_mgr_dms_" + _this->name).c_str(), &_this->bookmarkDisplayMode, bookmarkDisplayModesTxt)) { if (ImGui::Combo(("##_freq_mgr_dms_" + _this->name).c_str(), &_this->bookmarkDisplayMode, bookmarkDisplayModesTxt)) {
config.acquire(); config.acquire();

View File

@ -305,8 +305,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Bandwidth"); ImGui::LeftLabel("Bandwidth");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_hackrf_bw_sel_", _this->name), &_this->bwId, bandwidthsTxt)) { if (ImGui::Combo(CONCAT("##_hackrf_bw_sel_", _this->name), &_this->bwId, bandwidthsTxt)) {
if (_this->running) { if (_this->running) {
@ -317,6 +316,28 @@ private:
config.release(true); 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 (ImGui::Checkbox(CONCAT("Bias-T##_hackrf_bt_", _this->name), &_this->biasT)) {
if (_this->running) { if (_this->running) {
hackrf_set_antenna_enable(_this->openDev, _this->biasT); hackrf_set_antenna_enable(_this->openDev, _this->biasT);
@ -334,30 +355,6 @@ private:
config.conf["devices"][_this->selectedSerial]["amp"] = _this->amp; config.conf["devices"][_this->selectedSerial]["amp"] = _this->amp;
config.release(true); 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) { static int callback(hackrf_transfer* transfer) {

View File

@ -411,8 +411,7 @@ private:
} }
if (_this->channelCount > 1) { if (_this->channelCount > 1) {
ImGui::Text("RX Channel"); ImGui::LeftLabel("RX Channel");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##limesdr_ch_sel", &_this->chanId, _this->channelNamesTxt.c_str()) && _this->selectedDevName != "") { if (ImGui::Combo("##limesdr_ch_sel", &_this->chanId, _this->channelNamesTxt.c_str()) && _this->selectedDevName != "") {
config.acquire(); config.acquire();
@ -423,8 +422,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Antenna"); ImGui::LeftLabel("Antenna");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##limesdr_ant_sel", &_this->antennaId, _this->antennaListTxt.c_str())) { if (ImGui::Combo("##limesdr_ant_sel", &_this->antennaId, _this->antennaListTxt.c_str())) {
if (_this->running) { if (_this->running) {
@ -437,8 +435,7 @@ private:
} }
} }
ImGui::Text("Bandwidth"); ImGui::LeftLabel("Bandwidth");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##limesdr_bw_sel", &_this->bwId, _this->bandwidthsTxt.c_str())) { if (ImGui::Combo("##limesdr_bw_sel", &_this->bwId, _this->bandwidthsTxt.c_str())) {
if (_this->running) { if (_this->running) {
@ -451,8 +448,7 @@ private:
} }
} }
ImGui::Text("Gain"); ImGui::LeftLabel("Gain");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderInt("##limesdr_gain_sel", &_this->gain, 0, 73, "%ddB")) { if (ImGui::SliderInt("##limesdr_gain_sel", &_this->gain, 0, 73, "%ddB")) {
if (_this->running) { if (_this->running) {

View File

@ -134,8 +134,7 @@ public:
config.release(true); config.release(true);
} }
ImGui::Text("Protocol"); ImGui::LeftLabel("Protocol");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_network_sink_mode_", _streamName), &modeId, sinkModesTxt)) { if (ImGui::Combo(CONCAT("##_network_sink_mode_", _streamName), &modeId, sinkModesTxt)) {
config.acquire(); config.acquire();
@ -145,8 +144,7 @@ public:
if (listening) { style::endDisabled(); } if (listening) { style::endDisabled(); }
ImGui::Text("Samplerate"); ImGui::LeftLabel("Samplerate");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_network_sink_sr_", _streamName), &srId, sampleRatesTxt.c_str())) { if (ImGui::Combo(CONCAT("##_network_sink_sr_", _streamName), &srId, sampleRatesTxt.c_str())) {
sampleRate = sampleRates[srId]; sampleRate = sampleRates[srId];

View File

@ -188,8 +188,7 @@ private:
float menuWidth = ImGui::GetContentRegionAvailWidth(); float menuWidth = ImGui::GetContentRegionAvailWidth();
if (_this->running) { style::beginDisabled(); } if (_this->running) { style::beginDisabled(); }
ImGui::Text("IP"); ImGui::LeftLabel("IP");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16)) { if (ImGui::InputText(CONCAT("##_pluto_ip_", _this->name), &_this->ip[3], 16)) {
config.acquire(); config.acquire();
@ -197,8 +196,7 @@ private:
config.release(true); config.release(true);
} }
ImGui::Text("Samplerate"); ImGui::LeftLabel("Samplerate");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_pluto_sr_", _this->name), &_this->srId, _this->sampleRatesTxt.c_str())) { if (ImGui::Combo(CONCAT("##_pluto_sr_", _this->name), &_this->srId, _this->sampleRatesTxt.c_str())) {
@ -210,8 +208,7 @@ private:
} }
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Gain Mode"); ImGui::LeftLabel("Gain Mode");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_gainmode_select_", _this->name), &_this->gainMode, gainModesTxt)) { if (ImGui::Combo(CONCAT("##_gainmode_select_", _this->name), &_this->gainMode, gainModesTxt)) {
if (_this->running) { if (_this->running) {
@ -222,8 +219,7 @@ private:
config.release(true); config.release(true);
} }
ImGui::Text("PGA Gain"); ImGui::LeftLabel("PGA Gain");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (_this->gainMode) { style::beginDisabled(); } if (_this->gainMode) { style::beginDisabled(); }
if (ImGui::SliderFloat(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 76)) { if (ImGui::SliderFloat(CONCAT("##_gain_select_", _this->name), &_this->gain, 0, 76)) {

View File

@ -137,8 +137,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -148,8 +147,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_am_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_am_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -141,8 +141,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -152,8 +151,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_cw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_cw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -137,8 +137,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -148,8 +147,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_dsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_dsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -129,8 +129,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -140,8 +139,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_fm_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_fm_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -137,8 +137,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -148,8 +147,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_lsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_lsb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -90,8 +90,7 @@ public:
void showMenu() { void showMenu() {
float menuWidth = ImGui::GetContentRegionAvailWidth(); float menuWidth = ImGui::GetContentRegionAvailWidth();
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -101,8 +100,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_raw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_raw_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -137,8 +137,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -148,8 +147,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_usb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_usb_squelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -164,8 +164,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Snap Interval"); ImGui::LeftLabel("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) { if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; } if (snapInterval < 1) { snapInterval = 1; }
@ -176,8 +175,7 @@ public:
} }
ImGui::Text("De-emphasis"); ImGui::LeftLabel("De-emphasis");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) { if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) {
setDeempIndex(deempId); setDeempIndex(deempId);
@ -186,8 +184,7 @@ public:
_config->release(true); _config->release(true);
} }
ImGui::Text("Squelch"); ImGui::LeftLabel("Squelch");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::SliderFloat(("##_radio_wfm_sqelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) { if (ImGui::SliderFloat(("##_radio_wfm_sqelch_" + uiPrefix).c_str(), &squelchLevel, -100.0f, 0.0f, "%.3fdB")) {
squelch.setLevel(squelchLevel); squelch.setLevel(squelchLevel);

View File

@ -353,17 +353,18 @@ I will soon publish a contributing.md listing the code style to use.
## Patrons ## Patrons
* [Croccydile](https://example.com/) * 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/)
* [Eric Johnson](https://example.com/) * Eric Johnson
* Flinger Films
* [W4IPA](https://twitter.com/W4IPAstroke5) * [W4IPA](https://twitter.com/W4IPAstroke5)
* [Lee Donaghy](https://github.com/github) * Lee Donaghy
* [ON4MU](https://github.com/) * ON4MU
* [Passion-Radio.com](https://passion-radio.com/) * [Passion-Radio.com](https://passion-radio.com/)
* [Scanner School](https://scannerschool.com/) * [Scanner School](https://scannerschool.com/)
* [SignalsEverywhere](https://signalseverywhere.com/) * [SignalsEverywhere](https://signalseverywhere.com/)
* [Syne Ardwin (WI9SYN)](https://example.com/) * Syne Ardwin (WI9SYN)
## Contributors ## Contributors

View File

@ -126,8 +126,7 @@ private:
} }
if (listening) { style::endDisabled(); } if (listening) { style::endDisabled(); }
ImGui::Text("Controlled VFO"); ImGui::LeftLabel("Controlled VFO");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
{ {
std::lock_guard lck(_this->vfoMtx); std::lock_guard lck(_this->vfoMtx);
@ -141,8 +140,7 @@ private:
} }
} }
ImGui::Text("Controlled Recorder"); ImGui::LeftLabel("Controlled Recorder");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
{ {
std::lock_guard lck(_this->vfoMtx); std::lock_guard lck(_this->vfoMtx);

View File

@ -352,8 +352,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
// Rest of rtlsdr config here // Rest of rtlsdr config here
ImGui::Text("Direct Sampling"); ImGui::LeftLabel("Direct Sampling");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_rtlsdr_ds_", _this->name), &_this->directSamplingMode, directSamplingModesTxt)) { if (ImGui::Combo(CONCAT("##_rtlsdr_ds_", _this->name), &_this->directSamplingMode, directSamplingModesTxt)) {
if (_this->running) { if (_this->running) {
@ -378,8 +377,7 @@ private:
} }
} }
ImGui::Text("PPM Correction"); ImGui::LeftLabel("PPM Correction");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputInt(CONCAT("##_rtlsdr_ppm_", _this->name), &_this->ppm, 1, 10)) { if (ImGui::InputInt(CONCAT("##_rtlsdr_ppm_", _this->name), &_this->ppm, 1, 10)) {
_this->ppm = std::clamp<int>(_this->ppm, -1000000, 1000000); _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 (ImGui::Checkbox(CONCAT("Bias T##_rtlsdr_rtl_biast_", _this->name), &_this->biasT)) {
if (_this->running) { if (_this->running) {
rtlsdr_set_bias_tee(_this->openDev, _this->biasT); rtlsdr_set_bias_tee(_this->openDev, _this->biasT);
@ -442,21 +455,6 @@ private:
config.release(true); 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() { void worker() {

View File

@ -218,8 +218,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Direct Sampling"); ImGui::LeftLabel("Direct Sampling");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_rtltcp_ds_", _this->name), &_this->directSamplingMode, "Disabled\0I branch\0Q branch\0")) { if (ImGui::Combo(CONCAT("##_rtltcp_ds_", _this->name), &_this->directSamplingMode, "Disabled\0I branch\0Q branch\0")) {
if (_this->running) { if (_this->running) {
@ -231,8 +230,7 @@ private:
config.release(true); config.release(true);
} }
ImGui::Text("PPM Correction"); ImGui::LeftLabel("PPM Correction");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputInt(CONCAT("##_rtltcp_ppm_", _this->name), &_this->ppm, 1, 10)) { if (ImGui::InputInt(CONCAT("##_rtltcp_ppm_", _this->name), &_this->ppm, 1, 10)) {
if (_this->running) { if (_this->running) {
@ -243,6 +241,18 @@ private:
config.release(true); 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 (ImGui::Checkbox(CONCAT("Bias-T##_biast_select_", _this->name), &_this->biasTee)) {
if (_this->running) { if (_this->running) {
_this->client.setBiasTee(_this->biasTee); _this->client.setBiasTee(_this->biasTee);
@ -284,18 +294,6 @@ private:
config.conf["tunerAGC"] = _this->tunerAGC; config.conf["tunerAGC"] = _this->tunerAGC;
config.release(true); 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) { static void worker(void* ctx) {

View File

@ -744,8 +744,7 @@ private:
if (_this->selectedName != "") { if (_this->selectedName != "") {
ImGui::PushItemWidth(menuWidth - ImGui::CalcTextSize("LNA Gain").x - 10); ImGui::PushItemWidth(menuWidth - ImGui::CalcTextSize("LNA Gain").x - 10);
ImGui::Text("LNA Gain"); ImGui::LeftLabel("LNA Gain");
ImGui::SameLine();
float pos = ImGui::GetCursorPosX(); float pos = ImGui::GetCursorPosX();
if (ImGui::SliderInt(CONCAT("##sdrplay_lna_gain", _this->name), &_this->lnaGain, _this->lnaSteps - 1, 0, "")) { if (ImGui::SliderInt(CONCAT("##sdrplay_lna_gain", _this->name), &_this->lnaGain, _this->lnaSteps - 1, 0, "")) {
if (_this->running) { if (_this->running) {
@ -758,8 +757,7 @@ private:
} }
if (_this->agc > 0) { style::beginDisabled(); } if (_this->agc > 0) { style::beginDisabled(); }
ImGui::Text("IF Gain"); ImGui::LeftLabel("IF Gain");
ImGui::SameLine();
ImGui::SetCursorPosX(pos); ImGui::SetCursorPosX(pos);
if (ImGui::SliderInt(CONCAT("##sdrplay_gain", _this->name), &_this->gain, 59, 20, "")) { if (ImGui::SliderInt(CONCAT("##sdrplay_gain", _this->name), &_this->gain, 59, 20, "")) {
if (_this->running) { if (_this->running) {
@ -773,8 +771,7 @@ private:
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (_this->agc > 0) { style::endDisabled(); } if (_this->agc > 0) { style::endDisabled(); }
ImGui::Text("AGC"); ImGui::LeftLabel("AGC");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_agc", _this->name), &_this->agc, agcModesTxt)) { if (ImGui::Combo(CONCAT("##sdrplay_agc", _this->name), &_this->agc, agcModesTxt)) {
if (_this->running) { if (_this->running) {
@ -852,8 +849,7 @@ private:
} }
void RSP2Menu(float menuWidth) { void RSP2Menu(float menuWidth) {
ImGui::Text("Antenna"); ImGui::LeftLabel("Antenna");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_rsp2_ant", name), &rsp2_antennaPort, rsp2_antennaPortsTxt)) { if (ImGui::Combo(CONCAT("##sdrplay_rsp2_ant", name), &rsp2_antennaPort, rsp2_antennaPortsTxt)) {
if (running) { if (running) {
@ -887,8 +883,7 @@ private:
} }
void RSPduoMenu(float menuWidth) { void RSPduoMenu(float menuWidth) {
ImGui::Text("Antenna"); ImGui::LeftLabel("Antenna");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_rspduo_ant", name), &rspduo_antennaPort, rspduo_antennaPortsTxt)) { if (ImGui::Combo(CONCAT("##sdrplay_rspduo_ant", name), &rspduo_antennaPort, rspduo_antennaPortsTxt)) {
@ -938,8 +933,7 @@ private:
} }
void RSPdxMenu(float menuWidth) { void RSPdxMenu(float menuWidth) {
ImGui::Text("Antenna"); ImGui::LeftLabel("Antenna");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##sdrplay_rspdx_ant", name), &rspdx_antennaPort, rspdx_antennaPortsTxt)) { if (ImGui::Combo(CONCAT("##sdrplay_rspdx_ant", name), &rspdx_antennaPort, rspdx_antennaPortsTxt)) {
if (running) { if (running) {

View File

@ -397,8 +397,7 @@ private:
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
if (_this->antennaList.size() > 1) { if (_this->antennaList.size() > 1) {
ImGui::Text("Antenna"); ImGui::LeftLabel("Antenna");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_antenna_select_", _this->name), &_this->uiAntennaId, _this->txtAntennaList.c_str())) { if (ImGui::Combo(CONCAT("##_antenna_select_", _this->name), &_this->uiAntennaId, _this->txtAntennaList.c_str())) {
if (_this->running) if (_this->running)
@ -433,9 +432,10 @@ private:
} }
int i = 0; int i = 0;
char buf[128];
for (auto gain : _this->gainList) { for (auto gain : _this->gainList) {
ImGui::Text("%s gain", gain.c_str()); sprintf(buf, "%s gain", gain.c_str());
ImGui::SameLine(); ImGui::LeftLabel(buf);
ImGui::SetCursorPosX(gainNameLen); ImGui::SetCursorPosX(gainNameLen);
ImGui::SetNextItemWidth(menuWidth - gainNameLen); ImGui::SetNextItemWidth(menuWidth - gainNameLen);
float step = _this->gainRanges[i].step(); float step = _this->gainRanges[i].step();
@ -454,12 +454,8 @@ private:
i++; i++;
} }
if(_this->bandwidthList.size() > 2) { if(_this->bandwidthList.size() > 2) {
float bwLen = ImGui::CalcTextSize("Bandwidth").x + 5.0f; ImGui::LeftLabel("Bandwidth");
ImGui::Text("Bandwidth"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
ImGui::SameLine();
ImGui::SetCursorPosX(bwLen);
ImGui::SetNextItemWidth(menuWidth - bwLen);
if (ImGui::Combo(CONCAT("##_bw_select_", _this->name), &_this->uiBandwidthId, _this->txtBwList.c_str())) { if (ImGui::Combo(CONCAT("##_bw_select_", _this->name), &_this->uiBandwidthId, _this->txtBwList.c_str())) {
if(_this->running) { if(_this->running) {
if(_this->bandwidthList[_this->uiBandwidthId] == -1) if(_this->bandwidthList[_this->uiBandwidthId] == -1)

View File

@ -231,8 +231,7 @@ private:
if (connected) { if (connected) {
if (_this->running) { style::beginDisabled(); } if (_this->running) { style::beginDisabled(); }
ImGui::Text("Samplerate"); ImGui::LeftLabel("Samplerate");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##spyserver_source_sr", &_this->srId, _this->sampleRatesTxt.c_str())) { if (ImGui::Combo("##spyserver_source_sr", &_this->srId, _this->sampleRatesTxt.c_str())) {
_this->sampleRate = _this->sampleRates[_this->srId]; _this->sampleRate = _this->sampleRates[_this->srId];
@ -243,8 +242,7 @@ private:
} }
if (_this->running) { style::endDisabled(); } if (_this->running) { style::endDisabled(); }
ImGui::Text("Sample bit depth"); ImGui::LeftLabel("Sample bit depth");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##spyserver_source_type", &_this->iqType, streamFormatStr)) { if (ImGui::Combo("##spyserver_source_type", &_this->iqType, streamFormatStr)) {
int srvBits = streamFormatsBitCount[_this->iqType]; int srvBits = streamFormatsBitCount[_this->iqType];