Skip to content
Snippets Groups Projects
Commit ed6fb3a5 authored by Edward Brown's avatar Edward Brown
Browse files

Re #21691: Completed refl gui + data processor plumbing required

parent 70ee8c30
No related merge requests found
Showing
with 55 additions and 4 deletions
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWPRESENTER_H #define MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWPRESENTER_H
#include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h" #include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h"
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
#include <string> #include <string>
...@@ -43,6 +44,9 @@ public: ...@@ -43,6 +44,9 @@ public:
enum class Flag { ConfirmReductionPausedFlag, ConfirmReductionResumedFlag }; enum class Flag { ConfirmReductionPausedFlag, ConfirmReductionResumedFlag };
virtual void notify(Flag flag) = 0; virtual void notify(Flag flag) = 0;
virtual void completedReductionSuccessfully(
MantidWidgets::DataProcessor::GroupData const &group) = 0;
/// Pre-processing /// Pre-processing
virtual std::string getTransmissionRuns(int group) const = 0; virtual std::string getTransmissionRuns(int group) const = 0;
virtual MantidWidgets::DataProcessor::OptionsQMap virtual MantidWidgets::DataProcessor::OptionsQMap
......
#ifndef MANTID_ISISREFLECTOMETRY_IREFLSAVETABPRESENTER_H #ifndef MANTID_ISISREFLECTOMETRY_IREFLSAVETABPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_IREFLSAVETABPRESENTER_H #define MANTID_ISISREFLECTOMETRY_IREFLSAVETABPRESENTER_H
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
...@@ -46,6 +47,9 @@ public: ...@@ -46,6 +47,9 @@ public:
suggestSaveDirFlag suggestSaveDirFlag
}; };
virtual void completedReductionSuccessfully(
MantidWidgets::DataProcessor::GroupData const &group) = 0;
/// Tell the presenter something happened /// Tell the presenter something happened
virtual void notify(IReflSaveTabPresenter::Flag flag) = 0; virtual void notify(IReflSaveTabPresenter::Flag flag) = 0;
}; };
......
...@@ -266,6 +266,11 @@ bool ReflDataProcessorPresenter::processGroupAsEventWS( ...@@ -266,6 +266,11 @@ bool ReflDataProcessorPresenter::processGroupAsEventWS(
return errors; return errors;
} }
void ReflDataProcessorPresenter::completedReductionSuccessfully(
MantidWidgets::DataProcessor::GroupData const &groupData) {
m_mainPresenter->completedReductionSuccessfully(groupData);
}
/** Processes a group of non-event workspaces /** Processes a group of non-event workspaces
* *
* @param groupID :: An integer number indicating the id of this group * @param groupID :: An integer number indicating the id of this group
......
...@@ -59,6 +59,7 @@ public: ...@@ -59,6 +59,7 @@ public:
// Add entry for the number of slices for all rows in a group // Add entry for the number of slices for all rows in a group
void addNumGroupSlicesEntry(int groupID, size_t numSlices); void addNumGroupSlicesEntry(int groupID, size_t numSlices);
void completedReductionSuccessfully(GroupData const& groupData) override;
private: private:
// Process selected rows // Process selected rows
void process() override; void process() override;
......
...@@ -41,6 +41,10 @@ ReflMainWindowPresenter::ReflMainWindowPresenter( ...@@ -41,6 +41,10 @@ ReflMainWindowPresenter::ReflMainWindowPresenter(
*/ */
ReflMainWindowPresenter::~ReflMainWindowPresenter() {} ReflMainWindowPresenter::~ReflMainWindowPresenter() {}
void ReflMainWindowPresenter::completedReductionSuccessfully(GroupData const &group) {
m_savePresenter->completedReductionSuccessfully(group);
}
/** /**
Used by the view to tell the presenter something has changed Used by the view to tell the presenter something has changed
*/ */
......
...@@ -85,6 +85,8 @@ public: ...@@ -85,6 +85,8 @@ public:
void settingsChanged(int group) override; void settingsChanged(int group) override;
void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const &group) override;
private: private:
/// Check for Settings Tab null pointer /// Check for Settings Tab null pointer
void checkSettingsPtrValid(IReflSettingsTabPresenter *pointer) const; void checkSettingsPtrValid(IReflSettingsTabPresenter *pointer) const;
......
...@@ -159,6 +159,11 @@ void ReflRunsTabPresenter::notify(IReflRunsTabPresenter::Flag flag) { ...@@ -159,6 +159,11 @@ void ReflRunsTabPresenter::notify(IReflRunsTabPresenter::Flag flag) {
// a flag we aren't handling. // a flag we aren't handling.
} }
void ReflRunsTabPresenter::completedReductionSuccessfully(
GroupData const &group) {
m_mainPresenter->completedReductionSuccessfully(group);
}
/** Pushes the list of commands (actions) */ /** Pushes the list of commands (actions) */
void ReflRunsTabPresenter::pushCommands() { void ReflRunsTabPresenter::pushCommands() {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "DllConfig.h" #include "DllConfig.h"
#include "IReflRunsTabPresenter.h" #include "IReflRunsTabPresenter.h"
#include "MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h" #include "MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h"
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
namespace MantidQt { namespace MantidQt {
...@@ -86,6 +87,7 @@ public: ...@@ -86,6 +87,7 @@ public:
void confirmReductionPaused() const override; void confirmReductionPaused() const override;
void confirmReductionResumed() const override; void confirmReductionResumed() const override;
void settingsChanged(int group) override; void settingsChanged(int group) override;
void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const& group) override;
private: private:
/// The search model /// The search model
......
...@@ -61,6 +61,11 @@ void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) { ...@@ -61,6 +61,11 @@ void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) {
} }
} }
void ReflSaveTabPresenter::completedReductionSuccessfully(
MantidWidgets::DataProcessor::GroupData const &group) {
std::cout << "Reduced group with size " << group.size() << std::endl;
}
/** Fills the 'List of Workspaces' widget with the names of all available /** Fills the 'List of Workspaces' widget with the names of all available
* workspaces * workspaces
*/ */
...@@ -212,4 +217,4 @@ std::vector<std::string> ReflSaveTabPresenter::getAvailableWorkspaceNames() { ...@@ -212,4 +217,4 @@ std::vector<std::string> ReflSaveTabPresenter::getAvailableWorkspaceNames() {
return validNames; return validNames;
} }
} }
} }
\ No newline at end of file
...@@ -49,6 +49,7 @@ public: ...@@ -49,6 +49,7 @@ public:
/// Accept a main presenter /// Accept a main presenter
void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override;
void notify(IReflSaveTabPresenter::Flag flag) override; void notify(IReflSaveTabPresenter::Flag flag) override;
void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const& group) override;
private: private:
/// Adds all workspace names to the list of workspaces /// Adds all workspace names to the list of workspaces
......
...@@ -54,6 +54,7 @@ set ( SRC_FILES ...@@ -54,6 +54,7 @@ set ( SRC_FILES
src/CatalogSelector.cpp src/CatalogSelector.cpp
src/CheckboxHeader.cpp src/CheckboxHeader.cpp
src/DataProcessorUI/AbstractTreeModel.cpp src/DataProcessorUI/AbstractTreeModel.cpp
src/DataProcessorUI/TreeData.cpp
src/DataProcessorUI/GenerateNotebook.cpp src/DataProcessorUI/GenerateNotebook.cpp
src/DataProcessorUI/OneLevelTreeManager.cpp src/DataProcessorUI/OneLevelTreeManager.cpp
src/DataProcessorUI/OptionsMap.cpp src/DataProcessorUI/OptionsMap.cpp
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "MantidKernel/System.h" #include "MantidKernel/System.h"
#include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h" #include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h"
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
#include <QSet> #include <QSet>
#include <QString> #include <QString>
...@@ -74,6 +75,7 @@ public: ...@@ -74,6 +75,7 @@ public:
/// Handle data reduction paused/resumed confirmation /// Handle data reduction paused/resumed confirmation
virtual void confirmReductionPaused() const {} virtual void confirmReductionPaused() const {}
virtual void confirmReductionResumed() const {} virtual void confirmReductionResumed() const {}
virtual void completedReductionSuccessfully(GroupData const&) {};
}; };
} }
} }
......
...@@ -213,6 +213,7 @@ protected: ...@@ -213,6 +213,7 @@ protected:
// Plotting // Plotting
virtual void plotRow(); virtual void plotRow();
virtual void plotGroup(); virtual void plotGroup();
virtual void completedReductionSuccessfully(GroupData const& groupData);
void plotWorkspaces(const QOrderedSet<QString> &workspaces); void plotWorkspaces(const QOrderedSet<QString> &workspaces);
// Get the name of a post-processed workspace // Get the name of a post-processed workspace
QString getPostprocessedWorkspaceName(const GroupData &groupData); QString getPostprocessedWorkspaceName(const GroupData &groupData);
...@@ -223,6 +224,7 @@ protected slots: ...@@ -223,6 +224,7 @@ protected slots:
void issueNotFoundWarning(QString const &granule, void issueNotFoundWarning(QString const &granule,
QSet<QString> const &missingWorkspaces); QSet<QString> const &missingWorkspaces);
private: private:
void applyDefaultOptions(std::map<QString, QVariant> &options); void applyDefaultOptions(std::map<QString, QVariant> &options);
void setPropertiesFromKeyValueString(Mantid::API::IAlgorithm_sptr alg, void setPropertiesFromKeyValueString(Mantid::API::IAlgorithm_sptr alg,
......
...@@ -38,6 +38,7 @@ namespace DataProcessor { ...@@ -38,6 +38,7 @@ namespace DataProcessor {
using RowData = QStringList; using RowData = QStringList;
using GroupData = std::map<int, RowData>; using GroupData = std::map<int, RowData>;
using TreeData = std::map<int, GroupData>; using TreeData = std::map<int, GroupData>;
bool canPostprocess(GroupData const& group);
} }
} }
} }
......
...@@ -417,6 +417,7 @@ void GenericDataProcessorPresenter::nextRow() { ...@@ -417,6 +417,7 @@ void GenericDataProcessorPresenter::nextRow() {
// single row // single row
if (!isProcessed(groupIndex) && m_groupData.size() > 1) { if (!isProcessed(groupIndex) && m_groupData.size() > 1) {
startAsyncGroupReduceThread(m_groupData, groupIndex); startAsyncGroupReduceThread(m_groupData, groupIndex);
completedReductionSuccessfully(m_groupData);
return; return;
} }
} }
...@@ -425,6 +426,9 @@ void GenericDataProcessorPresenter::nextRow() { ...@@ -425,6 +426,9 @@ void GenericDataProcessorPresenter::nextRow() {
doNextAction(); doNextAction();
} }
void GenericDataProcessorPresenter::completedReductionSuccessfully(
GroupData const &) {}
/** /**
Process a new group Process a new group
*/ */
...@@ -437,9 +441,6 @@ void GenericDataProcessorPresenter::nextGroup() { ...@@ -437,9 +441,6 @@ void GenericDataProcessorPresenter::nextGroup() {
return; return;
} }
// Clear group data from any previously processed groups
m_groupData.clear();
if (!m_group_queue.empty()) { if (!m_group_queue.empty()) {
// Set next action flag // Set next action flag
m_nextActionFlag = ReductionFlag::ReduceRowFlag; m_nextActionFlag = ReductionFlag::ReduceRowFlag;
...@@ -458,6 +459,8 @@ void GenericDataProcessorPresenter::nextGroup() { ...@@ -458,6 +459,8 @@ void GenericDataProcessorPresenter::nextGroup() {
saveNotebook(m_selectedData); saveNotebook(m_selectedData);
endReduction(); endReduction();
} }
// Clear group data from any previously processed groups
m_groupData.clear();
} }
/* /*
......
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
namespace MantidQt {
namespace MantidWidgets {
namespace DataProcessor {
bool canPostprocess(GroupData const &group) { return group.size() > 1; }
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment