-
Notifications
You must be signed in to change notification settings - Fork 122
/
MuonSequentialFitDialog.h
129 lines (88 loc) · 3.75 KB
/
MuonSequentialFitDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#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, Algorithm_sptr loadAlg);
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;
/// Algorithm the dialog should use for loading
Algorithm_sptr m_loadAlg;
// -- 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_ */