Skip to content

Commit

Permalink
refs #10131. Fix broken test and functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Aug 20, 2014
1 parent a8b8489 commit 0fb121f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Expand Up @@ -51,8 +51,6 @@ namespace API
/// Method to indicate that a non-standard property is taken as the input, so will be specified via fetchInputPropertyName.
virtual bool useCustomInputPropertyName() const {return false;}

/// Flag used to determine whether to use base or local virtual methods.
bool m_useDefaultGroupingBehaviour;
/// Convenience typdef for workspace names.
typedef MultiPeriodGroupWorker::VecWSGroupType VecWSGroupType;
/// multi period group workspaces.
Expand Down
25 changes: 20 additions & 5 deletions Code/Mantid/Framework/API/src/MultiPeriodGroupAlgorithm.cpp
Expand Up @@ -11,7 +11,7 @@ namespace Mantid
//----------------------------------------------------------------------------------------------
/** Constructor
*/
MultiPeriodGroupAlgorithm::MultiPeriodGroupAlgorithm() : m_useDefaultGroupingBehaviour(true)
MultiPeriodGroupAlgorithm::MultiPeriodGroupAlgorithm() : m_worker(new MultiPeriodGroupWorker)
{
}

Expand Down Expand Up @@ -42,9 +42,18 @@ namespace Mantid
m_worker.reset(new MultiPeriodGroupWorker(propName));
}
m_multiPeriodGroups = m_worker->findMultiPeriodGroups(this);

m_useDefaultGroupingBehaviour = m_multiPeriodGroups.size() == 0;
return !m_useDefaultGroupingBehaviour;
bool useDefaultGroupingBehaviour = m_multiPeriodGroups.size() == 0;
/*
* Give the opportunity to treat this as a regular group workspace.
*/
if(useDefaultGroupingBehaviour)
{
return Algorithm::checkGroups(); // Delegate to algorithm base class.
}
else
{
return !useDefaultGroupingBehaviour; // Evaluates to True if if multiperiod, that way algorithm will call the overrriden processGroups.
}
}


Expand All @@ -65,9 +74,15 @@ namespace Mantid
bool MultiPeriodGroupAlgorithm::processGroups()
{
bool result = m_worker->processGroups(this, m_multiPeriodGroups);
/*
* If we could not process the groups as a multiperiod set of groups workspaces
*/
if(!result)
{
result = Algorithm::processGroups();
}

this->setExecuted(result);
return result;
}

} // namespace API
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/MultiPeriodGroupWorker.cpp
Expand Up @@ -205,7 +205,7 @@ namespace Mantid
// If we are not processing multiperiod groups, use the base behaviour.
if (vecMultiPeriodGroups.size() < 1)
{
return sourceAlg->processGroups();
return false; // Indicates that this is not a multiperiod group workspace.
}
Property* outputWorkspaceProperty = sourceAlg->getProperty("OutputWorkspace");
const std::string outName = outputWorkspaceProperty->value();
Expand Down
Expand Up @@ -42,7 +42,7 @@ namespace MDAlgorithms

virtual const std::string name() const;
///Summary of algorithms purpose
virtual const std::string summary() const {return "Sticch two MD ReflectometryQ group workspaces together.";}
virtual const std::string summary() const {return "Stitch two MD ReflectometryQ group workspaces together.";}

virtual int version() const;
virtual const std::string category() const;
Expand Down

0 comments on commit 0fb121f

Please sign in to comment.