]> sigrok.org Git - pulseview.git/commitdiff
Signal: Added a reference to _session
authorJoel Holdsworth <redacted>
Thu, 13 Nov 2014 12:31:56 +0000 (12:31 +0000)
committerUwe Hermann <redacted>
Thu, 13 Nov 2014 18:34:39 +0000 (19:34 +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 eb4cd5138bd23bca0f616305f066a972b18da5ac..2d695af3837af60b95eb1b0cb59e280142f9ff28 100644 (file)
@@ -359,7 +359,8 @@ void SigSession::update_signals(shared_ptr<Device> device)
                        switch(channel->type()->id()) {
                        case SR_CHANNEL_LOGIC:
                                signal = shared_ptr<view::Signal>(
-                                       new view::LogicSignal(device, channel, _logic_data));
+                                       new view::LogicSignal(*this, device,
+                                               channel, _logic_data));
                                break;
 
                        case SR_CHANNEL_ANALOG:
@@ -367,7 +368,8 @@ void SigSession::update_signals(shared_ptr<Device> device)
                                shared_ptr<data::Analog> data(
                                        new data::Analog());
                                signal = shared_ptr<view::Signal>(
-                                       new view::AnalogSignal(channel, data));
+                                       new view::AnalogSignal(
+                                               *this, channel, data));
                                break;
                        }
 
index 7b49bbd2b7d454606d2ac5d51e482a331ca1b01c..38468942a79ad594d7854cd43029aea08e75a3a7 100644 (file)
@@ -49,9 +49,11 @@ const QColor AnalogSignal::SignalColours[4] = {
 
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
-AnalogSignal::AnalogSignal(shared_ptr<Channel> channel,
+AnalogSignal::AnalogSignal(
+       pv::SigSession &session,
+       shared_ptr<Channel> channel,
        shared_ptr<data::Analog> data) :
-       Signal(channel),
+       Signal(session, channel),
        _data(data),
        _scale(1.0f)
 {
index 4070a8aa199ecb29834559e912df27a9ad683fb6..a7ae455b8598159e47c738a48cc5e8176ace3ed7 100644 (file)
@@ -42,7 +42,8 @@ private:
        static const float EnvelopeThreshold;
 
 public:
-       AnalogSignal(std::shared_ptr<sigrok::Channel> channel,
+       AnalogSignal(pv::SigSession &session,
+               std::shared_ptr<sigrok::Channel> channel,
                std::shared_ptr<pv::data::Analog> data);
 
        virtual ~AnalogSignal();
index 76890aa0d5880d1c17b862f4e72d0ed2ad766989..e214ec78426c505d621808fb38e9e5f34dc65462 100644 (file)
@@ -72,10 +72,12 @@ const QColor LogicSignal::SignalColours[10] = {
        QColor(0xEE, 0xEE, 0xEC),       // White
 };
 
-LogicSignal::LogicSignal(shared_ptr<Device> device,
-               shared_ptr<Channel> channel,
-               shared_ptr<data::Logic> data) :
-       Signal(channel),
+LogicSignal::LogicSignal(
+       pv::SigSession &session,
+       shared_ptr<Device> device,
+       shared_ptr<Channel> channel,
+       shared_ptr<data::Logic> data) :
+       Signal(session, channel),
        _device(device),
        _data(data),
        _trigger_none(NULL),
index 11b1d2bdd6a18933e26804f2203ce80836979cfd..481293808824e52be05173f09456363d77216968 100644 (file)
@@ -54,7 +54,8 @@ private:
        static const QColor SignalColours[10];
 
 public:
-       LogicSignal(std::shared_ptr<sigrok::Device> device,
+       LogicSignal(pv::SigSession &session,
+               std::shared_ptr<sigrok::Device> device,
                std::shared_ptr<sigrok::Channel> channel,
                std::shared_ptr<pv::data::Logic> data);
 
index 16ebc74d24a890f70f8ca3f5bf0d8b1335506f5b..fab76fcfd1f1fcbf593d3cb853eff457ba70f8cb 100644 (file)
@@ -58,8 +58,10 @@ const char *const ChannelNames[] = {
        "SCL"
 };
 
-Signal::Signal(shared_ptr<Channel> channel) :
+Signal::Signal(pv::SigSession &session,
+       std::shared_ptr<sigrok::Channel> channel) :
        Trace(channel->name().c_str()),
+       _session(session),
        _channel(channel),
        _name_widget(NULL),
        _updating_name_widget(false)
index 7028b29e9fb31cdc182b5396ba2e7fa7f9ba75b8..b7666ee6f1cd14c3a0256db621b0081579abe1fb 100644 (file)
@@ -36,6 +36,8 @@ namespace sigrok {
 
 namespace pv {
 
+class SigSession;
+
 namespace data {
 class SignalData;
 }
@@ -47,7 +49,8 @@ class Signal : public Trace
        Q_OBJECT
 
 protected:
-       Signal(std::shared_ptr<sigrok::Channel> channel);
+       Signal(pv::SigSession &session,
+               std::shared_ptr<sigrok::Channel> channel);
 
 public:
        /**
@@ -76,6 +79,7 @@ private Q_SLOTS:
        void on_disable();
 
 protected:
+       pv::SigSession &_session;
        std::shared_ptr<sigrok::Channel> _channel;
 
        QComboBox *_name_widget;