Skip to content

Commit

Permalink
Add history of a WS group to children on algo
Browse files Browse the repository at this point in the history
Refs #10340
  • Loading branch information
DanNixon committed Nov 17, 2014
1 parent 8f9facd commit bd8c3dc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -1055,15 +1055,33 @@ namespace Mantid
// Loop over the output workspaces
for (outWS = outputWorkspaces.begin(); outWS != outputWorkspaces.end(); ++outWS)
{
WorkspaceGroup_sptr wsGroup = boost::dynamic_pointer_cast<WorkspaceGroup>(*outWS);

// Loop over the input workspaces, making the call that copies their history to the output ones
// (Protection against copy to self is in WorkspaceHistory::copyAlgorithmHistory)
for (inWS = inputWorkspaces.begin(); inWS != inputWorkspaces.end(); ++inWS)
{
(*outWS)->history().addHistory( (*inWS)->getHistory() );

if(wsGroup)
{
for(size_t i = 0; i < wsGroup->size(); i++)
{
wsGroup->getItem(i)->history().addHistory( (*inWS)->getHistory() );
}
}
}

// Add the history for the current algorithm to all the output workspaces
(*outWS)->history().addHistory(m_history);

if(wsGroup)
{
for(size_t i = 0; i < wsGroup->size(); i++)
{
wsGroup->getItem(i)->history().addHistory(m_history);
}
}
}
}
//this is a child algorithm, but we still want to keep the history.
Expand Down

0 comments on commit bd8c3dc

Please sign in to comment.