Skip to content

Commit

Permalink
Refs #6473. Minor refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Dec 10, 2013
1 parent 8223861 commit e9e10a3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Code/Mantid/MantidQt/MantidWidgets/src/MuonSequentialFitDialog.cpp
Expand Up @@ -213,33 +213,39 @@ namespace MantidWidgets
setState(Running);
m_stopRequested = false;

for ( auto runIt = runFilenames.constBegin(); runIt != runFilenames.constEnd(); ++runIt )
for ( auto fileIt = runFilenames.constBegin(); fileIt != runFilenames.constEnd(); ++fileIt )
{
// Process events (so that Stop button press is processed)
QApplication::processEvents();

// Stop if requested by user
if ( m_stopRequested )
{
setState(Stopped);
return;
}
break;

Workspace_sptr loadedWS;
// Update progress
m_ui.progress->setValue( m_ui.progress->value() + 1 );

try
{
// TODO: should be MuonLoad here
IAlgorithm_sptr loadAlg = AlgorithmManager::Instance().createUnmanaged("LoadMuonNexus");
loadAlg->setChild(true);
loadAlg->initialize();
loadAlg->setPropertyValue( "Filename", runIt->toStdString() );
loadAlg->setPropertyValue( "OutputWorkspace", "Loaded" );
loadAlg->setPropertyValue( "Filename", fileIt->toStdString() );
loadAlg->setPropertyValue( "OutputWorkspace", "__YouDontSeeMeIAmNinja" ); // Is not used
loadAlg->execute();

loadedWS = loadAlg->getProperty("OutputWorkspace");
}
catch(std::exception& e)
{
QMessageBox::critical(this, "Loading failed",
"Unable to load one of the files.\n\nCheck log for details");
g_log.error(e.what());
break;
}
catch(std::exception)
{
// TODO: probably should show QMEssageBox
setState(Stopped);
}
}

Expand Down

0 comments on commit e9e10a3

Please sign in to comment.