Update device on setting and bandwidth change

This commit is contained in:
Charles J. Cliffe 2016-02-02 19:27:08 -05:00
parent 609a2216ad
commit 2518e22682
2 changed files with 13 additions and 2 deletions

View File

@ -566,10 +566,11 @@ void AppFrame::updateDeviceParams() {
SoapySDR::ArgInfoList::const_iterator args_i;
int i = 0;
settingArgs = devInfo->getSoapyDevice()->getSettingInfo();
SoapySDR::Device *soapyDev = devInfo->getSoapyDevice();
settingArgs = soapyDev->getSettingInfo();
for (args_i = settingArgs.begin(); args_i != settingArgs.end(); args_i++) {
SoapySDR::ArgInfo arg = (*args_i);
std::string currentVal = wxGetApp().getSDRThread()->readSetting(arg.key);
std::string currentVal = soapyDev->readSetting(arg.key);
if (arg.type == SoapySDR::ArgInfo::BOOL) {
wxMenuItem *item = newSettingsMenu->AppendCheckItem(wxID_SETTINGS_BASE+i, arg.name, arg.description);
item->Check(currentVal=="true");

View File

@ -249,6 +249,8 @@ void SDRThread::updateGains() {
}
void SDRThread::updateSettings() {
bool doUpdate = false;
if (offset_changed.load()) {
if (!freq_changed.load()) {
frequency.store(frequency.load());
@ -273,6 +275,7 @@ void SDRThread::updateSettings() {
buffs[0] = malloc(mtuElems.load() * 4 * sizeof(float));
numOverflow = 0;
rate_changed.store(false);
doUpdate = true;
}
if (ppm_changed.load() && hasPPM.load()) {
@ -301,6 +304,7 @@ void SDRThread::updateSettings() {
if (!agc_mode.load()) {
updateGains();
}
doUpdate = true;
}
if (gain_value_changed.load() && !agc_mode.load()) {
@ -329,6 +333,12 @@ void SDRThread::updateSettings() {
setting_value_changed.store(false);
setting_busy.unlock();
doUpdate = true;
}
if (doUpdate) {
wxGetApp().sdrThreadNotify(SDRThread::SDR_THREAD_INITIALIZED, std::string("Settings updated."));
}
}