return data;
}
+void DevInst::enable_probe(const sr_probe *probe, bool enable)
+{
+ for (const GSList *p = _sdi->probes; p; p = p->next)
+ if (probe == p->data) {
+ const_cast<sr_probe*>(probe)->enabled = enable;
+ return;
+ }
+
+ // Probe was not found in the device
+ assert(0);
+}
+
} // pv
#include <glib.h>
struct sr_dev_inst;
+struct sr_probe;
struct sr_probe_group;
namespace pv {
GVariant* list_config(const sr_probe_group *group, int key);
+ void enable_probe(const sr_probe *probe, bool enable = true);
+
signals:
void config_changed();
const float AnalogSignal::EnvelopeThreshold = 256.0f;
AnalogSignal::AnalogSignal(shared_ptr<pv::DevInst> dev_inst,
- sr_probe *const probe, shared_ptr<data::Analog> data) :
+ const sr_probe *const probe, shared_ptr<data::Analog> data) :
Signal(dev_inst, probe),
_data(data),
_scale(1.0f)
public:
AnalogSignal(boost::shared_ptr<pv::DevInst> dev_inst,
- sr_probe *const probe,
+ const sr_probe *const probe,
boost::shared_ptr<pv::data::Analog> data);
virtual ~AnalogSignal();
};
LogicSignal::LogicSignal(shared_ptr<pv::DevInst> dev_inst,
- sr_probe *const probe, shared_ptr<data::Logic> data) :
+ const sr_probe *const probe, shared_ptr<data::Logic> data) :
Signal(dev_inst, probe),
_data(data),
_trigger_none(NULL),
public:
LogicSignal(boost::shared_ptr<pv::DevInst> dev_inst,
- sr_probe *const probe,
+ const sr_probe *const probe,
boost::shared_ptr<pv::data::Logic> data);
virtual ~LogicSignal();
#include "signal.h"
#include "view.h"
+#include <pv/devinst.h>
+
using boost::shared_ptr;
namespace pv {
};
Signal::Signal(shared_ptr<pv::DevInst> dev_inst,
- sr_probe *const probe) :
+ const sr_probe *const probe) :
Trace(probe->name),
_dev_inst(dev_inst),
_probe(probe),
void Signal::enable(bool enable)
{
- _probe->enabled = enable;
+ _dev_inst->enable_probe(_probe, enable);
visibility_changed();
}
Q_OBJECT
protected:
- Signal(boost::shared_ptr<pv::DevInst> dev_inst, sr_probe *const probe);
+ Signal(boost::shared_ptr<pv::DevInst> dev_inst,
+ const sr_probe *const probe);
public:
/**
protected:
boost::shared_ptr<pv::DevInst> _dev_inst;
- sr_probe *const _probe;
+ const sr_probe *const _probe;
QComboBox *_name_widget;
bool _updating_name_widget;