Files
Jungfraujoch/viewer/widgets/JFJochViewerSettingsDock.h
T
leonarski_fandClaude Opus 4.8 58c60e03fe viewer: Phase 1b — inline MX/AzInt settings dock
Surface a surgical subset of processing settings in an always-visible dock
instead of hidden windows:

- New JFJochViewerSettingsDock with an MX / AzInt segmented toggle.
  MX page: geometry (energy, distance, beam X/Y), a new unit-cell +
  space-group editor (no such input existed before; enables known-cell
  ffbidx), spot finding (S/N, photon count, min pixels/spot), indexing
  algorithm and geometry refinement. AzInt page: q range / spacing /
  azimuthal bins plus the existing powder-calibration widget.
- Edits feed straight into the worker (UpdateSpotFindingSettings,
  UpdateAzintSettings, UpdateDataset, FindCenter); fields populate from the
  loaded dataset.
- Add CeO2 and Silicon calibrant presets.
- Dock it left, objectName "settingsDock", show it in the Processing
  perspective (hidden in Image).

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

69 lines
2.6 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 <memory>
#include "../../common/DiffractionExperiment.h"
#include "../../common/IndexingSettings.h"
#include "../../common/AzimuthalIntegrationSettings.h"
#include "../../image_analysis/spot_finding/SpotFindingSettings.h"
#include "../../reader/JFJochReaderDataset.h"
#include "../../reader/JFJochReaderImage.h"
class QStackedWidget;
class QCheckBox;
class QComboBox;
class SliderPlusBox;
class NumberLineEdit;
class PowderCalibrationWidget;
// Compact, always-visible settings panel with an MX / AzInt toggle: the surgical subset of
// processing settings that the two communities reach for most, kept in a dock instead of a
// hidden window. Edits feed straight back into the running analysis via the worker.
class JFJochViewerSettingsDock : public QWidget {
Q_OBJECT
public:
JFJochViewerSettingsDock(const SpotFindingSettings &spot, const IndexingSettings &indexing,
const AzimuthalIntegrationSettings &azint, QWidget *parent = nullptr);
public slots:
void datasetLoaded(std::shared_ptr<const JFJochReaderDataset> dataset);
void loadImage(std::shared_ptr<const JFJochReaderImage> image);
signals:
void spotFindingChanged(const SpotFindingSettings &spot, const IndexingSettings &indexing, int64_t max_spots);
void azintChanged(const AzimuthalIntegrationSettings &settings);
void experimentChanged(const DiffractionExperiment &experiment);
void findBeamCenter(const UnitCell &calibrant, bool guess);
void ringsFromCalibration(QVector<float> rings);
private:
SpotFindingSettings spot_;
IndexingSettings indexing_;
AzimuthalIntegrationSettings azint_;
DiffractionExperiment experiment_;
bool have_experiment_ = false; // geometry edits only take effect once a dataset is loaded
int64_t max_spots_ = 1000;
// MX geometry + crystal fields
NumberLineEdit *energy_ = nullptr;
NumberLineEdit *distance_ = nullptr;
NumberLineEdit *beamX_ = nullptr;
NumberLineEdit *beamY_ = nullptr;
QCheckBox *cellKnown_ = nullptr;
NumberLineEdit *cellA_ = nullptr, *cellB_ = nullptr, *cellC_ = nullptr;
NumberLineEdit *cellAlpha_ = nullptr, *cellBeta_ = nullptr, *cellGamma_ = nullptr;
NumberLineEdit *spaceGroup_ = nullptr;
PowderCalibrationWidget *powder_ = nullptr;
QWidget *BuildMXPage();
QWidget *BuildAzIntPage();
void EmitSpotFinding();
void EmitExperiment();
void RefreshGeometryFields();
};