Skip to content

Commit

Permalink
Re #8637. Lose the flag for reloading the data.
Browse files Browse the repository at this point in the history
No longer needed now that I'm good and never modify the input workspace
to the StepScan algorithm.
  • Loading branch information
RussellTaylor committed Jan 30, 2014
1 parent c261608 commit 9b85b8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Expand Up @@ -69,7 +69,6 @@ private slots:
Ui::StepScan m_uiForm; ///< The form generated by Qt Designer
std::string m_inputWSName, m_tableWSName, m_plotWSName;
QString m_inputFilename;
bool m_dataReloadNeeded;
const std::string m_instrument; ///< The default instrument (for live data)

API::AlgorithmRunner * m_algRunner; ///< Object for running algorithms asynchronously
Expand Down
17 changes: 7 additions & 10 deletions Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp
Expand Up @@ -25,7 +25,7 @@ using namespace Mantid::API;

/// Constructor
StepScan::StepScan(QWidget *parent)
: UserSubWindow(parent), m_dataReloadNeeded(false),
: UserSubWindow(parent),
m_instrument(ConfigService::Instance().getInstrument().name()),
m_algRunner(new API::AlgorithmRunner(this)),
m_addObserver(*this, &StepScan::handleAddEvent),
Expand Down Expand Up @@ -169,7 +169,7 @@ void StepScan::loadFile(bool async)
const QString filename = m_uiForm.mWRunFiles->getFirstFilename();
// This handles the fact that mwRunFiles emits the filesFound signal more than
// we want (on some platforms). TODO: Consider dealing with this up in mwRunFiles.
if ( filename != m_inputFilename || m_dataReloadNeeded )
if ( filename != m_inputFilename )
{
m_inputFilename = filename;

Expand Down Expand Up @@ -200,7 +200,6 @@ void StepScan::loadFileComplete(bool error)
disconnect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(loadFileComplete(bool)));
if ( ! error )
{
m_dataReloadNeeded = false;
setupOptionControls();
}
else
Expand Down Expand Up @@ -355,10 +354,6 @@ IAlgorithm_sptr StepScan::setupStepScanAlg()
break;
}

// If any of the filtering options were set, next time round we'll need to reload the data
// as they cause the workspace to be changed
if ( !maskWS.isEmpty() || !xminStr.isEmpty() || !xmaxStr.isEmpty() ) m_dataReloadNeeded = true;

return stepScan;
}

Expand Down Expand Up @@ -399,9 +394,11 @@ void StepScan::runStepScanAlg()
else // Offline data
{
// Check just in case the user has deleted the loaded workspace
if ( ! AnalysisDataService::Instance().doesExist(m_inputWSName) ) m_dataReloadNeeded = true;
// Reload also needed if the workspace isn't fresh, as well as if the line above triggers
if ( m_dataReloadNeeded ) loadFile(false);
if ( ! AnalysisDataService::Instance().doesExist(m_inputWSName) )
{
m_inputFilename.clear();
loadFile(false);
}
stepScan->setPropertyValue("InputWorkspace", m_inputWSName);
algSuccessful = stepScan->execute();
}
Expand Down

0 comments on commit 9b85b8f

Please sign in to comment.