Skip to content

Commit 39f4060

Browse files
Restored changes because python binding is not ready.
1 parent a6ae996 commit 39f4060

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

Framework/Algorithms/src/PDCalibration.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include "MantidKernel/ArrayProperty.h"
3131
#include "MantidKernel/BoundedValidator.h"
3232
#include "MantidKernel/CompositeValidator.h"
33-
#include "MantidKernel/EnumeratedString.h"
34-
#include "MantidKernel/EnumeratedStringProperty.h"
3533
#include "MantidKernel/ListValidator.h"
3634
#include "MantidKernel/MandatoryValidator.h"
3735
#include "MantidKernel/RebinParamsValidator.h"
@@ -75,17 +73,6 @@ DECLARE_ALGORITHM(PDCalibration)
7573

7674
namespace { // anonymous
7775
const auto isNonZero = [](const double value) { return value != 0.; };
78-
79-
// properties about peak positions to fit
80-
const std::vector<std::string> peakTypesNames{"BackToBackExponential", "Gaussian", "Lorentzian", "PseudoVoigt",
81-
"IkedaCarpenterPV"};
82-
enum class PeakMode { BackToBackExponential, Gaussian, Lorentzian, PseudoVoigt, IkedaCarpenterPV, enum_count };
83-
typedef Mantid::Kernel::EnumeratedString<PeakMode, &peakTypesNames> PEAKMODE;
84-
85-
const vector<std::string> backgroundTypesNames{"Flat", "Linear", "Quadratic"};
86-
enum class BackgroundMode { FLAT, LINEAR, QUADRATIC, enum_count };
87-
typedef Mantid::Kernel::EnumeratedString<BackgroundMode, &backgroundTypesNames> BACKGROUND_MODE;
88-
8976
} // namespace
9077

9178
/// private inner class
@@ -231,13 +218,13 @@ void PDCalibration::init() {
231218
"This property has precedence over PreviousCalibrationFile.");
232219

233220
// properties about peak positions to fit
234-
declareProperty(std::make_unique<Mantid::Kernel::EnumeratedStringProperty<PeakMode, &peakTypesNames>>("PeakFunction"),
221+
std::vector<std::string> peaktypes{"BackToBackExponential", "Gaussian", "Lorentzian", "PseudoVoigt",
222+
"IkedaCarpenterPV"};
223+
declareProperty("PeakFunction", "Gaussian", std::make_shared<StringListValidator>(peaktypes),
235224
"Function to fit input peaks.");
236-
setProperty("PeakFunction", "Gaussian");
237-
declareProperty(std::make_unique<Mantid::Kernel::EnumeratedStringProperty<BackgroundMode, &backgroundTypesNames>>(
238-
"BackgroundType"),
225+
vector<std::string> bkgdtypes{"Flat", "Linear", "Quadratic"};
226+
declareProperty("BackgroundType", "Linear", std::make_shared<StringListValidator>(bkgdtypes),
239227
"Function to fit input peaks background.");
240-
setProperty("BackgroundType", "Linear");
241228

242229
auto peaksValidator = std::make_shared<CompositeValidator>();
243230
auto mustBePosArr = std::make_shared<Kernel::ArrayBoundedValidator<double>>();

0 commit comments

Comments
 (0)