From: Joel Holdsworth Date: Mon, 10 Feb 2014 21:26:32 +0000 (+0000) Subject: Added DevInst pointer to Signal X-Git-Tag: pulseview-0.2.0~76 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8d3e0764def48fdf19dc9100c87bbb42da5a9d6d;p=pulseview.git Added DevInst pointer to Signal --- diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index 3767e485..b293cacb 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include "decoder.h" diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 809509bb..a2f44dab 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -442,8 +442,8 @@ void SigSession::update_signals(shared_ptr dev_inst) switch(probe->type) { case SR_PROBE_LOGIC: signal = shared_ptr( - 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 dev_inst) shared_ptr data( new data::Analog()); signal = shared_ptr( - new view::AnalogSignal(*this, probe, - data)); + new view::AnalogSignal(*this, dev_inst, + probe, data)); break; } diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 9cc3547d..84e55cc3 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -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 dev_inst, sr_probe *const probe, shared_ptr data) : - Signal(session, probe), + Signal(session, dev_inst, probe), _data(data), _scale(1.0f) { diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index 4b7b3bc3..7c506a7a 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -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 dev_inst, sr_probe *const probe, boost::shared_ptr data); virtual ~AnalogSignal(); diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 8e0ea27d..81ddd6e9 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -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 dev_inst, sr_probe *const probe, shared_ptr data) : - Signal(session, probe), + Signal(session, dev_inst, probe), _data(data), _trigger_none(NULL), _trigger_rising(NULL), diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index 992745eb..701dbbf7 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -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 dev_inst, sr_probe *const probe, boost::shared_ptr data); virtual ~LogicSignal(); diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 1f00477a..ba1271b0 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -27,9 +27,13 @@ #include #include +#include + #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 dev_inst, + sr_probe *const probe) : Trace(session, probe->name), + _dev_inst(dev_inst), _probe(probe), _name_widget(NULL), _updating_name_widget(false) diff --git a/pv/view/signal.h b/pv/view/signal.h index bdbd27a3..70b908b1 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -28,12 +28,14 @@ #include -#include - #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 dev_inst, + sr_probe *const probe); public: /** @@ -74,6 +77,7 @@ private slots: void on_disable(); protected: + boost::shared_ptr _dev_inst; sr_probe *const _probe; QComboBox *_name_widget;