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 89c375cc0551cb7689e7b63a4693b70c8d962f3b..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,8
+64,8
@@
const QColor LogicSignal::SignalColours[10] = {
QColor(0xEE, 0xEE, 0xEC), // White
};
QColor(0xEE, 0xEE, 0xEC), // White
};
-LogicSignal::LogicSignal(shared_ptr<pv::DevInst> dev_inst,
- const sr_
probe
*const probe, shared_ptr<data::Logic> data) :
+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),
Signal(dev_inst, probe),
_data(data),
_trigger_none(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 -
@@
-248,7
+246,7
@@
void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form)
// Add the trigger actions
assert(_dev_inst);
// Add the trigger actions
assert(_dev_inst);
- if (
!
(gvar = _dev_inst->list_config(NULL, SR_CONF_TRIGGER_TYPE)))
+ 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);
@@
-306,7
+304,7
@@
void LogicSignal::set_trigger(char type)
const sr_dev_inst *const sdi = _dev_inst->dev_inst();
assert(sdi);
const sr_dev_inst *const sdi = _dev_inst->dev_inst();
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);