diff --git a/GUI/View/Device/SpanPropertyForm.cpp b/GUI/View/Device/SpanPropertyForm.cpp index f003b492d362a6a295c4e6cbd6d74a79686687af..43d7ac611d0ed2af9a742505b598dde3b6009734 100644 --- a/GUI/View/Device/SpanPropertyForm.cpp +++ b/GUI/View/Device/SpanPropertyForm.cpp @@ -13,6 +13,7 @@ // ************************************************************************************************ #include "GUI/View/Device/SpanPropertyForm.h" +#include "Base/Util/Assert.h" #include "GUI/Model/Descriptor/SpanProperty.h" #include "GUI/Model/Project/ProjectDocument.h" #include "GUI/View/Numeric/DoubleSpinBox.h" @@ -42,24 +43,17 @@ SpanPropertyForm::SpanPropertyForm(QWidget* parent, const QString& groupTitle, m_centerSpinBox = GUI::Util::createDoubleSpinBoxRow(layout, spanProperty->center()); connect(m_widthSpinBox, &DoubleSpinBox::baseValueChanged, [this](double v) { - if (m_spanProperty->width() != v) { - m_spanProperty->setWidth(v); - emit dataChanged(); - if (m_spanProperty->center() < v) { - m_spanProperty->setCenter(v); - m_centerSpinBox->updateValue(); - } - } + ASSERT(v >= 0); // spin box should have got limits from property + if (m_spanProperty->width() == v) + return; + m_spanProperty->setWidth(v); + emit dataChanged(); }); connect(m_centerSpinBox, &DoubleSpinBox::baseValueChanged, [this](double v) { if (m_spanProperty->center() != v) { m_spanProperty->setCenter(v); emit dataChanged(); - if (m_spanProperty->width() > v) { - m_spanProperty->setWidth(v); - m_widthSpinBox->updateValue(); - } } }); } diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 94fef054950a0689e10364edd0d314f487e0f19b..0ebbebc171b9293b88478e72176d0fec3a09fe13 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2714,9 +2714,9 @@ class Detector2D(IDetector): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, phi_full_width, alpha_full_width, n_phi, n_alpha, center_phi, center_alpha): - r"""__init__(Detector2D self, double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> Detector2D""" - _libBornAgainDevice.Detector2D_swiginit(self, _libBornAgainDevice.new_Detector2D(phi_full_width, alpha_full_width, n_phi, n_alpha, center_phi, center_alpha)) + def __init__(self, phi_span, alpha_span, n_phi, n_alpha, phi_center, alpha_center): + r"""__init__(Detector2D self, double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center) -> Detector2D""" + _libBornAgainDevice.Detector2D_swiginit(self, _libBornAgainDevice.new_Detector2D(phi_span, alpha_span, n_phi, n_alpha, phi_center, alpha_center)) __swig_destroy__ = _libBornAgainDevice.delete_Detector2D def clone(self): diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index 33aafff29ae0ec23ab7e7dfb1aa932909ab33958..52d182f8508d6bd8793034bbd543a43983d90eb0 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -42453,7 +42453,7 @@ static PyMethodDef SwigMethods[] = { { "IDetector_setRegionOfInterest", _wrap_IDetector_setRegionOfInterest, METH_VARARGS, "IDetector_setRegionOfInterest(IDetector self, double xlow, double ylow, double xup, double yup)"}, { "IDetector_clippedFrame", _wrap_IDetector_clippedFrame, METH_O, "IDetector_clippedFrame(IDetector self) -> Frame"}, { "IDetector_swigregister", IDetector_swigregister, METH_O, NULL}, - { "new_Detector2D", _wrap_new_Detector2D, METH_VARARGS, "new_Detector2D(double phi_full_width, double alpha_full_width, size_t n_phi, size_t n_alpha, double center_phi, double center_alpha) -> Detector2D"}, + { "new_Detector2D", _wrap_new_Detector2D, METH_VARARGS, "new_Detector2D(double phi_span, double alpha_span, size_t n_phi, size_t n_alpha, double phi_center, double alpha_center) -> Detector2D"}, { "delete_Detector2D", _wrap_delete_Detector2D, METH_O, "delete_Detector2D(Detector2D self)"}, { "Detector2D_clone", _wrap_Detector2D_clone, METH_O, "Detector2D_clone(Detector2D self) -> Detector2D"}, { "Detector2D_className", _wrap_Detector2D_className, METH_O, "Detector2D_className(Detector2D self) -> std::string"},