diff --git a/GUI/Model/Descriptor/SpanProperty.cpp b/GUI/Model/Descriptor/SpanProperty.cpp index 4a116ae1be43551f6e748b47410c3ec715645f5f..ed6d1f47fd5c548dc922bed79416e122fcb56bc8 100644 --- a/GUI/Model/Descriptor/SpanProperty.cpp +++ b/GUI/Model/Descriptor/SpanProperty.cpp @@ -28,18 +28,13 @@ const QString ExpandGroupbox("ExpandGroupbox"); // from AxisProperty pre v22 } // namespace Tag } // namespace -SpanProperty::SpanProperty() = default; - -void SpanProperty::initWidth(const QString& label, const QString& tooltip, double value, - const RealLimits& limits, uint decimals) -{ - m_width.init(label, tooltip, value, decimals, limits, "width"); -} - -void SpanProperty::initCenter(const QString& label, const QString& tooltip, double value, - const RealLimits& limits, uint decimals) +SpanProperty::SpanProperty(const QString& width_label, const QString& width_tooltip, + double width_value, const RealLimits& width_limits, + const QString& center_label, const QString& center_tooltip, + double center_value, const RealLimits& center_limits) { - m_center.init(label, tooltip, value, decimals, limits, "center"); + m_width.init(width_label, width_tooltip, width_value, 3, width_limits, "width"); + m_center.init(center_label, center_tooltip, center_value, 3, center_limits, "center"); } void SpanProperty::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Descriptor/SpanProperty.h b/GUI/Model/Descriptor/SpanProperty.h index b4d52a56a38e376d100297809529b525874f1dc1..2d3ad2221953ab34776989c08d54103d9e42e7e0 100644 --- a/GUI/Model/Descriptor/SpanProperty.h +++ b/GUI/Model/Descriptor/SpanProperty.h @@ -27,7 +27,10 @@ class SpanProperty { public: - SpanProperty(); + SpanProperty(const QString& width_label, const QString& width_tooltip, double width_value, + const RealLimits& width_limits, const QString& center_label, + const QString& center_tooltip, double center_value, + const RealLimits& center_limits); DoubleProperty& width() { return m_width; } const DoubleProperty& width() const { return m_width; } @@ -37,11 +40,6 @@ public: const DoubleProperty& center() const { return m_center; } void setCenter(double v) { m_center.setValue(v); } - void initWidth(const QString& label, const QString& tooltip, double value, - const RealLimits& limits, uint decimals = 3); - void initCenter(const QString& label, const QString& tooltip, double value, - const RealLimits& limits, uint decimals = 3); - uint nbins() const { return m_nbins; } void setNbins(uint v) { m_nbins = v; } diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index f5dc7901b0c0511e49ba6862882d201e647c6b69..831c9458f6fabad2d98d61904b52fdfc16f97cb4 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -38,19 +38,14 @@ const QString ProjectionContainer("ProjectionContainer"); DetectorItem::DetectorItem() - : m_masks(std::make_unique<MasksSet>()) + : m_phi_axis("Span (deg)", "Full width in phi direction", 4.0, RealLimits::limited(0, 180), + "Center (deg)", "Angle phi of detector center", 0., RealLimits::limited(-90, 90)) + , m_alpha_axis("Span (deg)", "Full width in alpha direction", 4.0, RealLimits::limited(0, 180), + "Center (deg)", "Angle alpha of detector center", 0., + RealLimits::limited(-90, 90)) + , m_masks(std::make_unique<MasksSet>()) , m_prjns(std::make_unique<MasksSet>()) { - m_phi_axis.initWidth("Span (deg)", "Full width in phi direction", 4.0, - RealLimits::limited(0, 180)); - m_phi_axis.initCenter("Center (deg)", "Angle phi of detector center", 0., - RealLimits::limited(-90, 90)); - - m_alpha_axis.initWidth("Span (deg)", "Full width in alpha direction", 4.0, - RealLimits::limited(0, 180)); - m_alpha_axis.initCenter("Center (deg)", "Angle alpha of detector center", 0., - RealLimits::limited(-90, 90)); - m_resolution_function.initWithArgs("Resolution function", "Detector resolution function", ResolutionFunctionItemCatalog::Type::None); }