| 1863 | } |
| 1864 | |
| 1865 | void 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 | |
| 1889 | void MainWindow::openFilterEditor(std::vector<CurveDescriptor> sources, PlotWidget* origin) { |
| 1890 | if (origin == nullptr || session_ == nullptr) { |
nothing calls this directly
no test coverage detected