]> sigrok.org Git - pulseview.git/commitdiff
Added _session reference to Signal objects
authorJoel Holdsworth <redacted>
Mon, 27 May 2013 09:36:33 +0000 (10:36 +0100)
committerJoel Holdsworth <redacted>
Mon, 27 May 2013 09:36:33 +0000 (10:36 +0100)
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 0de7c4a7a3bddec86a758bb3d99cf93db7251b37..793a5e8a894147073f2d91fe5143690cd1e1e10d 100644 (file)
@@ -304,13 +304,13 @@ void SigSession::update_signals()
                                switch(probe->type) {
                                case SR_PROBE_LOGIC:
                                        signal = shared_ptr<view::Signal>(
-                                               new view::LogicSignal(probe,
+                                               new view::LogicSignal(*this, probe,
                                                        _logic_data));
                                        break;
 
                                case SR_PROBE_ANALOG:
                                        signal = shared_ptr<view::Signal>(
-                                               new view::AnalogSignal(probe,
+                                               new view::AnalogSignal(*this, probe,
                                                        _analog_data));
                                        break;
                                }
index 7c906b52db8f6d74b79ae9f4d35e39bb661e0b9f..6b81fda77da324d8db0dec9ce6803758fad45a6a 100644 (file)
@@ -41,9 +41,9 @@ const QColor AnalogSignal::SignalColours[4] = {
 
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
-AnalogSignal::AnalogSignal(const sr_probe *const probe,
+AnalogSignal::AnalogSignal(pv::SigSession &session, const sr_probe *const probe,
        shared_ptr<data::Analog> data) :
-       Signal(probe),
+       Signal(session, probe),
        _data(data),
        _scale(1.0f)
 {
index 42c15bb0fdf8d0f1379aeef4a06f009a4f9644b1..7815261ec8cf51d9352bbdb150a377591a062f26 100644 (file)
@@ -42,7 +42,7 @@ private:
        static const float EnvelopeThreshold;
 
 public:
-       AnalogSignal(const sr_probe *const probe,
+       AnalogSignal(pv::SigSession &session, const sr_probe *const probe,
                boost::shared_ptr<pv::data::Analog> data);
 
        virtual ~AnalogSignal();
index b684210b26667e3fcf7ee30e3447867d1708bb68..cca25df282b5328767ce42cd0ead3b4dadb1e302 100644 (file)
@@ -52,9 +52,9 @@ const QColor LogicSignal::SignalColours[10] = {
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
-LogicSignal::LogicSignal(const sr_probe *const probe,
+LogicSignal::LogicSignal(pv::SigSession &session, const sr_probe *const probe,
        shared_ptr<data::Logic> data) :
-       Signal(probe),
+       Signal(session, probe),
        _data(data),
        _separator(this),
        _icon_trigger_none(":/icons/trigger-none.svg"),
index c1b83d0ba5a64259624f21e62271dc3799e4f458..62b7c9ab1f9b085f02ed7dcaa43f2f59abb58acf 100644 (file)
@@ -45,7 +45,7 @@ private:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(const sr_probe *const probe,
+       LogicSignal(pv::SigSession &session, const sr_probe *const probe,
                boost::shared_ptr<pv::data::Logic> data);
 
        virtual ~LogicSignal();
index bb86d8cb6d0add9c3585c8690dee22c60d06579a..ab1426e0ed08d548e11157cfb074971c422e00f2 100644 (file)
@@ -52,7 +52,8 @@ const char *const ProbeNames[] = {
        "SCL"
 };
 
-Signal::Signal(const sr_probe *const probe) :
+Signal::Signal(pv::SigSession &session, const sr_probe *const probe) :
+       _session(session),
        _probe(probe),
        _name(probe->name),
        _v_offset(0),
index 5732e19d5f45e632630d382ddcc5b36ef581f8fe..eeef55389eb79384f5f84ccaa9542bb631b28999 100644 (file)
@@ -39,6 +39,8 @@
 
 namespace pv {
 
+class SigSession;
+
 namespace data {
 class SignalData;
 }
@@ -55,7 +57,7 @@ private:
        static const QPen SignalAxisPen;
 
 protected:
-       Signal(const sr_probe *const probe);
+       Signal(pv::SigSession &session, const sr_probe *const probe);
 
 public:
        /**
@@ -159,6 +161,7 @@ signals:
        void text_changed();    
 
 protected:
+       pv::SigSession &_session;
        const sr_probe *const _probe;
 
        QString _name;