Mantid
Loading...
Searching...
No Matches
Load.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
11#include "MantidDataHandling/DllConfig.h"
12#include <mutex>
13
14namespace Mantid {
15namespace DataHandling {
16
23class MANTID_DATAHANDLING_DLL Load final : public API::Algorithm {
24public:
26 const std::string name() const override { return "Load"; }
28 const std::string summary() const override {
29 return "Attempts to load a given file by finding an appropriate Load "
30 "algorithm.";
31 }
32
34 int version() const override { return 1; }
35 const std::vector<std::string> seeAlso() const override { return {"LoadNexus", "LoadRaw", "LoadBBY"}; }
36
38 const std::string category() const override { return "DataHandling"; }
40 const std::string alias() const override { return "load"; }
42 void setPropertyValue(const std::string &name, const std::string &value) override;
43
44protected:
45 Parallel::ExecutionMode
46 getParallelExecutionMode(const std::map<std::string, Parallel::StorageMode> &storageModes) const override;
47
48private:
51 API::IAlgorithm_sptr getFileLoader(const std::string &filePath);
52 void findFilenameProperty(const API::IAlgorithm_sptr &loader);
54 void declareLoaderProperties(const API::IAlgorithm_sptr &loader);
55
57 void init() override;
59 void exec() override;
60
62 void loadSingleFile();
64 void loadMultipleFiles();
65
67 void cancel() override;
69 API::IAlgorithm_sptr createLoader(const double startProgress = -1.0, const double endProgress = -1.0,
70 const bool logging = true) const;
72 void setUpLoader(const API::IAlgorithm_sptr &loader, const double startProgress = -1.0,
73 const double endProgress = -1.0, const bool logging = true) const;
75 void setOutputProperties(const API::IAlgorithm_sptr &loader);
77 API::Workspace_sptr getOutputWorkspace(const std::string &propName, const API::IAlgorithm_sptr &loader) const;
78
80 API::Workspace_sptr loadFileToWs(const std::string &fileName, const std::string &wsName);
84 API::WorkspaceGroup_sptr groupWsList(const std::vector<API::Workspace_sptr> &wsList);
85
87 std::unordered_set<std::string> m_baseProps;
92 std::string m_filenamePropName;
94 static std::recursive_mutex m_mutex;
95};
96
97} // namespace DataHandling
98} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Loads a workspace from a data file.
Definition: Load.h:23
const std::string summary() const override
Summary of algorithms purpose.
Definition: Load.h:28
API::IAlgorithm_sptr m_loader
The actual loader.
Definition: Load.h:89
static std::recursive_mutex m_mutex
Mutex for temporary fix for #5963.
Definition: Load.h:94
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Load.h:26
const std::string alias() const override
Aliases.
Definition: Load.h:40
std::string m_filenamePropName
The name of the property that will be passed the property from our Filename.
Definition: Load.h:92
const std::string category() const override
Category.
Definition: Load.h:38
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: Load.h:35
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Load.h:34
std::unordered_set< std::string > m_baseProps
The base properties.
Definition: Load.h:87
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Helper class which provides the Collimation Length for SANS instruments.