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

Method onFileLoaded

pj_app/src/MainWindow.cpp:1440–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440void MainWindow::onFileLoaded(
1441 const QString& path, const QString& prefix, const QString& plugin_id, const QString& plugin_config_json) {
1442 // MainWindow is the shell that wires load completion to the runtime —
1443 // recording the source (incl. plugin id + json) and seeding playback are
1444 // pj_runtime concerns; we just relay. Prefix is empty in v1 until the
1445 // load dialog gains a prefix input.
1446 session_->sessionManager().recordLoadedSource(path, prefix, plugin_id, plugin_config_json);
1447 // Feed the loaded source path to every existing 3D dock so its URDF package
1448 // resolver can key per-source remembered roots and auto-seed search roots from
1449 // the file's directory (M.2/M.16). Docks created later pick it up from
1450 // lastLoadedSource() in makeSceneDock.
1451 forEachDock([&path](DockWidget* dock) {
1452 if (dock->objectWidget() == nullptr) {
1453 return;
1454 }
1455 if (auto* scene3d = qobject_cast<Scene3DDockWidget*>(dock->objectWidget()->widget())) {
1456 scene3d->setSourcePath(path);
1457 }
1458 });
1459 // TODO(embedded-assets): route in-band embedded assets to Scene3D docks once the
1460 // load path surfaces the extracted asset map (resolver step 0).
1461 session_->seedPlaybackFromSession();
1462 // A same-source reload evicts the old dataset's objects AFTER the removeDataset
1463 // signal fired, so re-run the coherence pass here to reset any 2D viewer still
1464 // bound to an evicted topic. Idempotent for a first/additive load.
1465 syncWidgetsToCatalog();
1466 // Seed every data widget AND the curve-list Value column with the just-set
1467 // playhead. seedPlaybackFromSession positions the cursor, but currentTimeChanged
1468 // only fires on an actual change — so a fresh load that lands the cursor where it
1469 // already was (e.g. 0) would otherwise leave the value column blank until the
1470 // first scrub. Mirrors PJ3's update2ndColumnValues-after-load.
1471 broadcastTrackerTime(toAxisDouble(session_->playbackEngine().currentTime()));
1472 ui_->leftPanel->setReloadEnabled(true);
1473}
1474
1475bool MainWindow::confirmAndRemoveDependentTransforms(const std::vector<std::string>& removed_names) {
1476 auto& dp = session_->sessionManager().dataProcessorService();

Callers

nothing calls this directly

Calls 9

toAxisDoubleFunction · 0.85
recordLoadedSourceMethod · 0.80
objectWidgetMethod · 0.80
currentTimeMethod · 0.80
setReloadEnabledMethod · 0.80
sessionManagerMethod · 0.45
widgetMethod · 0.45
setSourcePathMethod · 0.45

Tested by

no test coverage detected