2
0
forked from Ivasoft/DSView

Add DSLogic hardware support

This commit is contained in:
DreamSourceLab
2014-04-14 17:46:11 +08:00
parent a76c4b4a5f
commit 264a094168
300 changed files with 305141 additions and 284 deletions

View File

@@ -29,12 +29,15 @@
#include <stdexcept>
#include <string>
#include <QtGui/QApplication>
#include <QObject>
#include <QDebug>
#include <QDir>
#include <libsigrok4DSLogic/libsigrok.h>
using namespace std;
char config_path[256];
namespace pv {
@@ -98,6 +101,15 @@ list<sr_dev_inst*> DeviceManager::driver_scan(
// Release this driver and all it's attached devices
release_driver(driver);
// Check If DSLogic driver
if (strcmp(driver->name, "DSLogic") == 0) {
QDir dir(QApplication::applicationDirPath());
if (!dir.cd("res"))
return driver_devices;
std::string str = dir.absolutePath().toStdString() + "/";
strcpy(config_path, str.c_str());
}
// Do the scan
GSList *const devices = sr_driver_scan(driver, drvopts);
for (GSList *l = devices; l; l = l->next)