if (visible_data.empty())
return;
- double samplerate = 0.0;
- for (const shared_ptr<SignalData> d : visible_data) {
- assert(d);
- const vector< shared_ptr<Segment> > segments =
- d->segments();
- for (const shared_ptr<Segment> &s : segments)
- samplerate = max(samplerate, s->samplerate());
- }
-
- if (samplerate == 0.0)
- return;
-
assert(viewport_);
const int w = viewport_->width();
if (w <= 0)
return;
- set_zoom(1.0 / samplerate, w / 2);
+ set_zoom(1.0 / session_.get_samplerate(), w / 2);
}
void View::set_scale_offset(double scale, const Timestamp& offset)
{
flags_.push_back(shared_ptr<Flag>(new Flag(*this, time,
QString("%1").arg(next_flag_text_))));
+
next_flag_text_ = (next_flag_text_ >= 'Z') ? 'A' :
(next_flag_text_ + 1);
+
+ // Skip 'T' (for trigger) as it's treated special
+ if (next_flag_text_ == 'T')
+ next_flag_text_ += 1;
+
time_item_appearance_changed(true, true);
}
i->animate_to_layout_v_offset();
}
+void View::trigger_event(util::Timestamp location)
+{
+ char next_flag_text = next_flag_text_;
+
+ next_flag_text_ = 'T';
+ add_flag(location);
+
+ next_flag_text_ = next_flag_text;
+}
+
void View::get_scroll_layout(double &length, Timestamp &offset) const
{
const pair<Timestamp, Timestamp> extents = get_time_extents();