44#include <QSignalMapper>
58std::string expandEnvironmentVariables(
const std::string &target) {
59 std::string result = target;
64 while ((pos = result.find(
'%', pos)) != std::string::npos) {
65 size_t end = result.find(
'%', pos + 1);
66 if (end == std::string::npos)
69 std::string varName = result.substr(pos + 1, end - pos - 1);
70 const char *envValue = std::getenv(varName.c_str());
73 result.replace(pos, end - pos + 1, envValue);
74 pos += std::strlen(envValue);
82 while ((pos = result.find(
'$', pos)) != std::string::npos) {
87 if (pos + 1 < result.length() && result[pos + 1] ==
'{') {
89 end = result.find(
'}', pos + 2);
90 if (end == std::string::npos) {
94 varName = result.substr(pos + 2, end - pos - 2);
99 while (end < result.length() && (std::isalnum(result[end]) || result[end] ==
'_')) {
102 varName = result.substr(pos + 1, end - pos - 1);
105 if (!varName.empty()) {
106 const char *envValue = std::getenv(varName.c_str());
108 result.replace(start, end - start, envValue);
109 pos = start + std::strlen(envValue);
126 : QWidget(parent), m_mantidDisplayModel(mdb), m_viewOnly(viewOnly), m_updateCount(0), m_treeUpdating(false),
128 m_sortDirection(
SortDirection::Ascending), m_mutex(QMutex::Recursive) {
129 setObjectName(
"exploreMantid");
142 static bool registered_addtional_types =
false;
143 if (!registered_addtional_types) {
144 registered_addtional_types =
true;
145 qRegisterMetaType<TopLevelItems>();
154 m_tree->setDragEnabled(
true);
156 auto presenter = std::make_shared<WorkspacePresenter>(
this);
157 m_presenter = std::dynamic_pointer_cast<ViewNotifiable>(presenter);
174 m_tree->setHeaderLabel(
"Workspaces");
180 m_saveButton->setToolTip(
"Save the selected workspaces");
186 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
188 m_sortButton->setToolTip(
"Sort all workspaces by name, size, or the last time they were modified");
206 auto *layout =
new QVBoxLayout();
207 layout->setMargin(0);
208 layout->addLayout(buttonLayout);
210 layout->addWidget(
m_tree);
211 this->setLayout(layout);
217 QAction *loadFileAction =
new QAction(
"File",
this);
218 QAction *liveDataAction =
new QAction(
"Live Data",
this);
219 connect(loadFileAction, SIGNAL(triggered()),
this, SLOT(
onClickLoad()));
220 connect(liveDataAction, SIGNAL(triggered()),
this, SLOT(
onClickLiveData()));
231 connect(
m_tree, SIGNAL(itemClicked(QTreeWidgetItem *,
int)),
this, SLOT(
clickedWorkspace(QTreeWidgetItem *,
int)));
235 m_tree->setContextMenuPolicy(Qt::CustomContextMenu);
236 connect(
m_tree, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
popupMenu(
const QPoint &)));
238 Qt::QueuedConnection);
256 return std::dynamic_pointer_cast<WorkspacePresenter>(
m_presenter);
263 auto items =
m_tree->selectedItems();
265 names.reserve(
static_cast<size_t>(items.size()));
266 std::transform(items.cbegin(), items.cend(), std::back_inserter(names),
267 [](
auto const &item) { return item->text(0).toStdString(); });
273 auto items =
m_tree->selectedItems();
276 for (
auto &item : items) {
277 names.append(item->text(0));
286 auto items =
m_tree->selectedItems();
287 auto data = items[0]->data(0, Qt::UserRole).value<
Workspace_sptr>();
293 return QMessageBox::question(parentWidget(), QString::fromStdString(caption), QString::fromStdString(message),
294 QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes;
298 QMessageBox::critical(parentWidget(), QString::fromStdString(caption), QString::fromStdString(message));
302 QObject *sender = QObject::sender();
307 QString fn = MantidQt::API::AlgorithmInputHistory::Instance().previousInput(
"Load",
"Filename");
313 QMetaObject::invokeMethod(
dynamic_cast<QObject *
>(
m_mantidDisplayModel),
"showAlgorithmDialog", Qt::QueuedConnection,
314 Q_ARG(QString,
"Load"));
318 QMetaObject::invokeMethod(
dynamic_cast<QObject *
>(
m_mantidDisplayModel),
"showAlgorithmDialog", Qt::QueuedConnection,
319 Q_ARG(QString,
"StartLiveData"));
327 for (
const auto &ws : wsNames)
328 names.append(QString::fromStdString(ws));
341 QString qs_oldName = QString::fromStdString(oldName);
342 QString qs_newName = QString::fromStdString(newName);
344 QMutexLocker renameMapLock(&
m_mutex);
348 if (!oldNames.isEmpty()) {
349 for (
const auto &
name : oldNames)
364 return askUserYesNo(
"Delete Workspaces",
"Are you sure you want to delete the selected Workspaces?\n\nThis prompt "
365 "can be disabled from:\nFile->Settings->General");
370 for (
const auto &ws : wsNames)
371 names.append(QString::fromStdString(ws));
403 static int counter = 1;
442 const QAction *sendingAction =
dynamic_cast<QAction *
>(sender());
446 QString actionName = sendingAction->text();
448 if (actionName.compare(
"Nexus") == 0)
450 else if (actionName.compare(
"ASCII") == 0)
455 if (selectedNames.size() > 1) {
458 }
else if (selectedNames.size() == 1) {
468 if (!wsName.empty()) {
469 presets[
"InputWorkspace"] = QString::fromStdString(wsName);
472 std::string algorithmName;
476 algorithmName =
"SaveNexus";
479 algorithmName =
"SaveAscii";
488 if (items.size() < 2)
495 if (res != QFileDialog::Accepted)
500 std::string algorithmName;
501 std::string fileExtension;
505 algorithmName =
"SaveAscii";
506 fileExtension =
".dat";
510 algorithmName =
"SaveNexus";
511 fileExtension =
".nxs";
515 IAlgorithm_sptr saveAlg = AlgorithmManager::Instance().create(algorithmName);
516 saveAlg->initialize();
518 for (
auto &wsName : wsNames) {
519 std::string filename = folder +
"/" + wsName + fileExtension;
521 saveAlg->setProperty(
"InputWorkspace", wsName);
522 saveAlg->setProperty(
"Filename", filename);
524 }
catch (std::exception &ex) {
525 docklog.error() <<
"Error saving workspace " << wsName <<
": " << ex.what() <<
'\n';
533 const QString text = QString::fromStdString(filterText).trimmed();
534 QRegExp filterRegEx(text, Qt::CaseInsensitive);
537 QTreeWidgetItemIterator unhideIter(
m_tree);
538 while (*unhideIter) {
539 (*unhideIter)->setHidden(
false);
544 if (!text.isEmpty()) {
548 QStringList expanded;
549 int n =
m_tree->topLevelItemCount();
550 for (
int i = 0; i <
n; ++i) {
551 auto item =
m_tree->topLevelItem(i);
552 if (item->isExpanded()) {
553 expanded << item->text(0);
557 item->setExpanded(
true);
562 QTreeWidgetItemIterator it(
m_tree, QTreeWidgetItemIterator::All);
564 QTreeWidgetItem *item = (*it);
565 QVariant userData = item->data(0, Qt::UserRole);
567 if (!userData.isNull()) {
571 if (item->text(0).contains(filterRegEx)) {
577 visibleGroups.append(item);
578 item->setHidden(
false);
581 if (item->parent() ==
nullptr) {
583 item->setHidden(
false);
587 item->setHidden(
false);
588 if (item->parent()->isHidden()) {
591 item->parent()->setHidden(
false);
592 expanded << item->parent()->text(0);
597 item->setHidden(
true);
606 for (
auto group : visibleGroups) {
607 for (
int i = 0; i <
group->childCount(); i++) {
608 QTreeWidgetItem *child =
group->child(i);
609 if (child->isHidden()) {
612 child->setHidden(
false);
618 for (
int i = 0; i <
n; ++i) {
619 auto item =
m_tree->topLevelItem(i);
620 item->setExpanded(expanded.contains(item->text(0)));
625 if (hiddenCount > 0) {
626 QString headerString = QString(
"Workspaces (%1 filtered)").arg(QString::number(hiddenCount));
627 m_tree->headerItem()->setText(0, headerString);
629 m_tree->headerItem()->setText(0,
"Workspaces");
640 item->setIcon(0, QIcon(WORKSPACE_ICONS.
getIcon(wsID)));
641 }
catch (std::runtime_error &) {
642 docklog.warning() <<
"Cannot find icon for workspace ID '" << wsID <<
"'\n";
650 m_showData =
new QAction(tr(
"Show Data"),
this);
653 m_showInst =
new QAction(tr(
"Show Instrument"),
this);
656 m_plotSpec =
new QAction(tr(
"Plot Spectrum..."),
this);
659 m_plotSpecErr =
new QAction(tr(
"Plot Spectrum with Errors..."),
this);
665 m_colorFill =
new QAction(tr(
"Color Fill Plot"),
this);
671 m_showBoxData =
new QAction(tr(
"Show Box Data Table"),
this);
686 icon.addFile(QString::fromUtf8(
":/SliceViewer/icons/SliceViewerWindow_icon.png"), QSize(), QIcon::Normal,
692 m_showLogs =
new QAction(tr(
"Sample Logs..."),
this);
698 m_showHist =
new QAction(tr(
"Show History"),
this);
704 m_rename =
new QAction(tr(
"Rename"),
this);
707 m_delete =
new QAction(tr(
"Delete"),
this);
721 m_clearUB =
new QAction(tr(
"Clear UB Matrix"),
this);
730 QMenu *sortMenu =
new QMenu(
this);
732 QAction *ascendingSortAction =
new QAction(
"Ascending",
this);
733 QAction *descendingSortAction =
new QAction(
"Descending",
this);
734 QAction *byNameChoice =
new QAction(
"Name",
this);
735 QAction *byLastModifiedChoice =
new QAction(
"Last Modified",
this);
736 QAction *byMemorySize =
new QAction(
"Size",
this);
738 ascendingSortAction->setCheckable(
true);
739 ascendingSortAction->setEnabled(
true);
741 descendingSortAction->setCheckable(
true);
742 descendingSortAction->setEnabled(
true);
744 QActionGroup *sortDirectionGroup =
new QActionGroup(sortMenu);
745 sortDirectionGroup->addAction(ascendingSortAction);
746 sortDirectionGroup->addAction(descendingSortAction);
747 sortDirectionGroup->setExclusive(
true);
748 ascendingSortAction->setChecked(
true);
750 byNameChoice->setCheckable(
true);
751 byNameChoice->setEnabled(
true);
753 byLastModifiedChoice->setCheckable(
true);
754 byLastModifiedChoice->setEnabled(
true);
756 byMemorySize->setCheckable(
true);
757 byMemorySize->setEnabled(
true);
759 QActionGroup *sortChoiceGroup =
new QActionGroup(sortMenu);
760 sortChoiceGroup->addAction(byNameChoice);
761 sortChoiceGroup->addAction(byLastModifiedChoice);
762 sortChoiceGroup->addAction(byMemorySize);
763 sortChoiceGroup->setExclusive(
true);
764 byNameChoice->setChecked(
true);
766 connect(ascendingSortAction, SIGNAL(triggered()),
this, SLOT(
sortAscending()));
767 connect(descendingSortAction, SIGNAL(triggered()),
this, SLOT(
sortDescending()));
768 connect(byNameChoice, SIGNAL(triggered()),
this, SLOT(
chooseByName()));
772 sortMenu->addActions(sortDirectionGroup->actions());
773 sortMenu->addSeparator();
774 sortMenu->addActions(sortChoiceGroup->actions());
783 QVariant userData = item->data(0, Qt::UserRole);
784 if (userData.isNull())
788 while (item->childCount() > 0) {
789 auto *widgetItem = item->takeChild(0);
795 if (
auto group = std::dynamic_pointer_cast<WorkspaceGroup>(
workspace)) {
796 auto members =
group->getAllItems();
797 auto visibleNames = AnalysisDataService::Instance().getObjectNames();
798 for (
const auto &ws : members) {
799 if (std::find(visibleNames.begin(), visibleNames.end(), ws->getName()) != visibleNames.end()) {
800 auto *node =
addTreeEntry(std::make_pair(ws->getName(), ws), item);
803 node->setSelected(
true);
810 }
catch (std::runtime_error &e) {
811 details = QString(
"Error: %1").arg(e.what());
813 QStringList rows = details.split(QLatin1Char(
'\n'), Qt::SkipEmptyParts);
814 rows.append(QString(
"Memory used: ") +
workspace->getMemorySizeAsStr().c_str());
816 auto iend = rows.constEnd();
817 for (
auto itr = rows.constBegin(); itr != iend; ++itr) {
819 data->setFlags(Qt::NoItemFlags);
821 item->addChild(data);
847 foreach (QTreeWidgetItem *item, selected) {
853 auto iend = topLevelItems.end();
854 for (
auto it = topLevelItems.begin(); it != iend; ++it) {
856 QString
name = node->text(0);
857 if (expanded.contains(
name))
858 node->setExpanded(
true);
861 node->setSelected(
true);
879 QTreeWidgetItem *parent) {
881 node->setData(0, Qt::UserRole, QVariant::fromValue(item.second));
885 const std::string wsID = item.second->id();
887 idNode->setFlags(Qt::NoItemFlags);
888 node->addChild(idNode);
892 parent->addChild(node);
894 m_tree->addTopLevelItem(node);
906 if (!renamed.isEmpty()) {
907 return std::any_of(renamed.cbegin(), renamed.cend(),
908 [&](
const auto &oldName) { return m_selectedNames.contains(oldName); });
917 auto items =
m_tree->selectedItems();
920 if (items.size() == 1) {
922 auto wsSptr = items.first()->data(0, Qt::UserRole).value<
Workspace_sptr>();
923 auto grpSptr = std::dynamic_pointer_cast<WorkspaceGroup>(wsSptr);
931 }
else if (items.size() >= 2) {
934 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
935 }
else if (items.size() == 0) {
938 m_groupButton->setToolTip(
"Group together two or more selected workspaces");
948 if (items.size() > 0) {
949 auto item = *(items.begin());
968 m_showInst->setEnabled(matrixWS->getInstrument() && !matrixWS->getInstrument()->getName().empty() &&
969 matrixWS->getAxis(1)->isSpectra());
970 menu->addSeparator();
976 bool multipleBins =
false;
978 multipleBins = (matrixWS->blocksize() > 1);
980 const size_t numHist = matrixWS->getNumberHistograms();
981 for (
size_t i = 0; i < numHist; ++i) {
982 if (matrixWS->y(i).size() > 1) {
996 m_colorFill->setEnabled((matrixWS->axes() > 1 && matrixWS->getNumberHistograms() > 1));
998 menu->addSeparator();
1041 menu->addSeparator();
1060 menu->addSeparator();
1082 QMenu *clearMenu =
new QMenu(tr(
"Clear Options"),
this);
1087 menu->addMenu(clearMenu);
1092 Workspace_sptr ws = AnalysisDataService::Instance().retrieve(wsName);
1095 hasUB = wsIMD->hasOrientedLattice();
1109 if (menuEntryName.isEmpty())
1110 menuEntryName = algorithmString;
1113 QAction *saveAction =
new QAction(menuEntryName,
this);
1114 saveAction->setData(QVariant(algorithmString));
1142 return askUserYesNo(
"Clear Workspaces",
"This will delete all the workspaces, are you sure?");
1160 if (selectedNames.empty())
1176 if (qButtonName ==
"Group") {
1178 }
else if (qButtonName ==
"Ungroup") {
1201 QStringList expanded;
1202 int n =
m_tree->topLevelItemCount();
1203 for (
int i = 0; i <
n; ++i) {
1204 auto item =
m_tree->topLevelItem(i);
1205 if (item->isExpanded()) {
1206 expanded << item->text(0);
1243 m_tree->selectionModel()->clear();
1245 QMenu *menu(
nullptr);
1252 menu =
new QMenu(
this);
1253 menu->setObjectName(
"WorkspaceContextMenu");
1258 if (
auto matrixWS = std::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(ws)) {
1260 }
else if (
auto mdeventWS = std::dynamic_pointer_cast<const IMDEventWorkspace>(ws)) {
1262 }
else if (
auto mdWS = std::dynamic_pointer_cast<const IMDWorkspace>(ws)) {
1264 }
else if (
auto peaksWS = std::dynamic_pointer_cast<const IPeaksWorkspace>(ws)) {
1266 }
else if (
auto groupWS = std::dynamic_pointer_cast<const WorkspaceGroup>(ws)) {
1268 }
else if (std::dynamic_pointer_cast<const Mantid::API::ITableWorkspace>(ws)) {
1277 std::vector<std::string> programNames =
1278 (Mantid::Kernel::ConfigService::Instance().getKeys(
"workspace.sendto.name"));
1279 bool firstPass(
true);
1281 for (
const auto &programName : programNames) {
1282 std::string visible =
1283 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".visible");
1284 std::string target =
1285 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".target");
1286 if (Mantid::Kernel::ConfigService::Instance().isExecutable(target) && visible ==
"Yes") {
1287 bool compatible(
true);
1288 std::string saveUsing(
1289 Mantid::Kernel::ConfigService::Instance().getString(
"workspace.sendto." + programName +
".saveusing"));
1292 alg->setPropertyValue(
"InputWorkspace",
selectedWsName.toStdString());
1293 }
catch (std::exception &) {
1304 QString
name = QString::fromStdString(programName);
1327 menu->addSeparator();
1332 menu->popup(QCursor::pos());
1355 std::map<std::string, std::string> programKeysAndDetails;
1356 programKeysAndDetails[
"name"] =
m_programName.toStdString();
1360 std::vector<std::string> programKeys = (Mantid::Kernel::ConfigService::Instance().getKeys(
1361 (
"workspace.sendto." + programKeysAndDetails.find(
"name")->second)));
1363 for (
const auto &programKey : programKeys) {
1365 programKeysAndDetails[programKey] = (Mantid::Kernel::ConfigService::Instance().getString(
1366 (
"workspace.sendto." + programKeysAndDetails.find(
"name")->second +
"." + programKey)));
1370 if ((programKeysAndDetails.count(
"name") != 0) && (programKeysAndDetails.count(
"target") != 0) &&
1371 (programKeysAndDetails.count(
"saveusing") != 0)) {
1372 std::string expTarget = expandEnvironmentVariables(programKeysAndDetails.find(
"target")->second);
1374 QFileInfo target = QString::fromStdString(expTarget);
1375 if (target.exists()) {
1378 QString saveUsing = QString::fromStdString(programKeysAndDetails.find(
"saveusing")->second);
1384 Property *prop = alg->getProperty(
"Filename");
1392 alg->setPropertyValue(
"fileName",
"auto_save_" +
selectedWsName.toStdString() + ext);
1395 alg->setPropertyValue(
"InputWorkspace",
selectedWsName.toStdString());
1398 if (programKeysAndDetails.count(
"saveparameters") != 0) {
1399 QString saveParametersGrouped = QString::fromStdString(programKeysAndDetails.find(
"saveparameters")->second);
1400 QStringList saveParameters = saveParametersGrouped.split(
',');
1403 for (
int i = 0; i < saveParameters.size(); i++) {
1404 QStringList sPNameAndDetail = saveParameters[i].split(
'=');
1405 std::string saveParameterName = sPNameAndDetail[0].trimmed().toStdString();
1406 std::string saveParameterDetail = sPNameAndDetail[1].trimmed().toStdString();
1407 if (saveParameterDetail ==
"True")
1408 alg->setProperty(saveParameterName,
true);
1409 else if (saveParameterDetail ==
"False")
1410 alg->setProperty(saveParameterName,
false);
1413 alg->setPropertyValue(saveParameterName, saveParameterDetail);
1422 QString savedFile = QString::fromStdString(alg->getProperty(
"Filename"));
1423 QStringList arguments;
1426 if (programKeysAndDetails.count(
"arguments") != 0) {
1427 QString temp = QString::fromStdString(programKeysAndDetails.find(
"arguments")->second);
1428 temp.replace(QString(
"[file]"), savedFile);
1430 arguments = temp.split(
",");
1432 arguments.insert(0, savedFile);
1435 std::vector<std::string> argumentsV;
1437 for (
int i = 0; i < arguments.size(); i++) {
1438 argumentsV.assign(1, (arguments[i].toStdString()));
1443 Mantid::Kernel::ConfigService::Instance().launchProcess(expTarget, argumentsV);
1444 }
catch (std::runtime_error &) {
1445 QMessageBox::information(
this,
"Error",
1446 "User tried to open program from: " + QString::fromStdString(expTarget) +
1447 " There was an error opening the program. "
1448 "Please check the target and arguments list "
1449 "to ensure that these are correct");
1451 }
catch (std::exception &) {
1452 QMessageBox::information(
this,
"Mantid - Send to Program",
1453 "A file property wasn't found. Please check that the correct" +
1454 QString(
"save algorithm was used.\n(View -> Preferences -> "
1455 "Mantid -> SendTo -> Edit -> SaveUsing)"));
1458 QMessageBox::information(
this,
"Target Path Error",
1459 "User tried to open program from: " + QString::fromStdString(expTarget) +
1460 " The target file path for the program "
1461 "can't be found. Please check that the full "
1480 const bool isAdvanced = type ==
"Advanced";
1484 if (userInput.plots.empty()) {
1487 bool showErrorBars = ((type ==
"Errors") || (type ==
"Advanced" && userInput.errors));
1490 if (userInput.tiled) {
1492 }
else if (userInput.simple || userInput.waterfall) {
1493 if (userInput.isAdvanced) {
1494 const auto advancedUserInput = userInput.advanced.value();
1496 userInput.waterfall, advancedUserInput.logName, advancedUserInput.customLogValues);
1499 userInput.waterfall);
1502 }
else if (userInput.surface) {
1503 const auto advancedUserInput = userInput.advanced.value();
1505 advancedUserInput.axisName, advancedUserInput.logName,
1506 advancedUserInput.customLogValues, advancedUserInput.workspaceNames);
1507 }
else if (userInput.contour) {
1508 const auto advancedUserInput = userInput.advanced.value();
1510 advancedUserInput.axisName, advancedUserInput.logName,
1511 advancedUserInput.customLogValues, advancedUserInput.workspaceNames);
1526 auto items =
m_tree->selectedItems();
1532 QStringList allWsNames;
1534 for (
auto &item : items) {
1537 if (
auto wsGroup = std::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
1538 for (
const auto &
name : wsGroup->getNames())
1539 allWsNames.append(QString::fromStdString(
name));
1541 allWsNames.append(item->text(0));
1545 allWsNames.removeDuplicates();
1552 case Qt::Key_Delete:
1553 case Qt::Key_Backspace:
1568 QMessageBox::information(
this,
"Error", QString(
"Cannot create detectors tables for workspace ") + ws);
IPeaksWorkspace_sptr workspace
This class should be the basis for all customised algorithm dialogs.
Defines a mapping between a workspace ID and a pixmap to use for an icon.
QPixmap getIcon(const std::string &workspaceID) const
Returns an icon for the given ID.
A specialized class for dealing with file properties.
const std::string & getDefaultExt() const
Returns the main file extension that's used.
The Logger class is in charge of the publishing messages from the framework through various channels.
Base class for properties.
EXPORT_OPT_MANTIDQT_COMMON QPixmap getQPixmap(const std::string &name)
Function that returns a QPixmap given a string name.
std::shared_ptr< const IMDEventWorkspace > IMDEventWorkspace_const_sptr
Shared pointer to Mantid::API::IMDEventWorkspace (const version)
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< const IMDWorkspace > IMDWorkspace_const_sptr
Shared pointer to the IMDWorkspace base class (const version)
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
std::shared_ptr< const IPeaksWorkspace > IPeaksWorkspace_const_sptr
shared pointer to Mantid::API::IPeaksWorkspace (const version)