27 #include <QFormLayout>
28 #include <QStackedLayout>
40 , m_meanConfig(std::move(mean_config))
41 , m_distributions(distributions)
49 createDistributionWidgets();
50 emit distributionChanged();
71 if (d > gate->maximum()) {
73 maxSpinbox->updateValue();
77 if (d < gate->minimum()) {
79 minSpinbox->updateValue();
122 connect(sb, QOverload<int>::of(&QSpinBox::valueChanged), [=](
int v) {
166 const std::optional<MeanConfig>& mean_config,
169 : QGroupBox(title, parent)
171 setProperty(
"subgroup",
true);
172 auto* hLayout =
new QHBoxLayout(
this);
175 hLayout->setSpacing(50);
178 m_plot->setFixedSize(280, 170);
180 hLayout->addWidget(
m_plot);
181 hLayout->addStretch(1);
Defines GUI::Util namespace.
Defines class BeamDistributionItem.
A widget for selecting a distribution and setting its parameters.
Defines class DistributionItemCatalog.
Defines class DistributionItem and several subclasses.
Defines class DistributionPlot.
Defines class DoubleSpinBox.
Defines class GroupBoxCollapser.
Defines class ScientificSpinBox.
The BeamDistributionItem handles wavelength, inclination and azimuthal parameter distribution for Bea...
SelectionDescriptor< DistributionItem * > distributionSelection() const
DistributionItem * distribution() const
DistributionPlot * m_plot
void updateData()
Update UI from data.
DistributionSelector * m_selector
void distributionChanged()
DistributionEditor(const QString &title, const std::optional< MeanConfig > &mean_config, GUI::ID::Distributions distributions, QWidget *parent, BeamDistributionItem *item)
The DistributionPlot class plots 1d functions corresponding to domain's Distribution1D.
void setShowMouseCoords(bool b)
void setItem(DistributionItem *item)
Widget for selecting a distribution (combo box) and input of the corresponding values with respect to...
BeamDistributionItem * m_item
void distributionChanged()
DistributionSelector(std::optional< MeanConfig > mean_config, GUI::ID::Distributions distributions, QWidget *parent, BeamDistributionItem *item)
DoubleSpinBox * createSpinBox(const DoubleDescriptor &d)
void createDistributionWidgets()
GUI::ID::Distributions m_distributions
QComboBox * m_distributionCombo
GUI::ID::Distributions distributions() const
void createMeanSpinBox(const DoubleDescriptor &d)
BeamDistributionItem * item() const
QFormLayout * m_formLayout
std::optional< MeanConfig > m_meanConfig
Describes properties of a double value which are necessary to allow GUI representation,...
function< void(double)> set
function to set the value
SpinBox for DoubleDescriptors, supporting units.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
static GroupBoxCollapser * installIntoGroupBox(QGroupBox *groupBox, bool expanded=true)
void valueChanged(double value)
Describes properties of a uint value which are necessary to allow GUI representation,...
function< void(uint)> set
function to set the value
Distributions
Which distributions should be available in the selector.
ScientificSpinBox * createScientificSpinBox(QFormLayout *parentLayout, const DoubleDescriptor &d, std::function< void(double)> slot=nullptr)
Create a label and a scientific spin box with the information found in a DoubleDescriptor and place t...
QComboBox * createSelectionCombo(QWidget *parent, const SelectionDescriptor< T > d, std::function< void(int)> slot=nullptr)
Create a combo box with the information found in a selection descriptor.
QSpinBox * createSpinBox(QWidget *parent, const UIntDescriptor &d, std::function< void(uint)> slot=nullptr)
Create a spin box with the information found in a UIntDescriptor.