projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved default device functionality into SigSession
[pulseview.git]
/
pv
/
view
/
view.cpp
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index a437918d9f2a88f3001f35ae9eb33b854530924c..2b0f04a5952983ec3c4909fed12e112c4a34fc3e 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-120,6
+120,8
@@
View::View(SigSession &session, QWidget *parent) :
_viewport->installEventFilter(this);
_ruler->installEventFilter(this);
_header->installEventFilter(this);
_viewport->installEventFilter(this);
_ruler->installEventFilter(this);
_header->installEventFilter(this);
+
+ signals_changed();
}
SigSession& View::session()
}
SigSession& View::session()
@@
-154,9
+156,7
@@
void View::zoom(double steps)
void View::zoom(double steps, int offset)
{
void View::zoom(double steps, int offset)
{
- const double new_scale = max(min(_scale * pow(3.0/2.0, -steps),
- MaxScale), MinScale);
- set_zoom(new_scale, offset);
+ set_zoom(_scale * pow(3.0/2.0, -steps), offset);
}
void View::zoom_fit()
}
void View::zoom_fit()
@@
-171,7
+171,8
@@
void View::zoom_fit()
if (w <= 0)
return;
if (w <= 0)
return;
- set_scale_offset(delta / w, extents.first);
+ const double scale = max(min(delta / w, MaxScale), MinScale);
+ set_scale_offset(scale, extents.first);
}
void View::zoom_one_to_one()
}
void View::zoom_one_to_one()
@@
-182,11
+183,7
@@
void View::zoom_one_to_one()
session().get_signals());
// Make a set of all the visible data objects
session().get_signals());
// Make a set of all the visible data objects
- set< shared_ptr<SignalData> > visible_data;
- BOOST_FOREACH(const shared_ptr<Signal> sig, sigs)
- if (sig->enabled())
- visible_data.insert(sig->data());
-
+ set< shared_ptr<SignalData> > visible_data = get_visible_data();
if (visible_data.empty())
return;
if (visible_data.empty())
return;
@@
-286,9
+283,12
@@
pair<double, double> View::get_time_extents() const
BOOST_FOREACH(const shared_ptr<SignalData> d, visible_data)
{
const double start_time = d->get_start_time();
BOOST_FOREACH(const shared_ptr<SignalData> d, visible_data)
{
const double start_time = d->get_start_time();
+ double samplerate = d->samplerate();
+ samplerate = (samplerate <= 0.0) ? 1.0 : samplerate;
+
left_time = min(left_time, start_time);
right_time = max(right_time, start_time +
left_time = min(left_time, start_time);
right_time = max(right_time, start_time +
- d->get_max_sample_count() /
d->samplerate()
);
+ d->get_max_sample_count() /
samplerate
);
}
assert(left_time < right_time);
}
assert(left_time < right_time);