MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / updateTrackOffsets

Method updateTrackOffsets

pj_app/src/SourceTimelineController.cpp:199–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void SourceTimelineController::updateTrackOffsets() {
200 // Refresh ONLY the cached tracks' offsets from the SessionManager and re-feed
201 // them. Used on the offset-only path (displayOffsetChanged from a live drag /
202 // align / reset): the raw time ranges, names, colors, and order are unchanged,
203 // so this avoids rebuildTracks()'s per-dataset datasetRawTimeRange catalog
204 // scan. The widget keys its extent/auto-zoom on the (unchanged) raw bounds, so
205 // re-feeding never resets the view.
206 SessionManager& sessions = session_->sessionManager();
207 for (TimelineTrack& track : tracks_) {
208 // Align-only offset (see rebuildTracks): the global frame never moves a bar.
209 track.offset_ns = static_cast<qint64>(sessions.sourceDisplayOffset(static_cast<DatasetId>(track.id)).value.count());
210 }
211 widget_->setTracks(tracks_);
212}
213
214void SourceTimelineController::alignStarts() {
215 applyAlignment(AlignMode::kStarts);

Callers

nothing calls this directly

Calls 4

sourceDisplayOffsetMethod · 0.80
setTracksMethod · 0.80
sessionManagerMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected