Skip to content

Commit

Permalink
Re #9543. Correct indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Jun 9, 2014
1 parent 64270d8 commit b449710
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions Code/Mantid/Framework/LiveData/src/LoadLiveData.cpp
Expand Up @@ -254,25 +254,25 @@ namespace LiveData

if ( gws )
{
WorkspaceGroup_sptr accum_gws = boost::dynamic_pointer_cast<WorkspaceGroup>(m_accumWS);
if ( !accum_gws )
{
throw std::runtime_error("Two workspace groups are expected.");
}
if ( accum_gws->getNumberOfEntries() != gws->getNumberOfEntries() )
{
throw std::runtime_error("Accumulation and chunk workspace groups are expected to have the same size.");
}
// binary operations cannot handle groups passed by pointers, so add members one by one
for(size_t i = 0; i < static_cast<size_t>(gws->getNumberOfEntries()); ++i)
{
addMatrixWSChunk( algoName, accum_gws->getItem(i), gws->getItem(i) );
}
WorkspaceGroup_sptr accum_gws = boost::dynamic_pointer_cast<WorkspaceGroup>(m_accumWS);
if ( !accum_gws )
{
throw std::runtime_error("Two workspace groups are expected.");
}
if ( accum_gws->getNumberOfEntries() != gws->getNumberOfEntries() )
{
throw std::runtime_error("Accumulation and chunk workspace groups are expected to have the same size.");
}
// binary operations cannot handle groups passed by pointers, so add members one by one
for(size_t i = 0; i < static_cast<size_t>(gws->getNumberOfEntries()); ++i)
{
addMatrixWSChunk( algoName, accum_gws->getItem(i), gws->getItem(i) );
}
}
else
{
// just add the chunk
addMatrixWSChunk( algoName, m_accumWS, chunkWS );
// just add the chunk
addMatrixWSChunk( algoName, m_accumWS, chunkWS );
}
}

Expand All @@ -286,29 +286,29 @@ namespace LiveData
*/
void LoadLiveData::addMatrixWSChunk(const std::string& algoName, Workspace_sptr accumWS, Workspace_sptr chunkWS)
{
IAlgorithm_sptr alg = this->createChildAlgorithm(algoName);
alg->setProperty("LHSWorkspace", accumWS);
alg->setProperty("RHSWorkspace", chunkWS);
alg->setProperty("OutputWorkspace", accumWS);
alg->execute();
if (!alg->isExecuted())
{
throw std::runtime_error("Error when calling " + alg->name() + " to add the chunk of live data. See log.");
}
else
{
// Is this really necessary?

// Get the output as the generic Workspace type
Property * prop = alg->getProperty("OutputWorkspace");
IWorkspaceProperty * wsProp = dynamic_cast<IWorkspaceProperty*>(prop);
if (!wsProp)
throw std::runtime_error("The " + alg->name() + " Algorithm's OutputWorkspace property is not a WorkspaceProperty!");
Workspace_sptr temp = wsProp->getWorkspace();
accumWS = temp;
// And sort the events, if any
doSortEvents(accumWS);
}
IAlgorithm_sptr alg = this->createChildAlgorithm(algoName);
alg->setProperty("LHSWorkspace", accumWS);
alg->setProperty("RHSWorkspace", chunkWS);
alg->setProperty("OutputWorkspace", accumWS);
alg->execute();
if (!alg->isExecuted())
{
throw std::runtime_error("Error when calling " + alg->name() + " to add the chunk of live data. See log.");
}
else
{
// Is this really necessary?

// Get the output as the generic Workspace type
Property * prop = alg->getProperty("OutputWorkspace");
IWorkspaceProperty * wsProp = dynamic_cast<IWorkspaceProperty*>(prop);
if (!wsProp)
throw std::runtime_error("The " + alg->name() + " Algorithm's OutputWorkspace property is not a WorkspaceProperty!");
Workspace_sptr temp = wsProp->getWorkspace();
accumWS = temp;
// And sort the events, if any
doSortEvents(accumWS);
}
}


Expand Down

0 comments on commit b449710

Please sign in to comment.