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

Function setTimelineState

pj_app/tests/layout_xml_test.cpp:275–281  ·  view source on GitHub ↗

Stamps the per-source timeline attributes onto a doc's only , as MainWindow::appendDataSourceElement does at save time.

Source from the content-addressed store, hash-verified

273// Stamps the per-source timeline attributes onto a doc's only <fileInfo>, as
274// MainWindow::appendDataSourceElement does at save time.
275void setTimelineState(QDomDocument& doc, qint64 offset_ns, int order) {
276 QDomElement file_info = doc.documentElement()
277 .firstChildElement(QStringLiteral("previouslyLoaded_Datafiles"))
278 .firstChildElement(QStringLiteral("fileInfo"));
279 file_info.setAttribute(QStringLiteral("display_offset_ns"), QString::number(offset_ns));
280 file_info.setAttribute(QStringLiteral("timeline_order"), QString::number(order));
281}
282
283TEST(ExtractDataSource, TimelineStateAttributesParsed) {
284 QDomDocument doc = buildDataSourceDoc(QStringLiteral("/tmp/run.mcap"));

Callers 1

TESTFunction · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected