Mantid
Loading...
Searching...
No Matches
EditLocalParameterDialog.h
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 +
7#pragma once
8
9#include "DllOption.h"
12#include "ui_EditLocalParameterDialog.h"
13
14#include <memory>
15
16#include <QDialog>
17
18namespace MantidQt {
19namespace MantidWidgets {
20
21class FunctionMultiDomainPresenter;
22
29 Q_OBJECT
30public:
31 EditLocalParameterDialog(QWidget *parent, const QString &parName, const QStringList &datasetNames,
32 const QStringList &datasetDomainNames, const QList<double> &values, const QList<bool> &fixes,
33 const QStringList &ties, const QStringList &constraints);
34
35 QString getParameterName() const { return m_parName; }
36 QList<double> getValues() const;
37 QList<bool> getFixes() const;
38 QStringList getTies() const;
39 QStringList getConstraints() const;
40 double getValue(int i) const { return m_values[i]; }
41 bool isFixed(int i) const { return m_fixes[i]; }
42 QString getTie(int i) const { return m_ties[i]; }
43 QString getConstraint(int i) const { return m_constraints[i]; }
44 bool areOthersFixed(int i) const;
45 bool areAllOthersFixed(int i) const;
46 bool areOthersTied(int i) const;
47 bool isLogCheckboxTicked() const;
48
49signals:
50 void logOptionsChecked(bool /*_t1*/);
51
52private slots:
53 void valueChanged(int /*row*/, int /*col*/);
54 void setAllValues(double /*value*/);
55 void fixParameter(int /*index*/, bool /*fix*/);
56 void setAllFixed(bool /*fix*/);
57 void setTie(int /*index*/, QString /*tie*/);
58 void setTieAll(const QString & /*tie*/);
59 void setConstraint(int /*index*/, QString /*tie*/);
60 void setConstraintAll(const QString & /*tie*/);
61 void copy();
62 void paste();
63 void setValueToLog(int /*i*/);
64 void setAllValuesToLog();
65
66private:
67 void doSetup(const QString &parName, const QStringList &datasetDomains, const QStringList &datasetDomainNames);
68 bool eventFilter(QObject *obj, QEvent *ev) override;
69 void showContextMenu();
70 void redrawCells();
71 void updateRoleColumn(int index);
72 Ui::EditLocalParameterDialog m_uiForm;
74 QString m_parName;
81 QStringList m_ties;
83 QStringList m_constraints;
85 std::unique_ptr<LogValueFinder> m_logFinder;
86};
87
88} // namespace MantidWidgets
89} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
double obj
the value of the quadratic function
A dialog for displaying and editing values of local parameters.
std::unique_ptr< LogValueFinder > m_logFinder
Log value finder.
QList< bool > m_fixes
Cache for the "fixed" attribute.
QStringList m_constraints
Cache for the constraints.
QList< double > m_values
Cache for new values. size() == number of spectra.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...