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#include <string>
16#include <vector>
17
18#include <QDialog>
19
20namespace MantidQt {
21namespace MantidWidgets {
22
23class FunctionMultiDomainPresenter;
24
31 Q_OBJECT
32public:
33 EditLocalParameterDialog(QWidget *parent, const std::string &parName, const std::vector<std::string> &datasetNames,
34 const std::vector<std::string> &datasetDomainNames, const QList<double> &values,
35 const QList<bool> &fixes, const QStringList &ties, const QStringList &constraints);
36
37 const std::string &getParameterName() const { return m_parName; }
38 const QList<double> &getValues() const;
39 const QList<bool> &getFixes() const;
40 const QStringList &getTies() const;
41 const QStringList &getConstraints() const;
42 double getValue(int i) const { return m_values[i]; }
43 bool isFixed(int i) const { return m_fixes[i]; }
44 QString getTie(int i) const { return m_ties[i]; }
45 QString getConstraint(int i) const { return m_constraints[i]; }
46 bool areOthersFixed(int i) const;
47 bool areAllOthersFixed(int i) const;
48 bool areOthersTied(int i) const;
49 bool isLogCheckboxTicked() const;
50
51signals:
52 void logOptionsChecked(bool /*_t1*/);
53 void dialogFinished(int /*result*/, EditLocalParameterDialog * /*dialog*/);
54
55private slots:
56 void emitDialogFinished(int /*result*/);
57 void valueChanged(int /*row*/, int /*col*/);
58 void setAllValues(double /*value*/);
59 void fixParameter(int /*index*/, bool /*fix*/);
60 void setAllFixed(bool /*fix*/);
61 void setTie(int /*index*/, QString /*tie*/);
62 void setTieAll(const QString & /*tie*/);
63 void setConstraint(int /*index*/, QString /*tie*/);
64 void setConstraintAll(const QString & /*tie*/);
65 void copy();
66 void paste();
67 void setValueToLog(int /*i*/);
68 void setAllValuesToLog();
69
70private:
71 void doSetup(const std::string &parName, const std::vector<std::string> &datasetDomains,
72 const std::vector<std::string> &datasetDomainNames);
73 bool eventFilter(QObject *obj, QEvent *ev) override;
74 void showContextMenu();
75 void redrawCells();
76 void updateRoleColumn(int index);
77 Ui::EditLocalParameterDialog m_uiForm;
79 std::string m_parName;
86 QStringList m_ties;
88 QStringList m_constraints;
90 std::unique_ptr<LogValueFinder> m_logFinder;
91};
92
93} // namespace MantidWidgets
94} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
std::map< DeltaEMode::Type, std::string > index
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.
void dialogFinished(int, EditLocalParameterDialog *)
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...