]> sigrok.org Git - pulseview.git/commitdiff
Added DevInst pointer to Signal
authorJoel Holdsworth <redacted>
Mon, 10 Feb 2014 21:26:32 +0000 (21:26 +0000)
committerJoel Holdsworth <redacted>
Tue, 11 Feb 2014 21:44:46 +0000 (21:44 +0000)
pv/data/decode/decoder.cpp
pv/sigsession.cpp
pv/view/analogsignal.cpp
pv/view/analogsignal.h
pv/view/logicsignal.cpp
pv/view/logicsignal.h
pv/view/signal.cpp
pv/view/signal.h

index 3767e4853b3bbe92299a6034d8140cde90424ca4..b293cacb010790c61f46edef34c7f81f0306abfe 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <libsigrok/libsigrok.h>
 #include <libsigrokdecode/libsigrokdecode.h>
 
 #include "decoder.h"
index 809509bb78768fc9a054b1a7db8d6b64c2d57f4d..a2f44dab1aaf01a462ef8383f83759f5b8147925 100644 (file)
@@ -442,8 +442,8 @@ void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
                        switch(probe->type) {
                        case SR_PROBE_LOGIC:
                                signal = shared_ptr<view::Signal>(
-                                       new view::LogicSignal(*this, probe,
-                                               _logic_data));
+                                       new view::LogicSignal(*this, dev_inst,
+                                               probe, _logic_data));
                                break;
 
                        case SR_PROBE_ANALOG:
@@ -451,8 +451,8 @@ void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
                                shared_ptr<data::Analog> data(
                                        new data::Analog());
                                signal = shared_ptr<view::Signal>(
-                                       new view::AnalogSignal(*this, probe,
-                                               data));
+                                       new view::AnalogSignal(*this, dev_inst,
+                                               probe, data));
                                break;
                        }
 
index 9cc3547d272996a717cb7ebfe36c004a14ef7ce1..84e55cc3b6e0a2f9c48b1554395f69d8c9490606 100644 (file)
@@ -44,9 +44,10 @@ const QColor AnalogSignal::SignalColours[4] = {
 
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
-AnalogSignal::AnalogSignal(pv::SigSession &session, sr_probe *const probe,
+AnalogSignal::AnalogSignal(pv::SigSession &session,
+       shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe,
        shared_ptr<data::Analog> data) :
-       Signal(session, probe),
+       Signal(session, dev_inst, probe),
        _data(data),
        _scale(1.0f)
 {
index 4b7b3bc3ec649a7be07495759342f467ead1aff8..7c506a7a652378f24b5b30c0526d28e3d394aa7b 100644 (file)
@@ -42,7 +42,8 @@ private:
        static const float EnvelopeThreshold;
 
 public:
-       AnalogSignal(pv::SigSession &session, sr_probe *const probe,
+       AnalogSignal(pv::SigSession &session,
+               boost::shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe,
                boost::shared_ptr<pv::data::Analog> data);
 
        virtual ~AnalogSignal();
index 8e0ea27d43f775c687cab6a2b09ad7ee0e1b0b80..81ddd6e92ea4a925b0eb9d06e22b417d4f8f83cc 100644 (file)
@@ -63,9 +63,10 @@ const QColor LogicSignal::SignalColours[10] = {
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
-LogicSignal::LogicSignal(pv::SigSession &session, sr_probe *const probe,
+LogicSignal::LogicSignal(pv::SigSession &session,
+       shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe,
        shared_ptr<data::Logic> data) :
-       Signal(session, probe),
+       Signal(session, dev_inst, probe),
        _data(data),
        _trigger_none(NULL),
        _trigger_rising(NULL),
index 992745eb8e6ff6927ae10bf8db0ddbe952244b82..701dbbf7b03bad413a9e610787607e2e6a314b39 100644 (file)
@@ -49,7 +49,8 @@ private:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(pv::SigSession &session, sr_probe *const probe,
+       LogicSignal(pv::SigSession &session,
+               boost::shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe,
                boost::shared_ptr<pv::data::Logic> data);
 
        virtual ~LogicSignal();
index 1f00477a2012d9cb5a3a8e11f6cd046ff62f8682..ba1271b0c4251afee4f3dedfff8b534d59a3d647 100644 (file)
 #include <QFormLayout>
 #include <QMenu>
 
+#include <libsigrok/libsigrok.h>
+
 #include "signal.h"
 #include "view.h"
 
+using boost::shared_ptr;
+
 namespace pv {
 namespace view {
 
@@ -50,8 +54,10 @@ const char *const ProbeNames[] = {
        "SCL"
 };
 
-Signal::Signal(pv::SigSession &session, sr_probe *const probe) :
+Signal::Signal(pv::SigSession &session, shared_ptr<pv::DevInst> dev_inst,
+       sr_probe *const probe) :
        Trace(session, probe->name),
+       _dev_inst(dev_inst),
        _probe(probe),
        _name_widget(NULL),
        _updating_name_widget(false)
index bdbd27a35f1b9554cde55dd75b1a441f0b1619b8..70b908b1030efe928bcc011fd244998cbf94e305 100644 (file)
 
 #include <stdint.h>
 
-#include <libsigrok/libsigrok.h>
-
 #include "trace.h"
 
+struct sr_probe;
+
 namespace pv {
 
+class DevInst;
+
 namespace data {
 class SignalData;
 }
@@ -45,7 +47,8 @@ class Signal : public Trace
        Q_OBJECT
 
 protected:
-       Signal(pv::SigSession &session, sr_probe *const probe);
+       Signal(pv::SigSession &session, boost::shared_ptr<pv::DevInst> dev_inst,
+               sr_probe *const probe);
 
 public:
        /**
@@ -74,6 +77,7 @@ private slots:
        void on_disable();
 
 protected:
+       boost::shared_ptr<pv::DevInst> _dev_inst;
        sr_probe *const _probe;
 
        QComboBox *_name_widget;