connect(&_session, SIGNAL(signals_changed()),
this, SLOT(signals_changed()));
- connect(&_session, SIGNAL(data_updated()),
+ connect(&_session, SIGNAL(data_received()),
+ this, SLOT(data_updated()));
+ connect(&_session, SIGNAL(frame_ended()),
this, SLOT(data_updated()));
connect(_cursors.first().get(), SIGNAL(time_changed()),
_viewport->installEventFilter(this);
_ruler->installEventFilter(this);
_header->installEventFilter(this);
+
+ signals_changed();
}
SigSession& View::session()
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()
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()
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;
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 +
- d->get_max_sample_count() / d->samplerate());
+ d->get_max_sample_count() / samplerate);
}
assert(left_time < right_time);