]> sigrok.org Git - pulseview.git/commitdiff
Moved DevInst into the pv::device namespace
authorJoel Holdsworth <redacted>
Wed, 19 Feb 2014 22:18:01 +0000 (22:18 +0000)
committerJoel Holdsworth <redacted>
Sat, 1 Mar 2014 11:02:10 +0000 (11:02 +0000)
27 files changed:
CMakeLists.txt
pv/device/devinst.cpp [new file with mode: 0644]
pv/device/devinst.h [new file with mode: 0644]
pv/devicemanager.cpp
pv/devicemanager.h
pv/devinst.cpp [deleted file]
pv/devinst.h [deleted file]
pv/dialogs/connect.cpp
pv/dialogs/connect.h
pv/mainwindow.cpp
pv/mainwindow.h
pv/popups/deviceoptions.cpp
pv/popups/deviceoptions.h
pv/popups/probes.cpp
pv/prop/binding/deviceoptions.cpp
pv/prop/binding/deviceoptions.h
pv/sigsession.cpp
pv/sigsession.h
pv/toolbars/samplingbar.cpp
pv/toolbars/samplingbar.h
pv/view/analogsignal.cpp
pv/view/analogsignal.h
pv/view/logicsignal.cpp
pv/view/logicsignal.h
pv/view/signal.cpp
pv/view/signal.h
test/CMakeLists.txt

index d959a9f343cf8090c2291d1d1b95603e828c9ceb..aaed2d61d60603a90bd2673d9eece76142ee34cd 100644 (file)
@@ -118,7 +118,6 @@ configure_file (
 set(pulseview_SOURCES
        main.cpp
        pv/devicemanager.cpp
 set(pulseview_SOURCES
        main.cpp
        pv/devicemanager.cpp
-       pv/devinst.cpp
        pv/mainwindow.cpp
        pv/sigsession.cpp
        pv/storesession.cpp
        pv/mainwindow.cpp
        pv/sigsession.cpp
        pv/storesession.cpp
@@ -128,6 +127,7 @@ set(pulseview_SOURCES
        pv/data/logicsnapshot.cpp
        pv/data/signaldata.cpp
        pv/data/snapshot.cpp
        pv/data/logicsnapshot.cpp
        pv/data/signaldata.cpp
        pv/data/snapshot.cpp
+       pv/device/devinst.cpp
        pv/dialogs/about.cpp
        pv/dialogs/connect.cpp
        pv/dialogs/storeprogress.cpp
        pv/dialogs/about.cpp
        pv/dialogs/connect.cpp
        pv/dialogs/storeprogress.cpp
@@ -166,10 +166,10 @@ set(pulseview_SOURCES
 
 # This list includes only QObject derived class headers.
 set(pulseview_HEADERS
 
 # This list includes only QObject derived class headers.
 set(pulseview_HEADERS
-       pv/devinst.h
        pv/mainwindow.h
        pv/sigsession.h
        pv/storesession.h
        pv/mainwindow.h
        pv/sigsession.h
        pv/storesession.h
+       pv/device/devinst.h
        pv/dialogs/about.h
        pv/dialogs/connect.h
        pv/dialogs/storeprogress.h
        pv/dialogs/about.h
        pv/dialogs/connect.h
        pv/dialogs/storeprogress.h
diff --git a/pv/device/devinst.cpp b/pv/device/devinst.cpp
new file mode 100644 (file)
index 0000000..a5f9680
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <cassert>
+#include <sstream>
+
+#include <QDebug>
+
+#include <libsigrok/libsigrok.h>
+
+#include "devinst.h"
+
+using std::ostringstream;
+using std::string;
+
+namespace pv {
+namespace device {
+
+DevInst::DevInst(sr_dev_inst *sdi) :
+       _sdi(sdi)
+{
+       assert(_sdi);
+}
+
+sr_dev_inst* DevInst::dev_inst() const
+{
+       return _sdi;
+}
+
+string DevInst::format_device_title() const
+{
+       ostringstream s;
+
+       assert(_sdi);
+
+       if (_sdi->vendor && _sdi->vendor[0]) {
+               s << _sdi->vendor;
+               if ((_sdi->model && _sdi->model[0]) ||
+                       (_sdi->version && _sdi->version[0]))
+                       s << ' ';
+       }
+
+       if (_sdi->model && _sdi->model[0]) {
+               s << _sdi->model;
+               if (_sdi->version && _sdi->version[0])
+                       s << ' ';
+       }
+
+       if (_sdi->version && _sdi->version[0])
+               s << _sdi->version;
+
+       return s.str();
+}
+
+GVariant* DevInst::get_config(const sr_probe_group *group, int key)
+{
+       GVariant *data = NULL;
+       if (sr_config_get(_sdi->driver, _sdi, group, key, &data) != SR_OK)
+               return NULL;
+       return data;
+}
+
+bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data)
+{
+       if(sr_config_set(_sdi, group, key, data) == SR_OK) {
+               config_changed();
+               return true;
+       }
+       return false;
+}
+
+GVariant* DevInst::list_config(const sr_probe_group *group, int key)
+{
+       GVariant *data = NULL;
+       if (sr_config_list(_sdi->driver, _sdi, group, key, &data) != SR_OK)
+               return NULL;
+       return data;
+}
+
+void DevInst::enable_probe(const sr_probe *probe, bool enable)
+{
+       for (const GSList *p = _sdi->probes; p; p = p->next)
+               if (probe == p->data) {
+                       const_cast<sr_probe*>(probe)->enabled = enable;
+                       config_changed();
+                       return;
+               }
+
+       // Probe was not found in the device
+       assert(0);
+}
+
+uint64_t DevInst::get_sample_limit()
+{
+       uint64_t sample_limit;
+       GVariant* gvar = get_config(NULL, SR_CONF_LIMIT_SAMPLES);
+       if (gvar != NULL) {
+               sample_limit = g_variant_get_uint64(gvar);
+               g_variant_unref(gvar);
+       } else {
+               sample_limit = 0U;
+       }
+       return sample_limit;
+}
+
+} // device
+} // pv
diff --git a/pv/device/devinst.h b/pv/device/devinst.h
new file mode 100644 (file)
index 0000000..073813f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef PULSEVIEW_PV_DEVICE_DEVINST_H
+#define PULSEVIEW_PV_DEVICE_DEVINST_H
+
+#include <string>
+
+#include <boost/shared_ptr.hpp>
+
+#include <QObject>
+
+#include <glib.h>
+
+#include <stdint.h>
+
+struct sr_dev_inst;
+struct sr_probe;
+struct sr_probe_group;
+
+namespace pv {
+namespace device {
+
+class DevInst : public QObject
+{
+       Q_OBJECT
+
+public:
+       DevInst(sr_dev_inst *sdi);
+
+       sr_dev_inst* dev_inst() const;
+
+       std::string format_device_title() const;
+
+       GVariant* get_config(const sr_probe_group *group, int key);
+
+       bool set_config(const sr_probe_group *group, int key, GVariant *data);
+
+       GVariant* list_config(const sr_probe_group *group, int key);
+
+       void enable_probe(const sr_probe *probe, bool enable = true);
+
+       /**
+        * @brief Gets the sample limit from the driver.
+        *
+        * @return The returned sample limit from the driver, or 0 if the
+        *      sample limit could not be read.
+        */
+       uint64_t get_sample_limit();
+
+signals:
+       void config_changed();
+
+private:
+       sr_dev_inst *const _sdi;
+};
+
+} // device
+} // pv
+
+#endif // PULSEVIEW_PV_DEVICE_DEVINST_H
index 39c311c5a0e35726f4d38a1471af2d19bdaaf343..11a5fe3c2ff9564f56ae1dfaf33c81e23eb16859 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #include "devicemanager.h"
  */
 
 #include "devicemanager.h"
-#include "devinst.h"
+#include "device/devinst.h"
 #include "sigsession.h"
 
 #include <cassert>
 #include "sigsession.h"
 
 #include <cassert>
@@ -49,12 +49,13 @@ DeviceManager::~DeviceManager()
        release_devices();
 }
 
        release_devices();
 }
 
-const list< shared_ptr<pv::DevInst> >& DeviceManager::devices() const
+const list< shared_ptr<pv::device::DevInst> >& DeviceManager::devices() const
 {
        return _devices;
 }
 
 {
        return _devices;
 }
 
-void DeviceManager::use_device(shared_ptr<DevInst> dev_inst, SigSession *owner)
+void DeviceManager::use_device(shared_ptr<device::DevInst> dev_inst,
+       SigSession *owner)
 {
        assert(dev_inst);
        assert(owner);
 {
        assert(dev_inst);
        assert(owner);
@@ -64,29 +65,29 @@ void DeviceManager::use_device(shared_ptr<DevInst> dev_inst, SigSession *owner)
        sr_dev_open(dev_inst->dev_inst());
 }
 
        sr_dev_open(dev_inst->dev_inst());
 }
 
-void DeviceManager::release_device(shared_ptr<DevInst> dev_inst)
+void DeviceManager::release_device(shared_ptr<device::DevInst> dev_inst)
 {
        assert(dev_inst);
 
        // Notify the owner, and remove the device from the used device list
 {
        assert(dev_inst);
 
        // Notify the owner, and remove the device from the used device list
-       map< shared_ptr<DevInst>, pv::SigSession*>::const_iterator iter =
-               _used_devices.find(dev_inst);
+       map< shared_ptr<device::DevInst>, pv::SigSession*>::const_iterator
+               iter = _used_devices.find(dev_inst);
        assert(iter != _used_devices.end());
 
        (*iter).second->release_device(dev_inst);
        _used_devices.erase(dev_inst);
 }
 
        assert(iter != _used_devices.end());
 
        (*iter).second->release_device(dev_inst);
        _used_devices.erase(dev_inst);
 }
 
-list< shared_ptr<DevInst> > DeviceManager::driver_scan(
+list< shared_ptr<device::DevInst> > DeviceManager::driver_scan(
        struct sr_dev_driver *const driver, GSList *const drvopts)
 {
        struct sr_dev_driver *const driver, GSList *const drvopts)
 {
-       list< shared_ptr<DevInst> > driver_devices;
+       list< shared_ptr<device::DevInst> > driver_devices;
 
        assert(driver);
 
        // Remove any device instances from this driver from the device
        // list. They will not be valid after the scan.
 
        assert(driver);
 
        // Remove any device instances from this driver from the device
        // list. They will not be valid after the scan.
-       list< shared_ptr<DevInst> >::iterator i = _devices.begin();
+       list< shared_ptr<device::DevInst> >::iterator i = _devices.begin();
        while (i != _devices.end()) {
                if ((*i)->dev_inst()->driver == driver)
                        i = _devices.erase(i);
        while (i != _devices.end()) {
                if ((*i)->dev_inst()->driver == driver)
                        i = _devices.erase(i);
@@ -100,8 +101,8 @@ list< shared_ptr<DevInst> > DeviceManager::driver_scan(
        // Do the scan
        GSList *const devices = sr_driver_scan(driver, drvopts);
        for (GSList *l = devices; l; l = l->next)
        // Do the scan
        GSList *const devices = sr_driver_scan(driver, drvopts);
        for (GSList *l = devices; l; l = l->next)
-               driver_devices.push_back(shared_ptr<DevInst>(
-                       new DevInst((sr_dev_inst*)l->data)));
+               driver_devices.push_back(shared_ptr<device::DevInst>(
+                       new device::DevInst((sr_dev_inst*)l->data)));
        g_slist_free(devices);
        driver_devices.sort(compare_devices);
 
        g_slist_free(devices);
        driver_devices.sort(compare_devices);
 
@@ -129,7 +130,7 @@ void DeviceManager::init_drivers()
 void DeviceManager::release_devices()
 {
        // Release all the used devices
 void DeviceManager::release_devices()
 {
        // Release all the used devices
-       for (map<shared_ptr<DevInst>, SigSession*>::iterator i =
+       for (map<shared_ptr<device::DevInst>, SigSession*>::iterator i =
                _used_devices.begin(); i != _used_devices.end(); i++)
                release_device((*i).first);
 
                _used_devices.begin(); i != _used_devices.end(); i++)
                release_device((*i).first);
 
@@ -152,7 +153,7 @@ void DeviceManager::scan_all_drivers()
 void DeviceManager::release_driver(struct sr_dev_driver *const driver)
 {
        assert(driver);
 void DeviceManager::release_driver(struct sr_dev_driver *const driver)
 {
        assert(driver);
-       for (map<shared_ptr<DevInst>, SigSession*>::iterator i =
+       for (map<shared_ptr<device::DevInst>, SigSession*>::iterator i =
                _used_devices.begin(); i != _used_devices.end(); i++)
                if((*i).first->dev_inst()->driver == driver)
                {
                _used_devices.begin(); i != _used_devices.end(); i++)
                if((*i).first->dev_inst()->driver == driver)
                {
@@ -170,8 +171,8 @@ void DeviceManager::release_driver(struct sr_dev_driver *const driver)
        sr_dev_clear(driver);
 }
 
        sr_dev_clear(driver);
 }
 
-bool DeviceManager::compare_devices(shared_ptr<DevInst> a,
-       shared_ptr<DevInst> b)
+bool DeviceManager::compare_devices(shared_ptr<device::DevInst> a,
+       shared_ptr<device::DevInst> b)
 {
        assert(a);
        assert(b);
 {
        assert(a);
        assert(b);
index 891ba3d2c1ac28a254917a7da49def32828779d2..3ed74e078f2baa3234b9807eb6d62e4e2af6f7ac 100644 (file)
@@ -34,9 +34,12 @@ struct sr_dev_driver;
 
 namespace pv {
 
 
 namespace pv {
 
-class DevInst;
 class SigSession;
 
 class SigSession;
 
+namespace device {
+class DevInst;
+}
+
 class DeviceManager
 {
 public:
 class DeviceManager
 {
 public:
@@ -44,14 +47,15 @@ public:
 
        ~DeviceManager();
 
 
        ~DeviceManager();
 
-       const std::list< boost::shared_ptr<pv::DevInst> >& devices() const;
+       const std::list< boost::shared_ptr<pv::device::DevInst> >&
+               devices() const;
 
 
-       void use_device(boost::shared_ptr<pv::DevInst> dev_inst,
+       void use_device(boost::shared_ptr<pv::device::DevInst> dev_inst,
                SigSession *owner);
 
                SigSession *owner);
 
-       void release_device(boost::shared_ptr<pv::DevInst> dev_inst);
+       void release_device(boost::shared_ptr<pv::device::DevInst> dev_inst);
 
 
-       std::list< boost::shared_ptr<DevInst> > driver_scan(
+       std::list< boost::shared_ptr<pv::device::DevInst> > driver_scan(
                struct sr_dev_driver *const driver,
                GSList *const drvopts = NULL);
 
                struct sr_dev_driver *const driver,
                GSList *const drvopts = NULL);
 
@@ -64,13 +68,13 @@ private:
 
        void release_driver(struct sr_dev_driver *const driver);
 
 
        void release_driver(struct sr_dev_driver *const driver);
 
-       static bool compare_devices(boost::shared_ptr<DevInst> a,
-               boost::shared_ptr<DevInst> b);
+       static bool compare_devices(boost::shared_ptr<device::DevInst> a,
+               boost::shared_ptr<device::DevInst> b);
 
 private:
        struct sr_context *const _sr_ctx;
 
 private:
        struct sr_context *const _sr_ctx;
-       std::list< boost::shared_ptr<pv::DevInst> > _devices;
-       std::map< boost::shared_ptr<pv::DevInst>, pv::SigSession*>
+       std::list< boost::shared_ptr<pv::device::DevInst> > _devices;
+       std::map< boost::shared_ptr<pv::device::DevInst>, pv::SigSession*>
                _used_devices;
 };
 
                _used_devices;
 };
 
diff --git a/pv/devinst.cpp b/pv/devinst.cpp
deleted file mode 100644 (file)
index b28fce0..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#include <cassert>
-#include <sstream>
-
-#include <QDebug>
-
-#include <libsigrok/libsigrok.h>
-
-#include "devinst.h"
-
-using std::ostringstream;
-using std::string;
-
-namespace pv {
-
-DevInst::DevInst(sr_dev_inst *sdi) :
-       _sdi(sdi)
-{
-       assert(_sdi);
-}
-
-sr_dev_inst* DevInst::dev_inst() const
-{
-       return _sdi;
-}
-
-string DevInst::format_device_title() const
-{
-       ostringstream s;
-
-       assert(_sdi);
-
-       if (_sdi->vendor && _sdi->vendor[0]) {
-               s << _sdi->vendor;
-               if ((_sdi->model && _sdi->model[0]) ||
-                       (_sdi->version && _sdi->version[0]))
-                       s << ' ';
-       }
-
-       if (_sdi->model && _sdi->model[0]) {
-               s << _sdi->model;
-               if (_sdi->version && _sdi->version[0])
-                       s << ' ';
-       }
-
-       if (_sdi->version && _sdi->version[0])
-               s << _sdi->version;
-
-       return s.str();
-}
-
-GVariant* DevInst::get_config(const sr_probe_group *group, int key)
-{
-       GVariant *data = NULL;
-       if (sr_config_get(_sdi->driver, _sdi, group, key, &data) != SR_OK)
-               return NULL;
-       return data;
-}
-
-bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data)
-{
-       if(sr_config_set(_sdi, group, key, data) == SR_OK) {
-               config_changed();
-               return true;
-       }
-       return false;
-}
-
-GVariant* DevInst::list_config(const sr_probe_group *group, int key)
-{
-       GVariant *data = NULL;
-       if (sr_config_list(_sdi->driver, _sdi, group, key, &data) != SR_OK)
-               return NULL;
-       return data;
-}
-
-void DevInst::enable_probe(const sr_probe *probe, bool enable)
-{
-       for (const GSList *p = _sdi->probes; p; p = p->next)
-               if (probe == p->data) {
-                       const_cast<sr_probe*>(probe)->enabled = enable;
-                       config_changed();
-                       return;
-               }
-
-       // Probe was not found in the device
-       assert(0);
-}
-
-uint64_t DevInst::get_sample_limit()
-{
-       uint64_t sample_limit;
-       GVariant* gvar = get_config(NULL, SR_CONF_LIMIT_SAMPLES);
-       if (gvar != NULL) {
-               sample_limit = g_variant_get_uint64(gvar);
-               g_variant_unref(gvar);
-       } else {
-               sample_limit = 0U;
-       }
-       return sample_limit;
-}
-
-} // pv
diff --git a/pv/devinst.h b/pv/devinst.h
deleted file mode 100644 (file)
index e57a4e4..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifndef PULSEVIEW_PV_DEVINST_H
-#define PULSEVIEW_PV_DEVINST_H
-
-#include <string>
-
-#include <boost/shared_ptr.hpp>
-
-#include <QObject>
-
-#include <glib.h>
-
-#include <stdint.h>
-
-struct sr_dev_inst;
-struct sr_probe;
-struct sr_probe_group;
-
-namespace pv {
-
-class DevInst : public QObject
-{
-       Q_OBJECT
-
-public:
-       DevInst(sr_dev_inst *sdi);
-
-       sr_dev_inst* dev_inst() const;
-
-       std::string format_device_title() const;
-
-       GVariant* get_config(const sr_probe_group *group, int key);
-
-       bool set_config(const sr_probe_group *group, int key, GVariant *data);
-
-       GVariant* list_config(const sr_probe_group *group, int key);
-
-       void enable_probe(const sr_probe *probe, bool enable = true);
-
-       /**
-        * @brief Gets the sample limit from the driver.
-        *
-        * @return The returned sample limit from the driver, or 0 if the
-        *      sample limit could not be read.
-        */
-       uint64_t get_sample_limit();
-
-signals:
-       void config_changed();
-
-private:
-       sr_dev_inst *const _sdi;
-};
-
-} // pv
-
-#endif // PULSEVIEW_PV_DEVINST_H
index 11cf0e7b5de3e211643d62d6697ec9b6b80f1c10..7b31942d974e5ca28e8aab2d33e54a5db7d608af 100644 (file)
@@ -25,7 +25,7 @@
 #include "connect.h"
 
 #include "pv/devicemanager.h"
 #include "connect.h"
 
 #include "pv/devicemanager.h"
-#include "pv/devinst.h"
+#include "pv/device/devinst.h"
 
 extern "C" {
 /* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
 
 extern "C" {
 /* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
@@ -82,17 +82,17 @@ Connect::Connect(QWidget *parent, pv::DeviceManager &device_manager) :
        _layout.addWidget(&_button_box);
 }
 
        _layout.addWidget(&_button_box);
 }
 
-shared_ptr<DevInst> Connect::get_selected_device() const
+shared_ptr<device::DevInst> Connect::get_selected_device() const
 {
        const QListWidgetItem *const item = _device_list.currentItem();
        if (!item)
 {
        const QListWidgetItem *const item = _device_list.currentItem();
        if (!item)
-               return shared_ptr<DevInst>();
+               return shared_ptr<device::DevInst>();
 
        const sr_dev_inst *const sdi = (sr_dev_inst*)item->data(
                Qt::UserRole).value<void*>();
        assert(sdi);
 
 
        const sr_dev_inst *const sdi = (sr_dev_inst*)item->data(
                Qt::UserRole).value<void*>();
        assert(sdi);
 
-       std::map<const sr_dev_inst*, boost::shared_ptr<pv::DevInst> >::
+       std::map<const sr_dev_inst*, boost::shared_ptr<pv::device::DevInst> >::
                const_iterator iter = _device_map.find(sdi);
        assert(iter != _device_map.end());
 
                const_iterator iter = _device_map.find(sdi);
        assert(iter != _device_map.end());
 
@@ -170,12 +170,12 @@ void Connect::scan_pressed()
                drvopts = g_slist_append(drvopts, src);
        }
 
                drvopts = g_slist_append(drvopts, src);
        }
 
-       const list< shared_ptr<DevInst> > devices = _device_manager.driver_scan(
-               driver, drvopts);
+       const list< shared_ptr<device::DevInst> > devices =
+               _device_manager.driver_scan(driver, drvopts);
 
        g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
 
 
        g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
 
-       BOOST_FOREACH(shared_ptr<DevInst> dev_inst, devices)
+       BOOST_FOREACH(shared_ptr<device::DevInst> dev_inst, devices)
        {
                assert(dev_inst);
                const sr_dev_inst *const sdi = dev_inst->dev_inst();
        {
                assert(dev_inst);
                const sr_dev_inst *const sdi = dev_inst->dev_inst();
index 0f272cae73a6eb8e0d94b5cf7fe3ee296896acee..5a8b1cd0baf07d7974535c4db4bb951616f05262 100644 (file)
@@ -38,7 +38,10 @@ struct sr_dev_inst;
 namespace pv {
 
 class DeviceManager;
 namespace pv {
 
 class DeviceManager;
+
+namespace device {
 class DevInst;
 class DevInst;
+}
 
 namespace dialogs {
 
 
 namespace dialogs {
 
@@ -49,7 +52,7 @@ class Connect : public QDialog
 public:
        Connect(QWidget *parent, pv::DeviceManager &device_manager);
 
 public:
        Connect(QWidget *parent, pv::DeviceManager &device_manager);
 
-       boost::shared_ptr<DevInst> get_selected_device() const;
+       boost::shared_ptr<device::DevInst> get_selected_device() const;
 
 private:
        void populate_drivers();
 
 private:
        void populate_drivers();
@@ -80,7 +83,7 @@ private:
 
        QPushButton _scan_button;
        QListWidget _device_list;
 
        QPushButton _scan_button;
        QListWidget _device_list;
-       std::map<const sr_dev_inst*, boost::shared_ptr<pv::DevInst> >
+       std::map<const sr_dev_inst*, boost::shared_ptr<pv::device::DevInst> >
                _device_map;
 
        QDialogButtonBox _button_box;
                _device_map;
 
        QDialogButtonBox _button_box;
index 0b2805b18e44a1ee0908b2715476d62466faf58e..f72d1b7056041bd5cb34c563f68c7aed3523917e 100644 (file)
@@ -39,7 +39,7 @@
 #include "mainwindow.h"
 
 #include "devicemanager.h"
 #include "mainwindow.h"
 
 #include "devicemanager.h"
-#include "devinst.h"
+#include "device/devinst.h"
 #include "dialogs/about.h"
 #include "dialogs/connect.h"
 #include "dialogs/storeprogress.h"
 #include "dialogs/about.h"
 #include "dialogs/connect.h"
 #include "dialogs/storeprogress.h"
@@ -284,11 +284,13 @@ void MainWindow::session_error(
                Q_ARG(QString, info_text));
 }
 
                Q_ARG(QString, info_text));
 }
 
-void MainWindow::update_device_list(shared_ptr<pv::DevInst> selected_device)
+void MainWindow::update_device_list(
+       shared_ptr<pv::device::DevInst> selected_device)
 {
        assert(_sampling_bar);
 
 {
        assert(_sampling_bar);
 
-       const list< shared_ptr<DevInst> > &devices = _device_manager.devices();
+       const list< shared_ptr<device::DevInst> > &devices =
+               _device_manager.devices();
        _sampling_bar->set_device_list(devices);
 
        if (!selected_device && !devices.empty()) {
        _sampling_bar->set_device_list(devices);
 
        if (!selected_device && !devices.empty()) {
@@ -296,7 +298,7 @@ void MainWindow::update_device_list(shared_ptr<pv::DevInst> selected_device)
                selected_device = devices.front();
 
                // Try and find the demo device and select that by default
                selected_device = devices.front();
 
                // Try and find the demo device and select that by default
-               BOOST_FOREACH (shared_ptr<pv::DevInst> dev_inst, devices)
+               BOOST_FOREACH (shared_ptr<pv::device::DevInst> dev_inst, devices)
                        if (strcmp(dev_inst->dev_inst()->driver->name,
                                "demo") == 0) {
                                selected_device = dev_inst;
                        if (strcmp(dev_inst->dev_inst()->driver->name,
                                "demo") == 0) {
                                selected_device = dev_inst;
@@ -368,7 +370,7 @@ void MainWindow::on_actionConnect_triggered()
 
        // If the user selected a device, select it in the device list. Select the
        // current device otherwise.
 
        // If the user selected a device, select it in the device list. Select the
        // current device otherwise.
-       shared_ptr<DevInst> dev_inst = dlg.exec() ?
+       shared_ptr<device::DevInst> dev_inst = dlg.exec() ?
                dlg.get_selected_device() : _session.get_device();
 
        update_device_list(dev_inst);
                dlg.get_selected_device() : _session.get_device();
 
        update_device_list(dev_inst);
index 6f3c8d56344d601d90628578ac1da419ac3f7e71..1acaf07227c7b8bd86a08d20ebda97e824f4115a 100644 (file)
@@ -36,7 +36,10 @@ class QVBoxLayout;
 namespace pv {
 
 class DeviceManager;
 namespace pv {
 
 class DeviceManager;
+
+namespace device {
 class DevInst;
 class DevInst;
+}
 
 namespace toolbars {
 class ContextBar;
 
 namespace toolbars {
 class ContextBar;
@@ -72,8 +75,8 @@ private:
         * first device in the device list should be selected.
         */
        void update_device_list(
         * first device in the device list should be selected.
         */
        void update_device_list(
-               boost::shared_ptr<pv::DevInst> selected_device =
-                       boost::shared_ptr<pv::DevInst>());
+               boost::shared_ptr<pv::device::DevInst> selected_device =
+                       boost::shared_ptr<pv::device::DevInst>());
 
 private slots:
        void load_file(QString file_name);
 
 private slots:
        void load_file(QString file_name);
index 7e1be20d52d5ca4dd7b14835387f960590c75b82..13055fc0e8cdee6c27e9d99b233064876f52e170 100644 (file)
@@ -32,7 +32,8 @@ using boost::shared_ptr;
 namespace pv {
 namespace popups {
 
 namespace pv {
 namespace popups {
 
-DeviceOptions::DeviceOptions(shared_ptr<DevInst> dev_inst, QWidget *parent) :
+DeviceOptions::DeviceOptions(shared_ptr<device::DevInst> dev_inst,
+       QWidget *parent) :
        Popup(parent),
        _dev_inst(dev_inst),
        _layout(this),
        Popup(parent),
        _dev_inst(dev_inst),
        _layout(this),
index 745ed994e9ea7f449d0bdd8fdfe6b3b601ee9aeb..945959b24eb7372c52c41c0b904b3cf18d3b9497 100644 (file)
@@ -35,12 +35,13 @@ class DeviceOptions : public pv::widgets::Popup
        Q_OBJECT
 
 public:
        Q_OBJECT
 
 public:
-       DeviceOptions(boost::shared_ptr<DevInst> dev_inst, QWidget *parent);
+       DeviceOptions(boost::shared_ptr<device::DevInst> dev_inst,
+               QWidget *parent);
 
        pv::prop::binding::DeviceOptions& binding();
 
 private:
 
        pv::prop::binding::DeviceOptions& binding();
 
 private:
-       boost::shared_ptr<DevInst> _dev_inst;
+       boost::shared_ptr<device::DevInst> _dev_inst;
 
        QVBoxLayout _layout;
 
 
        QVBoxLayout _layout;
 
index b19f8967cbe15d9200bbd6c23dbcea9f2214a552..13380c2dfb9d6999bcb23e4fb040aed39a0cd127 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "probes.h"
 
 
 #include "probes.h"
 
-#include <pv/devinst.h>
+#include <pv/device/devinst.h>
 #include <pv/prop/binding/deviceoptions.h>
 #include <pv/sigsession.h>
 #include <pv/view/signal.h>
 #include <pv/prop/binding/deviceoptions.h>
 #include <pv/sigsession.h>
 #include <pv/view/signal.h>
@@ -57,7 +57,7 @@ Probes::Probes(SigSession &session, QWidget *parent) :
        // Create the layout
        setLayout(&_layout);
 
        // Create the layout
        setLayout(&_layout);
 
-       shared_ptr<DevInst> dev_inst = _session.get_device();
+       shared_ptr<device::DevInst> dev_inst = _session.get_device();
        assert(dev_inst);
        const sr_dev_inst *const sdi = dev_inst->dev_inst();
        assert(sdi);
        assert(dev_inst);
        const sr_dev_inst *const sdi = dev_inst->dev_inst();
        assert(sdi);
index 016486922d86a95dcc1282684d2695d3f828c585..ea8f4b4218463e1c6e5ab03308ca6358d0066df2 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "deviceoptions.h"
 
 
 #include "deviceoptions.h"
 
-#include <pv/devinst.h>
+#include <pv/device/devinst.h>
 #include <pv/prop/bool.h>
 #include <pv/prop/double.h>
 #include <pv/prop/enum.h>
 #include <pv/prop/bool.h>
 #include <pv/prop/double.h>
 #include <pv/prop/enum.h>
@@ -45,7 +45,7 @@ namespace pv {
 namespace prop {
 namespace binding {
 
 namespace prop {
 namespace binding {
 
-DeviceOptions::DeviceOptions(shared_ptr<pv::DevInst> dev_inst,
+DeviceOptions::DeviceOptions(shared_ptr<pv::device::DevInst> dev_inst,
        const sr_probe_group *group) :
        _dev_inst(dev_inst),
        _group(group)
        const sr_probe_group *group) :
        _dev_inst(dev_inst),
        _group(group)
@@ -122,8 +122,9 @@ void DeviceOptions::bind_bool(const QString &name, int key)
 {
        assert(_dev_inst);
        _properties.push_back(shared_ptr<Property>(new Bool(name,
 {
        assert(_dev_inst);
        _properties.push_back(shared_ptr<Property>(new Bool(name,
-               bind(&DevInst::get_config, _dev_inst, _group, key),
-               bind(&DevInst::set_config, _dev_inst, _group, key, _1))));
+               bind(&device::DevInst::get_config, _dev_inst, _group, key),
+               bind(&device::DevInst::set_config, _dev_inst,
+                       _group, key, _1))));
 }
 
 void DeviceOptions::bind_enum(const QString &name, int key,
 }
 
 void DeviceOptions::bind_enum(const QString &name, int key,
@@ -141,8 +142,9 @@ void DeviceOptions::bind_enum(const QString &name, int key,
                values.push_back(make_pair(gvar, printer(gvar)));
 
        _properties.push_back(shared_ptr<Property>(new Enum(name, values,
                values.push_back(make_pair(gvar, printer(gvar)));
 
        _properties.push_back(shared_ptr<Property>(new Enum(name, values,
-               bind(&DevInst::get_config, _dev_inst, _group, key),
-               bind(&DevInst::set_config, _dev_inst, _group, key, _1))));
+               bind(&device::DevInst::get_config, _dev_inst, _group, key),
+               bind(&device::DevInst::set_config, _dev_inst,
+                       _group, key, _1))));
 }
 
 void DeviceOptions::bind_int(const QString &name, int key, QString suffix,
 }
 
 void DeviceOptions::bind_int(const QString &name, int key, QString suffix,
@@ -151,8 +153,8 @@ void DeviceOptions::bind_int(const QString &name, int key, QString suffix,
        assert(_dev_inst);
 
        _properties.push_back(shared_ptr<Property>(new Int(name, suffix, range,
        assert(_dev_inst);
 
        _properties.push_back(shared_ptr<Property>(new Int(name, suffix, range,
-               bind(&DevInst::get_config, _dev_inst, _group, key),
-               bind(&DevInst::set_config, _dev_inst, _group, key, _1))));
+               bind(&device::DevInst::get_config, _dev_inst, _group, key),
+               bind(&device::DevInst::set_config, _dev_inst, _group, key, _1))));
 }
 
 QString DeviceOptions::print_gvariant(GVariant *const gvar)
 }
 
 QString DeviceOptions::print_gvariant(GVariant *const gvar)
index 8814dc344015dbf748d27b746e29bb3a435a3919..4a6eff2eb1694f07ef61aa43b7feef2d95f191e2 100644 (file)
@@ -35,7 +35,9 @@ struct sr_probe_group;
 
 namespace pv {
 
 
 namespace pv {
 
+namespace device {
 class DevInst;
 class DevInst;
+}
 
 namespace prop {
 namespace binding {
 
 namespace prop {
 namespace binding {
@@ -43,7 +45,7 @@ namespace binding {
 class DeviceOptions : public Binding
 {
 public:
 class DeviceOptions : public Binding
 {
 public:
-       DeviceOptions(boost::shared_ptr<pv::DevInst> dev_inst,
+       DeviceOptions(boost::shared_ptr<pv::device::DevInst> dev_inst,
                const sr_probe_group *group = NULL);
 
 private:
                const sr_probe_group *group = NULL);
 
 private:
@@ -61,7 +63,7 @@ private:
        static QString print_voltage_threshold(GVariant *const gvar);
 
 protected:
        static QString print_voltage_threshold(GVariant *const gvar);
 
 protected:
-       boost::shared_ptr<DevInst> _dev_inst;
+       boost::shared_ptr<device::DevInst> _dev_inst;
        const sr_probe_group *const _group;
 };
 
        const sr_probe_group *const _group;
 };
 
index b5387877dda0a73a513f7cb5f066e030f3b17539..622bf8d2c5b4dedf18143df7e5824282178c4995 100644 (file)
@@ -25,7 +25,7 @@
 #include "sigsession.h"
 
 #include "devicemanager.h"
 #include "sigsession.h"
 
 #include "devicemanager.h"
-#include "devinst.h"
+#include "device/devinst.h"
 
 #include "data/analog.h"
 #include "data/analogsnapshot.h"
 
 #include "data/analog.h"
 #include "data/analogsnapshot.h"
@@ -85,12 +85,12 @@ SigSession::~SigSession()
        _session = NULL;
 }
 
        _session = NULL;
 }
 
-shared_ptr<DevInst> SigSession::get_device() const
+shared_ptr<device::DevInst> SigSession::get_device() const
 {
        return _dev_inst;
 }
 
 {
        return _dev_inst;
 }
 
-void SigSession::set_device(shared_ptr<DevInst> dev_inst)
+void SigSession::set_device(shared_ptr<device::DevInst> dev_inst)
 {
        // Ensure we are not capturing before setting the device
        stop_capture();
 {
        // Ensure we are not capturing before setting the device
        stop_capture();
@@ -103,12 +103,12 @@ void SigSession::set_device(shared_ptr<DevInst> dev_inst)
        update_signals(dev_inst);
 }
 
        update_signals(dev_inst);
 }
 
-void SigSession::release_device(shared_ptr<DevInst> dev_inst)
+void SigSession::release_device(shared_ptr<device::DevInst> dev_inst)
 {
        (void)dev_inst;
 
        assert(_capture_state == Stopped);
 {
        (void)dev_inst;
 
        assert(_capture_state == Stopped);
-       _dev_inst = shared_ptr<DevInst>();
+       _dev_inst = shared_ptr<device::DevInst>();
 }
 
 void SigSession::load_file(const string &name,
 }
 
 void SigSession::load_file(const string &name,
@@ -126,8 +126,8 @@ void SigSession::load_file(const string &name,
                        return;
                }
 
                        return;
                }
 
-               shared_ptr<DevInst> dev_inst(
-                       new DevInst((sr_dev_inst*)devlist->data));
+               shared_ptr<device::DevInst> dev_inst(
+                       new device::DevInst((sr_dev_inst*)devlist->data));
                g_slist_free(devlist);
 
                _decode_traces.clear();
                g_slist_free(devlist);
 
                _decode_traces.clear();
@@ -146,7 +146,8 @@ void SigSession::load_file(const string &name,
                        return;
 
                _decode_traces.clear();
                        return;
 
                _decode_traces.clear();
-               update_signals(shared_ptr<DevInst>(new DevInst(in->sdi)));
+               update_signals(shared_ptr<device::DevInst>(
+                       new device::DevInst(in->sdi)));
                read_sample_rate(in->sdi);
 
                _sampling_thread = boost::thread(
                read_sample_rate(in->sdi);
 
                _sampling_thread = boost::thread(
@@ -386,7 +387,7 @@ sr_input* SigSession::load_input_file_format(const string &filename,
        return in;
 }
 
        return in;
 }
 
-void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
+void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
 {
        assert(dev_inst);
        assert(_capture_state == Stopped);
 {
        assert(dev_inst);
        assert(_capture_state == Stopped);
@@ -568,7 +569,7 @@ void SigSession::load_input_thread_proc(const string name,
        delete in;
 }
 
        delete in;
 }
 
-void SigSession::sample_thread_proc(shared_ptr<DevInst> dev_inst,
+void SigSession::sample_thread_proc(shared_ptr<device::DevInst> dev_inst,
        function<void (const QString)> error_handler)
 {
        assert(dev_inst);
        function<void (const QString)> error_handler)
 {
        assert(dev_inst);
index a9a7ce23dce93b5bbd70efdabc3c84a7bf1db4c3..6b2e75999c06da96430924d8674fd64c90ccd422 100644 (file)
@@ -41,7 +41,6 @@ struct srd_probe;
 namespace pv {
 
 class DeviceManager;
 namespace pv {
 
 class DeviceManager;
-class DevInst;
 
 namespace data {
 class Analog;
 
 namespace data {
 class Analog;
@@ -51,6 +50,10 @@ class LogicSnapshot;
 class SignalData;
 }
 
 class SignalData;
 }
 
+namespace device {
+class DevInst;
+}
+
 namespace view {
 class DecodeTrace;
 class LogicSignal;
 namespace view {
 class DecodeTrace;
 class LogicSignal;
@@ -73,14 +76,14 @@ public:
 
        ~SigSession();
 
 
        ~SigSession();
 
-       boost::shared_ptr<DevInst> get_device() const;
+       boost::shared_ptr<device::DevInst> get_device() const;
 
        /**
         * Sets device instance that will be used in the next capture session.
         */
 
        /**
         * Sets device instance that will be used in the next capture session.
         */
-       void set_device(boost::shared_ptr<DevInst> dev_inst);
+       void set_device(boost::shared_ptr<device::DevInst> dev_inst);
 
 
-       void release_device(boost::shared_ptr<DevInst> dev_inst);
+       void release_device(boost::shared_ptr<device::DevInst> dev_inst);
 
        void load_file(const std::string &name,
                boost::function<void (const QString)> error_handler);
 
        void load_file(const std::string &name,
                boost::function<void (const QString)> error_handler);
@@ -108,7 +111,7 @@ public:
 private:
        void set_capture_state(capture_state state);
 
 private:
        void set_capture_state(capture_state state);
 
-       void update_signals(boost::shared_ptr<DevInst> dev_inst);
+       void update_signals(boost::shared_ptr<device::DevInst> dev_inst);
 
        bool is_trigger_enabled() const;
 
 
        bool is_trigger_enabled() const;
 
@@ -139,7 +142,7 @@ private:
        void load_input_thread_proc(const std::string name, sr_input *in,
                boost::function<void (const QString)> error_handler);
 
        void load_input_thread_proc(const std::string name, sr_input *in,
                boost::function<void (const QString)> error_handler);
 
-       void sample_thread_proc(boost::shared_ptr<DevInst> dev_inst,
+       void sample_thread_proc(boost::shared_ptr<device::DevInst> dev_inst,
                boost::function<void (const QString)> error_handler);
 
        void feed_in_header(const sr_dev_inst *sdi);
                boost::function<void (const QString)> error_handler);
 
        void feed_in_header(const sr_dev_inst *sdi);
@@ -163,7 +166,7 @@ private:
        /**
         * The device instance that will be used in the next capture session.
         */
        /**
         * The device instance that will be used in the next capture session.
         */
-       boost::shared_ptr<DevInst> _dev_inst;
+       boost::shared_ptr<device::DevInst> _dev_inst;
 
        std::vector< boost::shared_ptr<view::DecodeTrace> > _decode_traces;
 
 
        std::vector< boost::shared_ptr<view::DecodeTrace> > _decode_traces;
 
index 27af7c7b8acfd1cc6787cfbe70f6c917f08ac1ea..f58f4fc38fd60c2ecedce0aefae3bd8468fa6ffa 100644 (file)
@@ -30,7 +30,7 @@
 #include "samplingbar.h"
 
 #include <pv/devicemanager.h>
 #include "samplingbar.h"
 
 #include <pv/devicemanager.h>
-#include <pv/devinst.h>
+#include <pv/device/devinst.h>
 #include <pv/popups/deviceoptions.h>
 #include <pv/popups/probes.h>
 
 #include <pv/popups/deviceoptions.h>
 #include <pv/popups/probes.h>
 
@@ -96,14 +96,14 @@ SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
 }
 
 void SamplingBar::set_device_list(
 }
 
 void SamplingBar::set_device_list(
-       const std::list< shared_ptr<pv::DevInst> > &devices)
+       const std::list< shared_ptr<pv::device::DevInst> > &devices)
 {
        _updating_device_selector = true;
 
        _device_selector.clear();
        _device_selector_map.clear();
 
 {
        _updating_device_selector = true;
 
        _device_selector.clear();
        _device_selector_map.clear();
 
-       BOOST_FOREACH (shared_ptr<pv::DevInst> dev_inst, devices) {
+       BOOST_FOREACH (shared_ptr<pv::device::DevInst> dev_inst, devices) {
                assert(dev_inst);
                const string title = dev_inst->format_device_title();
                const sr_dev_inst *sdi = dev_inst->dev_inst();
                assert(dev_inst);
                const string title = dev_inst->format_device_title();
                const sr_dev_inst *sdi = dev_inst->dev_inst();
@@ -119,26 +119,26 @@ void SamplingBar::set_device_list(
        on_device_selected();
 }
 
        on_device_selected();
 }
 
-shared_ptr<pv::DevInst> SamplingBar::get_selected_device() const
+shared_ptr<pv::device::DevInst> SamplingBar::get_selected_device() const
 {
        const int index = _device_selector.currentIndex();
        if (index < 0)
 {
        const int index = _device_selector.currentIndex();
        if (index < 0)
-               return shared_ptr<pv::DevInst>();
+               return shared_ptr<pv::device::DevInst>();
 
        const sr_dev_inst *const sdi =
                (const sr_dev_inst*)_device_selector.itemData(
                        index).value<void*>();
        assert(sdi);
 
 
        const sr_dev_inst *const sdi =
                (const sr_dev_inst*)_device_selector.itemData(
                        index).value<void*>();
        assert(sdi);
 
-       map<const sr_dev_inst*, boost::weak_ptr<DevInst> >::
+       map<const sr_dev_inst*, boost::weak_ptr<device::DevInst> >::
                const_iterator iter = _device_selector_map.find(sdi);
        if (iter == _device_selector_map.end())
                const_iterator iter = _device_selector_map.find(sdi);
        if (iter == _device_selector_map.end())
-               return shared_ptr<pv::DevInst>();
+               return shared_ptr<pv::device::DevInst>();
 
 
-       return shared_ptr<pv::DevInst>((*iter).second);
+       return shared_ptr<pv::device::DevInst>((*iter).second);
 }
 
 }
 
-void SamplingBar::set_selected_device(boost::shared_ptr<pv::DevInst> dev_inst)
+void SamplingBar::set_selected_device(shared_ptr<pv::device::DevInst> dev_inst)
 {
        assert(dev_inst);
 
 {
        assert(dev_inst);
 
@@ -167,7 +167,7 @@ void SamplingBar::update_sample_rate_selector()
        if (_updating_sample_rate)
                return;
 
        if (_updating_sample_rate)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
@@ -231,7 +231,7 @@ void SamplingBar::update_sample_rate_selector_value()
        if (_updating_sample_rate)
                return;
 
        if (_updating_sample_rate)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
@@ -255,7 +255,7 @@ void SamplingBar::update_sample_count_selector()
        if (_updating_sample_count)
                return;
 
        if (_updating_sample_count)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
@@ -307,7 +307,7 @@ void SamplingBar::commit_sample_count()
        if (_updating_sample_count)
                return;
 
        if (_updating_sample_count)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
@@ -331,7 +331,7 @@ void SamplingBar::commit_sample_rate()
        if (_updating_sample_rate)
                return;
 
        if (_updating_sample_rate)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
@@ -359,7 +359,7 @@ void SamplingBar::on_device_selected()
        if (_updating_device_selector)
                return;
 
        if (_updating_device_selector)
                return;
 
-       const shared_ptr<DevInst> dev_inst = get_selected_device();
+       const shared_ptr<device::DevInst> dev_inst = get_selected_device();
        if (!dev_inst)
                return;
 
        if (!dev_inst)
                return;
 
index 454d607931be9633354549a43d89ba137c744024..db4e856e26dfff48a59a80bae7f41909aa124e30 100644 (file)
@@ -41,9 +41,12 @@ class QAction;
 
 namespace pv {
 
 
 namespace pv {
 
-class DevInst;
 class SigSession;
 
 class SigSession;
 
+namespace device {
+class DevInst;
+}
+
 namespace toolbars {
 
 class SamplingBar : public QToolBar
 namespace toolbars {
 
 class SamplingBar : public QToolBar
@@ -59,10 +62,12 @@ public:
        SamplingBar(SigSession &session, QWidget *parent);
 
        void set_device_list(
        SamplingBar(SigSession &session, QWidget *parent);
 
        void set_device_list(
-               const std::list< boost::shared_ptr<pv::DevInst> > &devices);
+               const std::list< boost::shared_ptr<pv::device::DevInst> >
+                       &devices);
 
 
-       boost::shared_ptr<pv::DevInst> get_selected_device() const;
-       void set_selected_device(boost::shared_ptr<pv::DevInst> dev_inst);
+       boost::shared_ptr<pv::device::DevInst> get_selected_device() const;
+       void set_selected_device(
+               boost::shared_ptr<pv::device::DevInst> dev_inst);
 
        void set_capture_state(pv::SigSession::capture_state state);
 
 
        void set_capture_state(pv::SigSession::capture_state state);
 
@@ -88,7 +93,7 @@ private:
        SigSession &_session;
 
        QComboBox _device_selector;
        SigSession &_session;
 
        QComboBox _device_selector;
-       std::map<const sr_dev_inst*, boost::weak_ptr<DevInst> >
+       std::map<const sr_dev_inst*, boost::weak_ptr<device::DevInst> >
                _device_selector_map;
        bool _updating_device_selector;
 
                _device_selector_map;
        bool _updating_device_selector;
 
index a64cf70f430dc4fd7c8d8d47432c24f593aa63ed..182e9abdfbf4bcb874242b8c671455f9aa553363 100644 (file)
@@ -44,7 +44,7 @@ const QColor AnalogSignal::SignalColours[4] = {
 
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
 
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
-AnalogSignal::AnalogSignal(shared_ptr<pv::DevInst> dev_inst,
+AnalogSignal::AnalogSignal(shared_ptr<pv::device::DevInst> dev_inst,
        const sr_probe *const probe, shared_ptr<data::Analog> data) :
        Signal(dev_inst, probe),
        _data(data),
        const sr_probe *const probe, shared_ptr<data::Analog> data) :
        Signal(dev_inst, probe),
        _data(data),
index 3b6f7f4f6ef240bfa0bee86202ab67593cd3ae46..8101167d5677ff001591936071c24d6a3d4ffd24 100644 (file)
@@ -42,7 +42,7 @@ private:
        static const float EnvelopeThreshold;
 
 public:
        static const float EnvelopeThreshold;
 
 public:
-       AnalogSignal(boost::shared_ptr<pv::DevInst> dev_inst,
+       AnalogSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
                const sr_probe *const probe,
                boost::shared_ptr<pv::data::Analog> data);
 
                const sr_probe *const probe,
                boost::shared_ptr<pv::data::Analog> data);
 
index cc974f5210050729493a368b6e726d06ba86923f..52cf4ac1ab24af7ae09051d4c30ec93e36b3c819 100644 (file)
@@ -29,7 +29,7 @@
 #include "view.h"
 
 #include <pv/sigsession.h>
 #include "view.h"
 
 #include <pv/sigsession.h>
-#include <pv/devinst.h>
+#include <pv/device/devinst.h>
 #include <pv/data/logic.h>
 #include <pv/data/logicsnapshot.h>
 #include <pv/view/view.h>
 #include <pv/data/logic.h>
 #include <pv/data/logicsnapshot.h>
 #include <pv/view/view.h>
@@ -63,7 +63,7 @@ const QColor LogicSignal::SignalColours[10] = {
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
-LogicSignal::LogicSignal(shared_ptr<pv::DevInst> dev_inst,
+LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
        const sr_probe *const probe, shared_ptr<data::Logic> data) :
        Signal(dev_inst, probe),
        _data(data),
        const sr_probe *const probe, shared_ptr<data::Logic> data) :
        Signal(dev_inst, probe),
        _data(data),
index 17f6eb26d862eede6bf8c968d7cb5deee8303bb7..9b7865743a76b0fd9458f3358760c1355abbafcd 100644 (file)
@@ -49,7 +49,7 @@ private:
        static const QColor SignalColours[10];
 
 public:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(boost::shared_ptr<pv::DevInst> dev_inst,
+       LogicSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
                const sr_probe *const probe,
                boost::shared_ptr<pv::data::Logic> data);
 
                const sr_probe *const probe,
                boost::shared_ptr<pv::data::Logic> data);
 
index 61f79a8c8351e8574ceabf779324f8d733195a96..aadaed78f7d238cac06a1a1ec789eb5795864650 100644 (file)
@@ -32,7 +32,7 @@
 #include "signal.h"
 #include "view.h"
 
 #include "signal.h"
 #include "view.h"
 
-#include <pv/devinst.h>
+#include <pv/device/devinst.h>
 
 using boost::shared_ptr;
 
 
 using boost::shared_ptr;
 
@@ -56,7 +56,7 @@ const char *const ProbeNames[] = {
        "SCL"
 };
 
        "SCL"
 };
 
-Signal::Signal(shared_ptr<pv::DevInst> dev_inst,
+Signal::Signal(shared_ptr<pv::device::DevInst> dev_inst,
        const sr_probe *const probe) :
        Trace(probe->name),
        _dev_inst(dev_inst),
        const sr_probe *const probe) :
        Trace(probe->name),
        _dev_inst(dev_inst),
index 25b671f4217af8e71b0b5a8314849ae31bf79a9a..3123519b9dcb6e5778d1e78f39302674a1afbb9d 100644 (file)
@@ -34,12 +34,14 @@ struct sr_probe;
 
 namespace pv {
 
 
 namespace pv {
 
-class DevInst;
-
 namespace data {
 class SignalData;
 }
 
 namespace data {
 class SignalData;
 }
 
+namespace device {
+class DevInst;
+}
+
 namespace view {
 
 class Signal : public Trace
 namespace view {
 
 class Signal : public Trace
@@ -47,7 +49,7 @@ class Signal : public Trace
        Q_OBJECT
 
 protected:
        Q_OBJECT
 
 protected:
-       Signal(boost::shared_ptr<pv::DevInst> dev_inst,
+       Signal(boost::shared_ptr<pv::device::DevInst> dev_inst,
                const sr_probe *const probe);
 
 public:
                const sr_probe *const probe);
 
 public:
@@ -77,7 +79,7 @@ private slots:
        void on_disable();
 
 protected:
        void on_disable();
 
 protected:
-       boost::shared_ptr<pv::DevInst> _dev_inst;
+       boost::shared_ptr<pv::device::DevInst> _dev_inst;
        const sr_probe *const _probe;
 
        QComboBox *_name_widget;
        const sr_probe *const _probe;
 
        QComboBox *_name_widget;
index ec833130fc61b9312b64f0eb2b4bfd2afa1687d4..27d42f916d69c1b44ca5ef2a1a2ca13bc52623db 100644 (file)
@@ -47,7 +47,6 @@ find_package(Qt4 REQUIRED)
 
 set(pulseview_TEST_SOURCES
        ${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp
 
 set(pulseview_TEST_SOURCES
        ${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp
-       ${PROJECT_SOURCE_DIR}/pv/devinst.cpp
        ${PROJECT_SOURCE_DIR}/pv/sigsession.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/analog.cpp
        ${PROJECT_SOURCE_DIR}/pv/sigsession.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/analog.cpp
@@ -58,6 +57,7 @@ set(pulseview_TEST_SOURCES
        ${PROJECT_SOURCE_DIR}/pv/data/logicsnapshot.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/snapshot.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/logicsnapshot.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/snapshot.cpp
        ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp
+       ${PROJECT_SOURCE_DIR}/pv/device/devinst.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp
        ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp
@@ -88,7 +88,7 @@ set(pulseview_TEST_SOURCES
 # This list includes only QObject derived class headers.
 set(pulseview_TEST_HEADERS
        ${PROJECT_SOURCE_DIR}/pv/sigsession.h
 # This list includes only QObject derived class headers.
 set(pulseview_TEST_HEADERS
        ${PROJECT_SOURCE_DIR}/pv/sigsession.h
-       ${PROJECT_SOURCE_DIR}/pv/devinst.h
+       ${PROJECT_SOURCE_DIR}/pv/device/devinst.h
        ${PROJECT_SOURCE_DIR}/pv/prop/int.h
        ${PROJECT_SOURCE_DIR}/pv/prop/property.h
        ${PROJECT_SOURCE_DIR}/pv/prop/string.h
        ${PROJECT_SOURCE_DIR}/pv/prop/int.h
        ${PROJECT_SOURCE_DIR}/pv/prop/property.h
        ${PROJECT_SOURCE_DIR}/pv/prop/string.h