Skip to content

Commit

Permalink
Merge pull request #18972 from mantidproject/18950_ReadingDeadTimeData
Browse files Browse the repository at this point in the history
Reading dead time data
  • Loading branch information
peterfpeterson committed Feb 23, 2017
2 parents bb09b60 + 786d435 commit f8dac2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Expand Up @@ -95,6 +95,8 @@ class MANTIDQT_CUSTOMINTERFACES_DLL MuonAnalysisDataLoader {
/// Load dead times from file
Mantid::API::Workspace_sptr
loadDeadTimesFromFile(const std::string &filename) const;
// empty the cache
void clearCache();

protected:
/// Set properties of algorithm from options
Expand Down
4 changes: 3 additions & 1 deletion MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp
Expand Up @@ -2694,7 +2694,7 @@ void MuonAnalysis::doSetToolbarsHidden(bool hidden) {
*/
void MuonAnalysis::onDeadTimeTypeChanged(int choice) {
m_deadTimesChanged = true;

m_dataLoader.clearCache();
if (choice == 0 || choice == 1) // if choice == none || choice == from file
{
m_uiForm.mwRunDeadTimeFile->setVisible(false);
Expand Down Expand Up @@ -2757,6 +2757,7 @@ void MuonAnalysis::deadTimeFileSelected() {
* from the form
*/
void MuonAnalysis::setTimeZeroState(int checkBoxState) {
m_dataLoader.clearCache();
if (checkBoxState == -1)
checkBoxState = m_uiForm.timeZeroAuto->checkState();

Expand All @@ -2778,6 +2779,7 @@ void MuonAnalysis::setTimeZeroState(int checkBoxState) {
* from the form
*/
void MuonAnalysis::setFirstGoodDataState(int checkBoxState) {
m_dataLoader.clearCache();
if (checkBoxState == -1)
checkBoxState = m_uiForm.firstGoodDataAuto->checkState();

Expand Down
6 changes: 6 additions & 0 deletions MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp
Expand Up @@ -472,5 +472,11 @@ void MuonAnalysisDataLoader::updateCache() const {
}
}

void MuonAnalysisDataLoader::clearCache() {
if (!m_loadedDataCache.empty()) {
m_loadedDataCache.clear();
}
}

} // namespace CustomInterfaces
} // namespace MantidQt

0 comments on commit f8dac2f

Please sign in to comment.