12#include "MantidQtWidgets/Common/QtPropertyBrowser/qteditorfactory.h"
13#include "MantidQtWidgets/Common/QtPropertyBrowser/qtpropertymanager.h"
14#include "MantidQtWidgets/Common/QtPropertyBrowser/qttreepropertybrowser.h"
22int constexpr DEFAULT_MAX_ITERATIONS = 500;
23QString
const DEFAULT_MINIMIZER =
"Levenberg-Marquardt";
24QString
const DEFAULT_OUTPUT_BASE_NAME =
"Output_Fit";
25bool const DEFAULT_PLOT_OUTPUT =
true;
26QStringList
const EVALUATION_TYPES = {
"CentrePoint",
"Histogram"};
27QStringList
const FITTING_MODES = {
"Sequential",
"Simultaneous"};
29QStringList convertToQStringList(std::vector<std::string>
const &vec) {
31 list.reserve(
static_cast<int>(vec.size()));
32 std::transform(vec.cbegin(), vec.cend(), std::back_inserter(list),
33 [](std::string
const &str) { return QString::fromStdString(str); });
41int defaultMinimizerIndex() {
42 auto const index = minimizers().indexOf(DEFAULT_MINIMIZER);
51 : QWidget(parent), m_fittingMode(nullptr), m_maxIterations(nullptr), m_minimizer(nullptr),
m_costFunction(nullptr),
52 m_evaluationType(nullptr) {
70 auto *lineEditFactory =
new QtLineEditFactory(
this);
71 auto *spinBoxFactory =
new QtSpinBoxFactory(
this);
72 auto *comboBoxFactory =
new QtEnumEditorFactory(
this);
73 auto *checkBoxFactory =
new QtCheckBoxFactory(
this);
75 m_browser =
new QtTreePropertyBrowser(
nullptr, QStringList(),
false);
85 auto *layout =
new QVBoxLayout(
this);
87 layout->setContentsMargins(0, 0, 0, 0);
179 (this->*f)(prop,
value);
185 return (this->*f)(prop);
195 throw std::runtime_error(
"Property " + name +
" isn't supported by the browser.");
225 return QString::number(
m_intManager->value(prop)).toStdString();
231 throw std::invalid_argument(
"An invalid property value was provided.");
239 throw std::invalid_argument(
"An invalid property was provided.");
245 switch (fittingMode) {
253 throw std::invalid_argument(
"Fitting mode must be SEQUENTIAL or SIMULTANEOUS.");
CostFunctions::CostFuncFitting & m_costFunction
The cost function.
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...