-
Notifications
You must be signed in to change notification settings - Fork 122
/
StepScan.h
84 lines (69 loc) · 2.67 KB
/
StepScan.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
#ifndef MANTIDQTCUSTOMINTERFACES_ROCKINGCURVE_H_
#define MANTIDQTCUSTOMINTERFACES_ROCKINGCURVE_H_
//----------------------
// Includes
//----------------------
#include "ui_StepScan.h"
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtAPI/AlgorithmRunner.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/IAlgorithm.h"
namespace MantidQt
{
namespace CustomInterfaces
{
class StepScan : public API::UserSubWindow
{
Q_OBJECT
public:
/// The name of the interface as registered into the factory
static std::string name() { return "Step Scan Analysis"; }
// This interface's categories.
static QString categoryInfo() { return "General"; }
StepScan(QWidget *parent = 0);
~StepScan();
signals:
void logsAvailable( const Mantid::API::MatrixWorkspace_const_sptr& );
void logsUpdated( const Mantid::API::MatrixWorkspace_const_sptr& );
void updatePlot( const QString& );
private slots:
void triggerLiveListener(bool checked);
void startLiveListenerComplete(bool error);
void loadFile(bool async = true);
void loadFileComplete(bool error);
void launchInstrumentWindow();
void fillPlotVarCombobox(const Mantid::API::MatrixWorkspace_const_sptr& ws);
void expandPlotVarCombobox(const Mantid::API::MatrixWorkspace_const_sptr& ws);
void fillNormalizationCombobox();
void runStepScanAlg();
bool runStepScanAlgLive(std::string stepScanProperties);
void updateForNormalizationChange();
void generateCurve(const QString& var);
void helpClicked();
private:
void initLayout();
void startLiveListener();
bool mergeRuns();
void setupOptionControls();
void clearNormalizationCombobox();
Mantid::API::IAlgorithm_sptr setupStepScanAlg();
void cleanupWorkspaces();
void plotCurve();
void handleAddEvent(Mantid::API::WorkspaceAddNotification_ptr pNf);
void handleReplEvent(Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf);
void addReplaceObserverOnce();
void checkForMaskWorkspace(const std::string& wsName);
void checkForResultTableUpdate(const std::string& wsName);
void checkForVaryingLogs(const std::string& wsName);
Ui::StepScan m_uiForm; ///< The form generated by Qt Designer
std::string m_inputWSName, m_tableWSName, m_plotWSName;
QString m_inputFilename;
const std::string m_instrument; ///< The default instrument (for live data)
API::AlgorithmRunner * m_algRunner; ///< Object for running algorithms asynchronously
Poco::NObserver<StepScan, Mantid::API::WorkspaceAddNotification> m_addObserver;
Poco::NObserver<StepScan, Mantid::API::WorkspaceAfterReplaceNotification> m_replObserver;
bool m_replaceObserverAdded;
};
} // namespace CustomInterfaces
} // namespace MantidQt
#endif //MANTIDQTCUSTOMINTERFACES_ROCKINGCURVE_H_