Commit 3af1caa7 authored by Michael Reuter's avatar Michael Reuter
Browse files

Refs #5051. Adding ability to set filename property for load.

One of the loaders that SNS supports, LoadEventPreNexus, does not use the
Filename property. Therefore, I've made a way to set that.
parent db267153
......@@ -47,6 +47,7 @@ public:
protected:
void setLoadAlg(const std::string & alg);
void setLoadAlgFileProp(const std::string & filePropName);
void setAccumAlg(const std::string & alg);
ITableWorkspace_sptr determineChunk();
void loadChunk();
......@@ -66,6 +67,8 @@ private:
std::string m_loadAlg;
/// The name of the algorithm to invoke when accumulating data chunks
std::string m_accumulateAlg;
/// An alternate filename property for the load algorithm
std::string m_loadAlgFileProp;
};
} // namespace API
......
......@@ -29,6 +29,7 @@ namespace API
{
m_loadAlg = "Load";
m_accumulateAlg = "Plus";
m_loadAlgFileProp = "Filename";
m_useMPI = false;
}
......@@ -47,6 +48,15 @@ namespace API
m_loadAlg = alg;
}
void DataProcessorAlgorithm::setLoadAlgFileProp(const std::string &filePropName)
{
if (filePropName.empty())
{
throw std::invalid_argument("Cannot set the load algorithm file property name");
}
m_loadAlgFileProp = filePropName;
}
void DataProcessorAlgorithm::setAccumAlg(const std::string &alg)
{
if (alg.empty())
......@@ -164,7 +174,7 @@ namespace API
const std::string outputWSName = p.getBaseName();
IAlgorithm_sptr loadAlg = createSubAlgorithm(m_loadAlg);
loadAlg->setProperty("Filename", foundFile);
loadAlg->setProperty(m_loadAlgFileProp, foundFile);
loadAlg->setAlwaysStoreInADS(true);
// Set up MPI if available
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment