mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-03-27 01:45:28 +01:00
Fixed weird VFO behavior
This commit is contained in:
parent
79e79e78ac
commit
011fdce237
@ -248,7 +248,17 @@ void MainWindow::vfoAddedHandler(VFOManager::VFO* vfo, void* ctx) {
|
|||||||
double offset = core::configManager.conf["vfoOffsets"][name];
|
double offset = core::configManager.conf["vfoOffsets"][name];
|
||||||
core::configManager.release();
|
core::configManager.release();
|
||||||
|
|
||||||
sigpath::vfoManager.setOffset(name, _this->initComplete ? std::clamp<double>(offset, -_this->bw/2.0, _this->bw/2.0) : offset);
|
double viewBW = gui::waterfall.getViewBandwidth();
|
||||||
|
double viewOffset = gui::waterfall.getViewOffset();
|
||||||
|
|
||||||
|
double viewLower = viewOffset - (viewBW/2.0);
|
||||||
|
double viewUpper = viewOffset + (viewBW/2.0);
|
||||||
|
|
||||||
|
double newOffset = std::clamp<double>(offset, viewLower, viewUpper);
|
||||||
|
|
||||||
|
sigpath::vfoManager.setCenterOffset(name, _this->initComplete ? newOffset : offset);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::draw() {
|
void MainWindow::draw() {
|
||||||
|
@ -74,6 +74,10 @@ double VFOManager::VFO::getBandwidth() {
|
|||||||
return wtfVFO->bandwidth;
|
return wtfVFO->bandwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int VFOManager::VFO::getReference() {
|
||||||
|
return wtfVFO->reference;
|
||||||
|
}
|
||||||
|
|
||||||
void VFOManager::VFO::setColor(ImU32 color) {
|
void VFOManager::VFO::setColor(ImU32 color) {
|
||||||
wtfVFO->color = color;
|
wtfVFO->color = color;
|
||||||
}
|
}
|
||||||
@ -176,6 +180,13 @@ double VFOManager::getBandwidth(std::string name) {
|
|||||||
return vfos[name]->getBandwidth();
|
return vfos[name]->getBandwidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int VFOManager::getReference(std::string name) {
|
||||||
|
if (vfos.find(name) == vfos.end()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return vfos[name]->getReference();
|
||||||
|
}
|
||||||
|
|
||||||
void VFOManager::setColor(std::string name, ImU32 color) {
|
void VFOManager::setColor(std::string name, ImU32 color) {
|
||||||
if (vfos.find(name) == vfos.end()) {
|
if (vfos.find(name) == vfos.end()) {
|
||||||
return;
|
return;
|
||||||
|
@ -22,6 +22,7 @@ public:
|
|||||||
void setBandwidthLimits(double minBandwidth, double maxBandwidth, bool bandwidthLocked);
|
void setBandwidthLimits(double minBandwidth, double maxBandwidth, bool bandwidthLocked);
|
||||||
bool getBandwidthChanged(bool erase = true);
|
bool getBandwidthChanged(bool erase = true);
|
||||||
double getBandwidth();
|
double getBandwidth();
|
||||||
|
int getReference();
|
||||||
void setColor(ImU32 color);
|
void setColor(ImU32 color);
|
||||||
std::string getName();
|
std::string getName();
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ public:
|
|||||||
double getBandwidth(std::string name);
|
double getBandwidth(std::string name);
|
||||||
void setColor(std::string name, ImU32 color);
|
void setColor(std::string name, ImU32 color);
|
||||||
std::string getName();
|
std::string getName();
|
||||||
|
int getReference(std::string name);
|
||||||
bool vfoExists(std::string name);
|
bool vfoExists(std::string name);
|
||||||
|
|
||||||
void updateFromWaterfall(ImGui::WaterFall* wtf);
|
void updateFromWaterfall(ImGui::WaterFall* wtf);
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_STR "1.0.0_rc3"
|
#define VERSION_STR "1.0.0_rc4"
|
Loading…
x
Reference in New Issue
Block a user