-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LoadSassena class derived from IDataFileChecker
- Loading branch information
Showing
1 changed file
with
96 additions
and
0 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#ifndef MANTID_DATAHANDLING_LOADSASSENA_H_ | ||
#define MANTID_DATAHANDLING_LOADSASSENA_H_ | ||
|
||
//---------------------------------------------------------------------- | ||
// Includes | ||
//---------------------------------------------------------------------- | ||
#include "MantidAPI/IDataFileChecker.h" | ||
#include "MantidAPI/WorkspaceGroup.h" | ||
|
||
namespace Mantid | ||
{ | ||
|
||
namespace DataHandling | ||
{ | ||
|
||
/** Load Sassena Output files. | ||
Required Properties: | ||
<UL> | ||
<LI> Filename - The name of and path to the Sassena file </LI> | ||
<LI> Workspace - The name of the group workspace to output | ||
</UL> | ||
@author Jose Borreguero | ||
@date 2012-04-24 | ||
Copyright © 2010 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
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/>. | ||
*/ | ||
|
||
class DLLExport LoadSassena : public API::IDataFileChecker | ||
{ | ||
public: | ||
/// Constructor | ||
LoadSassena(); | ||
/// Virtual Destructor | ||
virtual ~LoadSassena(); | ||
/// Algorithm's name | ||
virtual const std::string name() const { return "LoadSassena"; } | ||
/// Algorithm's version | ||
virtual int version() const { return 1; } | ||
/// Algorithm's category for identification | ||
virtual const std::string category() const { return "DataHandling\\Sassena"; } | ||
/** | ||
* Do a quick check that this file can be loaded | ||
* | ||
* @param filePath the location of and the file to check | ||
* @param nread number of bytes to read | ||
* @param header the first 100 bytes of the file as a union | ||
* @return true if the file can be loaded, otherwise false | ||
*/ | ||
virtual bool quickFileCheck(const std::string& filePath,size_t nread,const file_header& header); | ||
/** | ||
* Check the structure of the file and return a value between 0 and 100 of | ||
* how much this file can be loaded | ||
* | ||
* @param filePath the location of and the file to check | ||
* @return a confidence level indicator between 0 and 100 | ||
*/ | ||
int fileCheck(const std::string& filePath); | ||
|
||
private: | ||
/// Sets documentation strings for this algorithm | ||
virtual void initDocs(); // Sets documentation strings for this algorithm | ||
/// Initialization code | ||
void init(); // Overwrites Algorithm method. | ||
/// Execution code | ||
void exec(); // Overwrites Algorithm method | ||
|
||
/// name and path of input file | ||
std::string m_filename; | ||
/// Group workspace being filled | ||
API::WorkspaceGroup_const_sptr GWS; | ||
/// Reference to the logger class | ||
static Kernel::Logger& g_log; | ||
|
||
}; // class LoadSassena | ||
|
||
} // namespace DataHandling | ||
} // namespace Mantid | ||
|
||
#endif /*MANTID_DATAHANDLING_LOADSASSENA_H_*/ |