projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CursorHeader: Use the same number format as the ruler.
[pulseview.git]
/
pv
/
view
/
logicsignal.cpp
diff --git
a/pv/view/logicsignal.cpp
b/pv/view/logicsignal.cpp
index bc6e09fa2aaf9e63adad840686ec7d3cdd634e98..77771f82e494d4f3d953c1b4006ad173a32debf2 100644
(file)
--- a/
pv/view/logicsignal.cpp
+++ b/
pv/view/logicsignal.cpp
@@
-20,7
+20,8
@@
#include <extdef.h>
#include <extdef.h>
-#include <math.h>
+#include <cassert>
+#include <cmath>
#include <QFormLayout>
#include <QToolBar>
#include <QFormLayout>
#include <QToolBar>
@@
-29,16
+30,16
@@
#include "view.h"
#include <pv/sigsession.h>
#include "view.h"
#include <pv/sigsession.h>
-#include <pv/devinst.h>
+#include <pv/devi
ce/devi
nst.h>
#include <pv/data/logic.h>
#include <pv/data/logicsnapshot.h>
#include <pv/view/view.h>
#include <pv/data/logic.h>
#include <pv/data/logicsnapshot.h>
#include <pv/view/view.h>
-using boost::shared_ptr;
using std::deque;
using std::max;
using std::min;
using std::pair;
using std::deque;
using std::max;
using std::min;
using std::pair;
+using std::shared_ptr;
using std::vector;
namespace pv {
using std::vector;
namespace pv {
@@
-63,9
+64,9
@@
const QColor LogicSignal::SignalColours[10] = {
QColor(0xEE, 0xEE, 0xEC), // White
};
QColor(0xEE, 0xEE, 0xEC), // White
};
-LogicSignal::LogicSignal(
pv::SigSession &session, sr_probe *const probe
,
- shared_ptr<data::Logic> data) :
- Signal(
session
, probe),
+LogicSignal::LogicSignal(
shared_ptr<pv::device::DevInst> dev_inst
,
+
const sr_channel *const probe,
shared_ptr<data::Logic> data) :
+ Signal(
dev_inst
, probe),
_data(data),
_trigger_none(NULL),
_trigger_rising(NULL),
_data(data),
_trigger_none(NULL),
_trigger_rising(NULL),
@@
-155,9
+156,7
@@
void LogicSignal::paint_mid(QPainter &p, int left, int right)
QLineF *const edge_lines = new QLineF[edge_count];
line = edge_lines;
QLineF *const edge_lines = new QLineF[edge_count];
line = edge_lines;
- for (vector<pv::data::LogicSnapshot::EdgePair>::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);
const float x = ((*i).first / samples_per_pixel -
pixels_offset) + left;
*line++ = QLineF(x, high_offset, x, low_offset);
@@
-188,8
+187,7
@@
void LogicSignal::paint_caps(QPainter &p, QLineF *const lines,
{
QLineF *line = lines;
{
QLineF *line = lines;
- for (vector<pv::data::LogicSnapshot::EdgePair>::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 -
if ((*i).second == level) {
*line++ = QLineF(
((*i).first / samples_per_pixel -
@@
-247,14
+245,8
@@
void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form)
Signal::populate_popup_form(parent, form);
// Add the trigger actions
Signal::populate_popup_form(parent, form);
// Add the trigger actions
- boost::shared_ptr<DevInst> 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);
{
const char *const trig_types =
g_variant_get_string(gvar, NULL);
@@
-308,13
+300,11
@@
void LogicSignal::set_trigger(char type)
const char *const trigger_string =
(type != 0) ? trigger_type_string : NULL;
const char *const trigger_string =
(type != 0) ? trigger_type_string : NULL;
- boost::shared_ptr<DevInst> 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);
assert(sdi);
- const int probe_count = g_slist_length(sdi->
probe
s);
+ const int probe_count = g_slist_length(sdi->
channel
s);
assert(probe_count > 0);
assert(_probe && _probe->index < probe_count);
assert(probe_count > 0);
assert(_probe && _probe->index < probe_count);