Skip to content

Commit

Permalink
refs #18950 Renamed emptyCache to clearCache
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLim23 committed Feb 23, 2017
1 parent 7efdc11 commit abd3fe0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MANTIDQT_CUSTOMINTERFACES_DLL MuonAnalysisDataLoader {
Mantid::API::Workspace_sptr
loadDeadTimesFromFile(const std::string &filename) const;
//empty the cache
void emptyCache();
void clearCache();

protected:
/// Set properties of algorithm from options
Expand Down
6 changes: 3 additions & 3 deletions MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,7 @@ void MuonAnalysis::doSetToolbarsHidden(bool hidden) {
*/
void MuonAnalysis::onDeadTimeTypeChanged(int choice) {
m_deadTimesChanged = true;
m_dataLoader.emptyCache();
m_dataLoader.clearCache();
if (choice == 0 || choice == 1) // if choice == none || choice == from file
{
m_uiForm.mwRunDeadTimeFile->setVisible(false);
Expand Down Expand Up @@ -2757,7 +2757,7 @@ void MuonAnalysis::deadTimeFileSelected() {
* from the form
*/
void MuonAnalysis::setTimeZeroState(int checkBoxState) {
m_dataLoader.emptyCache();
m_dataLoader.clearCache();
if (checkBoxState == -1)
checkBoxState = m_uiForm.timeZeroAuto->checkState();

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

Expand Down
22 changes: 1 addition & 21 deletions MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,8 @@ LoadResult MuonAnalysisDataLoader::loadFiles(const QStringList &files) const {
const std::string fileString = toString(files);
if (m_loadedDataCache.find(fileString) != m_loadedDataCache.end())
{
/* LoadResult result = m_loadedDataCache[fileString];
if (m_deadTimesType == DeadTimesType::FromFile) { // manually reset the DeadTime
IAlgorithm_sptr load =
AlgorithmManager::Instance().createUnmanaged("LoadMuonNexus");
load->initialize();
load->setChild(true);
load->setLogging(false); // We'll take care of printing messages ourselves
std::string fileString2 = toString(files);
fileString2.pop_back();
const std::string fileString3 = fileString2;
load->setPropertyValue("Filename", fileString3);
g_log.information("Using cached workspace for file(s): " + fileString);
// Just to pass validation
load->setPropertyValue("OutputWorkspace", "__NotUsed");
load->setPropertyValue("DeadTimeTable", "__NotUsed");
load->execute();
result.loadedDeadTimes = load->getProperty("DeadTimeTable");
}
return result;*/
g_log.information("Using cached workspace for file(s): " + fileString);
return m_loadedDataCache[fileString];

}

LoadResult result;
Expand Down Expand Up @@ -493,7 +473,7 @@ void MuonAnalysisDataLoader::updateCache() const {
}
}

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

0 comments on commit abd3fe0

Please sign in to comment.