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

Method onPlotAdded

pj_app/src/MainWindow.cpp:1865–1887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1863}
1864
1865void MainWindow::onPlotAdded(PlotWidget* plot) {
1866 if (plot == nullptr) {
1867 return;
1868 }
1869 connect(plot, &PlotWidget::rectChanged, this, &MainWindow::onPlotZoomChanged, Qt::UniqueConnection);
1870 connect(plot, &PlotWidget::trackerMoved, this, &MainWindow::onTrackerMovedFromWidget, Qt::UniqueConnection);
1871 // Dropping a scalar curve into a plot during streaming seeds playback, exactly
1872 // like dropping an object topic into a 2D/3D dock (PlotDocker::firstObjectTopicAdded).
1873 // Without this, a scalar-only stream never sets streaming_playback_seeded_, so the
1874 // live-ingest handler early-returns forever and the slider stays at the placeholder
1875 // range. seedStreamingPlaybackFromDrop is a no-op unless a stream is active and is
1876 // one-shot per session, so file-curve drops and later stream drops are harmless.
1877 connect(plot, &PlotWidget::curvesDropped, this, &MainWindow::seedStreamingPlaybackFromDrop, Qt::UniqueConnection);
1878 connect(plot, &PlotWidget::filterEditorRequested, this, &MainWindow::openFilterEditor, Qt::UniqueConnection);
1879 connect(plot, &PlotWidget::statusMessageRequested, this, [this](const QString& message) {
1880 emitDiagnostic(DiagnosticLevel::kInfo, "Plot", "status", message);
1881 });
1882 plot->setTrackerPosition(toAxisDouble(session_->playbackEngine().currentTime()));
1883 applyGlobalToggles(plot);
1884 if (curve_editor_ != nullptr && curve_editor_->plot() == nullptr) {
1885 bindEditorToPlot(plot);
1886 }
1887}
1888
1889void MainWindow::openFilterEditor(std::vector<CurveDescriptor> sources, PlotWidget* origin) {
1890 if (origin == nullptr || session_ == nullptr) {

Callers

nothing calls this directly

Calls 4

toAxisDoubleFunction · 0.85
setTrackerPositionMethod · 0.80
currentTimeMethod · 0.80
plotMethod · 0.45

Tested by

no test coverage detected