This is an update related to bug #259.
bool Device::is_trigger_enabled() const
{
assert(_sdi);
- for (const GSList *l = _sdi->probes; l; l = l->next) {
- const sr_probe *const p = (const sr_probe *)l->data;
+ for (const GSList *l = _sdi->channels; l; l = l->next) {
+ const sr_channel *const p = (const sr_channel *)l->data;
assert(p);
if (p->trigger && p->trigger[0] != '\0')
return true;
return data;
}
-void DevInst::enable_probe(const sr_probe *probe, bool enable)
+void DevInst::enable_probe(const sr_channel *probe, bool enable)
{
assert(_owner);
sr_dev_inst *const sdi = dev_inst();
assert(sdi);
- for (const GSList *p = sdi->probes; p; p = p->next)
+ for (const GSList *p = sdi->channels; p; p = p->next)
if (probe == p->data) {
- const_cast<sr_probe*>(probe)->enabled = enable;
+ const_cast<sr_channel*>(probe)->enabled = enable;
config_changed();
return;
}
#include <stdint.h>
struct sr_dev_inst;
-struct sr_probe;
+struct sr_channel;
struct sr_channel_group;
namespace pv {
GVariant* list_config(const sr_channel_group *group, int key);
- void enable_probe(const sr_probe *probe, bool enable = true);
+ void enable_probe(const sr_channel *probe, bool enable = true);
/**
* @brief Gets the sample limit from the driver.
const string title = dev_inst->format_device_title();
QString text = QString::fromUtf8(title.c_str());
- if (sdi->probes) {
+ if (sdi->channels) {
text += QString(" with %1 probes").arg(
- g_slist_length(sdi->probes));
+ g_slist_length(sdi->channels));
}
QListWidgetItem *const item = new QListWidgetItem(text,
assert(sdi);
// Collect a set of signals
- map<const sr_probe*, shared_ptr<Signal> > signal_map;
+ map<const sr_channel*, shared_ptr<Signal> > signal_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
BOOST_FOREACH(const shared_ptr<Signal> &sig, sigs)
signal_map[sig->probe()] = sig;
// Make a set of signals, and removed this signals from the
// signal map.
vector< shared_ptr<Signal> > group_sigs;
- for (const GSList *p = group->probes; p; p = p->next)
+ for (const GSList *p = group->channels; p; p = p->next)
{
- const sr_probe *const probe = (const sr_probe*)p->data;
+ const sr_channel *const probe = (const sr_channel*)p->data;
assert(probe);
- const map<const sr_probe*, shared_ptr<Signal> >::
+ const map<const sr_channel*, shared_ptr<Signal> >::
iterator iter = signal_map.find(probe);
assert(iter != signal_map.end());
// Make a vector of the remaining probes
vector< shared_ptr<Signal> > global_sigs;
- for (const GSList *p = sdi->probes; p; p = p->next)
+ for (const GSList *p = sdi->channels; p; p = p->next)
{
- const sr_probe *const probe = (const sr_probe*)p->data;
+ const sr_channel *const probe = (const sr_channel*)p->data;
assert(probe);
- const map<const sr_probe*, shared_ptr<Signal> >::
+ const map<const sr_channel*, shared_ptr<Signal> >::
const_iterator iter = signal_map.find(probe);
if (iter != signal_map.end())
global_sigs.push_back((*iter).second);
// Check that at least one probe is enabled
const GSList *l;
- for (l = _dev_inst->dev_inst()->probes; l; l = l->next) {
- sr_probe *const probe = (sr_probe*)l->data;
+ for (l = _dev_inst->dev_inst()->channels; l; l = l->next) {
+ sr_channel *const probe = (sr_channel*)l->data;
assert(probe);
if (probe->enabled)
break;
}
if (!l) {
- error_handler(tr("No probes enabled."));
+ error_handler(tr("No channels enabled."));
return;
}
// Detect what data types we will receive
if(dev_inst) {
assert(dev_inst->dev_inst());
- for (const GSList *l = dev_inst->dev_inst()->probes;
+ for (const GSList *l = dev_inst->dev_inst()->channels;
l; l = l->next) {
- const sr_probe *const probe = (const sr_probe *)l->data;
+ const sr_channel *const probe = (const sr_channel *)l->data;
if (!probe->enabled)
continue;
switch(probe->type) {
- case SR_PROBE_LOGIC:
+ case SR_CHANNEL_LOGIC:
logic_probe_count++;
break;
}
break;
assert(dev_inst->dev_inst());
- for (const GSList *l = dev_inst->dev_inst()->probes;
+ for (const GSList *l = dev_inst->dev_inst()->channels;
l; l = l->next) {
shared_ptr<view::Signal> signal;
- sr_probe *const probe = (sr_probe *)l->data;
+ sr_channel *const probe = (sr_channel *)l->data;
assert(probe);
switch(probe->type) {
- case SR_PROBE_LOGIC:
+ case SR_CHANNEL_LOGIC:
signal = shared_ptr<view::Signal>(
new view::LogicSignal(dev_inst,
probe, _logic_data));
break;
- case SR_PROBE_ANALOG:
+ case SR_CHANNEL_ANALOG:
{
shared_ptr<data::Analog> data(
new data::Analog());
}
shared_ptr<view::Signal> SigSession::signal_from_probe(
- const sr_probe *probe) const
+ const sr_channel *probe) const
{
lock_guard<mutex> lock(_signals_mutex);
BOOST_FOREACH(shared_ptr<view::Signal> sig, _signals) {
{
lock_guard<mutex> lock(_data_mutex);
- const unsigned int probe_count = g_slist_length(analog.probes);
+ const unsigned int probe_count = g_slist_length(analog.channels);
const size_t sample_count = analog.num_samples / probe_count;
const float *data = analog.data;
bool sweep_beginning = false;
- for (GSList *p = analog.probes; p; p = p->next)
+ for (GSList *p = analog.channels; p; p = p->next)
{
shared_ptr<data::AnalogSnapshot> snapshot;
- sr_probe *const probe = (sr_probe*)p->data;
+ sr_channel *const probe = (sr_channel*)p->data;
assert(probe);
// Try to get the snapshot of the probe
- const map< const sr_probe*, shared_ptr<data::AnalogSnapshot> >::
+ const map< const sr_channel*, shared_ptr<data::AnalogSnapshot> >::
iterator iter = _cur_analog_snapshots.find(probe);
if (iter != _cur_analog_snapshots.end())
snapshot = (*iter).second;
void update_signals(boost::shared_ptr<device::DevInst> dev_inst);
boost::shared_ptr<view::Signal> signal_from_probe(
- const sr_probe *probe) const;
+ const sr_channel *probe) const;
void read_sample_rate(const sr_dev_inst *const sdi);
mutable boost::mutex _data_mutex;
boost::shared_ptr<data::Logic> _logic_data;
boost::shared_ptr<data::LogicSnapshot> _cur_logic_snapshot;
- std::map< const sr_probe*, boost::shared_ptr<data::AnalogSnapshot> >
+ std::map< const sr_channel*, boost::shared_ptr<data::AnalogSnapshot> >
_cur_analog_snapshots;
boost::thread _sampling_thread;
const float AnalogSignal::EnvelopeThreshold = 256.0f;
AnalogSignal::AnalogSignal(shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe, shared_ptr<data::Analog> data) :
+ const sr_channel *const probe, shared_ptr<data::Analog> data) :
Signal(dev_inst, probe),
_data(data),
_scale(1.0f)
public:
AnalogSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe,
+ const sr_channel *const probe,
boost::shared_ptr<pv::data::Analog> data);
virtual ~AnalogSignal();
};
LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe, shared_ptr<data::Logic> data) :
+ const sr_channel *const probe, shared_ptr<data::Logic> data) :
Signal(dev_inst, probe),
_data(data),
_trigger_none(NULL),
const sr_dev_inst *const sdi = _dev_inst->dev_inst();
assert(sdi);
- const int probe_count = g_slist_length(sdi->probes);
+ const int probe_count = g_slist_length(sdi->channels);
assert(probe_count > 0);
assert(_probe && _probe->index < probe_count);
public:
LogicSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe,
+ const sr_channel *const probe,
boost::shared_ptr<pv::data::Logic> data);
virtual ~LogicSignal();
};
Signal::Signal(shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe) :
+ const sr_channel *const probe) :
Trace(probe->name),
_dev_inst(dev_inst),
_probe(probe),
visibility_changed();
}
-const sr_probe* Signal::probe() const
+const sr_channel* Signal::probe() const
{
return _probe;
}
#include "trace.h"
-struct sr_probe;
+struct sr_channel;
namespace pv {
protected:
Signal(boost::shared_ptr<pv::device::DevInst> dev_inst,
- const sr_probe *const probe);
+ const sr_channel *const probe);
public:
/**
void enable(bool enable = true);
- const sr_probe* probe() const;
+ const sr_channel* probe() const;
virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
protected:
boost::shared_ptr<pv::device::DevInst> _dev_inst;
- const sr_probe *const _probe;
+ const sr_channel *const _probe;
QComboBox *_name_widget;
bool _updating_name_widget;