|
Mantid
|
A dialog for displaying and editing values of local parameters. More...
#include <EditLocalParameterDialog.h>
Signals | |
| void | dialogFinished (int, EditLocalParameterDialog *) |
| void | logOptionsChecked (bool) |
Signals inherited from MantidQt::API::MantidDialog | |
| void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
| bool | areAllOthersFixed (int i) const |
| Check if all other parameters are fixed. | |
| bool | areOthersFixed (int i) const |
| Check if there are any other fixed parameters. | |
| bool | areOthersTied (int i) const |
| Check if there are any other tied parameters. | |
| EditLocalParameterDialog (QWidget *parent, const std::string &parName, const std::vector< std::string > &datasetNames, const std::vector< std::string > &datasetDomainNames, const QList< double > &values, const QList< bool > &fixes, const QStringList &ties, const QStringList &constraints) | |
| Constructor for EditLocalParameterDialog used in FunctionBrowser. | |
| QString | getConstraint (int i) const |
| const QStringList & | getConstraints () const |
| Get a list of the constraints. | |
| const QList< bool > & | getFixes () const |
| Get a list with the "fixed" attribute. | |
| const std::string & | getParameterName () const |
| QString | getTie (int i) const |
| const QStringList & | getTies () const |
| Get a list of the ties. | |
| double | getValue (int i) const |
| const QList< double > & | getValues () const |
| Get the list of new parameter values. | |
| bool | isFixed (int i) const |
| bool | isLogCheckboxTicked () const |
| Returns whether log checkbox is ticked or not. | |
Public Member Functions inherited from MantidQt::API::MantidDialog | |
| MantidDialog (QWidget *parent=nullptr, const Qt::WindowFlags &flags=Qt::WindowCloseButtonHint|Qt::WindowType::WindowTitleHint) | |
| DefaultConstructor. | |
| ~MantidDialog () override | |
| Destructor. | |
Private Slots | |
| void | copy () |
| Copy all parameter values to the clipboard. | |
| void | emitDialogFinished (int) |
| void | fixParameter (int, bool) |
| Fix/unfix a single parameter. | |
| void | paste () |
| Paste a list of values from the clipboard. | |
| void | setAllFixed (bool) |
| Fix/unfix all parameters. | |
| void | setAllValues (double) |
| Set all parameters to the same value. | |
| void | setAllValuesToLog () |
| Set value of each parameter to log value from respective workspace. | |
| void | setConstraint (int, QString) |
| void | setConstraintAll (const QString &) |
| void | setTie (int, QString) |
| Set a new tie for a parameter. | |
| void | setTieAll (const QString &) |
| Set the same tie to all parameters. | |
| void | setValueToLog (int) |
| Set value to log value. | |
| void | valueChanged (int, int) |
| Slot. | |
Private Member Functions | |
| void | doSetup (const std::string &parName, const std::vector< std::string > &datasetDomains, const std::vector< std::string > &datasetDomainNames) |
| Common setup method used by both constructors Prerequisite: one of the constructors must have filled m_values, m_fixes, m_ties and set up the UI first. | |
| bool | eventFilter (QObject *obj, QEvent *ev) override |
| Event filter for managing the context menu. | |
| void | redrawCells () |
| Force the table to redraw its cells. | |
| void | showContextMenu () |
| Show the context menu. | |
| void | updateRoleColumn (int index) |
| Update the text in the role column. | |
Private Attributes | |
| QStringList | m_constraints |
| Cache for the constraints. | |
| QList< bool > | m_fixes |
| Cache for the "fixed" attribute. | |
| std::unique_ptr< LogValueFinder > | m_logFinder |
| Log value finder. | |
| std::string | m_parName |
| Parameter name. | |
| QStringList | m_ties |
| Cache for the ties. | |
| Ui::EditLocalParameterDialog | m_uiForm |
| QList< double > | m_values |
| Cache for new values. size() == number of spectra. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MantidQt::API::MantidDialog | |
| static bool | handle (QObject *receiver, const std::exception &e) |
| Handles the exception caught in an event handler. | |
Protected Member Functions inherited from MantidQt::API::MantidDialog | |
| virtual void | handleException (const std::exception &e) |
| Override this method to handle an exception in a derived class. | |
| QString | runPythonCode (const QString &code, bool no_output=false) |
| Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string. | |
A dialog for displaying and editing values of local parameters.
Parameters can be set individually or all to the same value. They also can be fixed and unfixed.
Definition at line 30 of file EditLocalParameterDialog.h.
| MantidQt::MantidWidgets::EditLocalParameterDialog::EditLocalParameterDialog | ( | QWidget * | parent, |
| const std::string & | parName, | ||
| const std::vector< std::string > & | datasetNames, | ||
| const std::vector< std::string > & | datasetDomainNames, | ||
| const QList< double > & | values, | ||
| const QList< bool > & | fixes, | ||
| const QStringList & | ties, | ||
| const QStringList & | constraints | ||
| ) |
Constructor for EditLocalParameterDialog used in FunctionBrowser.
| parent | :: [input] Parent widget of this dialog |
| parName | :: [input] Name of parameter to edit in this dialog |
| datasetNames | :: [input] Names of workspaces being fitted. |
| datasetDomainNames | :: [input] Names given to the domains being fitted. |
| values | :: [input] Parameter values. |
| fixes | :: [input] Flags indicating if a parameter is fixed. |
| ties | :: [input] Parameter ties. |
| constraints | :: [input] Parameter constraints. |
Definition at line 38 of file EditLocalParameterDialog.cpp.
| bool MantidQt::MantidWidgets::EditLocalParameterDialog::areAllOthersFixed | ( | int | i | ) | const |
Check if all other parameters are fixed.
Definition at line 322 of file EditLocalParameterDialog.cpp.
References m_fixes.
| bool MantidQt::MantidWidgets::EditLocalParameterDialog::areOthersFixed | ( | int | i | ) | const |
Check if there are any other fixed parameters.
Definition at line 313 of file EditLocalParameterDialog.cpp.
References m_fixes.
| bool MantidQt::MantidWidgets::EditLocalParameterDialog::areOthersTied | ( | int | i | ) | const |
Check if there are any other tied parameters.
Definition at line 331 of file EditLocalParameterDialog.cpp.
|
privateslot |
Copy all parameter values to the clipboard.
Values will be separated by '
'
Definition at line 254 of file EditLocalParameterDialog.cpp.
Referenced by showContextMenu().
|
signal |
Referenced by emitDialogFinished().
|
private |
Common setup method used by both constructors Prerequisite: one of the constructors must have filled m_values, m_fixes, m_ties and set up the UI first.
| parName | :: [input] Name of parameter to edit in this dialog |
| datasetNames | :: [input] Names of workspaces being fitted. |
| datasetDomainNames | :: [input] Names given to the domains being fitted. |
Definition at line 62 of file EditLocalParameterDialog.cpp.
References emitDialogFinished(), fixParameter(), logOptionsChecked(), m_logFinder, m_uiForm, m_values, setAllFixed(), setAllValues(), setAllValuesToLog(), setConstraint(), setConstraintAll(), setTie(), setTieAll(), setValueToLog(), MantidQt::MantidWidgets::stdVectorToQStringList(), updateRoleColumn(), and valueChanged().
Referenced by EditLocalParameterDialog().
|
privateslot |
Definition at line 110 of file EditLocalParameterDialog.cpp.
References dialogFinished().
Referenced by doSetup().
|
overrideprivate |
Event filter for managing the context menu.
Definition at line 212 of file EditLocalParameterDialog.cpp.
References m_uiForm, obj, and showContextMenu().
|
privateslot |
Fix/unfix a single parameter.
| index | :: Index of a paramter to fix or unfix. |
| fix | :: Fix (true) or unfix (false). |
Definition at line 159 of file EditLocalParameterDialog.cpp.
References index, m_fixes, m_ties, and updateRoleColumn().
Referenced by doSetup().
|
inline |
Definition at line 45 of file EditLocalParameterDialog.h.
| const QStringList & MantidQt::MantidWidgets::EditLocalParameterDialog::getConstraints | ( | ) | const |
Get a list of the constraints.
Definition at line 154 of file EditLocalParameterDialog.cpp.
References m_constraints.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
| const QList< bool > & MantidQt::MantidWidgets::EditLocalParameterDialog::getFixes | ( | ) | const |
Get a list with the "fixed" attribute.
Definition at line 148 of file EditLocalParameterDialog.cpp.
References m_fixes.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 37 of file EditLocalParameterDialog.h.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 44 of file EditLocalParameterDialog.h.
Referenced by MantidQt::MantidWidgets::LocalParameterItemDelegate::paint().
| const QStringList & MantidQt::MantidWidgets::EditLocalParameterDialog::getTies | ( | ) | const |
Get a list of the ties.
Definition at line 151 of file EditLocalParameterDialog.cpp.
References m_ties.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 42 of file EditLocalParameterDialog.h.
| const QList< double > & MantidQt::MantidWidgets::EditLocalParameterDialog::getValues | ( | ) | const |
Get the list of new parameter values.
Definition at line 145 of file EditLocalParameterDialog.cpp.
References m_values.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 43 of file EditLocalParameterDialog.h.
| bool MantidQt::MantidWidgets::EditLocalParameterDialog::isLogCheckboxTicked | ( | ) | const |
Returns whether log checkbox is ticked or not.
Definition at line 369 of file EditLocalParameterDialog.cpp.
References m_uiForm.
|
signal |
Referenced by doSetup().
|
privateslot |
Paste a list of values from the clipboard.
Definition at line 264 of file EditLocalParameterDialog.cpp.
References m_uiForm, m_values, n, MantidQt::MantidWidgets::LocalParameterItemDelegate::prepareForPastedData(), and vec.
Referenced by showContextMenu().
|
private |
Force the table to redraw its cells.
Definition at line 283 of file EditLocalParameterDialog.cpp.
References m_uiForm, and m_values.
Referenced by setAllFixed(), setConstraintAll(), and setTieAll().
|
privateslot |
Fix/unfix all parameters.
| fix | :: Fix (true) or unfix (false). |
Definition at line 200 of file EditLocalParameterDialog.cpp.
References m_fixes, m_ties, redrawCells(), and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Set all parameters to the same value.
| value | :: A new value. |
Definition at line 135 of file EditLocalParameterDialog.cpp.
References m_uiForm, m_values, n, updateRoleColumn(), and value.
Referenced by doSetup().
|
privateslot |
Set value of each parameter to log value from respective workspace.
Definition at line 360 of file EditLocalParameterDialog.cpp.
References m_values, and setValueToLog().
Referenced by doSetup().
|
privateslot |
Definition at line 185 of file EditLocalParameterDialog.cpp.
References index, m_constraints, and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Definition at line 190 of file EditLocalParameterDialog.cpp.
References m_constraints, redrawCells(), and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Set a new tie for a parameter.
| index | :: Index of a paramter to tie. |
| tie | :: A tie string. |
Definition at line 168 of file EditLocalParameterDialog.cpp.
References index, m_fixes, m_ties, and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Set the same tie to all parameters.
| tie | :: A tie string. |
Definition at line 176 of file EditLocalParameterDialog.cpp.
References m_fixes, m_ties, redrawCells(), and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Set value to log value.
| i | :: [input] Index of parameter to set |
Definition at line 341 of file EditLocalParameterDialog.cpp.
References m_logFinder, m_uiForm, m_values, updateRoleColumn(), and value.
Referenced by doSetup(), and setAllValuesToLog().
|
private |
Show the context menu.
Definition at line 220 of file EditLocalParameterDialog.cpp.
References copy(), index, m_uiForm, and paste().
Referenced by eventFilter().
|
private |
Update the text in the role column.
Definition at line 293 of file EditLocalParameterDialog.cpp.
References index, m_constraints, m_fixes, m_ties, and m_uiForm.
Referenced by doSetup(), fixParameter(), setAllFixed(), setAllValues(), setConstraint(), setConstraintAll(), setTie(), setTieAll(), and setValueToLog().
|
privateslot |
|
private |
Cache for the constraints.
Definition at line 88 of file EditLocalParameterDialog.h.
Referenced by getConstraints(), setConstraint(), setConstraintAll(), and updateRoleColumn().
|
private |
Cache for the "fixed" attribute.
If changes are accepted parameters for which m_fixes[i] is true are fixed to their m_values[i]
Definition at line 84 of file EditLocalParameterDialog.h.
Referenced by areAllOthersFixed(), areOthersFixed(), areOthersTied(), fixParameter(), getFixes(), setAllFixed(), setTie(), setTieAll(), and updateRoleColumn().
|
private |
Log value finder.
Definition at line 90 of file EditLocalParameterDialog.h.
Referenced by doSetup(), and setValueToLog().
|
private |
Parameter name.
Definition at line 79 of file EditLocalParameterDialog.h.
|
private |
Cache for the ties.
Definition at line 86 of file EditLocalParameterDialog.h.
Referenced by areOthersTied(), fixParameter(), getTies(), setAllFixed(), setTie(), setTieAll(), updateRoleColumn(), and valueChanged().
|
private |
Definition at line 77 of file EditLocalParameterDialog.h.
Referenced by doSetup(), EditLocalParameterDialog(), eventFilter(), isLogCheckboxTicked(), paste(), redrawCells(), setAllValues(), setValueToLog(), showContextMenu(), updateRoleColumn(), and valueChanged().
|
private |
Cache for new values. size() == number of spectra.
Definition at line 81 of file EditLocalParameterDialog.h.
Referenced by copy(), doSetup(), getValues(), paste(), redrawCells(), setAllValues(), setAllValuesToLog(), setValueToLog(), and valueChanged().