|
Mantid
|
Implements a dialog box that allows users to save multiple Mantid workspaces. More...
#include <SaveWorkspaces.h>
Public Slots | |
| void | onSaveAsZeroErrorFreeChanged (int state) |
| Reacts to a user change wether the workspace is to be saved as zero-error-free or not. More... | |
| void | onUpdateGeomtryInformation (QString &geometryID, QString &sampleHeight, QString &sampleWidth, QString &sampleThickness) |
| Recieves an update for the geometry information. More... | |
Signals | |
| void | closing () |
| void | createZeroErrorFreeWorkspace (QString &originalWorkspace, QString &zeroFreeWorkspace) |
| void | deleteZeroErrorFreeWorkspace (QString &zeroFreeWorkspace) |
| void | updateGeometryInformation () |
Signals inherited from MantidQt::API::MantidDialog | |
| void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
| void | initLayout () |
| Set up the dialog layout. More... | |
| SaveWorkspaces (QWidget *parent, const QString &suggFname, QHash< const QCheckBox *const, QString > &defSavs, bool saveAsZeroErrorFree) | |
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... | |
Static Public Member Functions | |
| static QString | getSaveAlgExt (const QString &algName) |
| Returns the save extension expected the name algorithm. More... | |
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... | |
Private Types | |
| using | SavFormatsConstIt = QHash< QCheckBox *const, QString >::const_iterator |
Private Slots | |
| void | saveFileBrowse () |
| Raises a browse dialog and inserts the selected file into the save text edit box, outfile_edit. More... | |
| void | saveSel () |
| Excutes the selected save algorithms on the workspaces that have been selected to be saved. More... | |
| void | setFileName (int row) |
| Sets the filename to the name of the selected workspace. More... | |
Private Member Functions | |
| void | addButtonsDisab (int row) |
| void | closeEvent (QCloseEvent *event) override |
| Called in response to a close event. More... | |
| bool | isValid () |
| Checks if the save option selection is compatible with the dimensionality selection. More... | |
| QHash< QString, QString > | provideZeroFreeWorkspaces (const QListWidget *workspaces) |
| Goes through all selected workspaces and maps them to a zero-error free clone, if the user has selected to do this otherwise the value of the hash is set to the same as the key. More... | |
| void | readSettings () |
| Sets up some controls from what is in the QSettings. More... | |
| void | removeZeroFreeWorkspaces (const QHash< QString, QString > &workspaces) |
| Remove all the zero-error free workspaces. More... | |
| QString | saveList (const QList< QListWidgetItem * > &list, const QString &algorithm, QString fileBase, bool toAppend, QHash< QString, QString > workspaceMap) |
| void | saveSettings () const |
| Saves the state of some controls to the QSettings. More... | |
| void | setFileName (const QString &newName) |
| Set the name of the output file. More... | |
| void | setupFormatTicks (const QHash< const QCheckBox *const, QString > &defSavs) |
| For each save format tick box take the user setting from the main form. More... | |
| void | setupLine1 (QHBoxLayout *const lineOne) |
| Puts the controls that go on the first line, the output filename commands, on to the layout that's passed to it. More... | |
| void | setupLine2 (QHBoxLayout *const lineTwo, const QHash< const QCheckBox *const, QString > &defSavs) |
| Puts the controls that go on the second line, the workspace list and save commands, on to the layout that's passed to it. More... | |
Private Attributes | |
| QCheckBox * | m_append |
| QLineEdit * | m_fNameEdit |
| QString | m_geometryID |
| QString | m_lastName |
| QString | m_sampleHeight |
| QString | m_sampleThickness |
| QString | m_sampleWidth |
| bool | m_saveAsZeroErrorFree |
| QHash< QCheckBox *const, QString > | m_savFormats |
| QListWidget * | m_workspaces |
Additional Inherited Members | |
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... | |
Implements a dialog box that allows users to save multiple Mantid workspaces.
Definition at line 26 of file SaveWorkspaces.h.
|
private |
Definition at line 58 of file SaveWorkspaces.h.
| SaveWorkspaces::SaveWorkspaces | ( | QWidget * | parent, |
| const QString & | suggFname, | ||
| QHash< const QCheckBox *const, QString > & | defSavs, | ||
| bool | saveAsZeroErrorFree | ||
| ) |
| parent | :: used by QT |
| suggFname | :: sets the initial entry in the filename box |
| defSavs | :: sets which boxes are ticked |
| saveAsZeroErrorFree | :: if the workspace should be saved with the zero errors replaced by a default value or not |
Definition at line 61 of file SaveWorkspaces.cpp.
References readSettings(), setFileName(), setupLine1(), and setupLine2().
|
private |
|
overrideprivate |
Called in response to a close event.
| event | The event object |
Definition at line 215 of file SaveWorkspaces.cpp.
References closing(), and saveSettings().
|
signal |
Referenced by closeEvent().
|
signal |
Referenced by provideZeroFreeWorkspaces().
|
signal |
Referenced by removeZeroFreeWorkspaces().
|
static |
Returns the save extension expected the name algorithm.
Gets the first extension that the algorithm passed algorithm has in it's FileProperty (the FileProperty must have the name "Filename".
| algName | :: name of the Mantid save algorithm |
Definition at line 284 of file SaveWorkspaces.cpp.
References Mantid::API::FileProperty::getDefaultExt(), and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by saveList().
| void SaveWorkspaces::initLayout | ( | ) |
Set up the dialog layout.
Definition at line 84 of file SaveWorkspaces.cpp.
|
private |
Checks if the save option selection is compatible with the dimensionality selection.
Definition at line 343 of file SaveWorkspaces.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_savFormats, m_workspaces, and workspace.
Referenced by saveSel().
|
slot |
Reacts to a user change wether the workspace is to be saved as zero-error-free or not.
| state | :: 0 if we don't save with the zero-error correction, otherwise anything else |
Definition at line 461 of file SaveWorkspaces.cpp.
References m_saveAsZeroErrorFree.
|
slot |
Recieves an update for the geometry information.
Definition at line 472 of file SaveWorkspaces.cpp.
References m_geometryID, m_sampleHeight, m_sampleThickness, and m_sampleWidth.
|
private |
Goes through all selected workspaces and maps them to a zero-error free clone, if the user has selected to do this otherwise the value of the hash is set to the same as the key.
| workspaces | :: a QListWIdget which contains the selected workspaces |
Definition at line 424 of file SaveWorkspaces.cpp.
References createZeroErrorFreeWorkspace(), Mantid::Kernel::SingletonHolder< T >::Instance(), and m_saveAsZeroErrorFree.
Referenced by saveSel().
|
private |
Sets up some controls from what is in the QSettings.
Definition at line 170 of file SaveWorkspaces.cpp.
References m_append, and m_lastName.
Referenced by SaveWorkspaces().
|
private |
Remove all the zero-error free workspaces.
| workspaces | :: a map containing the names of all zero-error-free workspaces. |
Definition at line 448 of file SaveWorkspaces.cpp.
References deleteZeroErrorFreeWorkspace().
Referenced by saveSel().
|
privateslot |
Raises a browse dialog and inserts the selected file into the save text edit box, outfile_edit.
Definition at line 392 of file SaveWorkspaces.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_append, and m_fNameEdit.
Referenced by setupLine1().
|
private |
Definition at line 220 of file SaveWorkspaces.cpp.
References getSaveAlgExt(), m_geometryID, m_sampleHeight, m_sampleThickness, m_sampleWidth, and updateGeometryInformation().
Referenced by saveSel().
|
privateslot |
Excutes the selected save algorithms on the workspaces that have been selected to be saved.
Definition at line 298 of file SaveWorkspaces.cpp.
References isValid(), m_append, m_fNameEdit, m_saveAsZeroErrorFree, m_savFormats, m_workspaces, provideZeroFreeWorkspaces(), removeZeroFreeWorkspaces(), MantidQt::API::MantidDialog::runPythonCode(), and saveList().
Referenced by setupLine2().
|
private |
Saves the state of some controls to the QSettings.
Definition at line 205 of file SaveWorkspaces.cpp.
References m_append, and m_lastName.
Referenced by closeEvent().
|
private |
Set the name of the output file.
| newName | filename to use |
Definition at line 179 of file SaveWorkspaces.cpp.
References m_append, m_fNameEdit, and m_lastName.
|
privateslot |
Sets the filename to the name of the selected workspace.
| row | number of the row that is selected |
Definition at line 388 of file SaveWorkspaces.cpp.
References m_workspaces, and setFileName().
Referenced by SaveWorkspaces(), setFileName(), and setupLine2().
|
private |
For each save format tick box take the user setting from the main form.
| defSavs | the formats to save into |
Definition at line 191 of file SaveWorkspaces.cpp.
References m_savFormats.
Referenced by setupLine2().
|
private |
Puts the controls that go on the first line, the output filename commands, on to the layout that's passed to it.
| lineOne | :: the layout on to which the controls will be placed |
Definition at line 89 of file SaveWorkspaces.cpp.
References m_fNameEdit, and saveFileBrowse().
Referenced by SaveWorkspaces().
|
private |
Puts the controls that go on the second line, the workspace list and save commands, on to the layout that's passed to it.
| lineTwo | :: the layout on to which the controls will be placed |
| defSavs | the formats to save into, sets the check boxes to be checked |
Definition at line 108 of file SaveWorkspaces.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_append, m_savFormats, m_workspaces, saveSel(), setFileName(), and setupFormatTicks().
Referenced by SaveWorkspaces().
|
signal |
Referenced by saveList().
|
private |
Definition at line 49 of file SaveWorkspaces.h.
Referenced by readSettings(), saveFileBrowse(), saveSel(), saveSettings(), setFileName(), and setupLine2().
|
private |
Definition at line 47 of file SaveWorkspaces.h.
Referenced by saveFileBrowse(), saveSel(), setFileName(), and setupLine1().
|
private |
Definition at line 52 of file SaveWorkspaces.h.
Referenced by onUpdateGeomtryInformation(), and saveList().
|
private |
Definition at line 50 of file SaveWorkspaces.h.
Referenced by readSettings(), saveSettings(), and setFileName().
|
private |
Definition at line 53 of file SaveWorkspaces.h.
Referenced by onUpdateGeomtryInformation(), and saveList().
|
private |
Definition at line 55 of file SaveWorkspaces.h.
Referenced by onUpdateGeomtryInformation(), and saveList().
|
private |
Definition at line 54 of file SaveWorkspaces.h.
Referenced by onUpdateGeomtryInformation(), and saveList().
|
private |
Definition at line 51 of file SaveWorkspaces.h.
Referenced by onSaveAsZeroErrorFreeChanged(), provideZeroFreeWorkspaces(), and saveSel().
|
private |
Definition at line 57 of file SaveWorkspaces.h.
Referenced by isValid(), saveSel(), setupFormatTicks(), and setupLine2().
|
private |
Definition at line 48 of file SaveWorkspaces.h.
Referenced by isValid(), saveSel(), setFileName(), and setupLine2().