Mantid
Loading...
Searching...
No Matches
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::EditLocalParameterDialog Class Reference

A dialog for displaying and editing values of local parameters. More...

#include <EditLocalParameterDialog.h>

Inheritance diagram for MantidQt::MantidWidgets::EditLocalParameterDialog:
MantidQt::API::MantidDialog

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< LogValueFinderm_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EditLocalParameterDialog()

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.

Parameters
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.

References doSetup(), and m_uiForm.

Member Function Documentation

◆ areAllOthersFixed()

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.

◆ areOthersFixed()

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.

◆ areOthersTied()

bool MantidQt::MantidWidgets::EditLocalParameterDialog::areOthersTied ( int  i) const

Check if there are any other tied parameters.

Definition at line 326 of file EditLocalParameterDialog.cpp.

References m_fixes, and m_ties.

◆ copy

void MantidQt::MantidWidgets::EditLocalParameterDialog::copy ( )
privateslot

Copy all parameter values to the clipboard.

Values will be separated by '
'

Definition at line 249 of file EditLocalParameterDialog.cpp.

References m_values, and n.

Referenced by showContextMenu().

◆ doSetup()

void MantidQt::MantidWidgets::EditLocalParameterDialog::doSetup ( const QString &  parName,
const QStringList &  datasetNames,
const QStringList &  datasetDomainNames 
)
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.

Parameters
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().

◆ eventFilter()

bool MantidQt::MantidWidgets::EditLocalParameterDialog::eventFilter ( QObject *  obj,
QEvent *  ev 
)
overrideprivate

Event filter for managing the context menu.

Definition at line 207 of file EditLocalParameterDialog.cpp.

References m_uiForm, obj, and showContextMenu().

◆ fixParameter

void MantidQt::MantidWidgets::EditLocalParameterDialog::fixParameter ( int  index,
bool  fix 
)
privateslot

Fix/unfix a single parameter.

Parameters
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().

◆ getConstraint()

QString MantidQt::MantidWidgets::EditLocalParameterDialog::getConstraint ( int  i) const
inline

Definition at line 43 of file EditLocalParameterDialog.h.

◆ getConstraints()

QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::getConstraints ( ) const

◆ getFixes()

QList< bool > MantidQt::MantidWidgets::EditLocalParameterDialog::getFixes ( ) const

◆ getParameterName()

QString MantidQt::MantidWidgets::EditLocalParameterDialog::getParameterName ( ) const
inline

◆ getTie()

QString MantidQt::MantidWidgets::EditLocalParameterDialog::getTie ( int  i) const
inline

◆ getTies()

QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::getTies ( ) const

◆ getValue()

double MantidQt::MantidWidgets::EditLocalParameterDialog::getValue ( int  i) const
inline

Definition at line 40 of file EditLocalParameterDialog.h.

◆ getValues()

QList< double > MantidQt::MantidWidgets::EditLocalParameterDialog::getValues ( ) const

◆ isFixed()

bool MantidQt::MantidWidgets::EditLocalParameterDialog::isFixed ( int  i) const
inline

Definition at line 41 of file EditLocalParameterDialog.h.

◆ isLogCheckboxTicked()

bool MantidQt::MantidWidgets::EditLocalParameterDialog::isLogCheckboxTicked ( ) const

Returns whether log checkbox is ticked or not.

Returns
True if log options are enabled

Definition at line 364 of file EditLocalParameterDialog.cpp.

References m_uiForm.

◆ logOptionsChecked

void MantidQt::MantidWidgets::EditLocalParameterDialog::logOptionsChecked ( bool  )
signal

Referenced by doSetup().

◆ paste

void MantidQt::MantidWidgets::EditLocalParameterDialog::paste ( )
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().

◆ redrawCells()

void MantidQt::MantidWidgets::EditLocalParameterDialog::redrawCells ( )
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().

◆ setAllFixed

void MantidQt::MantidWidgets::EditLocalParameterDialog::setAllFixed ( bool  fix)
privateslot

Fix/unfix all parameters.

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().

◆ setAllValues

void MantidQt::MantidWidgets::EditLocalParameterDialog::setAllValues ( double  value)
privateslot

Set all parameters to the same value.

Parameters
value:: A new value.

Definition at line 130 of file EditLocalParameterDialog.cpp.

References m_uiForm, m_values, n, updateRoleColumn(), and value.

Referenced by doSetup().

◆ setAllValuesToLog

void MantidQt::MantidWidgets::EditLocalParameterDialog::setAllValuesToLog ( )
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().

◆ setConstraint

void MantidQt::MantidWidgets::EditLocalParameterDialog::setConstraint ( int  index,
QString  constraint 
)
privateslot

Definition at line 180 of file EditLocalParameterDialog.cpp.

References index, m_constraints, and updateRoleColumn().

Referenced by doSetup().

◆ setConstraintAll

void MantidQt::MantidWidgets::EditLocalParameterDialog::setConstraintAll ( const QString &  constraint)
privateslot

Definition at line 185 of file EditLocalParameterDialog.cpp.

References m_constraints, redrawCells(), and updateRoleColumn().

Referenced by doSetup().

◆ setTie

void MantidQt::MantidWidgets::EditLocalParameterDialog::setTie ( int  index,
QString  tie 
)
privateslot

Set a new tie for a parameter.

Parameters
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().

◆ setTieAll

void MantidQt::MantidWidgets::EditLocalParameterDialog::setTieAll ( const QString &  tie)
privateslot

Set the same tie to all parameters.

Parameters
tie:: A tie string.

Definition at line 171 of file EditLocalParameterDialog.cpp.

References m_fixes, m_ties, redrawCells(), and updateRoleColumn().

Referenced by doSetup().

◆ setValueToLog

void MantidQt::MantidWidgets::EditLocalParameterDialog::setValueToLog ( int  i)
privateslot

Set value to log value.

Parameters
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().

◆ showContextMenu()

void MantidQt::MantidWidgets::EditLocalParameterDialog::showContextMenu ( )
private

Show the context menu.

Definition at line 215 of file EditLocalParameterDialog.cpp.

References copy(), index, m_uiForm, and paste().

Referenced by eventFilter().

◆ updateRoleColumn()

void MantidQt::MantidWidgets::EditLocalParameterDialog::updateRoleColumn ( int  index)
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().

◆ valueChanged

void MantidQt::MantidWidgets::EditLocalParameterDialog::valueChanged ( int  row,
int  col 
)
privateslot

Slot.

Called when a value changes.

Parameters
row:: Row index of the changed cell.
col:: Column index of the changed cell.

Definition at line 110 of file EditLocalParameterDialog.cpp.

References m_ties, m_uiForm, m_values, and value.

Referenced by doSetup().

Member Data Documentation

◆ m_constraints

QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::m_constraints
private

Cache for the constraints.

Definition at line 83 of file EditLocalParameterDialog.h.

Referenced by getConstraints(), setConstraint(), setConstraintAll(), and updateRoleColumn().

◆ m_fixes

QList<bool> MantidQt::MantidWidgets::EditLocalParameterDialog::m_fixes
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().

◆ m_logFinder

std::unique_ptr<LogValueFinder> MantidQt::MantidWidgets::EditLocalParameterDialog::m_logFinder
private

Log value finder.

Definition at line 85 of file EditLocalParameterDialog.h.

Referenced by doSetup(), and setValueToLog().

◆ m_parName

QString MantidQt::MantidWidgets::EditLocalParameterDialog::m_parName
private

Parameter name.

Definition at line 74 of file EditLocalParameterDialog.h.

◆ m_ties

QStringList MantidQt::MantidWidgets::EditLocalParameterDialog::m_ties
private

◆ m_uiForm

Ui::EditLocalParameterDialog MantidQt::MantidWidgets::EditLocalParameterDialog::m_uiForm
private

◆ m_values

QList<double> MantidQt::MantidWidgets::EditLocalParameterDialog::m_values
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().


The documentation for this class was generated from the following files: