projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a pointer to the current View inside Trace
[pulseview.git]
/
pv
/
view
/
analogsignal.cpp
diff --git
a/pv/view/analogsignal.cpp
b/pv/view/analogsignal.cpp
index 367b5890d7d6ef46f078c732cd579a2b4a5daa09..681386ff6b91f9c69e4f1a84f350b08675551b43 100644
(file)
--- a/
pv/view/analogsignal.cpp
+++ b/
pv/view/analogsignal.cpp
@@
-25,6
+25,7
@@
#include "analogsignal.h"
#include "pv/data/analog.h"
#include "pv/data/analogsnapshot.h"
#include "analogsignal.h"
#include "pv/data/analog.h"
#include "pv/data/analogsnapshot.h"
+#include "pv/view/view.h"
using namespace boost;
using namespace std;
using namespace boost;
using namespace std;
@@
-41,31
+42,47
@@
const QColor AnalogSignal::SignalColours[4] = {
const float AnalogSignal::EnvelopeThreshold = 256.0f;
const float AnalogSignal::EnvelopeThreshold = 256.0f;
-AnalogSignal::AnalogSignal(
QString name, shared_ptr<data::Analog> data
,
-
int probe_index
) :
- Signal(
nam
e),
+AnalogSignal::AnalogSignal(
pv::SigSession &session, const sr_probe *const probe
,
+
shared_ptr<data::Analog> data
) :
+ Signal(
session, prob
e),
_data(data),
_scale(1.0f)
{
_data(data),
_scale(1.0f)
{
- _colour = SignalColours[probe
_
index % countof(SignalColours)];
+ _colour = SignalColours[probe
->
index % countof(SignalColours)];
}
AnalogSignal::~AnalogSignal()
{
}
}
AnalogSignal::~AnalogSignal()
{
}
+const list<QAction*> AnalogSignal::get_context_bar_actions()
+{
+ list<QAction*> actions;
+ actions.push_back(_name_action);
+ return actions;
+}
+
void AnalogSignal::set_scale(float scale)
{
_scale = scale;
}
void AnalogSignal::set_scale(float scale)
{
_scale = scale;
}
-void AnalogSignal::paint(QPainter &p, int y, int left, int right, double scale,
- double offset)
+void AnalogSignal::paint(QPainter &p, int left, int right)
{
{
- assert(scale > 0);
assert(_data);
assert(right >= left);
assert(_data);
assert(right >= left);
+ assert(_view);
+ const int y = _v_offset - _view->v_offset();
+
+ const double scale = _view->scale();
+ assert(scale > 0);
+
+ const double offset = _view->offset();
+
+ if (!_probe->enabled)
+ return;
+
paint_axis(p, y, left, right);
const deque< shared_ptr<pv::data::AnalogSnapshot> > &snapshots =
paint_axis(p, y, left, right);
const deque< shared_ptr<pv::data::AnalogSnapshot> > &snapshots =