Skip to content

Commit

Permalink
Refs #8768 Attempt to reload file if it's been removed from ADS
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Jan 28, 2014
1 parent 0d6cc28 commit 20aaaf8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp
Expand Up @@ -251,12 +251,28 @@ namespace IDA
*/
QString ConvFit::validate()
{
using Mantid::API::AnalysisDataService;

UserInputValidator uiv;

switch( uiForm().confit_cbInputType->currentIndex() )
{
case 0:
uiv.checkMWRunFilesIsValid("Reduction", uiForm().confit_inputFile); break;
uiv.checkMWRunFilesIsValid("Reduction", uiForm().confit_inputFile);

//file should already be loaded by this point, but attempt to recover if not.
if(!AnalysisDataService::Instance().doesExist(m_cfInputWSName.toStdString()))
{
//attempt to reload the nexus file.
QString filename = uiForm().confit_inputFile->getFirstFilename();
QFileInfo fi(filename);
QString wsname = fi.baseName();

m_cfInputWS = runLoadNexus(filename, wsname);
m_cfInputWSName = wsname;
}

break;
case 1:
uiv.checkWorkspaceSelectorIsNotEmpty("Reduction", uiForm().confit_wsSample); break;
}
Expand Down Expand Up @@ -651,7 +667,7 @@ namespace IDA
QString wsname = fi.baseName();

// Load the file if it has not already been loaded.
if ( (m_cfInputWS == NULL) || ( wsname != m_cfInputWSName ))
if ( (m_cfInputWS == NULL) || ( wsname != m_cfInputWSName ) )
{
m_cfInputWSName = wsname;
m_cfInputWS = runLoadNexus(filename, wsname);
Expand Down

0 comments on commit 20aaaf8

Please sign in to comment.