Skip to content
Snippets Groups Projects
Commit c19060db authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Adding code generated by class_maker

parent 36f2a145
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ set ( SRC_FILES
src/ConjoinWorkspaces.cpp
src/ConvertAxesToRealSpace.cpp
src/ConvertAxisByFormula.cpp
src/ConvertDiffCal.cpp
src/ConvertEmptyToTof.cpp
src/ConvertFromDistribution.cpp
src/ConvertSpectrumAxis.cpp
......@@ -303,6 +304,7 @@ set ( INC_FILES
inc/MantidAlgorithms/ConjoinWorkspaces.h
inc/MantidAlgorithms/ConvertAxesToRealSpace.h
inc/MantidAlgorithms/ConvertAxisByFormula.h
inc/MantidAlgorithms/ConvertDiffCal.h
inc/MantidAlgorithms/ConvertEmptyToTof.h
inc/MantidAlgorithms/ConvertFromDistribution.h
inc/MantidAlgorithms/ConvertSpectrumAxis.h
......@@ -575,6 +577,7 @@ set ( TEST_FILES
ConjoinWorkspacesTest.h
ConvertAxesToRealSpaceTest.h
ConvertAxisByFormulaTest.h
ConvertDiffCalTest.h
ConvertEmptyToTofTest.h
ConvertFromDistributionTest.h
ConvertSpectrumAxis2Test.h
......
#ifndef MANTID_ALGORITHMS_CONVERTDIFFCAL_H_
#define MANTID_ALGORITHMS_CONVERTDIFFCAL_H_
#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
namespace Mantid {
namespace Algorithms {
/** ConvertDiffCal : TODO: DESCRIPTION
Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport ConvertDiffCal : public API::Algorithm {
public:
ConvertDiffCal();
virtual ~ConvertDiffCal();
virtual const std::string name() const;
virtual int version() const;
virtual const std::string category() const;
virtual const std::string summary() const;
private:
void init();
void exec();
};
} // namespace Algorithms
} // namespace Mantid
#endif /* MANTID_ALGORITHMS_CONVERTDIFFCAL_H_ */
\ No newline at end of file
#include "MantidAlgorithms/ConvertDiffCal.h"
namespace Mantid {
namespace Algorithms {
using Mantid::Kernel::Direction;
using Mantid::API::WorkspaceProperty;
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(ConvertDiffCal)
//----------------------------------------------------------------------------------------------
/** Constructor
*/
ConvertDiffCal::ConvertDiffCal() {}
//----------------------------------------------------------------------------------------------
/** Destructor
*/
ConvertDiffCal::~ConvertDiffCal() {}
//----------------------------------------------------------------------------------------------
/// Algorithms name for identification. @see Algorithm::name
const std::string ConvertDiffCal::name() const { return "ConvertDiffCal"; }
/// Algorithm's version for identification. @see Algorithm::version
int ConvertDiffCal::version() const { return 1; }
/// Algorithm's category for identification. @see Algorithm::category
const std::string ConvertDiffCal::category() const {
return "TODO: FILL IN A CATEGORY";
}
/// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
const std::string ConvertDiffCal::summary() const {
return "TODO: FILL IN A SUMMARY";
}
//----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties.
*/
void ConvertDiffCal::init() {
declareProperty(
new WorkspaceProperty<>("InputWorkspace", "", Direction::Input),
"An input workspace.");
declareProperty(
new WorkspaceProperty<>("OutputWorkspace", "", Direction::Output),
"An output workspace.");
}
//----------------------------------------------------------------------------------------------
/** Execute the algorithm.
*/
void ConvertDiffCal::exec() {
// TODO Auto-generated execute stub
}
} // namespace Algorithms
} // namespace Mantid
\ No newline at end of file
#ifndef MANTID_ALGORITHMS_CONVERTDIFFCALTEST_H_
#define MANTID_ALGORITHMS_CONVERTDIFFCALTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidAlgorithms/ConvertDiffCal.h"
using Mantid::Algorithms::ConvertDiffCal;
using namespace Mantid::API;
class ConvertDiffCalTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static ConvertDiffCalTest *createSuite() { return new ConvertDiffCalTest(); }
static void destroySuite( ConvertDiffCalTest *suite ) { delete suite; }
void test_Init()
{
ConvertDiffCal alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
}
void test_exec()
{
// Name of the output workspace.
std::string outWSName("ConvertDiffCalTest_OutputWS");
ConvertDiffCal 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 = AnalysisDataService::Instance().retrieveWS<Workspace>(outWSName) );
TS_ASSERT(ws);
if (!ws) return;
// TODO: Check the results
// Remove workspace from the data service.
AnalysisDataService::Instance().remove(outWSName);
}
void test_Something()
{
TSM_ASSERT( "You forgot to write a test!", 0);
}
};
#endif /* MANTID_ALGORITHMS_CONVERTDIFFCALTEST_H_ */
\ No newline at end of file
.. algorithm::
.. summary::
.. alias::
.. properties::
Description
-----------
TODO: Enter a full rst-markup description of your algorithm here.
Usage
-----
.. Try not to use files in your examples,
but if you cannot avoid it then the (small) files must be added to
autotestdata\UsageData and the following tag unindented
.. include:: ../usagedata-note.txt
**Example - ConvertDiffCal**
.. testcode:: ConvertDiffCalExample
# Create a host workspace
ws = CreateWorkspace(DataX=range(0,3), DataY=(0,2))
or
ws = CreateSampleWorkspace()
wsOut = ConvertDiffCal()
# Print the result
print "The output workspace has %i spectra" % wsOut.getNumberHistograms()
Output:
.. testoutput:: ConvertDiffCalExample
The output workspace has ?? spectra
.. categories::
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