Mantid
|
A dialog for displaying and editing values of local parameters. More...
#include <EditLocalParameterDialog.h>
Signals | |
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. More... | |
bool | areOthersFixed (int i) const |
Check if there are any other fixed parameters. More... | |
bool | areOthersTied (int i) const |
Check if there are any other tied parameters. More... | |
EditLocalParameterDialog (QWidget *parent, const QString &parName, const QStringList &datasetNames, const QStringList &datasetDomainNames, const QList< double > &values, const QList< bool > &fixes, const QStringList &ties, const QStringList &constraints) | |
Constructor for EditLocalParameterDialog used in FunctionBrowser. More... | |
QString | getConstraint (int i) const |
QStringList | getConstraints () const |
Get a list of the constraints. More... | |
QList< bool > | getFixes () const |
Get a list with the "fixed" attribute. More... | |
QString | getParameterName () const |
QString | getTie (int i) const |
QStringList | getTies () const |
Get a list of the ties. More... | |
double | getValue (int i) const |
QList< double > | getValues () const |
Get the list of new parameter values. More... | |
bool | isFixed (int i) const |
bool | isLogCheckboxTicked () const |
Returns whether log checkbox is ticked or not. More... | |
Public Member Functions inherited from MantidQt::API::MantidDialog | |
MantidDialog (QWidget *parent=nullptr, const Qt::WindowFlags &flags=Qt::WindowCloseButtonHint|Qt::WindowType::WindowTitleHint) | |
DefaultConstructor. More... | |
~MantidDialog () override | |
Destructor. More... | |
Private Slots | |
void | copy () |
Copy all parameter values to the clipboard. More... | |
void | fixParameter (int, bool) |
Fix/unfix a single parameter. More... | |
void | paste () |
Paste a list of values from the clipboard. More... | |
void | setAllFixed (bool) |
Fix/unfix all parameters. More... | |
void | setAllValues (double) |
Set all parameters to the same value. More... | |
void | setAllValuesToLog () |
Set value of each parameter to log value from respective workspace. More... | |
void | setConstraint (int, QString) |
void | setConstraintAll (const QString &) |
void | setTie (int, QString) |
Set a new tie for a parameter. More... | |
void | setTieAll (const QString &) |
Set the same tie to all parameters. More... | |
void | setValueToLog (int) |
Set value to log value. More... | |
void | valueChanged (int, int) |
Slot. More... | |
Private Member Functions | |
void | doSetup (const QString &parName, const QStringList &datasetDomains, const QStringList &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. More... | |
bool | eventFilter (QObject *obj, QEvent *ev) override |
Event filter for managing the context menu. More... | |
void | redrawCells () |
Force the table to redraw its cells. More... | |
void | showContextMenu () |
Show the context menu. More... | |
void | updateRoleColumn (int index) |
Update the text in the role column. More... | |
Private Attributes | |
QStringList | m_constraints |
Cache for the constraints. More... | |
QList< bool > | m_fixes |
Cache for the "fixed" attribute. More... | |
std::unique_ptr< LogValueFinder > | m_logFinder |
Log value finder. More... | |
QString | m_parName |
Parameter name. More... | |
QStringList | m_ties |
Cache for the ties. More... | |
Ui::EditLocalParameterDialog | m_uiForm |
QList< double > | m_values |
Cache for new values. size() == number of spectra. More... | |
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. More... | |
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. More... | |
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. More... | |
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 28 of file EditLocalParameterDialog.h.
MantidQt::MantidWidgets::EditLocalParameterDialog::EditLocalParameterDialog | ( | QWidget * | parent, |
const QString & | parName, | ||
const QStringList & | datasetNames, | ||
const QStringList & | 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 37 of file EditLocalParameterDialog.cpp.
bool MantidQt::MantidWidgets::EditLocalParameterDialog::areAllOthersFixed | ( | int | i | ) | const |
Check if all other parameters are fixed.
Definition at line 317 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 308 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 326 of file EditLocalParameterDialog.cpp.
|
privateslot |
Copy all parameter values to the clipboard.
Values will be separated by '
'
Definition at line 249 of file EditLocalParameterDialog.cpp.
Referenced by showContextMenu().
|
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 61 of file EditLocalParameterDialog.cpp.
References fixParameter(), logOptionsChecked(), m_logFinder, m_uiForm, m_values, setAllFixed(), setAllValues(), setAllValuesToLog(), setConstraint(), setConstraintAll(), setTie(), setTieAll(), setValueToLog(), updateRoleColumn(), and valueChanged().
Referenced by EditLocalParameterDialog().
|
overrideprivate |
Event filter for managing the context menu.
Definition at line 207 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 154 of file EditLocalParameterDialog.cpp.
References index, m_fixes, m_ties, and updateRoleColumn().
Referenced by doSetup().
|
inline |
Definition at line 43 of file EditLocalParameterDialog.h.
QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::getConstraints | ( | ) | const |
Get a list of the constraints.
Definition at line 149 of file EditLocalParameterDialog.cpp.
References m_constraints.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
QList< bool > MantidQt::MantidWidgets::EditLocalParameterDialog::getFixes | ( | ) | const |
Get a list with the "fixed" attribute.
Definition at line 143 of file EditLocalParameterDialog.cpp.
References m_fixes.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 35 of file EditLocalParameterDialog.h.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 42 of file EditLocalParameterDialog.h.
Referenced by MantidQt::MantidWidgets::LocalParameterItemDelegate::paint().
QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::getTies | ( | ) | const |
Get a list of the ties.
Definition at line 146 of file EditLocalParameterDialog.cpp.
References m_ties.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 40 of file EditLocalParameterDialog.h.
QList< double > MantidQt::MantidWidgets::EditLocalParameterDialog::getValues | ( | ) | const |
Get the list of new parameter values.
Definition at line 140 of file EditLocalParameterDialog.cpp.
References m_values.
Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::editLocalParameterFinish(), and MantidQt::MantidWidgets::FitScriptGeneratorView::getEditLocalParameterResults().
|
inline |
Definition at line 41 of file EditLocalParameterDialog.h.
bool MantidQt::MantidWidgets::EditLocalParameterDialog::isLogCheckboxTicked | ( | ) | const |
Returns whether log checkbox is ticked or not.
Definition at line 364 of file EditLocalParameterDialog.cpp.
References m_uiForm.
|
signal |
Referenced by doSetup().
|
privateslot |
Paste a list of values from the clipboard.
Definition at line 259 of file EditLocalParameterDialog.cpp.
References m_uiForm, m_values, n, and MantidQt::MantidWidgets::LocalParameterItemDelegate::prepareForPastedData().
Referenced by showContextMenu().
|
private |
Force the table to redraw its cells.
Definition at line 278 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 195 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 130 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 355 of file EditLocalParameterDialog.cpp.
References m_values, and setValueToLog().
Referenced by doSetup().
|
privateslot |
Definition at line 180 of file EditLocalParameterDialog.cpp.
References index, m_constraints, and updateRoleColumn().
Referenced by doSetup().
|
privateslot |
Definition at line 185 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 163 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 171 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 336 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 215 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 288 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 83 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 79 of file EditLocalParameterDialog.h.
Referenced by areAllOthersFixed(), areOthersFixed(), areOthersTied(), fixParameter(), getFixes(), setAllFixed(), setTie(), setTieAll(), and updateRoleColumn().
|
private |
Log value finder.
Definition at line 85 of file EditLocalParameterDialog.h.
Referenced by doSetup(), and setValueToLog().
|
private |
Parameter name.
Definition at line 74 of file EditLocalParameterDialog.h.
|
private |
Cache for the ties.
Definition at line 81 of file EditLocalParameterDialog.h.
Referenced by areOthersTied(), fixParameter(), getTies(), setAllFixed(), setTie(), setTieAll(), updateRoleColumn(), and valueChanged().
|
private |
Definition at line 72 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 76 of file EditLocalParameterDialog.h.
Referenced by copy(), doSetup(), getValues(), paste(), redrawCells(), setAllValues(), setAllValuesToLog(), setValueToLog(), and valueChanged().