In per-image mode the embedded chart brought its own combo box, so the plot panel showed two. Drop the per-image chart's combo and drive it from the one dataset-info combo: - JFJochViewerSidePanelChart loses its combo; it exposes PlotTypes() (the available profiles) and a setPlotType(code) slot, driven externally. - JFJochViewerDatasetInfo fills its single combo with the per-image plot types while in per-image mode (per-dataset metrics otherwise) and routes the selection to the chart; dataset/runs/live updates leave the per-image combo and plot untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QList>
|
|
#include <QPair>
|
|
#include <QString>
|
|
|
|
#include "../../reader/JFJochReaderImage.h"
|
|
#include "../charts/JFJochSimpleChartView.h"
|
|
|
|
// Per-image profile plot (azimuthal 1D, Wilson, I/sigma, spots, fluorescence). It has no selector
|
|
// of its own — the host (dataset-info dock) drives the plot type via setPlotType, reusing its one
|
|
// combo box.
|
|
class JFJochViewerSidePanelChart : public QWidget {
|
|
Q_OBJECT
|
|
JFJochSimpleChartView *azint_plot = nullptr;
|
|
std::shared_ptr<const JFJochReaderImage> image;
|
|
int plot_type_ = 0;
|
|
void redrawPlot();
|
|
|
|
signals:
|
|
void writeStatusBar(QString string, int timeout_ms = 0);
|
|
|
|
public:
|
|
JFJochViewerSidePanelChart(QWidget *parent);
|
|
// The available per-image plots as (label, code), so the host can fill its own combo.
|
|
static QList<QPair<QString, int>> PlotTypes();
|
|
|
|
public slots:
|
|
void loadImage(std::shared_ptr<const JFJochReaderImage> image);
|
|
void setPlotType(int code);
|
|
};
|