bunch of bugfix and new features

This commit is contained in:
AlexandreRouma
2022-11-12 02:19:53 +01:00
parent c4bac3b298
commit 1c373e9cdb
22 changed files with 219 additions and 59 deletions

View File

@ -30,8 +30,6 @@ public:
this->name = name;
sampleRate = 8000000.0;
// TODO: REMOVE
samplerates.define(8000000, "8MHz", 8000000.0);
handler.ctx = this;
handler.selectHandler = menuSelected;
@ -42,15 +40,6 @@ public:
handler.tuneHandler = tune;
handler.stream = &stream;
// List devices
refresh();
// Select device
config.acquire();
selectedSer = config.conf["device"];
config.release();
select(selectedSer);
sigpath::sourceManager.registerSource("USRP", &handler);
}
@ -212,6 +201,20 @@ private:
static void menuSelected(void* ctx) {
USRPSourceModule* _this = (USRPSourceModule*)ctx;
if (_this->firstSelect) {
_this->firstSelect = false;
// List devices
_this->refresh();
// Select device
config.acquire();
_this->selectedSer = config.conf["device"];
config.release();
_this->select(_this->selectedSer);
}
core::setInputSampleRate(_this->sampleRate);
spdlog::info("USRPSourceModule '{0}': Menu Select!", _this->name);
}
@ -406,6 +409,8 @@ private:
uhd::usrp::multi_usrp::sptr dev;
uhd::rx_streamer::sptr streamer;
bool firstSelect = true;
std::thread workerThread;
};