string setting fix, soapy device frequency setting control/feedback

This commit is contained in:
Charles J. Cliffe 2016-01-02 21:42:35 -05:00
parent 62288e485f
commit c94cdb0855
3 changed files with 15 additions and 3 deletions

View File

@ -81,7 +81,7 @@ void DeviceConfig::load(DataNode *node) {
std::string keyName = streamOptNode->getName(); std::string keyName = streamOptNode->getName();
std::string strSettingValue = streamOptNode->element()->toString(); std::string strSettingValue = streamOptNode->element()->toString();
if (keyName != "" && strSettingValue != "") { if (keyName != "") {
setStreamOpt(keyName, strSettingValue); setStreamOpt(keyName, strSettingValue);
} }
} }
@ -93,7 +93,7 @@ void DeviceConfig::load(DataNode *node) {
std::string keyName = settingNode->getName(); std::string keyName = settingNode->getName();
std::string strSettingValue = settingNode->element()->toString(); std::string strSettingValue = settingNode->element()->toString();
if (keyName != "" && strSettingValue != "") { if (keyName != "") {
setSetting(keyName, strSettingValue); setSetting(keyName, strSettingValue);
} }
} }

View File

@ -716,7 +716,11 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
wxGetApp().getSDRThread()->writeSetting(arg.key, (wxGetApp().getSDRThread()->readSetting(arg.key)=="true")?"false":"true"); wxGetApp().getSDRThread()->writeSetting(arg.key, (wxGetApp().getSDRThread()->readSetting(arg.key)=="true")?"false":"true");
break; break;
} else if (arg.type == SoapySDR::ArgInfo::STRING) { } 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) { } else if (arg.type == SoapySDR::ArgInfo::INT) {
int currentVal; int currentVal;
try { try {

View File

@ -3,6 +3,7 @@
#include <vector> #include <vector>
#include "CubicSDR.h" #include "CubicSDR.h"
#include <string> #include <string>
#include <SoapySDR/Logger.h>
SDRThread::SDRThread() : IOThread(), buffers("SDRThreadBuffers") { SDRThread::SDRThread() : IOThread(), buffers("SDRThreadBuffers") {
@ -51,6 +52,8 @@ SoapySDR::Kwargs SDRThread::combineArgs(SoapySDR::Kwargs a, SoapySDR::Kwargs b)
} }
void SDRThread::init() { void SDRThread::init() {
// SoapySDR_setLogLevel(SOAPY_SDR_DEBUG);
SDRDeviceInfo *devInfo = deviceInfo.load(); SDRDeviceInfo *devInfo = deviceInfo.load();
deviceConfig.store(wxGetApp().getConfig()->getDevice(devInfo->getDeviceId())); deviceConfig.store(wxGetApp().getConfig()->getDevice(devInfo->getDeviceId()));
DeviceConfig *devConfig = deviceConfig.load(); DeviceConfig *devConfig = deviceConfig.load();
@ -242,6 +245,11 @@ void SDRThread::updateSettings() {
freq_changed.store(false); 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()) { if (agc_mode_changed.load()) {
SDRDeviceInfo *devInfo = deviceInfo.load(); SDRDeviceInfo *devInfo = deviceInfo.load();