Skip to content

Commit

Permalink
Refs #8958 Initial Files Created
Browse files Browse the repository at this point in the history
Created the cpp, h and test.h for SaveANSTO and added them to the list.

The files contain a skeleton which allows the project to build but they'll not do anything
  • Loading branch information
keithnbrown committed Feb 11, 2014
1 parent 17d8683 commit b922bc4
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/DataHandling/CMakeLists.txt
Expand Up @@ -99,6 +99,7 @@ set ( SRC_FILES
src/SNSDataArchive.cpp
src/SNSDataArchiveICAT2.cpp
src/SaveAscii.cpp
src/SaveANSTO.cpp
src/SaveAscii2.cpp
src/SaveCSV.cpp
src/SaveCalFile.cpp
Expand Down Expand Up @@ -223,6 +224,7 @@ set ( INC_FILES
inc/MantidDataHandling/RotateInstrumentComponent.h
inc/MantidDataHandling/SNSDataArchive.h
inc/MantidDataHandling/SNSDataArchiveICAT2.h
inc/MantidDataHandling/SaveANSTO.h
inc/MantidDataHandling/SaveAscii.h
inc/MantidDataHandling/SaveAscii2.h
inc/MantidDataHandling/SaveCSV.h
Expand Down Expand Up @@ -345,6 +347,7 @@ set ( TEST_FILES
RotateInstrumentComponentTest.h
SNSDataArchiveICAT2Test.h
SNSDataArchiveTest.h
SaveANSTOTest.h
SaveAscii2Test.h
SaveAsciiTest.h
SaveCSVTest.h
Expand Down
@@ -0,0 +1,44 @@
#ifndef MANTID_DATAHANDLING_SAVEANSTO_H_
#define MANTID_DATAHANDLING_SAVEANSTO_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"

namespace Mantid
{
namespace DataHandling
{
class DLLExport SaveANSTO : public API::Algorithm
{
public:
/// Default constructor
SaveANSTO();
/// Destructor
~SaveANSTO() {}
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "SaveANSTO"; }
/// Algorithm's version for identification overriding a virtual method
virtual int version() const { return 1; }
/// Algorithm's category for identification overriding a virtual method
virtual const std::string category() const { return "DataHandling\\Text"; }

private:
/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Overwrites Algorithm method.
void init();
/// Overwrites Algorithm method
void exec();
///static reference to the logger class
static Kernel::Logger& g_log;

/// Map the separator options to their string equivalents
std::map<std::string,std::string> m_separatorIndex;
};

} // namespace DataHandling
} // namespace Mantid

#endif /* MANTID_DATAHANDLING_SAVEANSTO_H_ */
58 changes: 58 additions & 0 deletions Code/Mantid/Framework/DataHandling/src/SaveANSTO.cpp
@@ -0,0 +1,58 @@
/*WIKI*
==== Limitations ====
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/SaveANSTO.h"
#include "MantidKernel/UnitFactory.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidAPI/FileProperty.h"
#include "MantidKernel/BoundedValidator.h"
#include "MantidKernel/VisibleWhenProperty.h"
#include "MantidKernel/ListValidator.h"
#include <set>
#include <fstream>
#include <boost/tokenizer.hpp>
#include <boost/regex.hpp>

namespace Mantid
{
namespace DataHandling
{
// Register the algorithm into the algorithm factory
DECLARE_ALGORITHM(SaveANSTO)

/// Sets documentation strings for this algorithm
void SaveANSTO::initDocs()
{
this->setWikiSummary("Saves a 2D [[workspace]] to a comma separated ascii file. ");
this->setOptionalMessage("Saves a 2D workspace to a ascii file.");
}

using namespace Kernel;
using namespace API;

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

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

/// Initialisation method.
void SaveANSTO::init()
{
}

/**
* Executes the algorithm.
*/
void SaveANSTO::exec()
{
}
} // namespace DataHandling
} // namespace Mantid
38 changes: 38 additions & 0 deletions Code/Mantid/Framework/DataHandling/test/SaveANSTOTest.h
@@ -0,0 +1,38 @@
#ifndef SAVEANSTOTEST_H_
#define SAVEANSTOTEST_H_

#include <cxxtest/TestSuite.h>
#include "MantidDataHandling/SaveANSTO.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidAPI/FrameworkManager.h"
#include <fstream>
#include <Poco/File.h>

using namespace Mantid::API;
using namespace Mantid::DataHandling;
using namespace Mantid::DataObjects;

class SaveANSTOTest : public CxxTest::TestSuite
{

public:

static SaveANSTOTest *createSuite() { return new SaveANSTOTest(); }
static void destroySuite(SaveANSTOTest *suite) { delete suite; }

SaveANSTOTest()
{

}
~SaveANSTOTest()
{
FrameworkManager::Instance().deleteWorkspace("SaveANSTOWS");
}

void testExec()
{
}
};


#endif /*SAVEANSTOTEST_H_*/

0 comments on commit b922bc4

Please sign in to comment.