Files
Jungfraujoch/viewer/windows/JFJochMergeStatsWindow.h
T
leonarski_fandClaude Opus 4.8 0ed943dd4d viewer: show the space group in the merge-statistics window
The de-novo space-group search (SearchSpaceGroup) already ran inside Rugnux but
only its chosen number survived on ProcessResult, and the viewer dropped even
that. Carry the structured SearchSpaceGroupResult (point group + ranked
candidate scores) on ProcessResult and thread it into JFJochMergeStatsWindow,
which now shows a 'Space group' hero card (the final group, searched or fixed)
plus a compact table of candidate groups and their absence scores.

The library no longer renders the search to text (it used to embed it in
merge_statistics_text); rugnux_cli formats it for stdout instead, so the CLI
keeps its text table while the viewer draws a proper table and does not spew it
to stdout. Also surface a user-fixed space group on the result so the card
shows it too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 09:52:25 +02:00

47 lines
1.8 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <QWidget>
#include <cstdint>
#include <optional>
#include "../../image_analysis/scale_merge/Merge.h" // MergeStatistics
#include "../../image_analysis/scale_merge/TwinningAnalysis.h" // TwinningAnalysisResult
#include "../../image_analysis/scale_merge/SearchSpaceGroup.h" // SearchSpaceGroupResult
class QComboBox;
class QLabel;
class QStackedWidget;
class QTableWidget;
class JFJochSimpleChartView;
// Pop-up analysis window for a finished scaling/merging run: a row of eye-catching overall numbers
// (ISa, CC1/2, R-meas, completeness, multiplicity, and CCref when a reference was used) above a
// per-resolution-shell plot whose metric is chosen from a combo. Opened automatically when a merge
// job finishes and on demand from the processing-jobs dock. Modeless; deletes on close.
class JFJochMergeStatsWindow : public QWidget {
Q_OBJECT
public:
JFJochMergeStatsWindow(const QString &title, const MergeStatistics &stats,
double isa, bool has_reference,
const TwinningAnalysisResult &twinning,
std::optional<int64_t> space_group_number,
const std::optional<SearchSpaceGroupResult> &space_group_search,
QWidget *parent = nullptr);
private:
MergeStatistics stats_;
bool has_reference_;
QComboBox *metric_ = nullptr;
QLabel *metricLabel_ = nullptr; // "Metric:" — hidden in table view
QStackedWidget *stack_ = nullptr; // page 0: plot, page 1: table
JFJochSimpleChartView *chart_ = nullptr;
QTableWidget *table_ = nullptr;
void updatePlot();
void buildTable();
};