mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-04-19 09:59:00 -04:00
Update device on setting and bandwidth change
This commit is contained in:
parent
609a2216ad
commit
2518e22682
@ -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");
|
||||
|
@ -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."));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user