Optional title suffix, prefer local to bundled modules default

This commit is contained in:
Charles J. Cliffe
2015-11-10 19:25:41 -05:00
parent 886425d83d
commit 6cd82ea44f
4 changed files with 19 additions and 15 deletions
+4 -4
View File
@@ -271,13 +271,13 @@ bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
config.load();
#ifdef BUNDLE_SOAPY_MODS
if (parser.Found("l")) {
useLocalMod.store(true);
} else {
if (parser.Found("b")) {
useLocalMod.store(false);
} else {
useLocalMod.store(true);
}
#else
useLocalMod.store(false);
useLocalMod.store(true);
#endif
return true;
+1 -1
View File
@@ -161,7 +161,7 @@ static const wxCmdLineEntryDesc commandLineInfo [] =
{
{ wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
{ wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'" },
{ wxCMD_LINE_SWITCH, "l", "localmod", "Check local SoapySDR modules instead of bundled first." },
{ wxCMD_LINE_SWITCH, "b", "bundled", "Use bundled SoapySDR modules first instead of local." },
{ wxCMD_LINE_NONE }
};
#else
+7 -7
View File
@@ -63,8 +63,6 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
SoapySDR::loadModules();
#endif
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "done.");
std::cout << "done." << std::endl;
// modules = SoapySDR::listModules();
// for (size_t i = 0; i < modules.size(); i++) {
@@ -143,6 +141,12 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
dev->setHardware(it->second);
}
}
if (isRemote) {
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Querying remote " + remoteAddr + " device #" + std::to_string(i) + ": " + dev-> getName());
} else {
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Querying device #") + std::to_string(i) + ": " + dev->getName());
}
int numChan = device->getNumChannels(SOAPY_SDR_RX);
for (int i = 0; i < numChan; i++) {
@@ -191,8 +195,6 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
SoapySDR::Kwargs streamArgs;
if (isRemote) {
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Querying remote " + remoteAddr + " device #" + std::to_string(i));
// if (deviceArgs.count("rtl") != 0) {
// streamArgs["remote:mtu"] = "8192";
// streamArgs["remote:window"] = "16384000";
@@ -203,8 +205,6 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
if (nativeFormat.length()) {
streamArgs["remote:format"] = nativeFormat;
}
} else {
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Found local device #") + std::to_string(i));
}
dev->setStreamArgs(streamArgs);
@@ -217,7 +217,7 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
dev->setAvailable(true);
} catch (const std::exception &ex) {
std::cerr << "Error making device: " << ex.what() << std::endl;
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Error making device #") + std::to_string(i));
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Error querying device #") + std::to_string(i));
dev->setAvailable(false);
}
std::cout << std::endl;