Skip to content
Snippets Groups Projects
Commit 02554333 authored by Pranav Bahuguna's avatar Pranav Bahuguna
Browse files

Re #18056 Sep now specified with string arg rather than actual char

parent 082cc28a
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,12 @@ void AsciiPointBase::init() {
"The filename of the output file.");
std::vector<std::string> propOptions;
propOptions.push_back(",");
propOptions.push_back(" ");
propOptions.push_back("\t");
declareProperty("Separator", "\t",
propOptions.push_back("comma");
propOptions.push_back("space");
propOptions.push_back("tab");
declareProperty("Separator", "tab",
boost::make_shared<StringListValidator>(propOptions),
"The separator used for splitting data columns. Comma, space or tab.");
"The separator used for splitting data columns. Allowed values: ['comma', 'space', 'tab']");
extraProps();
}
......@@ -56,8 +56,14 @@ void AsciiPointBase::exec() {
}
m_ws = getProperty("InputWorkspace");
g_log.information("FILENAME: " + filename);
std::string sepString = getProperty("Separator");
sep = boost::lexical_cast<char>(sepString);
std::string sepOption = getProperty("Separator");
if (sepOption == "comma") {
sep = ',';
} else if (sepOption == "space") {
sep = ' ';
} else {
sep = '\t';
}
std::vector<double> XData = header(file);
extraHeaders(file);
data(file, XData);
......
......@@ -167,7 +167,7 @@ public:
Mantid::API::AlgorithmManager::Instance().create("SaveANSTOAscii");
alg->setPropertyValue("InputWorkspace", m_name);
alg->setPropertyValue("Filename", m_filename);
alg->setPropertyValue("Separator", ",");
alg->setPropertyValue("Separator", "comma");
TS_ASSERT_THROWS_NOTHING(alg->execute());
if (!alg->isExecuted()) {
......
......@@ -184,7 +184,7 @@ public:
alg->setPropertyValue("Filename", m_filename);
alg->setPropertyValue("UserContact", "John Smith");
alg->setPropertyValue("Title", "Testing this algorithm");
alg->setPropertyValue("Separator", ",");
alg->setPropertyValue("Separator", "comma");
TS_ASSERT_THROWS_NOTHING(alg->execute());
if (!alg->isExecuted()) {
......
......@@ -179,7 +179,7 @@ public:
alg->setPropertyValue("InputWorkspace", m_name);
alg->setPropertyValue("Filename", m_filename);
alg->setPropertyValue("Title", "Testing this algorithm");
alg->setPropertyValue("Separator", ",");
alg->setPropertyValue("Separator", "comma");
TS_ASSERT_THROWS_NOTHING(alg->execute());
if (!alg->isExecuted()) {
......
......@@ -172,7 +172,7 @@ public:
"SaveReflThreeColumnAscii");
alg->setPropertyValue("InputWorkspace", m_name);
alg->setPropertyValue("Filename", m_filename);
alg->setPropertyValue("Separator", ",");
alg->setPropertyValue("Separator", "comma");
TS_ASSERT_THROWS_NOTHING(alg->execute());
if (!alg->isExecuted()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment