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

This is a dialog for doing sequential fit. More...

#include <SequentialFitDialog.h>

Inheritance diagram for MantidQt::MantidWidgets::SequentialFitDialog:
MantidQt::API::MantidDialog Mantid::API::AlgorithmObserver

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

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

Detailed Description

This is a dialog for doing sequential fit.

(Calls algorithm PlotPeakByLogValue)

Author
Roman Tolchenov, Tessella plc
Date
4/06/2010

Definition at line 29 of file SequentialFitDialog.h.

Constructor & Destructor Documentation

◆ SequentialFitDialog()

MantidQt::MantidWidgets::SequentialFitDialog::SequentialFitDialog ( FitPropertyBrowser fitBrowser,
QObject *  mantidui 
)

Default constructor.

Constructor.

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

Member Function Documentation

◆ accept

void MantidQt::MantidWidgets::SequentialFitDialog::accept ( )
overrideslot

◆ addFile

void MantidQt::MantidWidgets::SequentialFitDialog::addFile ( )
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().

◆ addWorkspace

void MantidQt::MantidWidgets::SequentialFitDialog::addWorkspace ( )
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().

◆ addWorkspaces()

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

◆ defaultSpectrum()

int MantidQt::MantidWidgets::SequentialFitDialog::defaultSpectrum ( ) const
private

Definition at line 491 of file SequentialFitDialog.cpp.

References ui.

◆ finishHandle()

void MantidQt::MantidWidgets::SequentialFitDialog::finishHandle ( const Mantid::API::IAlgorithm alg)
overrideprivatevirtual

◆ functionChanged

void MantidQt::MantidWidgets::SequentialFitDialog::functionChanged ( )
privateslot

Actions in response to change of function.

Definition at line 346 of file SequentialFitDialog.cpp.

References populateParameters().

Referenced by SequentialFitDialog().

◆ getFitResults()

void MantidQt::MantidWidgets::SequentialFitDialog::getFitResults ( )
private

◆ getIndex()

QString MantidQt::MantidWidgets::SequentialFitDialog::getIndex ( int  row) const
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().

◆ helpClicked

void MantidQt::MantidWidgets::SequentialFitDialog::helpClicked ( )
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().

◆ isFile()

bool MantidQt::MantidWidgets::SequentialFitDialog::isFile ( int  row) const
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().

◆ name()

QString MantidQt::MantidWidgets::SequentialFitDialog::name ( int  row) const
private

◆ needShowPlot

void MantidQt::MantidWidgets::SequentialFitDialog::needShowPlot ( Ui::SequentialFitDialog *  ,
MantidQt::MantidWidgets::FitPropertyBrowser  
)
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().

◆ plotAgainstLog

void MantidQt::MantidWidgets::SequentialFitDialog::plotAgainstLog ( bool  yes)
privateslot

Definition at line 502 of file SequentialFitDialog.cpp.

References ui.

Referenced by SequentialFitDialog().

◆ populateParameters()

void MantidQt::MantidWidgets::SequentialFitDialog::populateParameters ( )
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().

◆ removeItem

void MantidQt::MantidWidgets::SequentialFitDialog::removeItem ( )
privateslot

Remove an input item.

Definition at line 170 of file SequentialFitDialog.cpp.

References rowCount(), and ui.

Referenced by SequentialFitDialog().

◆ rowCount()

int MantidQt::MantidWidgets::SequentialFitDialog::rowCount ( ) const
private

Definition at line 489 of file SequentialFitDialog.cpp.

References ui.

Referenced by accept(), getFitResults(), getIndex(), and removeItem().

◆ selectionChanged

void MantidQt::MantidWidgets::SequentialFitDialog::selectionChanged ( )
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().

◆ setRange()

void MantidQt::MantidWidgets::SequentialFitDialog::setRange ( int  row,
double  from,
double  to 
)
private

Definition at line 497 of file SequentialFitDialog.cpp.

References ui.

◆ setSpectrum()

void MantidQt::MantidWidgets::SequentialFitDialog::setSpectrum ( int  row,
int  spec 
)
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().

◆ setWSIndex()

void MantidQt::MantidWidgets::SequentialFitDialog::setWSIndex ( int  row,
int  wi 
)
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().

◆ spectraChanged

void MantidQt::MantidWidgets::SequentialFitDialog::spectraChanged ( int  row,
int  col 
)
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.

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

◆ validateLogs()

bool MantidQt::MantidWidgets::SequentialFitDialog::validateLogs ( const QString &  wsName)
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().

Member Data Documentation

◆ m_fitBrowser

FitPropertyBrowser* MantidQt::MantidWidgets::SequentialFitDialog::m_fitBrowser
private

Pointer to the calling fit browser.

Definition at line 46 of file SequentialFitDialog.h.

Referenced by accept(), addWorkspaces(), finishHandle(), getFitResults(), populateParameters(), and validateLogs().

◆ m_outputName

std::string MantidQt::MantidWidgets::SequentialFitDialog::m_outputName
private

Definition at line 118 of file SequentialFitDialog.h.

Referenced by accept(), and getFitResults().

◆ ui

Ui::SequentialFitDialog MantidQt::MantidWidgets::SequentialFitDialog::ui
private

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