|
Mantid
|
#include <SetValueWhenProperty.h>
Public Member Functions | |
| bool | applyChanges (const Mantid::Kernel::IPropertyManager *algo, const std::string ¤tPropName) override |
| If a new value should be set, the change is applied here. | |
| IPropertySettings * | clone () const override |
| Make a copy of the present type of IPropertySettings. | |
| std::vector< std::string > | dependsOn (const std::string &thisProp) const override |
| Other properties that this property depends on. | |
| bool | isConditionChanged (const IPropertyManager *algo, const std::string &changedPropName) const override |
| Return true when the property changed is the property that the current property's value depends on. | |
| SetValueWhenProperty (const std::string &watchedPropName, const std::function< std::string(std::string, std::string)> &changeCriterion) | |
| Constructs an SetValueWhenProperty object which checks the watched property with name given and uses the given function to check if changes should be applied. | |
Public Member Functions inherited from Mantid::Kernel::IPropertySettings | |
| IPropertySettings ()=default | |
| Constructor. | |
| virtual bool | isEnabled (const IPropertyManager *algo) const |
| Is the property to be shown as "enabled" in the GUI. | |
| virtual bool | isVisible (const IPropertyManager *algo) const |
| Is the property to be shown in the GUI? Default true. | |
| virtual | ~IPropertySettings ()=default |
| Destructor. | |
Private Attributes | |
| std::function< std::string(std::string, std::string)> | m_changeCriterion |
| Callback to check and actually apply any required changes: this function returns a new string value for the current property, which in some cases might be the same as the current value. | |
| std::string | m_watchedPropName |
| Name of the watched property, which is the property that the current property's value depends on. | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Kernel::IPropertySettings | |
| IPropertySettings (const IPropertySettings &)=default | |
Definition at line 21 of file SetValueWhenProperty.h.
|
inline |
Constructs an SetValueWhenProperty object which checks the watched property with name given and uses the given function to check if changes should be applied.
Definition at line 26 of file SetValueWhenProperty.h.
|
overridevirtual |
If a new value should be set, the change is applied here.
Return true if the current property was actually changed.
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 41 of file SetValueWhenProperty.cpp.
References Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::IPropertyManager::getPointerToProperty(), m_changeCriterion, m_watchedPropName, Mantid::Kernel::Property::value(), and Mantid::Kernel::Logger::warning().
|
overridevirtual |
Make a copy of the present type of IPropertySettings.
Implements Mantid::Kernel::IPropertySettings.
Definition at line 76 of file SetValueWhenProperty.cpp.
|
overridevirtual |
Other properties that this property depends on.
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 70 of file SetValueWhenProperty.cpp.
References m_watchedPropName.
|
overridevirtual |
Return true when the property changed is the property that the current property's value depends on.
Return true if the changedPropName matches the watchedPropName.
| algo | :: Pointer to the algorithm containing the property |
| changedPropName | :: Name of the property that has just been changed |
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 36 of file SetValueWhenProperty.cpp.
References Mantid::Kernel::IPropertyManager::getPointerToProperty(), m_watchedPropName, and Mantid::Kernel::Property::name().
|
private |
Callback to check and actually apply any required changes: this function returns a new string value for the current property, which in some cases might be the same as the current value.
Definition at line 50 of file SetValueWhenProperty.h.
Referenced by applyChanges().
|
private |
Name of the watched property, which is the property that the current property's value depends on.
Definition at line 45 of file SetValueWhenProperty.h.
Referenced by applyChanges(), dependsOn(), and isConditionChanged().