mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
Merge pull request #42 from wingrime/sample-rate
Soapysdr: Improve sample rate information
This commit is contained in:
commit
c3d39029b8
@ -137,7 +137,13 @@ private:
|
|||||||
sampleRates = dev->listSampleRates(SOAPY_SDR_RX, channelId);
|
sampleRates = dev->listSampleRates(SOAPY_SDR_RX, channelId);
|
||||||
txtSrList = "";
|
txtSrList = "";
|
||||||
for (double sr : sampleRates) {
|
for (double sr : sampleRates) {
|
||||||
txtSrList += std::to_string((int)sr);
|
if (sr > 1.0e3 && sr <= 1.0e6) {
|
||||||
|
txtSrList += std::to_string((sr / 1.0e3)) + " kHz";
|
||||||
|
} else if (sr > 1.0e6) {
|
||||||
|
txtSrList += std::to_string((sr / 1.0e6)) + " MHz";
|
||||||
|
} else {
|
||||||
|
txtSrList += std::to_string((int) sr);
|
||||||
|
}
|
||||||
txtSrList += '\0';
|
txtSrList += '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,15 +288,16 @@ private:
|
|||||||
config.release(true);
|
config.release(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Text("Sample rate");
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
||||||
if (ImGui::Combo(CONCAT("##_sr_select_", _this->name), &_this->srId, _this->txtSrList.c_str())) {
|
if (ImGui::Combo(CONCAT("##_sr_select_", _this->name), &_this->srId, _this->txtSrList.c_str())) {
|
||||||
_this->selectSampleRate(_this->sampleRates[_this->srId]);
|
_this->selectSampleRate(_this->sampleRates[_this->srId]);
|
||||||
_this->saveCurrent();
|
_this->saveCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
if (ImGui::Button(CONCAT("Refresh##_dev_select_", _this->name),
|
||||||
float refreshBtnWdith = menuWidth - ImGui::GetCursorPosX();
|
ImVec2(menuWidth - ImGui::GetCursorPosX(), 0.0))) {
|
||||||
if (ImGui::Button(CONCAT("Refresh##_dev_select_", _this->name), ImVec2(refreshBtnWdith, 0))) {
|
|
||||||
_this->refresh();
|
_this->refresh();
|
||||||
_this->selectDevice(config.conf["device"]);
|
_this->selectDevice(config.conf["device"]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user