New features + waterfall code cleanup

This commit is contained in:
Ryzerth
2021-04-17 22:37:50 +02:00
parent d1e553f05a
commit d91934955b
18 changed files with 263 additions and 84 deletions

View File

@@ -80,6 +80,7 @@ public:
_vfo->setSampleRate(bbSampRate, bw);
_vfo->setSnapInterval(snapInterval);
_vfo->setReference(ImGui::WaterfallVFO::REF_LOWER);
_vfo->setBandwidthLimits(bwMin, bwMax, false);
}
void setVFO(VFOManager::VFO* vfo) {
@@ -125,6 +126,14 @@ public:
_config->aquire();
_config->conf[uiPrefix]["USB"]["bandwidth"] = bw;
_config->release(true);
}if (running) {
if (_vfo->getBandwidthChanged()) {
bw = _vfo->getBandwidth();
setBandwidth(bw, false);
_config->aquire();
_config->conf[uiPrefix]["USB"]["bandwidth"] = bw;
_config->release(true);
}
}
ImGui::Text("Snap Interval");
@@ -150,9 +159,9 @@ public:
}
private:
void setBandwidth(float bandWidth) {
void setBandwidth(float bandWidth, bool updateWaterfall = true) {
bw = bandWidth;
_vfo->setBandwidth(bw);
_vfo->setBandwidth(bw, updateWaterfall);
demod.setBandWidth(bw);
float audioBW = std::min<float>(audioSampRate / 2.0f, bw);
win.setSampleRate(bbSampRate * resamp.getInterpolation());