diff --git a/src/AppConfig.cpp b/src/AppConfig.cpp index 91ecde9..008a387 100644 --- a/src/AppConfig.cpp +++ b/src/AppConfig.cpp @@ -467,8 +467,7 @@ bool AppConfig::load() { while (devices_node->hasAnother("device")) { DataNode *device_node = devices_node->getNext("device"); if (device_node->hasAnother("id")) { - std::string deviceId; - device_node->getNext("id")->element()->get(deviceId); + std::string deviceId = device_node->getNext("id")->element()->toString(); getDevice(deviceId)->load(device_node); } diff --git a/src/forms/SDRDevices/SDRDevices.cpp b/src/forms/SDRDevices/SDRDevices.cpp index 876171f..242cf19 100644 --- a/src/forms/SDRDevices/SDRDevices.cpp +++ b/src/forms/SDRDevices/SDRDevices.cpp @@ -296,12 +296,21 @@ void SDRDevicesDialog::OnDeviceTimer( wxTimerEvent& event ) { devs[""] = SDREnumerator::enumerate_devices("",true); if (devs[""] != NULL) { for (devs_i = devs[""]->begin(); devs_i != devs[""]->end(); devs_i++) { - DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice((*devs_i)->getDeviceId()); + DeviceConfig *devConfig = nullptr; if ((*devs_i)->isManual()) { - devItems[devTree->AppendItem(manualBranch, devConfig->getDeviceName())] = (*devs_i); + std::string devName = "Unknown"; + if ((*devs_i)->isAvailable()) { + devConfig = wxGetApp().getConfig()->getDevice((*devs_i)->getDeviceId()); + devName = devConfig->getDeviceName(); + } else { + devName = (*devs_i)->getDeviceId(); + } + devItems[devTree->AppendItem(manualBranch, devName)] = (*devs_i); } else if ((*devs_i)->isRemote()) { + devConfig = wxGetApp().getConfig()->getDevice((*devs_i)->getDeviceId()); devItems[devTree->AppendItem(dsBranch, devConfig->getDeviceName())] = (*devs_i); } else { + devConfig = wxGetApp().getConfig()->getDevice((*devs_i)->getDeviceId()); devItems[devTree->AppendItem(localBranch, devConfig->getDeviceName())] = (*devs_i); } } diff --git a/src/sdr/SDREnumerator.cpp b/src/sdr/SDREnumerator.cpp index 406c802..89af6c7 100644 --- a/src/sdr/SDREnumerator.cpp +++ b/src/sdr/SDREnumerator.cpp @@ -189,7 +189,8 @@ std::vector *SDREnumerator::enumerate_devices(std::string remot } } else { SoapySDR::Kwargs failedEnum; - failedEnum = argsStrToKwargs(strDevArgs+",label=Not Found ("+m_i->factory+")"); + failedEnum = argsStrToKwargs(strDevArgs); + failedEnum["label"] = "Not Found ("+m_i->factory+")"; results.push_back(failedEnum); manualResult.push_back(false); } @@ -228,7 +229,6 @@ std::vector *SDREnumerator::enumerate_devices(std::string remot std::cout << "Make device " << i << std::endl; if (igetDevice(dev->getDeviceId()); SoapySDR::Device *device = SoapySDR::Device::make(deviceArgs); SoapySDR::Kwargs info = device->getHardwareInfo(); for (SoapySDR::Kwargs::const_iterator it = info.begin(); it != info.end(); ++it) { @@ -245,7 +245,9 @@ std::vector *SDREnumerator::enumerate_devices(std::string remot } SoapySDR::ArgInfoList settingsInfo = device->getSettingInfo(); - + + DeviceConfig *cfg = wxGetApp().getConfig()->getDevice(dev->getDeviceId()); + ConfigSettings devSettings = cfg->getSettings(); if (devSettings.size()) { for (ConfigSettings::const_iterator set_i = devSettings.begin(); set_i != devSettings.end(); set_i++) {