Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
MantidQt::CustomDialogs::FitDialog Class Referencefinal

This class gives specialised dialog for the Load algorithm. More...

#include <FitDialog.h>

Inheritance diagram for MantidQt::CustomDialogs::FitDialog:
MantidQt::API::AlgorithmDialog Mantid::API::AlgorithmObserver

Public Member Functions

 FitDialog (QWidget *parent=nullptr)
 Default constructor. More...
 
- Public Member Functions inherited from MantidQt::API::AlgorithmDialog
 AlgorithmDialog (QWidget *parent=nullptr)
 DefaultConstructor. More...
 
void initializeLayout ()
 Create the layout of the widget. Can only be called once. More...
 
bool isInitialized () const
 Is this dialog initialized. More...
 
bool isShowKeepOpen () const
 Set if the keep open option is shown. More...
 
void setShowKeepOpen (const bool showOption)
 Set if the keep open option is shown. More...
 
 ~AlgorithmDialog () override
 Destructor. More...
 
void setAlgorithm (const Mantid::API::IAlgorithm_sptr &)
 The following methods were made public for testing in GenericDialogDemo.cpp. More...
 
void setPresetValues (const QHash< QString, QString > &presetValues)
 Set a list of suggested values. More...
 
void isForScript (bool forScript)
 Set whether this is intended for use from a script or not. More...
 
void executeOnAccept (bool on)
 If true then execute the algorithm on acceptance. More...
 
void setOptionalMessage (const QString &message)
 Set an optional message to be displayed at the top of the dialog. More...
 
void addEnabledAndDisableLists (const QStringList &enabled, const QStringList &disabled)
 Set comma-separated-list of enabled parameter names. More...
 
void addAlgorithmObserver (Mantid::API::AlgorithmObserver *observer)
 Add an AlgorithmObserver to the algorithm. More...
 

Private Slots

void createInputWorkspaceWidgets ()
 Create InputWorkspaceWidgets and populate the tabs of the tab widget. More...
 
void domainTypeChanged ()
 Update user interface when domain type changes. More...
 
void functionChanged ()
 
void workspaceChanged (const QString &)
 Override the help button clicked method. More...
 

Private Member Functions

QStringList getAllowedPropertyValues (const QString &propName) const
 Get allowed values for a property. More...
 
int getDomainType () const
 Get the domain type: Simple, Sequential, or Parallel. More...
 
QString getDomainTypeString () const
 Get the domain type: Simple, Sequential, or Parallel. More...
 
void initLayout () override
 Initialize the layout. More...
 
bool isMD () const
 Is the function MD? More...
 
void parseInput () override
 Parse input. More...
 
void saveInput () override
 Save the input history. More...
 
void setWorkspaceName (int i, const QString &wsName)
 Set i-th workspace name. More...
 
void tieStaticWidgets (const bool readHistory)
 Tie static widgets to their properties. More...
 

Private Attributes

Ui::FitDialog m_form
 Form. More...
 
QList< QWidget * > m_tabs
 

Friends

class InputWorkspaceWidget
 

Additional Inherited Members

- Signals inherited from MantidQt::API::AlgorithmDialog
void algCompletedSignal ()
 Emitted when alg completes and dialog is staying open. More...
 
void closeEventCalled ()
 
- Protected Slots inherited from MantidQt::API::AlgorithmDialog
void accept () override
 A default slot that can be used for an OK button. More...
 
void reject () override
 A default slot that can be used for a rejected button. More...
 
virtual void helpClicked ()
 Help button clicked;. More...
 
virtual void keepOpenChanged (int state)
 Keep open checkbox clicked;. More...
 
virtual void algorithmCompleted ()
 Keep the running algorithm has completed. More...
 
virtual void executeAlgorithmAsync ()
 Executes the algorithm in a separate thread. More...
 
virtual void removeAlgorithmFromManager ()
 Removes the algorithm from the manager. More...
 
void enableExitButton ()
 Enable to exit button. More...
 
- Protected Member Functions inherited from MantidQt::API::AlgorithmDialog
const QString & getOptionalMessage () const
 Get the message string. More...
 
void addOptionalMessage (QVBoxLayout *mainLay)
 Add the optional message to the given layout. More...
 
bool isForScript () const
 Get the usage boolean value. More...
 
bool isMessageAvailable () const
 Is there a message string available. More...
 
bool isWidgetEnabled (const QString &propName) const
 Check is a given property should have its control enabled or not. More...
 
Mantid::API::IAlgorithm_sptr getAlgorithm () const
 Get the algorithm pointer. More...
 
Mantid::Kernel::PropertygetAlgorithmProperty (const QString &propName) const
 Get a pointer to the named property. More...
 
bool requiresUserInput (const QString &propName) const
 Return a true if the given property requires user input. More...
 
QString getInputValue (const QString &propName) const
 Get an input value from the form, dealing with blank inputs etc. More...
 
QLabel * getValidatorMarker (const QString &propname)
 Get a property validator label. More...
 
void storePropertyValue (const QString &name, const QString &value)
 Adds a property (name,value) pair to the stored map. More...
 
void removePropertyValue (const QString &name)
 Removes a property (name, value) pair from the stored map. More...
 
bool setPropertyValues (const QStringList &skipList=QStringList())
 Set properties on this algorithm by pulling values from the tied widgets. More...
 
bool setPropertyValue (const QString &pName, bool validateOthers)
 Sets the value of a single property, using the value previously stored using storePropertyValue() More...
 
void showValidators ()
 Show the validators for all the properties. More...
 
QWidget * tie (QWidget *widget, const QString &property, QLayout *parent_layout=nullptr, bool readHistory=true)
 Tie a widget to a property. More...
 
void untie (const QString &property)
 Untie a widget to a property. More...
 
QString openFileDialog (const QString &propName)
 Open a file dialog to select a file. More...
 
QStringList openMultipleFileDialog (const QString &propName)
 Open a file dialog to select many file. More...
 
void fillAndSetComboBox (const QString &propName, QComboBox *optionsBox) const
 Fill a combo box for the named algorithm's allowed values. More...
 
void fillLineEdit (const QString &propName, QLineEdit *field)
 Fill in the necessary input for a text field. More...
 
QLayout * createDefaultButtonLayout (const QString &helpText=QString("?"), const QString &loadText=QString("Run"), const QString &cancelText=QString("Close"), const QString &keepOpenText=QString("Keep Open"))
 Create a row layout of buttons with specified text. More...
 
QPushButton * createHelpButton (const QString &helpText=QString("?")) const
 Create a help button for this algorithm. More...
 
void flagInputWS (QWidget *inputWidget)
 Flag an input workspace combobox with its property name. More...
 
QString getValue (QWidget *widget)
 Retrieve a text value for a property from a widget. More...
 
void parse ()
 Parse out the input from the dialog. More...
 
bool requestedToKeepEnabled (const QString &propName) const
 Test if the given name's widget has been explicity asked to be enabled. More...
 
QString getPreviousValue (const QString &propName) const
 Get the property value from either the previous input store or from Python argument. More...
 
void setPreviousValue (QWidget *widget, const QString &property)
 Set a value based on any old input that we have. More...
 
void finishHandle (const Mantid::API::IAlgorithm *alg) override
 Handle completion of algorithm started while staying open. More...
 
void errorHandle (const Mantid::API::IAlgorithm *alg, const std::string &what) override
 Handle completion of algorithm started while staying open. More...
 
void closeEvent (QCloseEvent *evt) override
 Only allow close when close is enabled. More...
 
- Protected Attributes inherited from MantidQt::API::AlgorithmDialog
Mantid::API::IAlgorithm_sptr m_algorithm
 The algorithm associated with this dialog. More...
 
QString m_algName
 The name of the algorithm. More...
 
QStringList m_algProperties
 The properties associated with this dialog. More...
 
QHash< QString, QString > m_propertyValueMap
 A map of property <name, value> pairs that have been taken from the dialog. More...
 
QHash< QString, QWidget * > m_tied_properties
 A list pointers to the widget for each property. More...
 
bool m_forScript
 A boolean indicating whether this is for a script or not. More...
 
QStringList m_python_arguments
 A list of property names that have been passed from Python. More...
 
QStringList m_enabled
 A list of property names that should have their widgets enabled. More...
 
QStringList m_disabled
 A list of property names that the user has requested to be disabled (overrides those in enabled) More...
 
QString m_strMessage
 The message string to be displayed at the top of the widget; if it exists. More...
 
bool m_keepOpen
 Whether to keep the dialog box open after alg execution. More...
 
bool m_msgAvailable
 Is the message string empty or not. More...
 
bool m_isInitialized
 Whether the layout has been initialized. More...
 
bool m_autoParseOnInit
 Flag if the input should be parsed automatically on initialization. More...
 
QHash< QString, QLabel * > m_validators
 A list of labels to use as validation markers. More...
 
QHash< QString, QString > m_errors
 A map where key = property name; value = the error for this property (i.e. More...
 
QStringList m_noValidation
 A list of property names whose widgets handle their own validation. More...
 
QVector< QWidget * > m_inputws_opts
 Store a list of the names of input workspace boxes. More...
 
QVector< QLineEdit * > m_outputws_fields
 Store a list of output workspace text edits. More...
 
QHash< QPushButton *, int > m_wsbtn_tracker
 A map to keep track of replace workspace button presses. More...
 
QCheckBox * m_keepOpenCheckBox
 
QPushButton * m_okButton
 
QPushButton * m_exitButton
 
std::vector< Mantid::API::AlgorithmObserver * > m_observers
 A list of AlgorithmObservers to add to the algorithm prior to execution. More...
 
QTimer m_btnTimer
 Enable the close button when the timer fires. More...
 
bool m_statusTracked
 A flag to track whether the status of the algorithm is being tracked. More...
 

Detailed Description

This class gives specialised dialog for the Load algorithm.

It requires that the specific load algorithm has at least 2 properties with these names:

There is no UI form as the most of the thing is dynamic.

Author
Martyn Gigg, Tessella plc
Date
31/01/2011

Definition at line 54 of file FitDialog.h.

Constructor & Destructor Documentation

◆ FitDialog()

MantidQt::CustomDialogs::FitDialog::FitDialog ( QWidget *  parent = nullptr)

Default constructor.

Definition at line 301 of file FitDialog.cpp.

Member Function Documentation

◆ createInputWorkspaceWidgets

void MantidQt::CustomDialogs::FitDialog::createInputWorkspaceWidgets ( )
privateslot

Create InputWorkspaceWidgets and populate the tabs of the tab widget.

Definition at line 409 of file FitDialog.cpp.

References MantidQt::CustomDialogs::InputWorkspaceWidget::getWorkspaceName(), InputWorkspaceWidget, m_form, and m_tabs.

Referenced by domainTypeChanged().

◆ domainTypeChanged

void MantidQt::CustomDialogs::FitDialog::domainTypeChanged ( )
privateslot

Update user interface when domain type changes.

Definition at line 390 of file FitDialog.cpp.

References createInputWorkspaceWidgets(), MantidQt::API::AlgorithmDialog::getAlgorithm(), getAllowedPropertyValues(), getDomainType(), getDomainTypeString(), index, and m_form.

Referenced by tieStaticWidgets().

◆ functionChanged

void MantidQt::CustomDialogs::FitDialog::functionChanged ( )
privateslot

Definition at line 463 of file FitDialog.cpp.

◆ getAllowedPropertyValues()

QStringList MantidQt::CustomDialogs::FitDialog::getAllowedPropertyValues ( const QString &  propName) const
private

◆ getDomainType()

int MantidQt::CustomDialogs::FitDialog::getDomainType ( ) const
private

Get the domain type: Simple, Sequential, or Parallel.

Definition at line 511 of file FitDialog.cpp.

References m_form.

Referenced by domainTypeChanged(), and MantidQt::CustomDialogs::InputWorkspaceWidget::getDomainType().

◆ getDomainTypeString()

QString MantidQt::CustomDialogs::FitDialog::getDomainTypeString ( ) const
private

Get the domain type: Simple, Sequential, or Parallel.

Definition at line 525 of file FitDialog.cpp.

References m_form.

Referenced by domainTypeChanged(), parseInput(), and saveInput().

◆ initLayout()

void MantidQt::CustomDialogs::FitDialog::initLayout ( )
overrideprivatevirtual

Initialize the layout.

Implements MantidQt::API::AlgorithmDialog.

Definition at line 304 of file FitDialog.cpp.

References MantidQt::API::AlgorithmDialog::createDefaultButtonLayout(), m_form, and tieStaticWidgets().

◆ isMD()

bool MantidQt::CustomDialogs::FitDialog::isMD ( ) const
private

Is the function MD?

Definition at line 503 of file FitDialog.cpp.

References m_form.

Referenced by MantidQt::CustomDialogs::InputWorkspaceWidget::setDynamicProperties().

◆ parseInput()

void MantidQt::CustomDialogs::FitDialog::parseInput ( )
overrideprivatevirtual

◆ saveInput()

void MantidQt::CustomDialogs::FitDialog::saveInput ( )
overrideprivatevirtual

Save the input history.

Save the input after OK is clicked.

Reimplemented from MantidQt::API::AlgorithmDialog.

Definition at line 314 of file FitDialog.cpp.

References getDomainTypeString(), m_form, MantidQt::API::AlgorithmDialog::saveInput(), and MantidQt::API::AlgorithmDialog::storePropertyValue().

◆ setWorkspaceName()

void MantidQt::CustomDialogs::FitDialog::setWorkspaceName ( int  i,
const QString &  wsName 
)
private

Set i-th workspace name.

Parameters
i:: Tab index
wsName:: A workspace name to try to set.

Definition at line 453 of file FitDialog.cpp.

References m_form, and MantidQt::CustomDialogs::InputWorkspaceWidget::setWorkspaceName().

Referenced by tieStaticWidgets().

◆ tieStaticWidgets()

void MantidQt::CustomDialogs::FitDialog::tieStaticWidgets ( const bool  readHistory)
private

Tie static widgets to their properties.

Parameters
readHistory:: If true then the history will be re read.

Definition at line 350 of file FitDialog.cpp.

References domainTypeChanged(), getAllowedPropertyValues(), MantidQt::API::AlgorithmDialog::getPreviousValue(), m_form, setWorkspaceName(), MantidQt::API::AlgorithmDialog::tie(), and value.

Referenced by initLayout().

◆ workspaceChanged

void MantidQt::CustomDialogs::FitDialog::workspaceChanged ( const QString &  )
privateslot

Override the help button clicked method.

Definition at line 461 of file FitDialog.cpp.

References MantidQt::API::AlgorithmDialog::setPropertyValues().

Friends And Related Function Documentation

◆ InputWorkspaceWidget

friend class InputWorkspaceWidget
friend

Definition at line 96 of file FitDialog.h.

Referenced by createInputWorkspaceWidgets().

Member Data Documentation

◆ m_form

Ui::FitDialog MantidQt::CustomDialogs::FitDialog::m_form
private

◆ m_tabs

QList<QWidget *> MantidQt::CustomDialogs::FitDialog::m_tabs
private

Definition at line 94 of file FitDialog.h.

Referenced by createInputWorkspaceWidgets(), and parseInput().


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