From: Joel Holdsworth Date: Mon, 27 May 2013 09:36:33 +0000 (+0100) Subject: Added _session reference to Signal objects X-Git-Tag: pulseview-0.2.0~338 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c0f868521a211747f89ef217ae63404f373d952b;p=pulseview.git Added _session reference to Signal objects --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 0de7c4a7..793a5e8a 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -304,13 +304,13 @@ void SigSession::update_signals() switch(probe->type) { case SR_PROBE_LOGIC: signal = shared_ptr( - new view::LogicSignal(probe, + new view::LogicSignal(*this, probe, _logic_data)); break; case SR_PROBE_ANALOG: signal = shared_ptr( - new view::AnalogSignal(probe, + new view::AnalogSignal(*this, probe, _analog_data)); break; } diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 7c906b52..6b81fda7 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -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) : - Signal(probe), + Signal(session, probe), _data(data), _scale(1.0f) { diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index 42c15bb0..7815261e 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -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 data); virtual ~AnalogSignal(); diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index b684210b..cca25df2 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -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) : - Signal(probe), + Signal(session, probe), _data(data), _separator(this), _icon_trigger_none(":/icons/trigger-none.svg"), diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index c1b83d0b..62b7c9ab 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -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 data); virtual ~LogicSignal(); diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index bb86d8cb..ab1426e0 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -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), diff --git a/pv/view/signal.h b/pv/view/signal.h index 5732e19d..eeef5538 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -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;