diff --git a/GUI/Model/Descriptor/AxisProperty.cpp b/GUI/Model/Descriptor/AxisProperty.cpp index 78e8aa3419546d98fe8fc4257b3a8adff69e84e5..594d48733b9e846ee2d845fb40212cc0deeb1e74 100644 --- a/GUI/Model/Descriptor/AxisProperty.cpp +++ b/GUI/Model/Descriptor/AxisProperty.cpp @@ -54,3 +54,13 @@ void AxisProperty::rwAxisProperty(Streamer& s, const QString& tag) Serialize::rwProperty(s, m_max); s.finish(tag); } + +uint AxisProperty::NEW_nbins() const +{ + return m_nbins_NEW; +} + +void AxisProperty::NEW_setNbins(uint value) +{ + m_nbins_NEW = value; +} diff --git a/GUI/Model/Descriptor/AxisProperty.h b/GUI/Model/Descriptor/AxisProperty.h index d683b6b2d3f3624d2728962b3f164d24cd4f4616..8318c963d9ca2aa29a004125ea7f497a94d80e32 100644 --- a/GUI/Model/Descriptor/AxisProperty.h +++ b/GUI/Model/Descriptor/AxisProperty.h @@ -57,6 +57,12 @@ public: std::unique_ptr<FixedBinAxis> createAxis(double scaleFactor) const; void rwAxisProperty(Streamer& s, const QString& tag); + + uint NEW_nbins() const; + void NEW_setNbins(uint value); + +private: + uint m_nbins_NEW = 100; }; // clang-format off diff --git a/GUI/View/Instrument/AxisPropertyEditor.cpp b/GUI/View/Instrument/AxisPropertyEditor.cpp index 89fcc8d8580bc17bedf0d082871a6a480a317509..f59136680e45080957f539e16fbcd8e809cb8aef 100644 --- a/GUI/View/Instrument/AxisPropertyEditor.cpp +++ b/GUI/View/Instrument/AxisPropertyEditor.cpp @@ -22,7 +22,8 @@ #include <QSpinBox> AxisPropertyEditor::AxisPropertyEditor(QWidget* parent, const QString& groupTitle, - AxisProperty* axisProperty) + AxisProperty* axisProperty, QString nbinsTooltip, + QString minTooltip, QString maxTooltip) : QGroupBox(groupTitle, parent) , m_axisProperty(axisProperty) { @@ -30,7 +31,12 @@ AxisPropertyEditor::AxisPropertyEditor(QWidget* parent, const QString& groupTitl auto* formLayout = new QFormLayout(this); formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); - m_nbinsSpinBox = GUI::Util::createSpinBoxRow(formLayout, axisProperty->nbins()); + m_nbinsSpinBox = GUI::Util::createIntSpinbox([=] { return axisProperty->NEW_nbins(); }, + [=](int v) { axisProperty->NEW_setNbins(static_cast<uint>(v)); }, nullptr /*updaters*/, + nbinsTooltip, RealLimits::nonnegative()); + formLayout->addRow(GUI::Util::labelWithUnit("Nbins", "nbins") + ":", m_nbinsSpinBox); + + m_minSpinBox = GUI::Util::createDoubleSpinBoxRow(formLayout, axisProperty->min()); m_maxSpinBox = GUI::Util::createDoubleSpinBoxRow(formLayout, axisProperty->max()); diff --git a/GUI/View/Instrument/AxisPropertyEditor.h b/GUI/View/Instrument/AxisPropertyEditor.h index 83c91c3902dda7371bee819a828ed0302254045d..ca3dbcc07e87ceeb2703be3f04d187dd3283ec23 100644 --- a/GUI/View/Instrument/AxisPropertyEditor.h +++ b/GUI/View/Instrument/AxisPropertyEditor.h @@ -29,7 +29,8 @@ class DoubleSpinBox; class AxisPropertyEditor : public QGroupBox { Q_OBJECT public: - AxisPropertyEditor(QWidget* parent, const QString& groupTitle, AxisProperty* axisProperty); + AxisPropertyEditor(QWidget* parent, const QString& groupTitle, AxisProperty* axisProperty, + QString nbinsTooltip = "", QString minTooltip = "", QString maxTooltip = ""); //! Reload UI from data void updateData(); diff --git a/GUI/View/Instrument/DepthProbeInstrumentEditor.cpp b/GUI/View/Instrument/DepthProbeInstrumentEditor.cpp index 0ac9b50f0b554edfb3af59c696386e8779de2018..c5201ff15dc9bbcf66959a3aeb54d104dfec251a 100644 --- a/GUI/View/Instrument/DepthProbeInstrumentEditor.cpp +++ b/GUI/View/Instrument/DepthProbeInstrumentEditor.cpp @@ -46,7 +46,10 @@ DepthProbeInstrumentEditor::DepthProbeInstrumentEditor(QWidget* parent, new InclinationAnglesEditor(this, instrument->beamItem()->inclinationAngleItem()); vLayout->addWidget(inclinationEditor); - auto* depthAxisEditor = new AxisPropertyEditor(this, "Depth axis", &instrument->zAxis()); + auto* depthAxisEditor = new AxisPropertyEditor(this, "Depth axis", &instrument->zAxis(), + "Number of points in scan across sample bulk", + "Starting value below sample horizon", + "Ending value above sample horizon"); vLayout->addWidget(depthAxisEditor); GroupBoxCollapser::installIntoGroupBox(parametersGroupBox); diff --git a/GUI/View/Instrument/OffspecBeamEditor.cpp b/GUI/View/Instrument/OffspecBeamEditor.cpp index c51581854ecbe7916655d119982c6d865926253b..dda9aec60e82a60f4424c298d28f9c5f347b86ab 100644 --- a/GUI/View/Instrument/OffspecBeamEditor.cpp +++ b/GUI/View/Instrument/OffspecBeamEditor.cpp @@ -49,7 +49,10 @@ OffspecBeamEditor::OffspecBeamEditor(QWidget* parent, OffspecInstrumentItem* ite item->beamItem()->wavelengthItem()); vLayout->addWidget(wavelengthEditor); - auto* inclinationEditor = new AxisPropertyEditor(this, "Inclination angle", &item->alphaAxis()); + auto* inclinationEditor = new AxisPropertyEditor(this, "Inclination angle", &item->alphaAxis(), + "Number of points in scan", + "Starting value", + "Ending value"); vLayout->addWidget(inclinationEditor); auto* azimuthalEditor = diff --git a/GUI/View/Instrument/SphericalDetectorEditor.cpp b/GUI/View/Instrument/SphericalDetectorEditor.cpp index 1d8df1ab4f945ca6dc0525eb4a2395358cca5656..9438763c0ca17e9503b8079aee47cc89828868a8 100644 --- a/GUI/View/Instrument/SphericalDetectorEditor.cpp +++ b/GUI/View/Instrument/SphericalDetectorEditor.cpp @@ -27,10 +27,16 @@ SphericalDetectorEditor::SphericalDetectorEditor(QWidget* parent, SphericalDetec grid->setColumnStretch(1, 1); grid->setColumnStretch(2, 1); - auto* phiAxisEditor = new AxisPropertyEditor(this, u8"\u03c6 axis", &item->phiAxis()); + auto* phiAxisEditor = new AxisPropertyEditor(this, u8"\u03c6 axis", &item->phiAxis(), + "Number of phi-axis bins", + "Lower edge of first phi-bin", + "Upper edge of last phi-bin"); grid->addWidget(phiAxisEditor, 1, 0); - auto* alphaAxisEditor = new AxisPropertyEditor(this, u8"\u03b1 axis", &item->alphaAxis()); + auto* alphaAxisEditor = new AxisPropertyEditor(this, u8"\u03b1 axis", &item->alphaAxis(), + "Number of alpha-axis bins", + "Lower edge of first alpha-bin", + "Upper edge of last alpha-bin"); grid->addWidget(alphaAxisEditor, 1, 1); auto* resolutionFunctionEditor =