|
Mantid
|
This is a dialog for doing sequential fit. More...
#include <SequentialFitDialog.h>
Public Slots | |
| void | accept () override |
| Start the fit and close dialog. | |
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. | |
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. | |
| SequentialFitDialog (FitPropertyBrowser *fitBrowser, QObject *mantidui) | |
| Default constructor. | |
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. | |
Public Member Functions inherited from Mantid::API::AlgorithmObserver | |
| AlgorithmObserver () | |
| Default constructor. | |
| AlgorithmObserver (const IAlgorithm_const_sptr &alg) | |
| Constructs AlgorithmObserver and connects all its handlers to algorithm alg. | |
| virtual void | errorHandle (const IAlgorithm *alg, const std::string &what) |
| void | observeAll (const IAlgorithm_const_sptr &alg) |
| Connect to algorithm alg and observe all its notifications. | |
| void | observeError (const IAlgorithm_const_sptr &alg) |
| Connect to algorithm alg and observe its error notification. | |
| void | observeFinish (const IAlgorithm_const_sptr &alg) |
| Connect to algorithm alg and observe its finish notification. | |
| void | observeProgress (const IAlgorithm_const_sptr &alg) |
| Connect to algorithm alg and observe its progress notification. | |
| void | observeStart (const IAlgorithm_const_sptr &alg) |
| Connect to algorithm alg and observe its start notification. | |
| void | observeStarting () |
| Connect to AlgorithmManager and observe its starting notifications. | |
| 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. | |
| void | stopObserving (const Mantid::API::IAlgorithm *alg) |
| void | stopObservingManager () |
| Disconnect from the algorithm manager. | |
| virtual | ~AlgorithmObserver () |
| Virtual destructor. | |
Private Slots | |
| void | addFile () |
| Add a file to the data list. | |
| void | addWorkspace () |
| Add a workspace to the data list. | |
| void | functionChanged () |
| Actions in response to change of function. | |
| void | helpClicked () |
| Show the result plot. | |
| void | plotAgainstLog (bool) |
| void | removeItem () |
| Remove an input item. | |
| void | selectionChanged () |
| called when selection in the workspace table changes | |
| void | spectraChanged (int row, int col) |
| called when spectra or workspace index change | |
Private Member Functions | |
| int | defaultSpectrum () const |
| void | finishHandle (const Mantid::API::IAlgorithm *alg) override |
| Called when the fit is finished. | |
| void | getFitResults () |
| Set the parameters to the fit outcome. | |
| QString | getIndex (int row) const |
| Ret. | |
| bool | isFile (int row) const |
| Return true if data source in a row is a file (rather than a workspace) | |
| bool | isValidRangeFormat (const QString &range) const |
| Return true if the range format is valid. | |
| QString | name (int row) const |
| void | populateParameters () |
| Populate parameter combo box with possible parameter names. | |
| 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 | |
| void | setWSIndex (int row, int wi) |
| set workspace index for workspace/file in row row | |
| bool | validateLogs (const QString &wsName) |
| Checks that the logs in workspace wsName are consistent with logs of other workspaces. | |
Private Attributes | |
| FitPropertyBrowser * | m_fitBrowser |
| Pointer to the calling fit browser. | |
| std::string | m_outputName |
| Ui::SequentialFitDialog | ui |
| The form generated with Qt Designer. | |
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. | |
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 45 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 324 of file SequentialFitDialog.cpp.
References MantidQt::MantidWidgets::FitPropertyBrowser::costFunction(), MantidQt::MantidWidgets::FitPropertyBrowser::endX(), error, Mantid::Kernel::Logger::error(), Mantid::API::g_log, getIndex(), index, isFile(), MantidQt::MantidWidgets::FitPropertyBrowser::isHistogramFit(), MantidQt::MantidWidgets::FitPropertyBrowser::m_compositeFunction, m_fitBrowser, m_outputName, MantidQt::MantidWidgets::FitPropertyBrowser::maxIterations(), MantidQt::MantidWidgets::FitPropertyBrowser::minimizer(), 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 138 of file SequentialFitDialog.cpp.
References ui.
Referenced by SequentialFitDialog().
|
privateslot |
Add a workspace to the data list.
Definition at line 80 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 88 of file SequentialFitDialog.cpp.
References m_fitBrowser, setSpectrum(), setWSIndex(), ui, validateLogs(), MantidQt::MantidWidgets::FitPropertyBrowser::workspaceIndex(), and Mantid::Geometry::y.
Referenced by addWorkspace().
|
private |
Definition at line 557 of file SequentialFitDialog.cpp.
References ui.
|
overrideprivatevirtual |
Called when the fit is finished.
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 416 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 414 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 426 of file SequentialFitDialog.cpp.
References MantidQt::MantidWidgets::FitPropertyBrowser::compositeFunction(), MantidQt::MantidWidgets::FitPropertyBrowser::count(), Mantid::API::TableRow::Double(), error, MantidQt::MantidWidgets::FitPropertyBrowser::getHandler(), index, m_fitBrowser, m_outputName, 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 284 of file SequentialFitDialog.cpp.
References Mantid::Kernel::Logger::error(), Mantid::API::g_log, index, isFile(), isValidRangeFormat(), 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 481 of file SequentialFitDialog.cpp.
References MantidQt::API::HelpWindow::showAlgorithm().
Referenced by SequentialFitDialog().
|
private |
Return true if data source in a row is a file (rather than a workspace)
Definition at line 236 of file SequentialFitDialog.cpp.
References ui.
Referenced by accept(), and getIndex().
|
private |
Return true if the range format is valid.
Definition at line 241 of file SequentialFitDialog.cpp.
Referenced by getIndex().
|
private |
Definition at line 559 of file SequentialFitDialog.cpp.
References ui.
|
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 568 of file SequentialFitDialog.cpp.
References ui.
Referenced by SequentialFitDialog().
|
private |
Populate parameter combo box with possible parameter names.
Definition at line 405 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 179 of file SequentialFitDialog.cpp.
References rowCount(), and ui.
Referenced by SequentialFitDialog().
|
private |
Definition at line 555 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 607 of file SequentialFitDialog.cpp.
References ui.
Referenced by SequentialFitDialog().
|
private |
Definition at line 563 of file SequentialFitDialog.cpp.
References ui.
|
private |
set spectrum value for workspace/file in row row
Definition at line 547 of file SequentialFitDialog.cpp.
References ui.
Referenced by addWorkspaces(), and spectraChanged().
|
private |
set workspace index for workspace/file in row row
Definition at line 551 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 490 of file SequentialFitDialog.cpp.
References setSpectrum(), setWSIndex(), Mantid::API::Axis::spectraNo(), 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 187 of file SequentialFitDialog.cpp.
References m_fitBrowser, n, 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 121 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().