Skip to content

Commit

Permalink
Refs #8958 Renamed and refactored
Browse files Browse the repository at this point in the history
The aglorithm has no been fully renamed from SaveANSTO to SaveANSTOAscii.

The test has also been heavily refactored to strip out some duplication, re-implement some parts in a way i've been advised to do and changed the testing to a better more strict way.

Windows now catches that nan that linux caught, as it was the way the stream opperator worked.
  • Loading branch information
keithnbrown committed Feb 13, 2014
1 parent 7eb694f commit 941feb5
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 144 deletions.
@@ -1,5 +1,5 @@
#ifndef MANTID_DATAHANDLING_SAVEANSTO_H_
#define MANTID_DATAHANDLING_SAVEANSTO_H_
#ifndef MANTID_DATAHANDLING_SAVEANSTOASCII_H_
#define MANTID_DATAHANDLING_SAVEANSTOASCII_H_

//----------------------------------------------------------------------
// Includes
Expand All @@ -10,15 +10,15 @@ namespace Mantid
{
namespace DataHandling
{
class DLLExport SaveANSTO : public API::Algorithm
class DLLExport SaveANSTOAscii : public API::Algorithm
{
public:
/// Default constructor
SaveANSTO();
SaveANSTOAscii();
/// Destructor
~SaveANSTO() {}
~SaveANSTOAscii() {}
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "SaveANSTO"; }
virtual const std::string name() const { return "SaveANSTOAscii"; }
/// Algorithm's version for identification overriding a virtual method
virtual int version() const { return 1; }
/// Algorithm's category for identification overriding a virtual method
Expand Down
14 changes: 7 additions & 7 deletions Code/Mantid/Framework/DataHandling/src/SaveANSTOAscii.cpp
Expand Up @@ -6,7 +6,7 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/SaveANSTO.h"
#include "MantidDataHandling/SaveANSTOAscii.h"
#include "MantidKernel/UnitFactory.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidAPI/FileProperty.h"
Expand All @@ -23,10 +23,10 @@ namespace Mantid
namespace DataHandling
{
// Register the algorithm into the algorithm factory
DECLARE_ALGORITHM(SaveANSTO)
DECLARE_ALGORITHM(SaveANSTOAscii)

/// Sets documentation strings for this algorithm
void SaveANSTO::initDocs()
void SaveANSTOAscii::initDocs()
{
this->setWikiSummary("Saves a 2D [[workspace]] to a comma separated ascii file. ");
this->setOptionalMessage("Saves a 2D workspace to a ascii file.");
Expand All @@ -36,15 +36,15 @@ namespace Mantid
using namespace API;

// Initialise the logger
Logger& SaveANSTO::g_log = Logger::get("SaveANSTO");
Logger& SaveANSTOAscii::g_log = Logger::get("SaveANSTOAscii");

/// Empty constructor
SaveANSTO::SaveANSTO()
SaveANSTOAscii::SaveANSTOAscii()
{
}

/// Initialisation method.
void SaveANSTO::init()
void SaveANSTOAscii::init()
{
declareProperty(new WorkspaceProperty<>("InputWorkspace",
"",Direction::Input), "The name of the workspace containing the data you want to save to a ANSTO file.");
Expand All @@ -58,7 +58,7 @@ namespace Mantid
/**
* Executes the algorithm.
*/
void SaveANSTO::exec()
void SaveANSTOAscii::exec()
{
std::string filename = getProperty("Filename");
std::ofstream file(filename.c_str());
Expand Down

0 comments on commit 941feb5

Please sign in to comment.