diff --git a/GUI/Model/Descriptor/DoubleProperty.cpp b/GUI/Model/Descriptor/DoubleProperty.cpp index 096dce7134baae29f964521c8e634732e72d181e..0e114874bcf7963fac01a15f78eaeb42d6727b76 100644 --- a/GUI/Model/Descriptor/DoubleProperty.cpp +++ b/GUI/Model/Descriptor/DoubleProperty.cpp @@ -30,6 +30,12 @@ void DoubleProperty::init(const QString& label, const QString& tooltip, double v init(label, tooltip, value, Unit::unitless, decimals, 0.01, limits, uidPrefix); } +void DoubleProperty::init(const QString& label, const QString& tooltip, double value, uint decimals, + double step, const RealLimits& limits, const QString& uidPrefix) +{ + init(label, tooltip, value, Unit::unitless, decimals, step, limits, uidPrefix); +} + void DoubleProperty::init(const QString& label, const QString& tooltip, double value, const variant<QString, Unit>& unit, const QString& uidPrefix) diff --git a/GUI/Model/Descriptor/DoubleProperty.h b/GUI/Model/Descriptor/DoubleProperty.h index e42390bd9a855988bc2c0cf7d12224a9f492e97a..8faa2680fc9a3ac1757c83139138c83c4700e9fb 100644 --- a/GUI/Model/Descriptor/DoubleProperty.h +++ b/GUI/Model/Descriptor/DoubleProperty.h @@ -41,6 +41,8 @@ public: void init(const QString& label, const QString& tooltip, double value, const QString& uidPrefix); void init(const QString& label, const QString& tooltip, double value, uint decimals, const RealLimits& limits, const QString& uidPrefix); + void init(const QString& label, const QString& tooltip, double value, uint decimals, + double step, const RealLimits& limits, const QString& uidPrefix); void init(const QString& label, const QString& tooltip, double value, const std::variant<QString, Unit>& unit, const QString& uidPrefix); diff --git a/GUI/Model/Detector/ResolutionFunctionItems.cpp b/GUI/Model/Detector/ResolutionFunctionItems.cpp index a4fa014a773f052b0d635a76eb6bb3908040ddb3..3e4a3d8821fa50201c53b6899f84e9a30a6eb8f4 100644 --- a/GUI/Model/Detector/ResolutionFunctionItems.cpp +++ b/GUI/Model/Detector/ResolutionFunctionItems.cpp @@ -33,9 +33,9 @@ ResolutionFunctionNoneItem::createResolutionFunction(double) const ResolutionFunction2DGaussianItem::ResolutionFunction2DGaussianItem() { - m_sigmaX.init("Sigma X", "Resolution along horizontal axis", 0.02, Unit::degree, - 3 /* decimals */, RealLimits::lowerLimited(0.0), "sigmaX"); - m_sigmaY.init("Sigma Y", "Resolution along vertical axis", 0.02, Unit::degree, 3 /* decimals */, + m_sigmaX.init("Sigma X (deg)", "Resolution along horizontal axis", 0.02, 3 /* decimals */, + RealLimits::lowerLimited(0.0), "sigmaX"); + m_sigmaY.init("Sigma Y (deg)", "Resolution along vertical axis", 0.02, 3 /* decimals */, RealLimits::lowerLimited(0.0), "sigmaY"); } diff --git a/GUI/Model/Sample/FormFactorItems.cpp b/GUI/Model/Sample/FormFactorItems.cpp index 562150b7ee5a385102eef35b1ebd1d4787bec9c2..42f460f7f33169cce642b58eba0ffc85e4ecb8e5 100644 --- a/GUI/Model/Sample/FormFactorItems.cpp +++ b/GUI/Model/Sample/FormFactorItems.cpp @@ -49,7 +49,7 @@ Pyramid2Item::Pyramid2Item() m_length.init("Length (nm)", "Length of the rectangular base", 16.0, "length"); m_width.init("Width (nm)", "Width of the rectangular base", 16.0, "width"); m_height.init("Height (nm)", "Height of pyramid", 16.0, "height"); - m_alpha.init("Alpha", "Dihedral angle between base and facet", 80.0, Unit::degree, 2, 0.1, + m_alpha.init("Alpha (deg)", "Dihedral angle between base and facet", 80.0, 2, 0.1, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -222,7 +222,7 @@ ConeItem::ConeItem() { m_radius.init("Radius (nm)", "Radius of the base", 8.0, "radius"); m_height.init("Height (nm)", "Height of the cone", 16.0, "height"); - m_alpha.init("Alpha", "Angle between the base and the side surface", 65.0, Unit::degree, 2, 0.1, + m_alpha.init("Alpha (deg)", "Angle between the base and the side surface", 65.0, 2, 0.1, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -265,7 +265,7 @@ Pyramid6Item::Pyramid6Item() { m_baseEdge.init("Base edge (nm)", "Edge of the regular hexagonal base", 8.0, "baseEdge"); m_height.init("Height (nm)", "Height of a truncated pyramid", 16.0, "height"); - m_alpha.init("Alpha", "Dihedral angle between base and facet", 70.0, Unit::degree, 2, 0.1, + m_alpha.init("Alpha (deg)", "Dihedral angle between base and facet", 70.0, 2, 0.1, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -314,7 +314,7 @@ Bipyramid4Item::Bipyramid4Item() m_heightRatio.init("Height ratio ()", "Ratio of heights of top to bottom pyramids", 0.7, 3, RealLimits::lowerLimited(0.0), "heightRatio"); - m_alpha.init("Alpha", "Dihedral angle between base and facets", 70.0, Unit::degree, 2, 0.1, + m_alpha.init("Alpha (deg)", "Dihedral angle between base and facets", 70.0, 2, 0.1, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -635,8 +635,8 @@ Pyramid4Item::Pyramid4Item() { m_baseEdge.init("Base edge (nm)", "Length of the square base", 16.0, "baseEdge"); m_height.init("Height (nm)", "Height of the pyramid", 16.0, "height"); - m_alpha.init("Alpha", "Dihedral angle between the base and a side face", 65.0, Unit::degree, 2, - 0.1, RealLimits::limited(0.0, 90.0), "alpha"); + m_alpha.init("Alpha (deg)", "Dihedral angle between the base and a side face", 65.0, 2, 0.1, + RealLimits::limited(0.0, 90.0), "alpha"); } std::unique_ptr<IFormFactor> Pyramid4Item::createFormFactor() const @@ -951,7 +951,7 @@ Pyramid3Item::Pyramid3Item() m_baseEdge.init("Base edge (nm)", "Length of one edge of the equilateral triangular base", 14.0, "baseEdge"); m_height.init("Height (nm)", "Height of the tetrahedron", 16.0, "height"); - m_alpha.init("Alpha", "Dihedral angle between base and facet", 80.0, Unit::degree, 2, 0.1, + m_alpha.init("Alpha (deg)", "Dihedral angle between base and facet", 80.0, 2, 0.1, RealLimits::limited(0.0, 90.0), "alpha"); } diff --git a/GUI/Model/Sample/Lattice2DItems.cpp b/GUI/Model/Sample/Lattice2DItems.cpp index b2eba1e76bc0ed635054799a53265de6066c3e80..7979d3bc1a2a744cff52d199f09313fc43cbe60f 100644 --- a/GUI/Model/Sample/Lattice2DItems.cpp +++ b/GUI/Model/Sample/Lattice2DItems.cpp @@ -69,7 +69,7 @@ BasicLattice2DItem::BasicLattice2DItem() { m_length1.init("LatticeLength1 (nm)", "Length of first lattice vector", 20.0, "len1"); m_length2.init("LatticeLength2 (nm)", "Length of second lattice vector", 20.0, "len2"); - m_angle.init("Angle", "Angle between lattice vectors", 90.0, Unit::degree, 2, 1.0, + m_angle.init("Angle (deg)", "Angle between lattice vectors", 90.0, 2, 1.0, RealLimits::limited(0, 180.0), "angle"); } diff --git a/GUI/Model/Sample/RotationItems.cpp b/GUI/Model/Sample/RotationItems.cpp index ee8d89477f9acfd1123fd06b42a848ccecb241a9..d59ef27fb36ecee727223a353e5e4700b5f2b839 100644 --- a/GUI/Model/Sample/RotationItems.cpp +++ b/GUI/Model/Sample/RotationItems.cpp @@ -56,7 +56,7 @@ void XYZRotationItem::readFrom(QXmlStreamReader* r) XRotationItem::XRotationItem() { - m_angle.init("Angle", "Rotation angle around x-axis", 0.0, Unit::degree, 2, 1.0, + m_angle.init("Angle (deg)", "Rotation angle around x-axis", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "angle"); } @@ -69,7 +69,7 @@ unique_ptr<IRotation> XRotationItem::createRotation() const YRotationItem::YRotationItem() { - m_angle.init("Angle", "Rotation angle around y-axis", 0.0, Unit::degree, 2, 1.0, + m_angle.init("Angle (deg)", "Rotation angle around y-axis", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "angle"); } @@ -82,7 +82,7 @@ unique_ptr<IRotation> YRotationItem::createRotation() const ZRotationItem::ZRotationItem() { - m_angle.init("Angle", "Rotation angle around z-axis", 0.0, Unit::degree, 2, 1.0, + m_angle.init("Angle (deg)", "Rotation angle around z-axis", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "angle"); } @@ -95,11 +95,11 @@ unique_ptr<IRotation> ZRotationItem::createRotation() const EulerRotationItem::EulerRotationItem() { - m_alpha.init("Alpha", "First Euler angle in z-x'-z' sequence", 0.0, Unit::degree, 2, 1.0, + m_alpha.init("Alpha (deg)", "First Euler angle in z-x'-z' sequence", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "alpha"); - m_beta.init("Beta", "Second Euler angle in z-x'-z' sequence", 0.0, Unit::degree, 2, 1.0, + m_beta.init("Beta (deg)", "Second Euler angle in z-x'-z' sequence", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "beta"); - m_gamma.init("Gamma", "Third Euler angle in z-x'-z' sequence", 0.0, Unit::degree, 2, 1.0, + m_gamma.init("Gamma (deg)", "Third Euler angle in z-x'-z' sequence", 0.0, 2, 1.0, RealLimits::limited(0.0, 360.0), "gamma"); }