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:
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;
}
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)
{
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();
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),
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);
"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)
namespace pv {
+class SigSession;
+
namespace data {
class SignalData;
}
Q_OBJECT
protected:
- Signal(std::shared_ptr<sigrok::Channel> channel);
+ Signal(pv::SigSession &session,
+ std::shared_ptr<sigrok::Channel> channel);
public:
/**
void on_disable();
protected:
+ pv::SigSession &_session;
std::shared_ptr<sigrok::Channel> _channel;
QComboBox *_name_widget;