-
Notifications
You must be signed in to change notification settings - Fork 122
/
CatalogGetDataSets.cpp
35 lines (32 loc) · 1.18 KB
/
CatalogGetDataSets.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
30
31
32
33
34
35
#include "MantidICat/CatalogGetDataSets.h"
#include "MantidKernel/MandatoryValidator.h"
#include "MantidAPI/CatalogManager.h"
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidAPI/WorkspaceProperty.h"
namespace Mantid {
namespace ICat {
DECLARE_ALGORITHM(CatalogGetDataSets)
/// Initialisation methods
void CatalogGetDataSets::init() {
declareProperty("InvestigationId", "",
boost::make_shared<Kernel::MandatoryValidator<std::string>>(),
"ID of the selected investigation");
declareProperty("Session", "",
"The session information of the catalog to use.");
declareProperty(
Kernel::make_unique<API::WorkspaceProperty<API::ITableWorkspace>>(
"OutputWorkspace", "", Kernel::Direction::Output),
"The name of the workspace to store the results.");
}
/// exec methods
void CatalogGetDataSets::exec() {
auto workspace =
API::WorkspaceFactory::Instance().createTable("TableWorkspace");
API::CatalogManager::Instance()
.getCatalog(getPropertyValue("Session"))
->getDataSets(getProperty("InvestigationId"), workspace);
setProperty("OutputWorkspace", workspace);
}
}
}