Skip to content

Commit

Permalink
Re #37 Created framework for LoadNexusGeometry algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljturner committed Aug 10, 2017
1 parent 165457d commit f2df524
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Framework/DataHandling/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set ( SRC_FILES
set ( SRC_FILES
src/AppendGeometryToSNSNexus.cpp
src/AsciiPointBase.cpp
src/BankPulseTimes.cpp
Expand Down Expand Up @@ -54,7 +54,7 @@ set ( SRC_FILES
src/LoadILLIndirect.cpp
src/LoadILLIndirect2.cpp
src/LoadILLReflectometry.cpp
src/LoadILLSANS.cpp
src/LoadILLSANS.cpp
src/LoadILLTOF2.cpp
src/LoadISISNexus2.cpp
src/LoadInstrument.cpp
Expand All @@ -75,7 +75,8 @@ set ( SRC_FILES
src/LoadNXSPE.cpp
src/LoadNXcanSAS.cpp
src/LoadNexus.cpp
src/LoadNexusLogs.cpp
src/LoadNexusGeometry.cpp
src/LoadNexusLogs.cpp
src/LoadNexusMonitors.cpp
src/LoadNexusMonitors2.cpp
src/LoadNexusProcessed.cpp
Expand Down Expand Up @@ -227,7 +228,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadILLIndirect.h
inc/MantidDataHandling/LoadILLIndirect2.h
inc/MantidDataHandling/LoadILLReflectometry.h
inc/MantidDataHandling/LoadILLSANS.h
inc/MantidDataHandling/LoadILLSANS.h
inc/MantidDataHandling/LoadILLTOF2.h
inc/MantidDataHandling/LoadISISNexus2.h
inc/MantidDataHandling/LoadInstrument.h
Expand All @@ -248,6 +249,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadNXSPE.h
inc/MantidDataHandling/LoadNXcanSAS.h
inc/MantidDataHandling/LoadNexus.h
inc/MantidDataHandling/LoadNexusGeometry.h
inc/MantidDataHandling/LoadNexusLogs.h
inc/MantidDataHandling/LoadNexusMonitors.h
inc/MantidDataHandling/LoadNexusMonitors2.h
Expand Down Expand Up @@ -414,6 +416,7 @@ set ( TEST_FILES
LoadMuonNexus2Test.h
LoadNXSPETest.h
LoadNXcanSASTest.h
LoadNexusGeometryTest.h
LoadNexusLogsTest.h
LoadNexusMonitorsTest.h
LoadNexusProcessedTest.h
Expand Down
44 changes: 44 additions & 0 deletions Framework/DataHandling/inc/MantidDataHandling/LoadNexusGeometry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef LOAD_NEXUS_GEOMETRY_H_
#define LOAD_NEXUS_GEOMETRY_H_

#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IFileLoader.h"

namespace Mantid{
namespace DataHandling{

class DLLExport LoadNexusGeometry
: public API::IFileLoader<Kernel::NexusDescriptor> {
public:
/// Default constructor
LoadNexusGeometry();
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadNexusGeometry"; }
/// Algorithm's version for identification overriding a virtual method
int version() const override { return 1; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "DataHandling\\Nexus"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Loads Instrument Geometry from a NeXus file.";

}

/// Returns a confidence value that this algorithm can load a file
int confidence(Kernel::NexusDescriptor &descriptor) const override;

private:
/// Overwrites Algorithm method.
void init() override;
/// Overwrites Algorithm method
void exec() override;

};


}
}


#endif // LOAD_NEXUS_GEOMETRY_H_

23 changes: 23 additions & 0 deletions Framework/DataHandling/src/LoadNexusGeometry.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//-----------------------------------------
// Includes
//-----------------------------------------
#include "MantidDataHandling/LoadNexusGeometry.h"

#include "MantidAPI/RegisterFileLoader.h"

namespace Mantid {
namespace DataHandling{

//Register the algorithm into the algorithm factory
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusGeometry)

//Empty Default Constructor
LoadNexusGeometry::LoadNexusGeometry(){}

void LoadNexusGeometry::init(){}
void LoadNexusGeometry::exec(){}

int LoadNexusGeometry::confidence (Kernel::NexusDescriptor &descriptor) const{return 0;}

}
}
22 changes: 22 additions & 0 deletions Framework/DataHandling/test/LoadNexusGeometryTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef LOAD_NEXUS_GEOMETRY_TEST_H_
#define LOAD_NEXUS_GEOMETRY_TEST_H_

#include "MantidDataHandling/LoadNexusGeometry.h"

#include <cxxtest/TestSuite.h>

using namespace Mantid::DataHandling;

class LoadNexusGeometryTest : public CxxTest::TestSuite
{
public:
void testExecLoadNexusGeometry()
{
LoadNexusGeometry ld;
TS_ASSERT_THROWS_NOTHING(ld.initialize ());
TS_ASSERT_THROWS_NOTHING(ld.execute ())
TS_ASSERT(ld.isExecuted ())
}
};

#endif // LOAD_NEXUS_GEOMETRY_TEST_H_

0 comments on commit f2df524

Please sign in to comment.