Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #6473. Merge branch 'feature/6473_muon_seq_fitting' into develop
Conflicts: Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
- Loading branch information
Showing
8 changed files
with
834 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MuonSequentialFitDialog.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
#ifndef MANTID_MANTIDWIDGETS_MUONSEQUENTIALFITDIALOG_H_ | ||
#define MANTID_MANTIDWIDGETS_MUONSEQUENTIALFITDIALOG_H_ | ||
|
||
#include "MantidKernel/System.h" | ||
#include "MantidKernel/Logger.h" | ||
|
||
#include "ui_MuonSequentialFitDialog.h" | ||
|
||
#include "MantidQtMantidWidgets/MuonFitPropertyBrowser.h" | ||
|
||
#include <QDialog> | ||
|
||
namespace MantidQt | ||
{ | ||
namespace MantidWidgets | ||
{ | ||
using namespace Mantid::Kernel; | ||
using namespace Mantid::API; | ||
|
||
/** MuonSequentialFitDialog : TODO: DESCRIPTION | ||
Copyright © 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
File change history is stored at: <https://github.com/mantidproject/mantid> | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class DLLExport MuonSequentialFitDialog : public QDialog | ||
{ | ||
|
||
Q_OBJECT | ||
|
||
public: | ||
MuonSequentialFitDialog(MuonFitPropertyBrowser* fitPropBrowser); | ||
virtual ~MuonSequentialFitDialog(); | ||
|
||
enum DialogState | ||
{ | ||
Running, | ||
Stopped | ||
}; | ||
|
||
signals: | ||
void stateChanged(DialogState newState); | ||
|
||
private: | ||
|
||
// -- FUNCTIONS ----------------------------------------------------------- | ||
|
||
/// Check if all the input field are valid | ||
bool isInputValid(); | ||
|
||
/// Set current dialog state | ||
void setState(DialogState newState); | ||
|
||
/// Initialize diagnosis table | ||
void initDiagnosisTable(); | ||
|
||
/// Add a new entry to the diagnosis table | ||
void addDiagnosisEntry(const std::string& runTitle, double fitQuality, | ||
IFunction_sptr fittedFunction); | ||
|
||
// -- VARIABLES ----------------------------------------------------------- | ||
|
||
/// UI form | ||
Ui::MuonSequentialFitDialog m_ui; | ||
|
||
/// Fit properties browser used to start the dialog | ||
MuonFitPropertyBrowser* m_fitPropBrowser; | ||
|
||
/// Current state of the dialog | ||
DialogState m_state; | ||
|
||
/// Whether user requested fitting to be stopped | ||
bool m_stopRequested; | ||
|
||
// -- STATIC MEMBERS ------------------------------------------------------ | ||
|
||
/// Checks if specified name is valid as a name for label. | ||
static std::string isValidLabel(const std::string& label); | ||
|
||
/// Returns displayable title for the given workspace | ||
static std::string getRunTitle(Workspace_const_sptr ws); | ||
|
||
/// Instance used to print log messages | ||
static Mantid::Kernel::Logger& g_log; | ||
|
||
private slots: | ||
/// Updates visibility/tooltip of label error asterisk | ||
void updateLabelError(const QString& label); | ||
|
||
/// Enables/disables start button depending on wether we are allowed to start | ||
void updateControlButtonState(); | ||
|
||
/// Sets control button to be start/stop depending on new dialog state | ||
void updateControlButtonType(DialogState newState); | ||
|
||
/// Update enabled state off all the input widgets depending on new dialog state | ||
void updateInputEnabled(DialogState newState); | ||
|
||
/// Start fitting process | ||
void startFit(); | ||
|
||
/// Stop fitting process | ||
void stopFit(); | ||
}; | ||
|
||
|
||
} // namespace MantidWidgets | ||
} // namespace Mantid | ||
|
||
#endif /* MANTID_MANTIDWIDGETS_MUONSEQUENTIALFITDIALOG_H_ */ |
Oops, something went wrong.