Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading dead time data in Muon interface #18972

Merged
merged 5 commits into from Feb 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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