X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Flogicsignal.cpp;h=8363383ac2125bfae2b04c21fa30d5749f87b147;hb=f9abf97e78bc4825d80926b0ebc6cbaef40768b1;hp=bc6e09fa2aaf9e63adad840686ec7d3cdd634e98;hpb=19adbc2c342b190161ec1223377a3619974b91f7;p=pulseview.git diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index bc6e09f..8363383 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -29,16 +29,16 @@ #include "view.h" #include -#include +#include #include #include #include -using boost::shared_ptr; using std::deque; using std::max; using std::min; using std::pair; +using std::shared_ptr; using std::vector; namespace pv { @@ -63,9 +63,9 @@ const QColor LogicSignal::SignalColours[10] = { QColor(0xEE, 0xEE, 0xEC), // White }; -LogicSignal::LogicSignal(pv::SigSession &session, sr_probe *const probe, - shared_ptr data) : - Signal(session, probe), +LogicSignal::LogicSignal(shared_ptr dev_inst, + const sr_channel *const probe, shared_ptr data) : + Signal(dev_inst, probe), _data(data), _trigger_none(NULL), _trigger_rising(NULL), @@ -155,9 +155,7 @@ void LogicSignal::paint_mid(QPainter &p, int left, int right) QLineF *const edge_lines = new QLineF[edge_count]; line = edge_lines; - for (vector::const_iterator i = - edges.begin() + 1; - i != edges.end() - 1; i++) { + for (auto i = edges.cbegin() + 1; i != edges.cend() - 1; i++) { const float x = ((*i).first / samples_per_pixel - pixels_offset) + left; *line++ = QLineF(x, high_offset, x, low_offset); @@ -188,8 +186,7 @@ void LogicSignal::paint_caps(QPainter &p, QLineF *const lines, { QLineF *line = lines; - for (vector::const_iterator i = - edges.begin(); i != (edges.end() - 1); i++) + for (auto i = edges.begin(); i != (edges.end() - 1); i++) if ((*i).second == level) { *line++ = QLineF( ((*i).first / samples_per_pixel - @@ -247,14 +244,8 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form) Signal::populate_popup_form(parent, form); // Add the trigger actions - boost::shared_ptr dev_inst = _session.get_device(); - assert(dev_inst); - - const sr_dev_inst *const sdi = dev_inst->dev_inst(); - assert(sdi); - - if (sr_config_list(sdi->driver, sdi, NULL, SR_CONF_TRIGGER_TYPE, - &gvar) == SR_OK) + assert(_dev_inst); + if ((gvar = _dev_inst->list_config(NULL, SR_CONF_TRIGGER_TYPE))) { const char *const trig_types = g_variant_get_string(gvar, NULL); @@ -308,13 +299,11 @@ void LogicSignal::set_trigger(char type) const char *const trigger_string = (type != 0) ? trigger_type_string : NULL; - boost::shared_ptr dev_inst = _session.get_device(); - assert(dev_inst); - - const sr_dev_inst *const sdi = dev_inst->dev_inst(); + assert(_dev_inst); + 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);