mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-12 23:26:10 -05:00
string setting fix, soapy device frequency setting control/feedback
This commit is contained in:
parent
62288e485f
commit
c94cdb0855
@ -81,7 +81,7 @@ void DeviceConfig::load(DataNode *node) {
|
||||
std::string keyName = streamOptNode->getName();
|
||||
std::string strSettingValue = streamOptNode->element()->toString();
|
||||
|
||||
if (keyName != "" && strSettingValue != "") {
|
||||
if (keyName != "") {
|
||||
setStreamOpt(keyName, strSettingValue);
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ void DeviceConfig::load(DataNode *node) {
|
||||
std::string keyName = settingNode->getName();
|
||||
std::string strSettingValue = settingNode->element()->toString();
|
||||
|
||||
if (keyName != "" && strSettingValue != "") {
|
||||
if (keyName != "") {
|
||||
setSetting(keyName, strSettingValue);
|
||||
}
|
||||
}
|
||||
|
@ -716,7 +716,11 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
||||
wxGetApp().getSDRThread()->writeSetting(arg.key, (wxGetApp().getSDRThread()->readSetting(arg.key)=="true")?"false":"true");
|
||||
break;
|
||||
} else if (arg.type == SoapySDR::ArgInfo::STRING) {
|
||||
menuIdx++;
|
||||
wxString stringVal = wxGetTextFromUser(arg.description, arg.name, wxGetApp().getSDRThread()->readSetting(arg.key));
|
||||
if (stringVal.ToStdString() != "") {
|
||||
wxGetApp().getSDRThread()->writeSetting(arg.key, stringVal.ToStdString());
|
||||
}
|
||||
break;
|
||||
} else if (arg.type == SoapySDR::ArgInfo::INT) {
|
||||
int currentVal;
|
||||
try {
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <vector>
|
||||
#include "CubicSDR.h"
|
||||
#include <string>
|
||||
#include <SoapySDR/Logger.h>
|
||||
|
||||
|
||||
SDRThread::SDRThread() : IOThread(), buffers("SDRThreadBuffers") {
|
||||
@ -51,6 +52,8 @@ SoapySDR::Kwargs SDRThread::combineArgs(SoapySDR::Kwargs a, SoapySDR::Kwargs b)
|
||||
}
|
||||
|
||||
void SDRThread::init() {
|
||||
// SoapySDR_setLogLevel(SOAPY_SDR_DEBUG);
|
||||
|
||||
SDRDeviceInfo *devInfo = deviceInfo.load();
|
||||
deviceConfig.store(wxGetApp().getConfig()->getDevice(devInfo->getDeviceId()));
|
||||
DeviceConfig *devConfig = deviceConfig.load();
|
||||
@ -242,6 +245,11 @@ void SDRThread::updateSettings() {
|
||||
freq_changed.store(false);
|
||||
}
|
||||
|
||||
double devFreq = device->getFrequency(SOAPY_SDR_RX,0);
|
||||
if (devFreq != frequency.load()) {
|
||||
wxGetApp().setFrequency((long long)devFreq);
|
||||
}
|
||||
|
||||
if (agc_mode_changed.load()) {
|
||||
SDRDeviceInfo *devInfo = deviceInfo.load();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user