-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run calib in separate thread, adjust test without thread, re #12610
- Loading branch information
1 parent
3bf947c
commit 4b84e93
Showing
7 changed files
with
323 additions
and
91 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
70 changes: 70 additions & 0 deletions
70
...CustomInterfaces/inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionPresWorker.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,70 @@ | ||
#ifndef MANTIDQTCUSTOMINTERFACES_ENGGDIFFRACTION_ENGGDIFFRACTIONPRESWORKER_H_ | ||
#define MANTIDQTCUSTOMINTERFACES_ENGGDIFFRACTION_ENGGDIFFRACTIONPRESWORKER_H_ | ||
|
||
#include "MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionPresenter.h" | ||
|
||
#include <QThread> | ||
|
||
namespace MantidQt { | ||
namespace CustomInterfaces { | ||
|
||
/** | ||
Worker to run long tasks for the presenter of the EnggDiffraction | ||
GUI. It has a finished() signal, and it is expected to emit it when | ||
the hard/long-work methods finish. | ||
Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD | ||
Oak Ridge National Laboratory & European Spallation Source | ||
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 EnggDiffWorker : public QObject { | ||
Q_OBJECT | ||
|
||
public: | ||
EnggDiffWorker(EnggDiffractionPresenter *pres, | ||
const std::string &outFilename, const std::string &vanNo, | ||
const std::string &ceriaNo) | ||
: m_pres(pres), m_outFilename(outFilename), m_vanNo(vanNo), | ||
m_ceriaNo(ceriaNo) {} | ||
|
||
private slots: | ||
|
||
/** | ||
* Calculate a new calibration. Connect this from a thread started() | ||
* signal. | ||
*/ | ||
void calibrate() { | ||
m_pres->doNewCalibration(m_outFilename, m_vanNo, m_ceriaNo); | ||
emit finished(); | ||
} | ||
|
||
signals: | ||
void finished(); | ||
|
||
private: | ||
EnggDiffractionPresenter *m_pres; | ||
/// parameters for calibration | ||
std::string m_outFilename, m_vanNo, m_ceriaNo; | ||
}; | ||
|
||
} // namespace CustomInterfaces | ||
} // namespace MantidQt | ||
|
||
#endif // MANTIDQTCUSTOMINTERFACES_ENGGDIFFRACTION_ENGGDIFFRACTIONPRESWORKER_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
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
Oops, something went wrong.