Files
Jungfraujoch/viewer/windows/JFJochSettingsWindow.cpp
T
leonarski_f b735aec1c4 viewer: show effective indexing algorithm; disable GPU options without CUDA
- The Indexing tab now shows what the selected algorithm resolves to on this
  machine/dataset ("Effective on this system: ..."), mirroring
  DiffractionExperiment::GetIndexingAlgorithm() so Auto is no longer ambiguous
  (GPU present? unit cell known?). Cell-known state is forwarded from the loaded
  dataset via JFJochSettingsWindow::datasetLoaded.
- FFBIDX and FFT (GPU) radio options are disabled on builds without CUDA, where
  only the FFTW CPU indexer exists.

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

46 lines
2.2 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include "JFJochSettingsWindow.h"
#include <QTabWidget>
JFJochSettingsWindow::JFJochSettingsWindow(const SpotFindingSettings &spot, const IndexingSettings &indexing,
const AzimuthalIntegrationSettings &azint,
const BraggIntegrationSettings &bragg,
const ScalingSettings &scaling, QWidget *parent)
: JFJochHelperWindow(parent) {
setWindowTitle("Processing settings");
// Reuse the existing spot/index + azimuthal windows: build them (kept hidden) and lift their
// content into tabs, so all their existing widgets, logic and signals keep working.
m_processing = new JFJochViewerProcessingWindow(spot, indexing, this);
m_azint = new JFJochAzIntWindow(azint, this);
m_bragg = new JFJochBraggIntegrationPanel(bragg, this);
m_scaling = new JFJochScalingPanel(scaling, this);
auto *tabs = new QTabWidget(this);
tabs->addTab(m_processing->TakeSpotFindingPage(), "Spot finding");
tabs->addTab(m_processing->TakeIndexingPage(), "Indexing");
tabs->addTab(m_azint->takeCentralWidget(), "Azimuthal");
tabs->addTab(m_bragg, "Bragg integration");
tabs->addTab(m_scaling, "Scaling");
setCentralWidget(tabs);
m_processing->hide(); // the emptied shells stay alive only to drive their signals
m_azint->hide();
connect(m_processing, &JFJochViewerProcessingWindow::settingsChanged,
this, &JFJochSettingsWindow::spotFindingChanged);
connect(m_azint, &JFJochAzIntWindow::settingsChanged,
this, &JFJochSettingsWindow::azintChanged);
connect(m_bragg, &JFJochBraggIntegrationPanel::settingsChanged,
this, &JFJochSettingsWindow::braggChanged);
connect(m_scaling, &JFJochScalingPanel::settingsChanged,
this, &JFJochSettingsWindow::scalingChanged);
}
void JFJochSettingsWindow::datasetLoaded(std::shared_ptr<const JFJochReaderDataset> in_dataset) {
m_processing->setUnitCellKnown(in_dataset && in_dataset->experiment.GetUnitCell().has_value());
}