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 f4a665c2ec49f225a5c8f246937e713923f89295..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,9
+42,9
@@
const QColor AnalogSignal::SignalColours[4] = {
const float AnalogSignal::EnvelopeThreshold = 256.0f;
const float AnalogSignal::EnvelopeThreshold = 256.0f;
-AnalogSignal::AnalogSignal(const sr_probe *const probe,
+AnalogSignal::AnalogSignal(
pv::SigSession &session,
const sr_probe *const probe,
shared_ptr<data::Analog> data) :
shared_ptr<data::Analog> data) :
- Signal(probe),
+ Signal(
session,
probe),
_data(data),
_scale(1.0f)
{
_data(data),
_scale(1.0f)
{
@@
-54,18
+55,31
@@
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;
if (!_probe->enabled)
return;