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

Method displayOffsetSeconds

pj_plotting/widget/src/PlotWidget.cpp:1237–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237double PlotWidget::displayOffsetSeconds() const {
1238 if (session_ == nullptr) {
1239 return 0.0;
1240 }
1241 // The axis is shared across curves; in the common case they share a dataset
1242 // (hence one offset). When they don't, the first datastore-backed curve's
1243 // dataset is the representative — the same rule must hold at save and load so
1244 // the absolute<->display round-trip is stable.
1245 for (const CurveInfo& info : curveList()) {
1246 if (info.curve == nullptr) {
1247 continue;
1248 }
1249 if (const auto* adapter = dynamic_cast<const DatastoreCurveAdapter*>(info.curve->data())) {
1250 const DisplayOffset offset = session_->displayOffset(adapter->source().dataset_id);
1251 return std::chrono::duration<double>(offset.value).count();
1252 }
1253 }
1254 return 0.0;
1255}
1256
1257QStringList PlotWidget::decodeCurveDrop(const QMimeData* mime_data, const QString& format) const {
1258 QStringList curves;

Callers

nothing calls this directly

Calls 4

displayOffsetMethod · 0.80
sourceMethod · 0.80
dataMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected