From: Joel Holdsworth Date: Mon, 10 Feb 2014 21:46:18 +0000 (+0000) Subject: Removed SigSession from Trace X-Git-Tag: pulseview-0.2.0~74 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=83c23cc9fa0d4501d9e6b8759251fa6337f5d491;p=pulseview.git Removed SigSession from Trace --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index a2f44dab..5da1551f 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -442,7 +442,7 @@ void SigSession::update_signals(shared_ptr dev_inst) switch(probe->type) { case SR_PROBE_LOGIC: signal = shared_ptr( - new view::LogicSignal(*this, dev_inst, + new view::LogicSignal(dev_inst, probe, _logic_data)); break; @@ -451,7 +451,7 @@ void SigSession::update_signals(shared_ptr dev_inst) shared_ptr data( new data::Analog()); signal = shared_ptr( - new view::AnalogSignal(*this, dev_inst, + new view::AnalogSignal(dev_inst, probe, data)); break; } diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 84e55cc3..292d5f9e 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -44,10 +44,9 @@ const QColor AnalogSignal::SignalColours[4] = { const float AnalogSignal::EnvelopeThreshold = 256.0f; -AnalogSignal::AnalogSignal(pv::SigSession &session, - shared_ptr dev_inst, sr_probe *const probe, - shared_ptr data) : - Signal(session, dev_inst, probe), +AnalogSignal::AnalogSignal(shared_ptr dev_inst, + sr_probe *const probe, shared_ptr data) : + Signal(dev_inst, probe), _data(data), _scale(1.0f) { diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index 7c506a7a..a312b3e8 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -42,8 +42,8 @@ private: static const float EnvelopeThreshold; public: - AnalogSignal(pv::SigSession &session, - boost::shared_ptr dev_inst, sr_probe *const probe, + AnalogSignal(boost::shared_ptr dev_inst, + sr_probe *const probe, boost::shared_ptr data); virtual ~AnalogSignal(); diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 61f28565..ddf006ce 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -111,8 +111,9 @@ const QColor DecodeTrace::OutlineColours[16] = { DecodeTrace::DecodeTrace(pv::SigSession &session, boost::shared_ptr decoder_stack, int index) : - Trace(session, QString::fromUtf8( + Trace(QString::fromUtf8( decoder_stack->stack().front()->decoder()->name)), + _session(session), _decoder_stack(decoder_stack), _delete_mapper(this), _show_hide_mapper(this) diff --git a/pv/view/decodetrace.h b/pv/view/decodetrace.h index cd8a82d6..08558c98 100644 --- a/pv/view/decodetrace.h +++ b/pv/view/decodetrace.h @@ -39,6 +39,8 @@ class QComboBox; namespace pv { +class SigSession; + namespace data { class DecoderStack; @@ -158,6 +160,7 @@ private slots: void on_show_hide_decoder(int index); private: + pv::SigSession &_session; boost::shared_ptr _decoder_stack; uint64_t _decode_start, _decode_end; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 57a988c3..7eb56da6 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -63,10 +63,9 @@ const QColor LogicSignal::SignalColours[10] = { QColor(0xEE, 0xEE, 0xEC), // White }; -LogicSignal::LogicSignal(pv::SigSession &session, - shared_ptr dev_inst, sr_probe *const probe, - shared_ptr data) : - Signal(session, dev_inst, probe), +LogicSignal::LogicSignal(shared_ptr dev_inst, + sr_probe *const probe, shared_ptr data) : + Signal(dev_inst, probe), _data(data), _trigger_none(NULL), _trigger_rising(NULL), diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index 701dbbf7..cc63884e 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -49,8 +49,8 @@ private: static const QColor SignalColours[10]; public: - LogicSignal(pv::SigSession &session, - boost::shared_ptr dev_inst, sr_probe *const probe, + LogicSignal(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 ba1271b0..f054eb2a 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -54,9 +54,9 @@ const char *const ProbeNames[] = { "SCL" }; -Signal::Signal(pv::SigSession &session, shared_ptr dev_inst, +Signal::Signal(shared_ptr dev_inst, sr_probe *const probe) : - Trace(session, probe->name), + Trace(probe->name), _dev_inst(dev_inst), _probe(probe), _name_widget(NULL), diff --git a/pv/view/signal.h b/pv/view/signal.h index 70b908b1..a8642d24 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -47,8 +47,7 @@ class Signal : public Trace Q_OBJECT protected: - Signal(pv::SigSession &session, boost::shared_ptr dev_inst, - sr_probe *const probe); + Signal(boost::shared_ptr dev_inst, sr_probe *const probe); public: /** diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 4fe9628c..d4bc69f2 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -40,8 +40,7 @@ namespace view { const QPen Trace::AxisPen(QColor(128, 128, 128, 64)); const int Trace::LabelHitPadding = 2; -Trace::Trace(pv::SigSession &session, QString name) : - _session(session), +Trace::Trace(QString name) : _name(name), _v_offset(0), _popup(NULL), diff --git a/pv/view/trace.h b/pv/view/trace.h index 2d8c7cf1..ace93d50 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -34,9 +34,6 @@ class QFormLayout; namespace pv { - -class SigSession; - namespace view { class View; @@ -50,7 +47,7 @@ private: static const int LabelHitPadding; protected: - Trace(SigSession &session, QString name); + Trace(QString name); public: /** @@ -189,7 +186,6 @@ signals: void colour_changed(); protected: - pv::SigSession &_session; pv::view::View *_view; QString _name;