37 connect(
m_uiForm.cbWorkspaceName, SIGNAL(currentIndexChanged(
const QString &)),
this,
39 m_uiForm.cbWorkspaceName->addItems(workspaceNames);
48 std::vector<MatrixWorkspace_const_sptr> workspaces;
62 auto const groupSize =
static_cast<std::size_t
>(group->getNumberOfEntries());
63 for (
auto i = 0u; i < groupSize; ++i) {
64 if (
auto const workspace = std::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(i))) {
79 m_uiForm.leWSIndices->setPlaceholderText(text);
86 if (state == Qt::Checked) {
88 m_uiForm.leWSIndices->setEnabled(
false);
90 m_uiForm.leWSIndices->setEnabled(
true);
96 QStringList workspaceNames;
98 for (
auto &wsName : wsNames) {
100 workspaceNames << QString::fromStdString(wsName);
105 bool hasMatrixWorkspace =
false;
106 for (
auto ws : grp->getAllItems()) {
108 hasMatrixWorkspace =
true;
112 if (hasMatrixWorkspace) {
113 workspaceNames << QString::fromStdString(wsName);
117 return workspaceNames;
122 auto mws = getMatrixWorkspace(wsName);
124 m_maxIndex =
static_cast<int>(mws->getNumberHistograms()) - 1;
126 auto grp = getWorkspaceGroup(wsName);
128 int maxIndex = std::numeric_limits<int>::max();
129 for (
auto ws : grp->getAllItems()) {
130 mws = std::dynamic_pointer_cast<MatrixWorkspace>(ws);
132 maxIndex = std::min(maxIndex,
static_cast<int>(mws->getNumberHistograms()) - 1);
135 m_maxIndex = maxIndex < std::numeric_limits<int>::max() ? maxIndex : 0;
152 QString indexInput =
m_uiForm.leWSIndices->text();
154 auto validator = std::make_shared<Mantid::Kernel::ArrayBoundedValidator<int>>(0,
m_maxIndex);
156 std::string err = prop.setValue(indexInput.toStdString());
160 QMessageBox::warning(
this,
"Mantid - Error",
161 QString(
"Some of the indices are outside the allowed range [0,%1]").arg(
m_maxIndex));
165 QMessageBox::warning(
this,
"Mantid - Warning", QString(
"No indices have been selected."));
IPeaksWorkspace_sptr workspace
Base MatrixWorkspace Abstract Class.
Class to hold a set of workspaces.
Support for a property that holds an array of values.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< const WorkspaceGroup > WorkspaceGroup_const_sptr
shared pointer to Mantid::API::WorkspaceGroup, pointer to const version
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class