diff --git a/GUI/coregui/Models/BeamItem.cpp b/GUI/coregui/Models/BeamItem.cpp index 3c8574c9d65c857fa555031cd84ef7755135b158..d5644ed99b61ed9474f96c008816b3f7e9649806 100644 --- a/GUI/coregui/Models/BeamItem.cpp +++ b/GUI/coregui/Models/BeamItem.cpp @@ -32,7 +32,8 @@ const QString BeamItem::P_AZIMUTHAL_ANGLE = QString::fromStdString(BornAgain::Az BeamItem::BeamItem() : SessionItem(Constants::BeamType) { ScientificDoubleProperty intensity(1e+08); - addProperty(P_INTENSITY, intensity.getVariant())->setLimits(RealLimits::limited(0.0, 1e+32)); + addProperty(P_INTENSITY, intensity.getVariant())->setLimits(RealLimits::limited(0.0, 1e+32)) + .setToolTip("Beam intensity in neutrons (or gammas) per sec."); addGroupProperty(P_WAVELENGTH, Constants::BeamWavelengthType); addGroupProperty(P_INCLINATION_ANGLE, Constants::BeamInclinationAngleType); addGroupProperty(P_AZIMUTHAL_ANGLE, Constants::BeamAzimuthalAngleType); diff --git a/GUI/coregui/Models/DetectorItems.cpp b/GUI/coregui/Models/DetectorItems.cpp index f9d9e34f9036cdbdb31fc92d79326626b23f4e23..faf46cf66b7bba08577940bddd3fa3fd9fd39707 100644 --- a/GUI/coregui/Models/DetectorItems.cpp +++ b/GUI/coregui/Models/DetectorItems.cpp @@ -33,6 +33,12 @@ DetectorItem::DetectorItem(const QString& modelType) : SessionItem(modelType) { registerTag(T_MASKS, 0, -1, QStringList() << Constants::MaskContainerType); setDefaultTag(T_MASKS); + + mapper()->setOnPropertyChange([this](const QString& name) { + if (name == P_RESOLUTION_FUNCTION) + update_resolution_function_tooltips(); + }); + } std::unique_ptr<IDetector2D> DetectorItem::createDetector() const @@ -73,8 +79,23 @@ void DetectorItem::importMasks(MaskContainerItem* maskContainer) void DetectorItem::register_resolution_function() { - addGroupProperty(P_RESOLUTION_FUNCTION, Constants::ResolutionFunctionGroup) - ->setDisplayName(res_func_group_label); + auto item = addGroupProperty(P_RESOLUTION_FUNCTION, Constants::ResolutionFunctionGroup); + item->setDisplayName(res_func_group_label); + item->setToolTip("Detector resolution function"); +} + +void DetectorItem::update_resolution_function_tooltips() +{ + auto& resfuncItem = groupItem<ResolutionFunctionItem>(DetectorItem::P_RESOLUTION_FUNCTION); + + if(resfuncItem.modelType() == Constants::ResolutionFunction2DGaussianType) { + QString units = modelType() == Constants::SphericalDetectorType ? "deg" : "mm"; + + resfuncItem.getItem(ResolutionFunction2DGaussianItem::P_SIGMA_X) + ->setToolTip("Resolution along horizontal axis (in "+units+")"); + resfuncItem.getItem(ResolutionFunction2DGaussianItem::P_SIGMA_Y) + ->setToolTip("Resolution along vertical axis (in "+units+")"); + } } std::unique_ptr<IResolutionFunction2D> DetectorItem::createResolutionFunction() const diff --git a/GUI/coregui/Models/DetectorItems.h b/GUI/coregui/Models/DetectorItems.h index fea70d171cf8eccb878e0ae35031e62d1d2e69d7..3583941a9a124f058690a048cc33acc8b294eec6 100644 --- a/GUI/coregui/Models/DetectorItems.h +++ b/GUI/coregui/Models/DetectorItems.h @@ -45,6 +45,7 @@ public: protected: void register_resolution_function(); + void update_resolution_function_tooltips(); virtual std::unique_ptr<IDetector2D> createDomainDetector() const = 0; std::unique_ptr<IResolutionFunction2D> createResolutionFunction() const; diff --git a/GUI/coregui/Models/ResolutionFunctionItems.cpp b/GUI/coregui/Models/ResolutionFunctionItems.cpp index 866024543e3d826f5c9d7f9a12516e4ac35c823d..c8eaaae595ff40aed5a70dfb420355549d6b9e80 100644 --- a/GUI/coregui/Models/ResolutionFunctionItems.cpp +++ b/GUI/coregui/Models/ResolutionFunctionItems.cpp @@ -44,8 +44,10 @@ const QString ResolutionFunction2DGaussianItem::P_SIGMA_Y = QString::fromStdStri ResolutionFunction2DGaussianItem::ResolutionFunction2DGaussianItem() : ResolutionFunctionItem(Constants::ResolutionFunction2DGaussianType) { - addProperty(P_SIGMA_X, 0.02)->setLimits(RealLimits::lowerLimited(0.0)).setDecimals(3); - addProperty(P_SIGMA_Y, 0.02)->setLimits(RealLimits::lowerLimited(0.0)).setDecimals(3); + addProperty(P_SIGMA_X, 0.02)->setLimits(RealLimits::lowerLimited(0.0)).setDecimals(3) + .setToolTip("Resolution along horizontal axis (in detector units)"); + addProperty(P_SIGMA_Y, 0.02)->setLimits(RealLimits::lowerLimited(0.0)).setDecimals(3) + .setToolTip("Resolution along vertical axis (in detector units)"); } std::unique_ptr<IResolutionFunction2D> diff --git a/GUI/coregui/Models/SphericalDetectorItem.cpp b/GUI/coregui/Models/SphericalDetectorItem.cpp index 96e421501007dccb363ac7e136a85215c65a3002..7256d9b569656929394071dfa6488c9d80397110 100644 --- a/GUI/coregui/Models/SphericalDetectorItem.cpp +++ b/GUI/coregui/Models/SphericalDetectorItem.cpp @@ -30,11 +30,19 @@ SphericalDetectorItem::SphericalDetectorItem() item->setItemValue(BasicAxisItem::P_MIN, -1.0); item->setItemValue(BasicAxisItem::P_MAX, 1.0); + item->getItem(BasicAxisItem::P_NBINS)->setToolTip("Number of phi-axis bins"); + item->getItem(BasicAxisItem::P_MIN)->setToolTip("Low edge of first phi-bin (in deg)"); + item->getItem(BasicAxisItem::P_MAX)->setToolTip("Upper edge of last phi-bin (in deg)"); + item = addGroupProperty(P_ALPHA_AXIS, Constants::BasicAxisType); item->getItem(BasicAxisItem::P_TITLE)->setVisible(false); item->setItemValue(BasicAxisItem::P_MIN, 0.0); item->setItemValue(BasicAxisItem::P_MAX, 2.0); + item->getItem(BasicAxisItem::P_NBINS)->setToolTip("Number of alpha-axis bins"); + item->getItem(BasicAxisItem::P_MIN)->setToolTip("Low edge of first alpha-bin (in deg)"); + item->getItem(BasicAxisItem::P_MAX)->setToolTip("Upper edge of last alpha-bin (in deg)"); + register_resolution_function(); } diff --git a/GUI/coregui/Views/InstrumentWidgets/InstrumentViewActions.cpp b/GUI/coregui/Views/InstrumentWidgets/InstrumentViewActions.cpp index 2250e0bdf9876b35c5a7ffdafb91299375c497fe..5d024d4f6aef7da040e413cb73c51117fc6019d2 100644 --- a/GUI/coregui/Views/InstrumentWidgets/InstrumentViewActions.cpp +++ b/GUI/coregui/Views/InstrumentWidgets/InstrumentViewActions.cpp @@ -33,10 +33,10 @@ InstrumentViewActions::InstrumentViewActions(QWidget* parent) "Add new instrument", this); m_removeInstrumentAction = new QAction(QIcon(":/images/toolbar16dark_recycle.svg"), - "Remove currently selected instrument", this); + "Remove this instrument", this); m_cloneInstrumentAction = new QAction(QIcon(":/images/toolbar16dark_cloneitem.svg"), - "Clone currently selected instrument", this); + "Clone this instrument", this); connect(m_addInstrumentAction, SIGNAL(triggered()), this, SLOT(onAddInstrument())); connect(m_removeInstrumentAction, SIGNAL(triggered()), this, SLOT(onRemoveInstrument()));