Files
Jungfraujoch/viewer/JFJochViewerDatasetInfo.h
T
leonarski_fandClaude Opus 4.8 e7edee6b2e viewer: Phase 1c — fold per-image plot into the dataset-info dock
Remove the duplicated per-image plot from the side panel and host it in the
dataset-info dock instead:

- JFJochViewerDatasetInfo gains a "Per-image" toggle (next to Grid) that swaps
  the stacked view to the existing JFJochViewerSidePanelChart (azimuthal 1D,
  Wilson, I/sigma, spot and fluorescence profiles of the current image). The
  per-dataset metric combo is disabled while in per-image mode.
- The per-image profile follows the displayed image (imageLoaded forwarded).
- Drop the "Image statistics plot" section from JFJochViewerSidePanel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 16:26:15 +02:00

63 lines
2.5 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <QComboBox>
#include <QStackedWidget>
#include <QPushButton>
#include "charts/JFJochDatasetInfoChartView.h"
#include "../reader/JFJochReader.h"
#include "image_viewer/JFJochGridScanImage.h"
#include "widgets/JFJochViewerSidePanelChart.h"
#include "RunData.h"
class JFJochViewerDatasetInfo : public QWidget {
Q_OBJECT
QComboBox *combo_box;
JFJochDatasetInfoChartView *chart_view;
const std::vector<float> *GetDataset();
std::shared_ptr<const JFJochReaderDataset> dataset; // the active (primary) run
std::shared_ptr<const JFJochReaderImage> image;
JFJochGridScanImage *grid_scan_image = nullptr;
JFJochViewerSidePanelChart *image_chart = nullptr; // per-image profiles (azimuthal, Wilson, ...)
QVector<RunData> runs_; // all runs, for overlay lines
QString active_id_; // which run is primary
std::shared_ptr<const JFJochReaderDataset> live_run_; // in-progress reprocessing, if any
QStackedWidget *stack = nullptr;
QPushButton *grid_button = nullptr;
QPushButton *image_button = nullptr; // toggle: show per-image profiles instead of the metric
int last_selection;
void UpdatePlot();
void UpdateView(); // pick the stack page from the grid / per-image toggles
// Pull the metric selected by combo value `val` out of one run's dataset.
std::vector<float> ExtractMetric(const JFJochReaderDataset &ds, int val, bool &one_over_d2) const;
void UpdateLabels();
signals:
void imageSelected(int64_t number, int64_t summation);
void writeStatusBar(QString string, int timeout_ms = 0);
public:
explicit JFJochViewerDatasetInfo(QWidget *parent = nullptr);
private slots:
void imageSelectedInChart(int64_t number);
void comboBoxSelected(int val);
void resetZoomButtonPressed();
public slots:
void datasetLoaded(std::shared_ptr<const JFJochReaderDataset> dataset);
void imageLoaded(std::shared_ptr<const JFJochReaderImage> image);
void setColorMap(int color_map);
// All runs (original + reprocessing snapshots) and which one is active/primary.
void runsChanged(QVector<RunData> runs, QString active_id);
// Live results of the in-progress reprocessing run (updated as it goes), or nullptr to clear.
void liveRunUpdated(std::shared_ptr<const JFJochReaderDataset> dataset);
};