Fixed bug with radio

This commit is contained in:
Ryzerth 2021-02-15 20:16:40 +01:00
parent 23dcc16829
commit aae6f535f5
8 changed files with 13 additions and 5 deletions

View File

@ -131,6 +131,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["AM"]["snapInterval"] = snapInterval;

View File

@ -139,6 +139,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["CW"]["snapInterval"] = snapInterval;

View File

@ -41,7 +41,7 @@ public:
squelch.init(_vfo->output, squelchLevel);
demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_DSB);
demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_DSB);
agc.init(&demod.out, 20.0f, bbSampRate);
@ -131,6 +131,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["DSB"]["snapInterval"] = snapInterval;

View File

@ -41,7 +41,7 @@ public:
squelch.init(_vfo->output, squelchLevel);
demod.init(&squelch.out, bbSampRate, bandWidth / 2.0f);
demod.init(&squelch.out, bbSampRate, bw / 2.0f);
float audioBW = std::min<float>(audioSampleRate / 2.0f, bw / 2.0f);
win.init(audioBW, audioBW, bbSampRate);
@ -127,6 +127,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["FM"]["snapInterval"] = snapInterval;

View File

@ -41,7 +41,7 @@ public:
squelch.init(_vfo->output, squelchLevel);
demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_LSB);
demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_LSB);
agc.init(&demod.out, 20.0f, bbSampRate);
@ -131,6 +131,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["LSB"]["snapInterval"] = snapInterval;

View File

@ -94,6 +94,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["RAW"]["snapInterval"] = snapInterval;

View File

@ -41,7 +41,7 @@ public:
squelch.init(_vfo->output, squelchLevel);
demod.init(&squelch.out, bbSampRate, bandWidth, dsp::SSBDemod::MODE_USB);
demod.init(&squelch.out, bbSampRate, bw, dsp::SSBDemod::MODE_USB);
agc.init(&demod.out, 20.0f, bbSampRate);
@ -131,6 +131,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["USB"]["snapInterval"] = snapInterval;

View File

@ -47,7 +47,7 @@ public:
squelch.init(_vfo->output, squelchLevel);
demod.init(&squelch.out, bbSampRate, bandWidth / 2.0f);
demod.init(&squelch.out, bbSampRate, bw / 2.0f);
float audioBW = std::min<float>(audioSampleRate / 2.0f, 16000.0f);
win.init(audioBW, audioBW, bbSampRate);
@ -140,6 +140,7 @@ public:
ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, "%.0f", 0)) {
if (snapInterval < 1) { snapInterval = 1; }
setSnapInterval(snapInterval);
_config->aquire();
_config->conf[uiPrefix]["WFM"]["snapInterval"] = snapInterval;