mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-26 01:34:43 +01:00
Merge branch 'AlexandreRouma:master' into sdrplay-lowif
This commit is contained in:
commit
0a54b92c58
@ -598,8 +598,14 @@ 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);
|
||||||
if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, gui::waterfall.getBandwidth(), 1000.0, "")) {
|
float minSliderBw = 1000.0;
|
||||||
gui::waterfall.setViewBandwidth(bw);
|
float maxSliderBw = gui::waterfall.getBandwidth();
|
||||||
|
if (ImGui::VSliderFloat("##_7_", ImVec2(20.0, 150.0), &bw, maxSliderBw, minSliderBw, "")) {
|
||||||
|
float normBw = bw / (maxSliderBw - minSliderBw);
|
||||||
|
float factor = normBw * normBw;
|
||||||
|
float finalBw = minSliderBw + bw * factor;
|
||||||
|
|
||||||
|
gui::waterfall.setViewBandwidth(finalBw);
|
||||||
if (vfo != NULL) {
|
if (vfo != NULL) {
|
||||||
gui::waterfall.setViewOffset(vfo->centerOffset); // center vfo on screen
|
gui::waterfall.setViewOffset(vfo->centerOffset); // center vfo on screen
|
||||||
}
|
}
|
||||||
|
@ -296,6 +296,11 @@ private:
|
|||||||
static void start(void* ctx) {
|
static void start(void* ctx) {
|
||||||
SoapyModule* _this = (SoapyModule*)ctx;
|
SoapyModule* _this = (SoapyModule*)ctx;
|
||||||
if (_this->running) { return; }
|
if (_this->running) { return; }
|
||||||
|
if (_this->devId < 0) {
|
||||||
|
spdlog::error("No device available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_this->dev = SoapySDR::Device::make(_this->devArgs);
|
_this->dev = SoapySDR::Device::make(_this->devArgs);
|
||||||
|
|
||||||
_this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate);
|
_this->dev->setSampleRate(SOAPY_SDR_RX, _this->channelId, _this->sampleRate);
|
||||||
@ -354,13 +359,17 @@ private:
|
|||||||
static void menuHandler(void* ctx) {
|
static void menuHandler(void* ctx) {
|
||||||
SoapyModule* _this = (SoapyModule*)ctx;
|
SoapyModule* _this = (SoapyModule*)ctx;
|
||||||
|
|
||||||
// If no device is available, do not attempt to display menu
|
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
||||||
|
|
||||||
|
// If no device is selected, draw only the refresh button
|
||||||
if (_this->devId < 0) {
|
if (_this->devId < 0) {
|
||||||
|
if (ImGui::Button(CONCAT("Refresh##_dev_select_", _this->name), ImVec2(menuWidth, 0))) {
|
||||||
|
_this->refresh();
|
||||||
|
_this->selectDevice(config.conf["device"]);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float menuWidth = ImGui::GetContentRegionAvailWidth();
|
|
||||||
|
|
||||||
if (_this->running) { style::beginDisabled(); }
|
if (_this->running) { style::beginDisabled(); }
|
||||||
|
|
||||||
ImGui::SetNextItemWidth(menuWidth);
|
ImGui::SetNextItemWidth(menuWidth);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user