Skip to content
Snippets Groups Projects
Commit 1c255f25 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

SpanProperty w/o 'init' fct

parent b5dafb2c
No related branches found
No related tags found
1 merge request!2637rename form-related classes; simplify span property construction
......@@ -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
......
......@@ -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; }
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment