-
Notifications
You must be signed in to change notification settings - Fork 122
/
CatalogMyDataSearch.cpp
29 lines (26 loc) · 1.18 KB
/
CatalogMyDataSearch.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidICat/CatalogMyDataSearch.h"
#include "MantidAPI/CatalogManager.h"
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/WorkspaceFactory.h"
namespace Mantid::ICat {
DECLARE_ALGORITHM(CatalogMyDataSearch)
/// Initialisation method.
void CatalogMyDataSearch::init() {
declareProperty("Session", "", "The session information of the catalog to use.");
declareProperty(
std::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>("OutputWorkspace", "", Kernel::Direction::Output),
"The name of the workspace to store the search results.");
}
/// Execution method.
void CatalogMyDataSearch::exec() {
auto outputws = API::WorkspaceFactory::Instance().createTable("TableWorkspace");
API::CatalogManager::Instance().getCatalog(getPropertyValue("Session"))->myData(outputws);
setProperty("OutputWorkspace", outputws);
}
} // namespace Mantid::ICat