mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-02-03 13:24:46 +01:00
Fixed delayed VFO update bug
This commit is contained in:
parent
c23b2bdc55
commit
9a1850bd61
@ -202,18 +202,6 @@ namespace ImGui {
|
|||||||
|
|
||||||
void WaterFall::drawVFOs() {
|
void WaterFall::drawVFOs() {
|
||||||
for (auto const& [name, vfo] : vfos) {
|
for (auto const& [name, vfo] : vfos) {
|
||||||
if (vfo->redrawRequired) {
|
|
||||||
vfo->redrawRequired = false;
|
|
||||||
vfo->updateDrawingVars(viewBandwidth, dataWidth, viewOffset, widgetPos, fftHeight);
|
|
||||||
vfo->wfRectMin = ImVec2(vfo->rectMin.x, wfMin.y);
|
|
||||||
vfo->wfRectMax = ImVec2(vfo->rectMax.x, wfMax.y);
|
|
||||||
vfo->wfLineMin = ImVec2(vfo->lineMin.x, wfMin.y);
|
|
||||||
vfo->wfLineMax = ImVec2(vfo->lineMax.x, wfMax.y);
|
|
||||||
vfo->wfLbwSelMin = ImVec2(vfo->wfRectMin.x - 2, vfo->wfRectMin.y);
|
|
||||||
vfo->wfLbwSelMax = ImVec2(vfo->wfRectMin.x + 2, vfo->wfRectMax.y);
|
|
||||||
vfo->wfRbwSelMin = ImVec2(vfo->wfRectMax.x - 2, vfo->wfRectMin.y);
|
|
||||||
vfo->wfRbwSelMax = ImVec2(vfo->wfRectMax.x + 2, vfo->wfRectMax.y);
|
|
||||||
}
|
|
||||||
vfo->draw(window, name == selectedVFO);
|
vfo->draw(window, name == selectedVFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -710,6 +698,8 @@ namespace ImGui {
|
|||||||
window->DrawList->AddLine(ImVec2(widgetPos.x, widgetPos.y + fftHeight + 50), ImVec2(widgetPos.x + widgetSize.x, widgetPos.y + fftHeight + 50), IM_COL32(50, 50, 50, 255), 1.0);
|
window->DrawList->AddLine(ImVec2(widgetPos.x, widgetPos.y + fftHeight + 50), ImVec2(widgetPos.x + widgetSize.x, widgetPos.y + fftHeight + 50), IM_COL32(50, 50, 50, 255), 1.0);
|
||||||
|
|
||||||
processInputs();
|
processInputs();
|
||||||
|
|
||||||
|
updateAllVFOs(true);
|
||||||
|
|
||||||
drawFFT();
|
drawFFT();
|
||||||
if (waterfallVisible) {
|
if (waterfallVisible) {
|
||||||
@ -980,14 +970,14 @@ namespace ImGui {
|
|||||||
return waterfallMax;
|
return waterfallMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaterFall::updateAllVFOs() {
|
void WaterFall::updateAllVFOs(bool checkRedrawRequired) {
|
||||||
for (auto const& [name, vfo] : vfos) {
|
for (auto const& [name, vfo] : vfos) {
|
||||||
|
if (checkRedrawRequired && !vfo->redrawRequired) { continue; }
|
||||||
vfo->updateDrawingVars(viewBandwidth, dataWidth, viewOffset, widgetPos, fftHeight);
|
vfo->updateDrawingVars(viewBandwidth, dataWidth, viewOffset, widgetPos, fftHeight);
|
||||||
vfo->wfRectMin = ImVec2(vfo->rectMin.x, wfMin.y);
|
vfo->wfRectMin = ImVec2(vfo->rectMin.x, wfMin.y);
|
||||||
vfo->wfRectMax = ImVec2(vfo->rectMax.x, wfMax.y);
|
vfo->wfRectMax = ImVec2(vfo->rectMax.x, wfMax.y);
|
||||||
vfo->wfLineMin = ImVec2(vfo->lineMin.x, wfMin.y);
|
vfo->wfLineMin = ImVec2(vfo->lineMin.x, wfMin.y);
|
||||||
vfo->wfLineMax = ImVec2(vfo->lineMax.x, wfMax.y);
|
vfo->wfLineMax = ImVec2(vfo->lineMax.x, wfMax.y);
|
||||||
|
|
||||||
vfo->wfLbwSelMin = ImVec2(vfo->wfRectMin.x - 2, vfo->wfRectMin.y);
|
vfo->wfLbwSelMin = ImVec2(vfo->wfRectMin.x - 2, vfo->wfRectMin.y);
|
||||||
vfo->wfLbwSelMax = ImVec2(vfo->wfRectMin.x + 2, vfo->wfRectMax.y);
|
vfo->wfLbwSelMax = ImVec2(vfo->wfRectMin.x + 2, vfo->wfRectMax.y);
|
||||||
vfo->wfRbwSelMin = ImVec2(vfo->wfRectMax.x - 2, vfo->wfRectMin.y);
|
vfo->wfRbwSelMin = ImVec2(vfo->wfRectMax.x - 2, vfo->wfRectMin.y);
|
||||||
|
@ -163,7 +163,7 @@ namespace ImGui {
|
|||||||
void onResize();
|
void onResize();
|
||||||
void updateWaterfallFb();
|
void updateWaterfallFb();
|
||||||
void updateWaterfallTexture();
|
void updateWaterfallTexture();
|
||||||
void updateAllVFOs();
|
void updateAllVFOs(bool checkRedrawRequired = false);
|
||||||
bool calculateVFOSignalInfo(WaterfallVFO* vfo, float& strength, float& snr);
|
bool calculateVFOSignalInfo(WaterfallVFO* vfo, float& strength, float& snr);
|
||||||
|
|
||||||
bool waterfallUpdate = false;
|
bool waterfallUpdate = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user