Commit f093f68a authored by Janik Zikovsky's avatar Janik Zikovsky
Browse files

Refs #3130: Stub for MDEWFindPeaks.

parent 9b493893
......@@ -9,6 +9,7 @@ set ( SRC_FILES
src/MDBin.cpp
src/MDBox.cpp
src/MDCentroidPeaks.cpp
src/MDEWFindPeaks.cpp
src/MDEWPeakIntegration.cpp
src/MDEventFactory.cpp
src/MDEventWorkspace.cpp
......@@ -42,6 +43,7 @@ set ( INC_FILES
inc/MantidMDEvents/MDCentroidPeaks.h
inc/MantidMDEvents/MDDimensionExtents.h
inc/MantidMDEvents/MDDimensionStats.h
inc/MantidMDEvents/MDEWFindPeaks.h
inc/MantidMDEvents/MDEWPeakIntegration.h
inc/MantidMDEvents/MDEvent.h
inc/MantidMDEvents/MDEventFactory.h
......@@ -65,6 +67,7 @@ set ( TEST_FILES
test/MDBoxTest.h
test/MDCentroidPeaksTest.h
test/MDDimensionStatsTest.h
test/MDEWFindPeaksTest.h
test/MDEWPeakIntegrationTest.h
test/MDEventFactoryTest.h
test/MDEventTest.h
......
#ifndef MANTID_MDEVENTS_MDEWFINDPEAKS_H_
#define MANTID_MDEVENTS_MDEWFINDPEAKS_H_
#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
namespace Mantid
{
namespace MDEvents
{
/** MDEWFindPeaks : TODO: DESCRIPTION
*
* @author
* @date 2011-06-02
*/
class DLLExport MDEWFindPeaks : public API::Algorithm
{
public:
MDEWFindPeaks();
~MDEWFindPeaks();
/// Algorithm's name for identification
virtual const std::string name() const { return "MDEWFindPeaks";};
/// Algorithm's version for identification
virtual int version() const { return 1;};
/// Algorithm's category for identification
virtual const std::string category() const { return "General";}
private:
/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Initialise the properties
void init();
/// Run the algorithm
void exec();
};
} // namespace Mantid
} // namespace MDEvents
#endif /* MANTID_MDEVENTS_MDEWFINDPEAKS_H_ */
#include "MantidMDEvents/MDEWFindPeaks.h"
#include "MantidKernel/System.h"
namespace Mantid
{
namespace MDEvents
{
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(MDEWFindPeaks)
using namespace Mantid::Kernel;
using namespace Mantid::API;
//----------------------------------------------------------------------------------------------
/** Constructor
*/
MDEWFindPeaks::MDEWFindPeaks()
{
}
//----------------------------------------------------------------------------------------------
/** Destructor
*/
MDEWFindPeaks::~MDEWFindPeaks()
{
}
//----------------------------------------------------------------------------------------------
/// Sets documentation strings for this algorithm
void MDEWFindPeaks::initDocs()
{
this->setWikiSummary("Find peaks in reciprocal space in a MDEventWorkspace.");
this->setOptionalMessage("Find peaks in reciprocal space in a MDEventWorkspace.");
this->setWikiDescription(""
""
);
}
//----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties.
*/
void MDEWFindPeaks::init()
{
declareProperty(new WorkspaceProperty<>("InputWorkspace","",Direction::Input), "An input workspace.");
declareProperty(new WorkspaceProperty<>("OutputWorkspace","",Direction::Output), "An output workspace.");
}
//----------------------------------------------------------------------------------------------
/** Execute the algorithm.
*/
void MDEWFindPeaks::exec()
{
}
} // namespace Mantid
} // namespace MDEvents
#ifndef MANTID_MDEVENTS_MDEWFINDPEAKSTEST_H_
#define MANTID_MDEVENTS_MDEWFINDPEAKSTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include <iostream>
#include <iomanip>
#include "MantidMDEvents/MDEWFindPeaks.h"
using namespace Mantid::MDEvents;
using namespace Mantid::API;
class MDEWFindPeaksTest : public CxxTest::TestSuite
{
public:
void test_Init()
{
MDEWFindPeaks alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
}
void xtest_exec()
{
// Name of the output workspace.
std::string outWSName("MDEWFindPeaksTest_OutputWS");
MDEWFindPeaks alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("REPLACE_PROPERTY_NAME_HERE!!!!", "value") );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
TS_ASSERT_THROWS_NOTHING( alg.execute(); );
TS_ASSERT( alg.isExecuted() );
// Retrieve the workspace from data service. TODO: Change to your desired type
Workspace_sptr ws;
TS_ASSERT_THROWS_NOTHING( ws = boost::dynamic_pointer_cast<Workspace>(AnalysisDataService::Instance().retrieve(outWSName)) );
TS_ASSERT(ws);
if (!ws) return;
// TODO: Check the results
// Remove workspace from the data service.
AnalysisDataService::Instance().remove(outWSName);
}
void test_Something()
{
}
};
#endif /* MANTID_MDEVENTS_MDEWFINDPEAKSTEST_H_ */
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