35 const double overrideValue) {
37 double param = defaultValue;
38 if (pm->existsProperty(pmProp)) {
39 param = pm->getProperty(pmProp);
40 if (defaultValue == param) {
41 std::vector<double> params = ws->getInstrument()->getNumberParameter(instParam);
42 if (!params.empty()) {
47 std::vector<double> params = ws->getInstrument()->getNumberParameter(instParam);
48 if (!params.empty()) {
52 if ((defaultValue == param) && (defaultValue != overrideValue)) {
53 param = overrideValue;
77 int param = defaultValue;
78 if (pm->existsProperty(pmProp)) {
79 param = pm->getProperty(pmProp);
80 if (defaultValue == param) {
81 std::vector<int> params = ws->getInstrument()->getIntParameter(instParam);
82 if (!params.empty()) {
87 std::vector<int> params = ws->getInstrument()->getIntParameter(instParam);
88 if (!params.empty()) {
92 if ((defaultValue == param) && (defaultValue != overrideValue)) {
93 param = overrideValue;
117 bool defaultValue =
false;
118 bool param = defaultValue;
119 if (pm->existsProperty(pmProp)) {
120 param = pm->getProperty(pmProp);
123 std::vector<bool> params = ws->getInstrument()->getBoolParameter(instParam);
128 }
catch (std::runtime_error &)
130 std::vector<double> params = ws->getInstrument()->getNumberParameter(instParam);
131 if (!params.empty()) {
132 param = (params[0] != 0.0);
136 if ((defaultValue == param) && (defaultValue != overrideValue)) {
137 param = overrideValue;
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< PropertyManager > PropertyManager_sptr
Typedef for a shared pointer to a PropertyManager.
Helper class which provides the Collimation Length for SANS instruments.
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
int getIntPropOrParam(const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const int overrideValue=Mantid::EMPTY_INT())
Function to get int property or instrument parameter value.
bool getBoolPropOrParam(const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const bool overrideValue=false)
Function to get boolean property or instrument parameter value.
double getDblPropOrParam(const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const double overrideValue=Mantid::EMPTY_DBL())
Function to get double property or instrument parameter value.