Files
Jungfraujoch/viewer/windows/JFJochScalingPanel.cpp
T
leonarski_f 74f36710e4
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 11m43s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 12m24s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 12m33s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m34s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m58s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m38s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 12m33s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m22s
Build Packages / build:rpm (rocky8) (push) Successful in 13m41s
Build Packages / Generate python client (push) Successful in 14s
Build Packages / build:rpm (rocky9) (push) Successful in 14m14s
Build Packages / Create release (push) Skipped
Build Packages / DIALS test (push) Successful in 13m55s
Build Packages / Build documentation (push) Successful in 45s
Build Packages / XDS test (durin plugin) (push) Successful in 6m54s
Build Packages / XDS test (neggia plugin) (push) Successful in 5m50s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 6m31s
Build Packages / Unit tests (push) Failing after 1h0m10s
viewer: converge processing settings into one tabbed window + Bragg/scaling
One "Processing settings" window with tabs: Spot finding & indexing | Azimuthal | Bragg
integration | Scaling, replacing the two separate settings windows. The spot/index and azimuthal
tabs reuse the existing windows' widgets unchanged (their content is lifted into tabs via
takeCentralWidget), so all their logic/signals keep working; Bragg integration and scaling are new
editable panels (previously not adjustable in the GUI).

JFJochImageReadingWorker gains UpdateBraggIntegrationSettings / UpdateScalingSettings; both persist
as worker state and are re-imported into curr_experiment on file load / dataset update (like the
indexing/azint settings), so they apply to interactive analysis (Bragg) and flow into processing
jobs via GetReprocessingInputs (Bragg + scaling). Scaling only affects the job post-pass, so it is
just stored, not reanalyzed.

Verified: jfjoch_viewer builds and runs (offscreen) with the converged window.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:09:20 +02:00

78 lines
3.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include "JFJochScalingPanel.h"
#include <QCheckBox>
#include <QComboBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QVBoxLayout>
JFJochScalingPanel::JFJochScalingPanel(const ScalingSettings &settings, QWidget *parent)
: QWidget(parent) {
auto *layout = new QVBoxLayout(this);
auto *group = new QGroupBox("Scaling && merging", this);
auto *form = new QFormLayout(group);
m_partiality = new QComboBox(this);
m_partiality->addItem("Fixed", static_cast<int>(PartialityModel::Fixed));
m_partiality->addItem("Rotation", static_cast<int>(PartialityModel::Rotation));
m_partiality->addItem("Unity", static_cast<int>(PartialityModel::Unity));
const auto pm = settings.GetPartialityModel().value_or(PartialityModel::Fixed);
if (const int idx = m_partiality->findData(static_cast<int>(pm)); idx >= 0)
m_partiality->setCurrentIndex(idx);
form->addRow("Partiality model", m_partiality);
m_mergeFriedel = new QCheckBox("Merge Friedel pairs", this);
m_mergeFriedel->setChecked(settings.GetMergeFriedel());
form->addRow("", m_mergeFriedel);
m_refineB = new QCheckBox("Refine per-image B-factor", this);
m_refineB->setChecked(settings.GetRefineB());
form->addRow("", m_refineB);
m_minPartiality = new SliderPlusBox(0.0, 1.0, 0.01, 2, this);
m_minPartiality->setValue(settings.GetMinPartiality());
form->addRow("Minimum partiality", m_minPartiality);
m_outlierNsigma = new SliderPlusBox(0.0, 10.0, 0.5, 1, this);
m_outlierNsigma->setValue(settings.GetOutlierRejectNsigma());
form->addRow("Outlier rejection [σ, 0 = off]", m_outlierNsigma);
m_limitResolution = new QCheckBox("Limit resolution", this);
m_limitResolution->setChecked(settings.GetHighResolutionLimit_A().has_value());
form->addRow("", m_limitResolution);
m_highRes = new SliderPlusBox(0.5, 5.0, 0.1, 1, this);
m_highRes->setValue(settings.GetHighResolutionLimit_A().value_or(2.0));
m_highRes->setEnabled(m_limitResolution->isChecked());
form->addRow("High-resolution limit [Å]", m_highRes);
layout->addWidget(group);
layout->addStretch();
connect(m_partiality, &QComboBox::currentIndexChanged, this, [this](int) { emitChanged(); });
connect(m_mergeFriedel, &QCheckBox::toggled, this, [this](bool) { emitChanged(); });
connect(m_refineB, &QCheckBox::toggled, this, [this](bool) { emitChanged(); });
connect(m_minPartiality, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
connect(m_outlierNsigma, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
connect(m_limitResolution, &QCheckBox::toggled, this, [this](bool checked) {
m_highRes->setEnabled(checked);
emitChanged();
});
connect(m_highRes, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
}
void JFJochScalingPanel::emitChanged() {
ScalingSettings s;
s.SetPartialityModel(static_cast<PartialityModel>(m_partiality->currentData().toInt()));
s.MergeFriedel(m_mergeFriedel->isChecked());
s.RefineB(m_refineB->isChecked());
s.MinPartiality(m_minPartiality->value());
s.OutlierRejectNsigma(m_outlierNsigma->value());
if (m_limitResolution->isChecked())
s.HighResolutionLimit_A(m_highRes->value());
emit settingsChanged(s);
}