Mantid
Loading...
Searching...
No Matches
EnabledWhenProperty.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <boost/python/class.hpp>
9#include <boost/python/enum.hpp>
10
11using namespace Mantid::Kernel;
12using namespace boost::python;
13
15 // State enumeration
16 enum_<ePropertyCriterion>("PropertyCriterion")
17 .value("IsDefault", IS_DEFAULT)
18 .value("IsNotDefault", IS_NOT_DEFAULT)
19 .value("IsEqualTo", IS_EQUAL_TO)
20 .value("IsNotEqualTo", IS_NOT_EQUAL_TO)
21 .value("IsMoreOrEqual", IS_MORE_OR_EQ);
22
23 // Logic enumeration
24 enum_<eLogicOperator>("LogicOperator").value("And", AND).value("Or", OR).value("Xor", XOR);
25
26 class_<EnabledWhenProperty, bases<IPropertySettings>>("EnabledWhenProperty", no_init) // no default constructor
27
28 .def(init<std::string, ePropertyCriterion, std::string>(
29 (arg("self"), arg("otherPropName"), arg("when"), arg("value")),
30 "Enabled otherPropName property when value criterion meets that "
31 "given by the 'when' argument"))
32
33 .def(init<std::string, ePropertyCriterion>((arg("self"), arg("otherPropName"), arg("when")),
34 "Enabled otherPropName property when criterion does not require a "
35 "value, i.e isDefault"))
36
37 .def(init<EnabledWhenProperty, EnabledWhenProperty, eLogicOperator>(
38 (arg("self"), arg("conditionObjOne"), arg("conditionObjTwo"), arg("operator")),
39 "Enables property when the two EnabledWhenProperty conditions match"
40 " the operator condition"));
41}
void export_EnabledWhenProperty()