diff --git a/Device/Beam/IFootprint.cpp b/Device/Beam/IFootprint.cpp index d1e6a6a1caf0ee710c927e3bb03e278c5ce00cbf..86d3f98fa363ba3a348924a4709a695bbf40fcaf 100644 --- a/Device/Beam/IFootprint.cpp +++ b/Device/Beam/IFootprint.cpp @@ -28,7 +28,7 @@ IFootprint::~IFootprint() = default; std::string IFootprint::validate() const { std::vector<std::string> errs; - requestGt0(errs, m_width_ratio, "width_ratio"); + requestGe0(errs, m_width_ratio, "width_ratio"); if (!errs.empty()) return jointError(errs); diff --git a/GUI/Model/Beam/SourceItems.cpp b/GUI/Model/Beam/SourceItems.cpp index 6328e1f6a2b3db2a1c84e780ae8cca4d9c280131..20897f9b5696253900588d48f5247e6abd30a232 100644 --- a/GUI/Model/Beam/SourceItems.cpp +++ b/GUI/Model/Beam/SourceItems.cpp @@ -54,7 +54,7 @@ SourceItem::SourceItem() RealLimits::limited(0.0, 1e32), "intensity"); m_azimuthalAngleItem.reset(new BeamAzimuthalAngleItem()); - m_footprint.init("Type", "Footprint type"); + m_footprint.init("Type", "Footprint type", FootprintItemCatalog::Type::Gaussian); } void SourceItem::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Beam/SourceItems.h b/GUI/Model/Beam/SourceItems.h index 16c439c604b0163af76e95b6f397e80e3eccdb60..da27e3bc68a1b4b9f271cd1a31a316f19d9d9ba1 100644 --- a/GUI/Model/Beam/SourceItems.h +++ b/GUI/Model/Beam/SourceItems.h @@ -27,7 +27,6 @@ class BeamAzimuthalAngleItem; class BeamDistributionItem; class BeamScan; class BeamWavelengthItem; -class FootprintItem; class Frame; class GrazingScanItem; class IFootprint; diff --git a/GUI/Model/Descriptor/SelectionProperty.h b/GUI/Model/Descriptor/SelectionProperty.h index 2a9e469ce9c3fcc0e0ebff807a888037248b4bf8..4a00140a94f51a953ee24bd336e44d4544e37f2e 100644 --- a/GUI/Model/Descriptor/SelectionProperty.h +++ b/GUI/Model/Descriptor/SelectionProperty.h @@ -61,10 +61,12 @@ public: //! optional arguments are the arguments which may be necessary for the creation method in the //! catalog. template <typename... ArgsForCreation> - void init(const QString& label, const QString& tooltip, ArgsForCreation... argsForCreation) + void init(const QString& label, const QString& tooltip, typename Catalog::Type currentType, + ArgsForCreation... argsForCreation) { initFieldsAndSetter(label, tooltip, argsForCreation...); - setCurrentIndex(0); + int index = Catalog::types().indexOf(currentType); + setCurrentIndex(index); } //! Initialize by means of a catalog class and an initializer function. diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index 8afc4895d504deaad223281d0888b90292585460..b66ec825052c0ed06b5aded8d2420360b8840028 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -51,7 +51,8 @@ DetectorItem::DetectorItem() m_alphaAxis.initMax("Max (deg)", "Upper edge of last alpha-bin", 3.0, RealLimits::limited(-90, 90)); - m_resolutionFunction.init("Resolution function", "Detector resolution function"); + m_resolutionFunction.init("Resolution function", "Detector resolution function", + ResolutionFunctionItemCatalog::Type::None); } DetectorItem::~DetectorItem() = default; diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp index e47853972536d364dd84ac7c6ebf0ebbf848516e..724abd23c72b3f1ca821ccf6da9a5895ff04f5a5 100644 --- a/GUI/Model/Device/InstrumentItems.cpp +++ b/GUI/Model/Device/InstrumentItems.cpp @@ -102,7 +102,7 @@ InstrumentItem::InstrumentItem() m_analyzerBlochVector.init("Analyzer Bloch vector", "Polarization analyzer direction times efficiency", "analyzerBlochVector"); - m_background.init("Background", ""); + m_background.init("Background", "", BackgroundItemCatalog::Type::Constant); } InstrumentItem* InstrumentItem::createItemCopy() const diff --git a/GUI/Model/Sample/InterferenceItems.cpp b/GUI/Model/Sample/InterferenceItems.cpp index b74851831a3ae2940a53ab35327e8482f6ada6eb..43ea805e761ecdf8934fcafdb3346cd91ab52442 100644 --- a/GUI/Model/Sample/InterferenceItems.cpp +++ b/GUI/Model/Sample/InterferenceItems.cpp @@ -84,7 +84,8 @@ Interference1DLatticeItem::Interference1DLatticeItem() "Xi (deg)", "Rotation of lattice with respect to x-axis of reference frame (beam direction)", 0.0, "xi"); - m_decayFunction.init("Decay Function", "One-dimensional decay function (finite size effects)"); + m_decayFunction.init("Decay Function", "One-dimensional decay function (finite size effects)", + Profile1DItemCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference1DLatticeItem::createInterference() const @@ -207,7 +208,7 @@ void Interference2DAbstractLatticeItem::readFrom(QXmlStreamReader* r) Interference2DAbstractLatticeItem::Interference2DAbstractLatticeItem(bool xiIntegration) : m_xiIntegration(xiIntegration) { - m_latticeType.init("Lattice type", ""); + m_latticeType.init("Lattice type", "", Lattice2DItemCatalog::Type::Basic); m_latticeType.setCurrentItem(new HexagonalLattice2DItem()); } @@ -216,7 +217,8 @@ Interference2DAbstractLatticeItem::Interference2DAbstractLatticeItem(bool xiInte Interference2DLatticeItem::Interference2DLatticeItem() : Interference2DAbstractLatticeItem(false) { - m_decayFunction.init("Decay Function", "Two-dimensional decay function (finite size effects)"); + m_decayFunction.init("Decay Function", "Two-dimensional decay function (finite size effects)", + Profile2DItemCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference2DLatticeItem::createInterference() const @@ -283,8 +285,10 @@ Interference2DParacrystalItem::Interference2DParacrystalItem() 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"); + m_pdf1.init("PDF 1", "Probability distribution in first lattice direction", + Profile2DItemCatalog::Type::Cauchy); + m_pdf2.init("PDF 2", "Probability distribution in second lattice direction", + Profile2DItemCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference2DParacrystalItem::createInterference() const @@ -524,7 +528,8 @@ InterferenceRadialParacrystalItem::InterferenceRadialParacrystalItem() m_kappa.init("SizeSpaceCoupling", "Size spacing coupling parameter of the Size Spacing Correlation Approximation", 0.0, "kappa"); - m_pdf.init("PDF", "One-dimensional probability distribution"); + m_pdf.init("PDF", "One-dimensional probability distribution", + Profile1DItemCatalog::Type::Cauchy); } std::unique_ptr<IInterference> InterferenceRadialParacrystalItem::createInterference() const diff --git a/GUI/Model/Sample/ItemWithParticles.cpp b/GUI/Model/Sample/ItemWithParticles.cpp index f831bffb4616b6550214d0831f9ce3d210b9282b..87f02a08866321956e2697fb29047806cb8a760a 100644 --- a/GUI/Model/Sample/ItemWithParticles.cpp +++ b/GUI/Model/Sample/ItemWithParticles.cpp @@ -33,7 +33,7 @@ ItemWithParticles::ItemWithParticles(const QString& abundanceTooltip, m_abundance.init("Abundance", abundanceTooltip, 1.0, 3, RealLimits::limited(0.0, 1.0), "abundance"); m_position.init("Position offset (nm)", positionTooltip, "pos"); - m_rotation.init("Rotation", ""); + m_rotation.init("Rotation", "", RotationItemCatalog::Type::None); } std::unique_ptr<IRotation> ItemWithParticles::createRotation() const diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp index f395a52904aaebbc221f41daba6abdf5b02a8448..26c62745ab2323916a382fdf7aa57abddd0fa9b5 100644 --- a/GUI/Model/Sample/LayerItem.cpp +++ b/GUI/Model/Sample/LayerItem.cpp @@ -74,7 +74,8 @@ LayerItem::LayerItem(const MaterialModel* materials) m_name = "Layer"; - m_roughness.init("Top roughness", "Roughness of top interface"); + m_roughness.init("Top roughness", "Roughness of top interface", + RoughnessItemCatalog::Type::Basic); } LayerItem::~LayerItem() = default; diff --git a/GUI/Model/Sample/MesocrystalItem.cpp b/GUI/Model/Sample/MesocrystalItem.cpp index a8dd96622621c2a7b52e3f36900a57a1c4b98757..77ee63d4238892f8e1155fa90914a314f349fc7d 100644 --- a/GUI/Model/Sample/MesocrystalItem.cpp +++ b/GUI/Model/Sample/MesocrystalItem.cpp @@ -57,8 +57,8 @@ MesocrystalItem::MesocrystalItem(const MaterialModel* materials) m_vectorC.init("Third lattice vector (nm)", "Coordinates of the third lattice vector", "vectorC"); - m_outerShape.init("Outer Shape", ""); - m_basisParticle.init("Basis", "", materials); + m_outerShape.init("Outer Shape", "", FormFactorItemCatalog::Type::Box); + m_basisParticle.init("Basis", "", ItemWithParticlesCatalog::Type::Particle, materials); } void MesocrystalItem::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Sample/ParticleItem.cpp b/GUI/Model/Sample/ParticleItem.cpp index e4864cfede782b2f4789ec93eba7a30ce2fed2ee..1be8eedd0b40a04b0054fc7456d42b02d5319956 100644 --- a/GUI/Model/Sample/ParticleItem.cpp +++ b/GUI/Model/Sample/ParticleItem.cpp @@ -41,7 +41,7 @@ ParticleItem::ParticleItem(const MaterialModel* materials) : ItemWithMaterial(materials) , ItemWithParticles(abundance_tooltip, position_tooltip) { - m_formFactor.init("Form Factor", ""); + m_formFactor.init("Form Factor", "", FormFactorItemCatalog::Type::Sphere); m_formFactor.setCurrentItem(new CylinderItem()); } diff --git a/GUI/Model/Sample/ParticleLayoutItem.cpp b/GUI/Model/Sample/ParticleLayoutItem.cpp index 61a85946a3c7dcd801b774341f153da2ea76dbd2..ebf094dd0c7945d2b7447ce4c5ce4c184ea3abd9 100644 --- a/GUI/Model/Sample/ParticleLayoutItem.cpp +++ b/GUI/Model/Sample/ParticleLayoutItem.cpp @@ -40,7 +40,7 @@ ParticleLayoutItem::ParticleLayoutItem(const MaterialModel* materials) "Should be defined for disordered and 1d-ordered particle collections.", 0.0005, 6, 0.0001 /* step */, RealLimits::nonnegative(), "density"); - m_interference.init("Interference function", ""); + m_interference.init("Interference function", "", InterferenceItemCatalog::Type::None); } double ParticleLayoutItem::totalDensityValue() const