projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a915c6a
)
Update the viewport as new data is decoded
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 7 Sep 2013 13:50:22 +0000
(14:50 +0100)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 29 Sep 2013 14:56:12 +0000
(23:56 +0900)
pv/data/decoder.cpp
patch
|
blob
|
history
pv/data/decoder.h
patch
|
blob
|
history
pv/view/decodesignal.cpp
patch
|
blob
|
history
pv/view/decodesignal.h
patch
|
blob
|
history
pv/view/view.cpp
patch
|
blob
|
history
pv/view/view.h
patch
|
blob
|
history
diff --git
a/pv/data/decoder.cpp
b/pv/data/decoder.cpp
index 787d1600bb89f5695c44c90625c06aed44a5cf0a..00b9e0b7efb0b87b3d508828922707e46f73f5e6 100644
(file)
--- a/
pv/data/decoder.cpp
+++ b/
pv/data/decoder.cpp
@@
-189,6
+189,8
@@
void Decoder::annotation_callback(srd_proto_data *pdata, void *decoder)
shared_ptr<Annotation> a(new Annotation(pdata));
lock_guard<mutex> lock(d->_annotations_mutex);
d->_annotations.push_back(a);
shared_ptr<Annotation> a(new Annotation(pdata));
lock_guard<mutex> lock(d->_annotations_mutex);
d->_annotations.push_back(a);
+
+ d->new_decode_data();
}
} // namespace data
}
} // namespace data
diff --git
a/pv/data/decoder.h
b/pv/data/decoder.h
index 8a0f00a42a5a731bb83b48d3a2c0bd6a3ce05e13..c881403b42e22f8f1391d4d80c94e2ecaee1cf12 100644
(file)
--- a/
pv/data/decoder.h
+++ b/
pv/data/decoder.h
@@
-83,6
+83,9
@@
private:
static void annotation_callback(srd_proto_data *pdata,
void *decoder);
static void annotation_callback(srd_proto_data *pdata,
void *decoder);
+signals:
+ void new_decode_data();
+
private:
const srd_decoder *const _decoder;
std::map<const srd_probe*, boost::shared_ptr<view::Signal> >
private:
const srd_decoder *const _decoder;
std::map<const srd_probe*, boost::shared_ptr<view::Signal> >
diff --git
a/pv/view/decodesignal.cpp
b/pv/view/decodesignal.cpp
index 514fbca339a0b07ca8f6349e0d1451b50c78647e..89d2c3212774cd229d72666a32cdd73f72e5ae8f 100644
(file)
--- a/
pv/view/decodesignal.cpp
+++ b/
pv/view/decodesignal.cpp
@@
-52,6
+52,9
@@
DecodeSignal::DecodeSignal(pv::SigSession &session,
assert(_decoder);
_colour = DecodeColours[index % countof(DecodeColours)];
assert(_decoder);
_colour = DecodeColours[index % countof(DecodeColours)];
+
+ connect(_decoder.get(), SIGNAL(new_decode_data()),
+ this, SLOT(on_new_decode_data()));
}
void DecodeSignal::init_context_bar_actions(QWidget *parent)
}
void DecodeSignal::init_context_bar_actions(QWidget *parent)
@@
-111,5
+114,11
@@
const list<QAction*> DecodeSignal::get_context_bar_actions()
return actions;
}
return actions;
}
+void DecodeSignal::on_new_decode_data()
+{
+ if (_view)
+ _view->update_viewport();
+}
+
} // namespace view
} // namespace pv
} // namespace view
} // namespace pv
diff --git
a/pv/view/decodesignal.h
b/pv/view/decodesignal.h
index a9ff265e0569ad59cea4b7be869347180d8310ed..673d65499509a409ca1266c5fbcd693ed4d97cd4 100644
(file)
--- a/
pv/view/decodesignal.h
+++ b/
pv/view/decodesignal.h
@@
-76,6
+76,9
@@
private:
**/
int get_nominal_offset(const QRect &rect) const;
**/
int get_nominal_offset(const QRect &rect) const;
+private slots:
+ void on_new_decode_data();
+
private:
boost::shared_ptr<pv::data::Decoder> _decoder;
private:
boost::shared_ptr<pv::data::Decoder> _decoder;
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index 54ab4ff9e2beb1d5892dd5d46e3bb4028474bc72..508b91c5c385ff7e34fae595105396ba94bc4d66 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-252,6
+252,12
@@
void View::normalize_layout()
v_scroll_value_changed(verticalScrollBar()->sliderPosition());
}
v_scroll_value_changed(verticalScrollBar()->sliderPosition());
}
+void View::update_viewport()
+{
+ assert(_viewport);
+ _viewport->update();
+}
+
void View::get_scroll_layout(double &length, double &offset) const
{
const shared_ptr<data::SignalData> sig_data = _session.get_data();
void View::get_scroll_layout(double &length, double &offset) const
{
const shared_ptr<data::SignalData> sig_data = _session.get_data();
diff --git
a/pv/view/view.h
b/pv/view/view.h
index 25e43b8a36c17b7feedf914c8fc2dd95e4c9cbac..c25ed78ada3f90a8cab3d6d4a9c7964c83c2a4a9 100644
(file)
--- a/
pv/view/view.h
+++ b/
pv/view/view.h
@@
-126,6
+126,8
@@
public:
void normalize_layout();
void normalize_layout();
+ void update_viewport();
+
signals:
void hover_point_changed();
signals:
void hover_point_changed();