Mantid
|
This is a dialog for doing sequential fit. More...
#include <SequentialFitDialog.h>
Public Slots | |
void | accept () override |
Start the fit and close dialog. More... | |
Signals | |
void | needShowPlot (Ui::SequentialFitDialog *, MantidQt::MantidWidgets::FitPropertyBrowser *) |
This signal is fired from finishHandle running in the algorithm's thread and caught by showPlot slot in the GUI thread. More... | |
Signals inherited from MantidQt::API::MantidDialog | |
void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
bool | addWorkspaces (const QStringList &wsNames) |
Add a list of workspace names to the data list Returns false if neither of the workspaces can be loaded. More... | |
SequentialFitDialog (FitPropertyBrowser *fitBrowser, QObject *mantidui) | |
Default constructor. 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... | |
Public Member Functions inherited from Mantid::API::AlgorithmObserver | |
AlgorithmObserver () | |
Default constructor. More... | |
AlgorithmObserver (const IAlgorithm_const_sptr &alg) | |
Constructs AlgorithmObserver and connects all its handlers to algorithm alg. More... | |
virtual void | errorHandle (const IAlgorithm *alg, const std::string &what) |
virtual void | finishHandle (const IAlgorithm *alg) |
void | observeAll (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe all its notifications. More... | |
void | observeError (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its error notification. More... | |
void | observeFinish (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its finish notification. More... | |
void | observeProgress (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its progress notification. More... | |
void | observeStart (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its start notification. More... | |
void | observeStarting () |
Connect to AlgorithmManager and observe its starting notifications. More... | |
virtual void | progressHandle (const IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision) |
virtual void | startHandle (const IAlgorithm *alg) |
virtual void | startingHandle (IAlgorithm_sptr alg) |
void | stopObserving (const IAlgorithm_const_sptr &alg) |
Disconnect from algorithm alg. More... | |
void | stopObserving (const Mantid::API::IAlgorithm *alg) |
void | stopObservingManager () |
Disconnect from the algorithm manager. More... | |
virtual | ~AlgorithmObserver () |
Virtual destructor. More... | |
Private Slots | |
void | addFile () |
Add a file to the data list. More... | |
void | addWorkspace () |
Add a workspace to the data list. More... | |
void | functionChanged () |
Actions in response to change of function. More... | |
void | helpClicked () |
Show the result plot. More... | |
void | plotAgainstLog (bool) |
void | removeItem () |
Remove an input item. More... | |
void | selectionChanged () |
called when selection in the workspace table changes More... | |
void | spectraChanged (int row, int col) |
called when spectra or workspace index change More... | |
Private Member Functions | |
int | defaultSpectrum () const |
void | finishHandle (const Mantid::API::IAlgorithm *alg) override |
Called when the fit is finished. More... | |
void | getFitResults () |
Set the parameters to the fit outcome. More... | |
QString | getIndex (int row) const |
Ret. More... | |
bool | isFile (int row) const |
Return true if data source in a row is a file (rather than a workspace) More... | |
QString | name (int row) const |
void | populateParameters () |
Populate parameter combo box with possible parameter names. More... | |
int | rowCount () const |
void | setRange (int row, double from, double to) |
void | setSpectrum (int row, int spec) |
set spectrum value for workspace/file in row row More... | |
void | setWSIndex (int row, int wi) |
set workspace index for workspace/file in row row More... | |
bool | validateLogs (const QString &wsName) |
Checks that the logs in workspace wsName are consistent with logs of other workspaces. More... | |
Private Attributes | |
FitPropertyBrowser * | m_fitBrowser |
Pointer to the calling fit browser. More... | |
std::string | m_outputName |
Ui::SequentialFitDialog | ui |
The form generated with Qt Designer. 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... | |
This is a dialog for doing sequential fit.
(Calls algorithm PlotPeakByLogValue)
Definition at line 29 of file SequentialFitDialog.h.
MantidQt::MantidWidgets::SequentialFitDialog::SequentialFitDialog | ( | FitPropertyBrowser * | fitBrowser, |
QObject * | mantidui | ||
) |
Default constructor.
Constructor.
fitBrowser | |
mantidui | Its purpose is to provide the slot showSequentialPlot |
Definition at line 41 of file SequentialFitDialog.cpp.
References accept(), addFile(), addWorkspace(), functionChanged(), helpClicked(), needShowPlot(), plotAgainstLog(), populateParameters(), removeItem(), selectionChanged(), spectraChanged(), and ui.
|
overrideslot |
Start the fit and close dialog.
Definition at line 271 of file SequentialFitDialog.cpp.
References MantidQt::MantidWidgets::FitPropertyBrowser::costFunction(), MantidQt::MantidWidgets::FitPropertyBrowser::endX(), getIndex(), Mantid::Kernel::SingletonHolder< T >::Instance(), isFile(), MantidQt::MantidWidgets::FitPropertyBrowser::isHistogramFit(), MantidQt::MantidWidgets::FitPropertyBrowser::m_compositeFunction, m_fitBrowser, m_outputName, MantidQt::MantidWidgets::FitPropertyBrowser::maxIterations(), MantidQt::MantidWidgets::FitPropertyBrowser::minimizer(), name(), Mantid::API::AlgorithmObserver::observeFinish(), MantidQt::MantidWidgets::FitPropertyBrowser::outputName(), rowCount(), MantidQt::MantidWidgets::FitPropertyBrowser::startX(), ui, MantidQt::MantidWidgets::FitPropertyBrowser::workspaceIndex(), and MantidQt::MantidWidgets::FitPropertyBrowser::workspaceName().
Referenced by SequentialFitDialog().
|
privateslot |
Add a file to the data list.
Definition at line 129 of file SequentialFitDialog.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), name(), and ui.
Referenced by SequentialFitDialog().
|
privateslot |
Add a workspace to the data list.
Definition at line 72 of file SequentialFitDialog.cpp.
References addWorkspaces(), and MantidQt::MantidWidgets::SelectWorkspacesDialog::getSelectedNames().
Referenced by SequentialFitDialog().
bool MantidQt::MantidWidgets::SequentialFitDialog::addWorkspaces | ( | const QStringList & | wsNames | ) |
Add a list of workspace names to the data list Returns false if neither of the workspaces can be loaded.
Definition at line 79 of file SequentialFitDialog.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_fitBrowser, name(), setSpectrum(), setWSIndex(), ui, validateLogs(), MantidQt::MantidWidgets::FitPropertyBrowser::workspaceIndex(), and Mantid::Geometry::y.
Referenced by addWorkspace().
|
private |
Definition at line 491 of file SequentialFitDialog.cpp.
References ui.
|
overrideprivatevirtual |
Called when the fit is finished.
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 348 of file SequentialFitDialog.cpp.
References getFitResults(), m_fitBrowser, needShowPlot(), MantidQt::MantidWidgets::FitPropertyBrowser::sequentialFitFinished(), and ui.
|
privateslot |
Actions in response to change of function.
Definition at line 346 of file SequentialFitDialog.cpp.
References populateParameters().
Referenced by SequentialFitDialog().
|
private |
Set the parameters to the fit outcome.
if more than one entry in the gui the parameters used are first entry with same name as fit property browser if one entry will try and use row that corresponds to ws index in fit browser, if not found defaults to first row.
Definition at line 358 of file SequentialFitDialog.cpp.
References MantidQt::MantidWidgets::FitPropertyBrowser::compositeFunction(), MantidQt::MantidWidgets::FitPropertyBrowser::count(), Mantid::API::TableRow::Double(), error, MantidQt::MantidWidgets::FitPropertyBrowser::getHandler(), index, Mantid::Kernel::SingletonHolder< T >::Instance(), m_fitBrowser, m_outputName, name(), rowCount(), MantidQt::MantidWidgets::PropertyHandler::updateErrors(), MantidQt::MantidWidgets::FitPropertyBrowser::updateParameters(), value, MantidQt::MantidWidgets::FitPropertyBrowser::workspaceIndex(), and MantidQt::MantidWidgets::FitPropertyBrowser::workspaceName().
Referenced by finishHandle().
|
private |
Ret.
Returns index for the data source in row row to be used in "Input" property of PlotPeakByLogValue.
index for the data source in row row to be used in "Input" property of PlotPeakByLogValue
Index includes the prefix "sp", "i", or "v"
Definition at line 236 of file SequentialFitDialog.cpp.
References index, Mantid::Kernel::SingletonHolder< T >::Instance(), isFile(), name(), rowCount(), ui, and Mantid::Geometry::y.
Referenced by accept().
|
privateslot |
Show the result plot.
Display the help page for PlotPeakByLogValue algorithm
Definition at line 413 of file SequentialFitDialog.cpp.
References MantidQt::API::MantidDesktopServices::openUrl().
Referenced by SequentialFitDialog().
|
private |
Return true if data source in a row is a file (rather than a workspace)
Definition at line 226 of file SequentialFitDialog.cpp.
References ui.
Referenced by accept(), and getIndex().
|
private |
Definition at line 493 of file SequentialFitDialog.cpp.
References ui.
Referenced by accept(), addFile(), addWorkspaces(), getFitResults(), getIndex(), spectraChanged(), and validateLogs().
|
signal |
This signal is fired from finishHandle running in the algorithm's thread and caught by showPlot slot in the GUI thread.
Referenced by finishHandle(), and SequentialFitDialog().
|
privateslot |
Definition at line 502 of file SequentialFitDialog.cpp.
References ui.
Referenced by SequentialFitDialog().
|
private |
Populate parameter combo box with possible parameter names.
Definition at line 337 of file SequentialFitDialog.cpp.
References MantidQt::MantidWidgets::FitPropertyBrowser::m_compositeFunction, m_fitBrowser, and ui.
Referenced by functionChanged(), and SequentialFitDialog().
|
privateslot |
Remove an input item.
Definition at line 170 of file SequentialFitDialog.cpp.
References rowCount(), and ui.
Referenced by SequentialFitDialog().
|
private |
Definition at line 489 of file SequentialFitDialog.cpp.
References ui.
Referenced by accept(), getFitResults(), getIndex(), and removeItem().
|
privateslot |
called when selection in the workspace table changes
Update the dialog's controls apropriately.
Definition at line 541 of file SequentialFitDialog.cpp.
References ui.
Referenced by SequentialFitDialog().
|
private |
Definition at line 497 of file SequentialFitDialog.cpp.
References ui.
|
private |
set spectrum value for workspace/file in row row
Definition at line 481 of file SequentialFitDialog.cpp.
References ui.
Referenced by addWorkspaces(), and spectraChanged().
|
private |
set workspace index for workspace/file in row row
Definition at line 485 of file SequentialFitDialog.cpp.
References ui.
Referenced by addWorkspaces(), and spectraChanged().
|
privateslot |
called when spectra or workspace index change
Slot.
Called in response to QTableWidget's cellChanged signal. If the cell contains spectra or workspace index of a workspace make them consistent.
row | :: Row index of the modified cell |
col | :: Column index of the modified cell |
Definition at line 424 of file SequentialFitDialog.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), name(), setSpectrum(), setWSIndex(), ui, and Mantid::Geometry::y.
Referenced by SequentialFitDialog().
|
private |
Checks that the logs in workspace wsName are consistent with logs of other workspaces.
Definition at line 178 of file SequentialFitDialog.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_fitBrowser, n, name(), and ui.
Referenced by addWorkspaces().
|
private |
Pointer to the calling fit browser.
Definition at line 46 of file SequentialFitDialog.h.
Referenced by accept(), addWorkspaces(), finishHandle(), getFitResults(), populateParameters(), and validateLogs().
|
private |
Definition at line 118 of file SequentialFitDialog.h.
Referenced by accept(), and getFitResults().
|
private |
The form generated with Qt Designer.
Definition at line 43 of file SequentialFitDialog.h.
Referenced by accept(), addFile(), addWorkspaces(), defaultSpectrum(), finishHandle(), getIndex(), isFile(), name(), plotAgainstLog(), populateParameters(), removeItem(), rowCount(), selectionChanged(), SequentialFitDialog(), setRange(), setSpectrum(), setWSIndex(), spectraChanged(), and validateLogs().