From 85836688fea5f6af35760d34317c79b966183897 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 10 Oct 2023 09:10:48 +0200 Subject: [PATCH] unit nm integrated in label --- GUI/Model/Descriptor/DoubleProperty.cpp | 13 ++ GUI/Model/Descriptor/DoubleProperty.h | 4 + GUI/Model/Sample/FormFactorItems.cpp | 187 ++++++++++++------------ GUI/Model/Sample/InterferenceItems.cpp | 30 ++-- GUI/Model/Sample/Lattice2DItems.cpp | 12 +- GUI/Model/Sample/LayerItem.cpp | 2 +- GUI/Model/Sample/ProfileItems.cpp | 8 +- GUI/Model/Sample/RoughnessItems.cpp | 7 +- 8 files changed, 136 insertions(+), 127 deletions(-) diff --git a/GUI/Model/Descriptor/DoubleProperty.cpp b/GUI/Model/Descriptor/DoubleProperty.cpp index fb4c15bf7ab..096dce7134b 100644 --- a/GUI/Model/Descriptor/DoubleProperty.cpp +++ b/GUI/Model/Descriptor/DoubleProperty.cpp @@ -18,6 +18,19 @@ using std::variant; +void DoubleProperty::init(const QString& label, const QString& tooltip, double value, + const QString& uidPrefix) +{ + init(label, tooltip, value, Unit::unitless, uidPrefix); +} + +void DoubleProperty::init(const QString& label, const QString& tooltip, double value, uint decimals, + const RealLimits& limits, const QString& uidPrefix) +{ + init(label, tooltip, value, Unit::unitless, decimals, 0.01, 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 e435a96ae4d..e42390bd9a8 100644 --- a/GUI/Model/Descriptor/DoubleProperty.h +++ b/GUI/Model/Descriptor/DoubleProperty.h @@ -38,6 +38,10 @@ class DoubleProperty { 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, const std::variant<QString, Unit>& unit, const QString& uidPrefix); void init(const QString& label, const QString& tooltip, double value, diff --git a/GUI/Model/Sample/FormFactorItems.cpp b/GUI/Model/Sample/FormFactorItems.cpp index 6d8257c5dc6..20fa623bdc2 100644 --- a/GUI/Model/Sample/FormFactorItems.cpp +++ b/GUI/Model/Sample/FormFactorItems.cpp @@ -46,9 +46,9 @@ const QString Width("Width"); Pyramid2Item::Pyramid2Item() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of pyramid", 16.0, Unit::nanometer, "height"); + 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, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -94,9 +94,9 @@ void Pyramid2Item::readFrom(QXmlStreamReader* r) BarGaussItem::BarGaussItem() { - m_length.init("Length", "Length of the base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the box", 16.0, Unit::nanometer, "height"); + m_length.init("Length (nm)", "Length of the base", 16.0, "length"); + m_width.init("Width (nm)", "Width of the base", 16.0, "width"); + m_height.init("Height (nm)", "Height of the box", 16.0, "height"); } std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const @@ -136,9 +136,9 @@ void BarGaussItem::readFrom(QXmlStreamReader* r) BarLorentzItem::BarLorentzItem() { - m_length.init("Length", "Length of the base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the box", 16.0, Unit::nanometer, "height"); + m_length.init("Length (nm)", "Length of the base", 16.0, "length"); + m_width.init("Width (nm)", "Width of the base", 16.0, "width"); + m_height.init("Height (nm)", "Height of the box", 16.0, "height"); } std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const @@ -178,9 +178,9 @@ void BarLorentzItem::readFrom(QXmlStreamReader* r) BoxItem::BoxItem() { - m_length.init("Length", "Length of the base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the box", 16.0, Unit::nanometer, "height"); + m_length.init("Length (nm)", "Length of the base", 16.0, "length"); + m_width.init("Width (nm)", "Width of the base", 16.0, "width"); + m_height.init("Height (nm)", "Height of the box", 16.0, "height"); } std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const @@ -220,8 +220,8 @@ void BoxItem::readFrom(QXmlStreamReader* r) ConeItem::ConeItem() { - m_radius.init("Radius", "Radius of the base", 8.0, Unit::nanometer, "radius"); - m_height.init("Height", "Height of the cone", 16.0, Unit::nanometer, "height"); + 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, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -263,9 +263,8 @@ void ConeItem::readFrom(QXmlStreamReader* r) Pyramid6Item::Pyramid6Item() { - m_baseEdge.init("Base edge", "Edge of the regular hexagonal base", 8.0, Unit::nanometer, - "baseEdge"); - m_height.init("Height", "Height of a truncated pyramid", 16.0, Unit::nanometer, "height"); + 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, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -308,11 +307,9 @@ void Pyramid6Item::readFrom(QXmlStreamReader* r) Bipyramid4Item::Bipyramid4Item() { - m_length.init("Length", "Side length of the common square base", 12.0, Unit::nanometer, - "length"); + m_length.init("Length (nm)", "Side length of the common square base", 12.0, "length"); - m_base_height.init("Base height", "Height of the lower pyramid", 16.0, Unit::nanometer, - "base_height"); + m_base_height.init("Base height (nm)", "Height of the lower pyramid", 16.0, "base_height"); m_heightRatio.init("Height ratio", "Ratio of heights of top to bottom pyramids", 0.7, Unit::unitless, 3, RealLimits::lowerLimited(0.0), "heightRatio"); @@ -362,8 +359,8 @@ void Bipyramid4Item::readFrom(QXmlStreamReader* r) CylinderItem::CylinderItem() { - m_radius.init("Radius", "Radius of the circular base", 8.0, Unit::nanometer, "radius"); - m_height.init("Height", "Height of the cylinder", 16.0, Unit::nanometer, "height"); + m_radius.init("Radius (nm)", "Radius of the circular base", 8.0, "radius"); + m_height.init("Height (nm)", "Height of the cylinder", 16.0, "height"); } std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const @@ -400,11 +397,11 @@ void CylinderItem::readFrom(QXmlStreamReader* r) EllipsoidalCylinderItem::EllipsoidalCylinderItem() { - m_radiusX.init("Radius x", "Radius of the ellipse base in the x-direction", 5.0, - Unit::nanometer, "radiusX"); - m_radiusY.init("Radius y", "Radius of the ellipse base in the y-direction", 8.0, - Unit::nanometer, "radiusY"); - m_height.init("Height", "Height of the ellipsoidal cylinder", 16.0, Unit::nanometer, "height"); + m_radiusX.init("Radius x (nm)", "Radius of the ellipse base in the x-direction", 5.0, + "radiusX"); + m_radiusY.init("Radius y (nm)", "Radius of the ellipse base in the y-direction", 8.0, + "radiusY"); + m_height.init("Height (nm)", "Height of the ellipsoidal cylinder", 16.0, "height"); } std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const @@ -445,7 +442,7 @@ void EllipsoidalCylinderItem::readFrom(QXmlStreamReader* r) SphereItem::SphereItem() { - m_radius.init("Radius", "Radius of the sphere", 8.0, Unit::nanometer, "radius"); + m_radius.init("Radius (nm)", "Radius of the sphere", 8.0, "radius"); } std::unique_ptr<IFormFactor> SphereItem::createFormFactor() const @@ -478,8 +475,8 @@ void SphereItem::readFrom(QXmlStreamReader* r) SpheroidItem::SpheroidItem() { - m_radius.init("Radius", "Radius of the circular cross section", 8.0, Unit::nanometer, "radius"); - m_height.init("Height", "Height of the full spheroid", 16.0, Unit::nanometer, "height"); + m_radius.init("Radius (nm)", "Radius of the circular cross section", 8.0, "radius"); + m_height.init("Height (nm)", "Height of the full spheroid", 16.0, "height"); } std::unique_ptr<IFormFactor> SpheroidItem::createFormFactor() const @@ -516,11 +513,11 @@ void SpheroidItem::readFrom(QXmlStreamReader* r) HemiEllipsoidItem::HemiEllipsoidItem() { - m_radiusX.init("Radius x", "Radius of the ellipse base in the x-direction", 8.0, - Unit::nanometer, "radiusX"); - m_radiusY.init("Radius y", "Radius of the ellipse base in the y-direction", 6.0, - Unit::nanometer, "radiusY"); - m_height.init("Height", "Height of the hemi ellipsoid", 16.0, Unit::nanometer, "height"); + m_radiusX.init("Radius x (nm)", "Radius of the ellipse base in the x-direction", 8.0, + "radiusX"); + m_radiusY.init("Radius y (nm)", "Radius of the ellipse base in the y-direction", 6.0, + "radiusY"); + m_height.init("Height (nm)", "Height of the hemi ellipsoid", 16.0, "height"); } std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const @@ -560,8 +557,8 @@ void HemiEllipsoidItem::readFrom(QXmlStreamReader* r) Prism3Item::Prism3Item() { - m_baseEdge.init("Base edge", "Length of the base edge", 14.0, Unit::nanometer, "baseEdge"); - m_height.init("Height", "Height", 16.0, Unit::nanometer, "height"); + m_baseEdge.init("Base edge (nm)", "Length of the base edge", 14.0, "baseEdge"); + m_height.init("Height (nm)", "Height", 16.0, "height"); } std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const @@ -598,8 +595,8 @@ void Prism3Item::readFrom(QXmlStreamReader* r) Prism6Item::Prism6Item() { - m_baseEdge.init("Base edge", "Length of the hexagonal base", 8.0, Unit::nanometer, "baseEdge"); - m_height.init("Height", "Height", 16.0, Unit::nanometer, "height"); + m_baseEdge.init("Base edge (nm)", "Length of the hexagonal base", 8.0, "baseEdge"); + m_height.init("Height (nm)", "Height", 16.0, "height"); } std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const @@ -636,8 +633,8 @@ void Prism6Item::readFrom(QXmlStreamReader* r) Pyramid4Item::Pyramid4Item() { - m_baseEdge.init("Base edge", "Length of the square base", 16.0, Unit::nanometer, "baseEdge"); - m_height.init("Height", "Height of the pyramid", 16.0, Unit::nanometer, "height"); + 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"); } @@ -680,9 +677,9 @@ void Pyramid4Item::readFrom(QXmlStreamReader* r) CosineRippleBoxItem::CosineRippleBoxItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); + 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 the ripple", 16.0, "height"); } std::unique_ptr<IFormFactor> CosineRippleBoxItem::createFormFactor() const @@ -722,9 +719,9 @@ void CosineRippleBoxItem::readFrom(QXmlStreamReader* r) CosineRippleGaussItem::CosineRippleGaussItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); + 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 the ripple", 16.0, "height"); } std::unique_ptr<IFormFactor> CosineRippleGaussItem::createFormFactor() const @@ -764,9 +761,9 @@ void CosineRippleGaussItem::readFrom(QXmlStreamReader* r) CosineRippleLorentzItem::CosineRippleLorentzItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); + 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 the ripple", 16.0, "height"); } std::unique_ptr<IFormFactor> CosineRippleLorentzItem::createFormFactor() const @@ -807,11 +804,11 @@ void CosineRippleLorentzItem::readFrom(QXmlStreamReader* r) SawtoothRippleBoxItem::SawtoothRippleBoxItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); - m_asymmetry.init("Asymmetry", "Asymmetry length of the triangular profile", 3.0, - Unit::nanometer, "asymmetry"); + 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 the ripple", 16.0, "height"); + m_asymmetry.init("Asymmetry (nm)", "Asymmetry length of the triangular profile", 3.0, + "asymmetry"); } std::unique_ptr<IFormFactor> SawtoothRippleBoxItem::createFormFactor() const @@ -855,11 +852,11 @@ void SawtoothRippleBoxItem::readFrom(QXmlStreamReader* r) SawtoothRippleGaussItem::SawtoothRippleGaussItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); - m_asymmetry.init("Asymmetry", "Asymmetry length of the triangular profile", 3.0, - Unit::nanometer, "asymmetry"); + 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 the ripple", 16.0, "height"); + m_asymmetry.init("Asymmetry (nm)", "Asymmetry length of the triangular profile", 3.0, + "asymmetry"); } std::unique_ptr<IFormFactor> SawtoothRippleGaussItem::createFormFactor() const @@ -903,11 +900,11 @@ void SawtoothRippleGaussItem::readFrom(QXmlStreamReader* r) SawtoothRippleLorentzItem::SawtoothRippleLorentzItem() { - m_length.init("Length", "Length of the rectangular base", 16.0, Unit::nanometer, "length"); - m_width.init("Width", "Width of the rectangular base", 16.0, Unit::nanometer, "width"); - m_height.init("Height", "Height of the ripple", 16.0, Unit::nanometer, "height"); - m_asymmetry.init("Asymmetry", "Asymmetry length of the triangular profile", 3.0, - Unit::nanometer, "asymmetry"); + 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 the ripple", 16.0, "height"); + m_asymmetry.init("Asymmetry (nm)", "Asymmetry length of the triangular profile", 3.0, + "asymmetry"); } std::unique_ptr<IFormFactor> SawtoothRippleLorentzItem::createFormFactor() const @@ -951,9 +948,9 @@ void SawtoothRippleLorentzItem::readFrom(QXmlStreamReader* r) Pyramid3Item::Pyramid3Item() { - m_baseEdge.init("Base edge", "Length of one edge of the equilateral triangular base", 14.0, - Unit::nanometer, "baseEdge"); - m_height.init("Height", "Height of the tetrahedron", 16.0, Unit::nanometer, "height"); + 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, RealLimits::limited(0.0, 90.0), "alpha"); } @@ -996,9 +993,9 @@ void Pyramid3Item::readFrom(QXmlStreamReader* r) TruncatedCubeItem::TruncatedCubeItem() { - m_length.init("Length", "Length of the full cube's edge", 16.0, Unit::nanometer, "length"); - m_removedLength.init("Removed length", "Removed length from each corner of the cube", 4.0, - Unit::nanometer, "removedLength"); + m_length.init("Length (nm)", "Length of the full cube's edge", 16.0, "length"); + m_removedLength.init("Removed length (nm)", "Removed length from each corner of the cube", 4.0, + "removedLength"); } std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const @@ -1035,11 +1032,10 @@ void TruncatedCubeItem::readFrom(QXmlStreamReader* r) TruncatedSphereItem::TruncatedSphereItem() { - m_radius.init("Radius", "Radius of the truncated sphere", 8.0, Unit::nanometer, "radius"); - m_untruncated_height.init("UntruncatedHeight", "Height before top removal", 16.0, - Unit::nanometer, "untruncated_height"); - m_removedTop.init("Delta height", "Height of the removed top cap", 16.0, Unit::nanometer, - "removedTop"); + m_radius.init("Radius (nm)", "Radius of the truncated sphere", 8.0, "radius"); + m_untruncated_height.init("UntruncatedHeight (nm)", "Height before top removal", 16.0, + "untruncated_height"); + m_removedTop.init("Delta height (nm)", "Height of the removed top cap", 16.0, "removedTop"); } std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const @@ -1080,16 +1076,15 @@ void TruncatedSphereItem::readFrom(QXmlStreamReader* r) TruncatedSpheroidItem::TruncatedSpheroidItem() { - m_radius.init("Radius", "Radius of the truncated spheroid", 8.0, Unit::nanometer, "radius"); - m_untruncated_height.init("UntruncatedHeight", "Height before top removal", 16.0, - Unit::nanometer, "untruncated_height"); + m_radius.init("Radius (nm)", "Radius of the truncated spheroid", 8.0, "radius"); + m_untruncated_height.init("UntruncatedHeight (nm)", "Height before top removal", 16.0, + "untruncated_height"); m_heightFlattening.init( "Height flattening", "Ratio of the height of the corresponding full spheroid to its diameter", 2.0, Unit::unitless, "heightFlattening"); - m_removedTop.init("Delta height", "Height of the removed top cap", 0.0, Unit::nanometer, - "removedTop"); + m_removedTop.init("Delta height (nm)", "Height of the removed top cap", 0.0, "removedTop"); } std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const @@ -1133,9 +1128,10 @@ void TruncatedSpheroidItem::readFrom(QXmlStreamReader* r) CantellatedCubeItem::CantellatedCubeItem() { - m_length.init("Length", "Length of the full cube's edge", 16.0, Unit::nanometer, "length"); - m_removedLength.init("Removed length", "Removed length from each edge and vertice of the cube", - 4.0, Unit::nanometer, "removedLength"); + m_length.init("Length (nm)", "Length of the full cube's edge", 16.0, "length"); + m_removedLength.init("Removed length (nm)", + "Removed length from each edge and vertice of the cube", 4.0, + "removedLength"); } std::unique_ptr<IFormFactor> CantellatedCubeItem::createFormFactor() const @@ -1172,12 +1168,13 @@ void CantellatedCubeItem::readFrom(QXmlStreamReader* r) HorizontalCylinderItem::HorizontalCylinderItem() { - m_radius.init("Radius", "Radius of the horizontal cylinder", 8.0, Unit::nanometer, "radius"); - m_length.init("Length", "Length of the horizontal cylinder", 16.0, Unit::nanometer, "length"); - m_sliceBottom.init("Bottom boundary", "Position of the lower boundary relative to the center", - -4.1, Unit::nanometer, "sliceBottom"); - m_sliceTop.init("Top boundary", "Position of the upper boundary relative to the center", +5.2, - Unit::nanometer, "sliceTop"); + m_radius.init("Radius (nm)", "Radius of the horizontal cylinder", 8.0, "radius"); + m_length.init("Length (nm)", "Length of the horizontal cylinder", 16.0, "length"); + m_sliceBottom.init("Bottom boundary (nm)", + "Position of the lower boundary relative to the center", -4.1, + "sliceBottom"); + m_sliceTop.init("Top boundary (nm)", "Position of the upper boundary relative to the center", + +5.2, "sliceTop"); } std::unique_ptr<IFormFactor> HorizontalCylinderItem::createFormFactor() const @@ -1242,7 +1239,7 @@ void PlatonicItem::readFrom(QXmlStreamReader* r) PlatonicOctahedronItem::PlatonicOctahedronItem() { - m_edge.init("Edge", "Length of the edge", 16.0, Unit::nanometer, "edge"); + m_edge.init("Edge (nm)", "Length of the edge", 16.0, "edge"); } std::unique_ptr<IFormFactor> PlatonicOctahedronItem::createFormFactor() const @@ -1254,7 +1251,7 @@ std::unique_ptr<IFormFactor> PlatonicOctahedronItem::createFormFactor() const PlatonicTetrahedronItem::PlatonicTetrahedronItem() { - m_edge.init("Edge", "Length of the edge", 20.0, Unit::nanometer, "edge"); + m_edge.init("Edge (nm)", "Length of the edge", 20.0, "edge"); } std::unique_ptr<IFormFactor> PlatonicTetrahedronItem::createFormFactor() const @@ -1266,7 +1263,7 @@ std::unique_ptr<IFormFactor> PlatonicTetrahedronItem::createFormFactor() const DodecahedronItem::DodecahedronItem() { - m_edge.init("Edge", "Length of the edge", 7.0, Unit::nanometer, "edge"); + m_edge.init("Edge (nm)", "Length of the edge", 7.0, "edge"); } std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const @@ -1278,7 +1275,7 @@ std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const IcosahedronItem::IcosahedronItem() { - m_edge.init("Edge", "Length of the edge", 10.0, Unit::nanometer, "edge"); + m_edge.init("Edge (nm)", "Length of the edge", 10.0, "edge"); } std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const diff --git a/GUI/Model/Sample/InterferenceItems.cpp b/GUI/Model/Sample/InterferenceItems.cpp index 994cf454a28..5bea50c74b2 100644 --- a/GUI/Model/Sample/InterferenceItems.cpp +++ b/GUI/Model/Sample/InterferenceItems.cpp @@ -79,7 +79,7 @@ void InterferenceItem::readFrom(QXmlStreamReader* r) Interference1DLatticeItem::Interference1DLatticeItem() { - m_length.init("Length", "Lattice length", 20.0, Unit::nanometer, "Length"); + m_length.init("Length (nm)", "Lattice length", 20.0, "Length"); m_rotationAngle.init( "Xi", "Rotation of lattice with respect to x-axis of reference frame (beam direction)", 0.0, Unit::degree, "xi"); @@ -274,12 +274,14 @@ void Interference2DLatticeItem::readFrom(QXmlStreamReader* r) Interference2DParacrystalItem::Interference2DParacrystalItem() : Interference2DAbstractLatticeItem(true) { - m_dampingLength.init("Damping length", "The damping (coherence) length of the paracrystal", 0.0, - Unit::nanometer, "dampingLen"); - m_domainSize1.init("Domain size 1", "Size of the coherent domain along the first basis vector", - 20000.0, Unit::nanometer, "size1"); - m_domainSize2.init("Domain size 2", "Size of the coherent domain along the second basis vector", - 20000.0, Unit::nanometer, "size2"); + m_dampingLength.init("Damping length (nm)", "The damping (coherence) length of the paracrystal", + 0.0, "dampingLen"); + m_domainSize1.init("Domain size 1 (nm)", + "Size of the coherent domain along the first basis vector", 20000.0, + "size1"); + m_domainSize2.init("Domain size 2 (nm)", + "Size of the coherent domain along the second basis vector", 20000.0, + "size2"); m_pdf1.init("PDF 1", "Probability distribution in first lattice direction"); m_pdf2.init("PDF 2", "Probability distribution in second lattice direction"); } @@ -448,7 +450,7 @@ void InterferenceFinite2DLatticeItem::readFrom(QXmlStreamReader* r) InterferenceHardDiskItem::InterferenceHardDiskItem() { - m_radius.init("Radius", "Hard disk radius", 5.0, Unit::nanometer, "radius"); + m_radius.init("Radius (nm)", "Hard disk radius", 5.0, "radius"); m_density.init("Total particle density", "Particle density in particles per area", 0.002, Unit::nanometerMinus2, 6 /* decimals */, 0.0001 /* step */, RealLimits::nonnegative(), "density"); @@ -513,12 +515,12 @@ void InterferenceHardDiskItem::readFrom(QXmlStreamReader* r) InterferenceRadialParacrystalItem::InterferenceRadialParacrystalItem() { - m_peakDistance.init("Peak distance", "Average distance to the next neighbor", 20.0, - Unit::nanometer, "peak"); - m_dampingLength.init("Damping length", "The damping (coherence) length of the paracrystal", - 1000.0, Unit::nanometer, "dampingLen"); - m_domainSize.init("Domain size", "Size of coherence domain along the lattice main axis", 0.0, - Unit::nanometer, "size"); + m_peakDistance.init("Peak distance (nm)", "Average distance to the next neighbor", 20.0, + "peak"); + m_dampingLength.init("Damping length (nm)", "The damping (coherence) length of the paracrystal", + 1000.0, "dampingLen"); + m_domainSize.init("Domain size (nm)", "Size of coherence domain along the lattice main axis", + 0.0, "size"); m_kappa.init("SizeSpaceCoupling", "Size spacing coupling parameter of the Size Spacing Correlation Approximation", 0.0, Unit::unitless, "kappa"); diff --git a/GUI/Model/Sample/Lattice2DItems.cpp b/GUI/Model/Sample/Lattice2DItems.cpp index cad293b0b99..b2eba1e76bc 100644 --- a/GUI/Model/Sample/Lattice2DItems.cpp +++ b/GUI/Model/Sample/Lattice2DItems.cpp @@ -67,10 +67,8 @@ double Lattice2DItem::unitCellArea() const BasicLattice2DItem::BasicLattice2DItem() { - m_length1.init("LatticeLength1", "Length of first lattice vector", 20.0, Unit::nanometer, - "len1"); - m_length2.init("LatticeLength2", "Length of second lattice vector", 20.0, Unit::nanometer, - "len2"); + 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, RealLimits::limited(0, 180.0), "angle"); } @@ -124,8 +122,7 @@ void BasicLattice2DItem::readFrom(QXmlStreamReader* r) SquareLattice2DItem::SquareLattice2DItem() { - m_length.init("LatticeLength", "Length of first and second lattice vectors", 20.0, - Unit::nanometer, "len"); + m_length.init("LatticeLength (nm)", "Length of first and second lattice vectors", 20.0, "len"); } std::unique_ptr<Lattice2D> SquareLattice2DItem::createLattice() const @@ -176,8 +173,7 @@ void SquareLattice2DItem::readFrom(QXmlStreamReader* r) HexagonalLattice2DItem::HexagonalLattice2DItem() { - m_length.init("LatticeLength", "Length of first and second lattice vectors", 20.0, - Unit::nanometer, "len"); + m_length.init("LatticeLength (nm)", "Length of first and second lattice vectors", 20.0, "len"); } std::unique_ptr<Lattice2D> HexagonalLattice2DItem::createLattice() const diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp index 02b846a539d..03d0540ee69 100644 --- a/GUI/Model/Sample/LayerItem.cpp +++ b/GUI/Model/Sample/LayerItem.cpp @@ -69,7 +69,7 @@ QVector<ItemWithMaterial*> layoutItemsWithMaterial(ParticleLayoutItem* layout) LayerItem::LayerItem(const MaterialModel* materials) : ItemWithMaterial(materials) { - m_thickness.init("Thickness", "Thickness of the layer", 0.0, Unit::nanometer, 3 /* decimals */, + m_thickness.init("Thickness (nm)", "Thickness of the layer", 0.0, 3 /* decimals */, RealLimits::lowerLimited(0.0), "thickness"); m_name = "Layer"; diff --git a/GUI/Model/Sample/ProfileItems.cpp b/GUI/Model/Sample/ProfileItems.cpp index 10cab792793..868bdb471f5 100644 --- a/GUI/Model/Sample/ProfileItems.cpp +++ b/GUI/Model/Sample/ProfileItems.cpp @@ -31,7 +31,7 @@ const QString BaseData("BaseData"); Profile1DItem::Profile1DItem() { - m_omega.init("Omega", "Half-width of the distribution", 1.0, Unit::nanometer, "omega"); + m_omega.init("Omega (nm)", "Half-width of the distribution", 1.0, "omega"); } void Profile1DItem::writeTo(QXmlStreamWriter* w) const @@ -155,10 +155,8 @@ DoubleProperties Profile1DVoigtItem::profileProperties() Profile2DItem::Profile2DItem() { - m_omegaX.init("OmegaX", "Half-width of the distribution along its x-axis", 1.0, Unit::nanometer, - "omegaX"); - m_omegaY.init("OmegaY", "Half-width of the distribution along its y-axis", 1.0, Unit::nanometer, - "omegaY"); + m_omegaX.init("OmegaX (nm)", "Half-width of the distribution along its x-axis", 1.0, "omegaX"); + m_omegaY.init("OmegaY (nm)", "Half-width of the distribution along its y-axis", 1.0, "omegaY"); m_gamma.init( "Gamma", "Angle in direct space between first lattice vector and x-axis of the distribution", 0.0, diff --git a/GUI/Model/Sample/RoughnessItems.cpp b/GUI/Model/Sample/RoughnessItems.cpp index f13486b7fba..a9b487099db 100644 --- a/GUI/Model/Sample/RoughnessItems.cpp +++ b/GUI/Model/Sample/RoughnessItems.cpp @@ -27,14 +27,13 @@ const QString LateralCorrelationLength("LateralCorrelationLength"); BasicRoughnessItem::BasicRoughnessItem() { - m_sigma.init("Sigma", "rms of the roughness", 1.0, Unit::nanometer, "sigma"); + m_sigma.init("Sigma (nm)", "rms of the roughness", 1.0, "sigma"); m_hurst.init("Hurst", "Hurst parameter which describes how jagged the interface,\n " "dimensionless [0.0, 1.0], where 0.0 gives more spikes, \n1.0 more smoothness.", 0.3, Unit::unitless, 3 /* decimals */, RealLimits::limited(0.0, 1.0), "hurst"); - m_lateralCorrelationLength.init("Correlation length", - "Lateral correlation length of the roughness", 5.0, - Unit::nanometer, "corrLen"); + m_lateralCorrelationLength.init("Correlation length (nm)", + "Lateral correlation length of the roughness", 5.0, "corrLen"); } void BasicRoughnessItem::writeTo(QXmlStreamWriter* w) const -- GitLab