SDR Device dialog property settings now functional

This commit is contained in:
Charles J. Cliffe
2015-11-04 02:04:52 -05:00
parent efbdb2d69f
commit 5346bdd50d
6 changed files with 90 additions and 4 deletions
+16 -1
View File
@@ -38,6 +38,18 @@ SDRThread::~SDRThread() {
}
SoapySDR::Kwargs SDRThread::combineArgs(SoapySDR::Kwargs a, SoapySDR::Kwargs b) {
SoapySDR::Kwargs c;
SoapySDR::Kwargs::iterator i;
for (i = a.begin(); i != a.end(); i++) {
c[i->first] = i->second;
}
for (i = b.begin(); i != b.end(); i++) {
c[i->first] = i->second;
}
return c;
}
void SDRThread::init() {
SDRDeviceInfo *devInfo = deviceInfo.load();
deviceConfig.store(wxGetApp().getConfig()->getDevice(devInfo->getDeviceId()));
@@ -54,7 +66,7 @@ void SDRThread::init() {
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Initializing device."));
device = SoapySDR::Device::make(args);
stream = device->setupStream(SOAPY_SDR_RX,"CF32", std::vector<size_t>(), devInfo->getStreamArgs());
stream = device->setupStream(SOAPY_SDR_RX,"CF32", std::vector<size_t>(), combineArgs(devInfo->getStreamArgs(),streamArgs));
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Activating stream."));
device->setSampleRate(SOAPY_SDR_RX,0,sampleRate.load());
@@ -406,3 +418,6 @@ std::string SDRThread::readSetting(std::string name) {
return val;
}
void SDRThread::setStreamArgs(SoapySDR::Kwargs streamArgs_in) {
streamArgs = streamArgs_in;
}
+5
View File
@@ -78,9 +78,12 @@ public:
void writeSetting(std::string name, std::string value);
std::string readSetting(std::string name);
void setStreamArgs(SoapySDR::Kwargs streamArgs);
protected:
void updateGains();
void updateSettings();
SoapySDR::Kwargs combineArgs(SoapySDR::Kwargs a, SoapySDR::Kwargs b);
SoapySDR::Stream *stream;
SoapySDR::Device *device;
@@ -104,4 +107,6 @@ protected:
std::mutex gain_busy;
std::map<std::string, float> gainValues;
std::map<std::string, bool> gainChanged;
SoapySDR::Kwargs streamArgs;
};