mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-05 07:24:47 -04:00
SDR Device dialog property settings now functional
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user