diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflMainWindowPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflMainWindowPresenter.h index 8512a94fb5000450ca79d1eee61913babe556905..4227018f54371aebbcbc8d9181e7dde50644695e 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflMainWindowPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflMainWindowPresenter.h @@ -44,8 +44,13 @@ public: enum class Flag { ConfirmReductionPausedFlag, ConfirmReductionResumedFlag }; virtual void notify(Flag flag) = 0; - virtual void completedReductionSuccessfully( - MantidWidgets::DataProcessor::GroupData const &group) = 0; + virtual void completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const &workspaceName) = 0; + + virtual void completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &workspaceName) = 0; /// Pre-processing virtual std::string getTransmissionRuns(int group) const = 0; diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h index c382482eddf814b76396a43ba93ebc0c3e078a99..647530dda81a2250b999156813bdc9507b3ba5d5 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h @@ -47,8 +47,14 @@ public: suggestSaveDirFlag }; - virtual void completedReductionSuccessfully( - MantidWidgets::DataProcessor::GroupData const &group) = 0; + virtual void completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &workspaceName) = 0; + + + virtual void completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const &workspaceName) = 0; /// Tell the presenter something happened virtual void notify(IReflSaveTabPresenter::Flag flag) = 0; diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.cpp index e12efa68bfd49becb3a229bd6f1a78a7f2994b5e..a0225901281da21be6541f198051ce66f3ce2897 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.cpp @@ -266,9 +266,16 @@ bool ReflDataProcessorPresenter::processGroupAsEventWS( return errors; } -void ReflDataProcessorPresenter::completedReductionSuccessfully( - MantidWidgets::DataProcessor::GroupData const &groupData) { - m_mainPresenter->completedReductionSuccessfully(groupData); +void ReflDataProcessorPresenter::completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &groupData, + std::string const &workspaceName) { + m_mainPresenter->completedGroupReductionSuccessfully(groupData, workspaceName); +} + +void ReflDataProcessorPresenter::completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &groupData, + std::vector<std::string> const &workspaceNames) { + m_mainPresenter->completedRowReductionSuccessfully(groupData, workspaceNames); } /** Processes a group of non-event workspaces diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.h index 13e1fd0ec54c9e562889a43330a32df7439126c0..3a34bda31d5e8f947d68379327a6913a5a1e6396 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflDataProcessorPresenter.h @@ -59,7 +59,12 @@ public: // Add entry for the number of slices for all rows in a group void addNumGroupSlicesEntry(int groupID, size_t numSlices); - void completedReductionSuccessfully(GroupData const& groupData) override; + void completedRowReductionSuccessfully( + GroupData const &groupData, + std::vector<std::string> const &workspaceName) override; + void completedGroupReductionSuccessfully( + GroupData const &groupData, std::string const &workspaceName) override; + private: // Process selected rows void process() override; diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp index dbdeb975c52efbaa72372ce079d40d076f132eb2..dba17cfa1bb98df007eb697e19343394643ff356 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp @@ -41,8 +41,14 @@ ReflMainWindowPresenter::ReflMainWindowPresenter( */ ReflMainWindowPresenter::~ReflMainWindowPresenter() {} -void ReflMainWindowPresenter::completedReductionSuccessfully(GroupData const &group) { - m_savePresenter->completedReductionSuccessfully(group); +void ReflMainWindowPresenter::completedGroupReductionSuccessfully( + GroupData const &group, std::string const &workspaceName) { + m_savePresenter->completedGroupReductionSuccessfully(group, workspaceName); +} + +void ReflMainWindowPresenter::completedRowReductionSuccessfully( + GroupData const &group, std::vector<std::string> const &workspaceNames) { + m_savePresenter->completedRowReductionSuccessfully(group, workspaceNames); } /** diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h index 9026220f9725591d1beb68e0125a32a22e42818b..708443f1ad4d9e1da9efe7ef14034e15d6330d42 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h @@ -85,7 +85,12 @@ public: void settingsChanged(int group) override; - void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const &group) override; + void completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &workspaceName) override; + void completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const &workspaceNames) override; private: /// Check for Settings Tab null pointer diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.cpp index 20f9bd5ad4c391401553b4db103cc76857238280..a1ea5882faee6ddabb81a7ea0888823cef203719 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.cpp @@ -159,9 +159,14 @@ void ReflRunsTabPresenter::notify(IReflRunsTabPresenter::Flag flag) { // a flag we aren't handling. } -void ReflRunsTabPresenter::completedReductionSuccessfully( - GroupData const &group) { - m_mainPresenter->completedReductionSuccessfully(group); +void ReflRunsTabPresenter::completedGroupReductionSuccessfully( + GroupData const &group, std::string const &workspaceName) { + m_mainPresenter->completedGroupReductionSuccessfully(group, workspaceName); +} + +void ReflRunsTabPresenter::completedRowReductionSuccessfully( + GroupData const &group, std::vector<std::string> const &workspaceNames) { + m_mainPresenter->completedRowReductionSuccessfully(group, workspaceNames); } /** Pushes the list of commands (actions) */ diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.h index 30434cb8711ea5c4d5c51a48a9ff39ebe2cd9ed0..86cdf5b7859d5a47848f10ef2ee6a93430cd50e5 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflRunsTabPresenter.h @@ -87,7 +87,12 @@ public: void confirmReductionPaused() const override; void confirmReductionResumed() const override; void settingsChanged(int group) override; - void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const& group) override; + void completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &) override; + void completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const & workspaceNames) override; private: /// The search model diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp index 6a736b20fa6efe7c0c094af12677a2854dd8c25f..84309f758dc5371429184101ca1afd480f5fa7bd 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp @@ -61,10 +61,21 @@ void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) { } } -void ReflSaveTabPresenter::completedReductionSuccessfully( - MantidWidgets::DataProcessor::GroupData const &group) { - std::cout << "Reduced group with size " << group.size() << std::endl; +void ReflSaveTabPresenter::completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &workspaceName) { + std::cout << "** Reduced group with size " << group.size() << std::endl; + std::cout << " Saving workspace " << workspaceName << std::endl; +} + +void ReflSaveTabPresenter::completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const &workspaceNames) { + + std::cout << "** Reduced row in group with size " << group.size() << std::endl; + for (auto &&workspaceName : workspaceNames) + std::cout << " Saving workspace " << workspaceName << std::endl; } /** Fills the 'List of Workspaces' widget with the names of all available diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h index c46c9e0df97905873e9ea75057b1f84e05a45837..26cfbd42e444bb101db590396eead290f59699a4 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h @@ -49,7 +49,12 @@ public: /// Accept a main presenter void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void notify(IReflSaveTabPresenter::Flag flag) override; - void completedReductionSuccessfully(MantidWidgets::DataProcessor::GroupData const& group) override; + void completedGroupReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::string const &workspaceName) override; + void completedRowReductionSuccessfully( + MantidWidgets::DataProcessor::GroupData const &group, + std::vector<std::string> const &workspaceNames) override; private: /// Adds all workspace names to the list of workspaces diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui index 682e164994229219e68b5d9ad16d79c631e5d099..d56bd588bfc5386a19eef247d35b69dfa9e4b68e 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui @@ -1,351 +1,395 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>ReflSaveTabWidget</class> - <widget class="QWidget" name="ReflSaveTabWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>959</width> - <height>346</height> - </rect> - </property> - <property name="windowTitle"> - <string>Save ASCII</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="margin"> - <number>20</number> + <widget class="QWidget" name="ReflSaveTabWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>943</width> + <height>632</height> + </rect> + </property> + <property name="windowTitle"> + <string>Save ASCII</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>10</number> + </property> + <property name="topMargin"> + <number>10</number> + </property> + <property name="rightMargin"> + <number>10</number> + </property> + <property name="bottomMargin"> + <number>10</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>File Names and Location</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Save Path:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="savePathEdit"/> + </item> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>File Name Prefix:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="prefixEdit"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="customSaveGroup"> + <property name="title"> + <string>Custom Save</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>10</number> + </property> + <property name="topMargin"> + <number>20</number> + </property> + <property name="rightMargin"> + <number>10</number> + </property> + <property name="bottomMargin"> + <number>10</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="savePathLabel"> - <property name="text"> - <string>Save path:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="savePathEdit"/> - </item> - <item> - <widget class="QLabel" name="prefixLabel"> - <property name="text"> - <string>Prefix:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="prefixEdit"/> - </item> - <item> - <spacer name="prefixSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> + <widget class="QGroupBox" name="workspaceList"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: transparent; + border-left: transparent; + border-right: transparent; +}</string> + </property> + <property name="title"> + <string>List Of Workspaces</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="leftMargin"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + <item> + <widget class="QLineEdit" name="filterEdit"> + <property name="placeholderText"> + <string>Filter Workspaces</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="regexCheckBox"> + <property name="text"> + <string>Regex</string> + </property> + </widget> + </item> + <item> + <widget class="QListWidget" name="listOfWorkspaces"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="refreshButton"> + <property name="text"> + <string>Refresh</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="loggedParameterList"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: transparent; + border-left: transparent; + border-right: transparent; +}</string> + </property> + <property name="title"> + <string>List Of Logged Parameters</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QListWidget" name="listOfLoggedParameters"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> </layout> + </widget> </item> <item> - <widget class="QGroupBox" name="customSaveGroup"> - <property name="title"> - <string>Custom save</string> - </property> - <layout class="QGridLayout" name="customSaveLayout"> - <property name="margin"> - <number>20</number> + <widget class="QGroupBox" name="fileFormatGroup"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: transparent; + border-left: transparent; + border-right: transparent; +}</string> + </property> + <property name="title"> + <string>File Format</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,2,0"> + <property name="leftMargin"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">.QGroupBox { \n border-bottom: 0px transparent;\n border-left: 0px transparent;\n border-right: 0px transparent;\n}</string> + </property> + <property name="title"> + <string>Custom Format Options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,1,1"> + <property name="leftMargin"> + <number>6</number> </property> - <item row ="0" column="0"> - <widget class="QLabel" name="filterLabel"> + <item> + <widget class="QCheckBox" name="qResolutionCheckBox"> <property name="text"> - <string>Filter</string> + <string>Q resolution</string> </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="filterEdit"/> - </item> - <item row="0" column="2"> - <widget class="QCheckBox" name="regexCheckBox"/> + </widget> </item> - <item row="0" column="3"> - <widget class="QLabel" name="regexLabel"> - <property name="text"> - <string>Regex</string> - </property> - </widget> - </item> - <item row="0" column="4"> - <spacer name="customSaveSpacer0"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row ="1" column="0" colspan="4"> - <widget class="QLabel" name="listOfWorkspacesLabel"> - <property name="text"> - <string>List Of Workspaces</string> - </property> - </widget> - </item> - <item row="1" column="4"> - <spacer name="customSaveSpacer1"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row ="1" column="5"> - <widget class="QLabel" name="listOfLoggedParametersLabel"> - <property name="text"> - <string>List Of Logged Parameters</string> - </property> - </widget> - </item> - <item row ="2" column="0" colspan="4"> - <widget class="QListWidget" name="listOfWorkspaces"> - <property name="selectionMode"> - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - </widget> - </item> - <item row="2" column="4"> - <spacer name="customSaveSpacer2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row ="2" column="5"> - <widget class="QListWidget" name="listOfLoggedParameters"> - <property name="selectionMode"> - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - </widget> - </item> - <item row="3" column="0" colspan="4"> - <widget class="QPushButton" name="refreshButton"> - <property name="text"> - <string>Refresh</string> - </property> - </widget> - </item> - <item row="3" column="4"> - <spacer name="customSaveSpacer3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="5" rowspan="4"> - <widget class="QGroupBox" name="customFormatOptionsGroup"> - <property name="title"> - <string>Custom Format Options</string> - </property> - <layout class="QGridLayout" name="customFormatOptionsLayout"> - <item row="0" column="0"> - <widget class="QCheckBox" name="titleCheckBox"/> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="titleLabel"> - <property name="text"> - <string>Title</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QCheckBox" name="qResolutionCheckBox"/> - </item> - <item row="0" column="3"> - <widget class="QLabel" name="qResolutionLabel"> - <property name="text"> - <string>Q resolution</string> - </property> - </widget> - </item> - <item row="0" column="4"> - <spacer name="customFormatOptionsSpacer0"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="0" colspan="5"> - <widget class="QGroupBox" name="separatorGroup"> - <property name="title"> - <string>Separator</string> - </property> - <layout class="QGridLayout" name="separatorLayout"> - <item row="0" column="0"> - <widget class="QRadioButton" name="commaRadioButton"> - <property name="text"> - <string>Comma</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">separatorButtonGroup</string> - </attribute> - </widget> - </item> - <item row="0" column="1"> - <widget class="QRadioButton" name="spaceRadioButton"> - <property name="text"> - <string>Space</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">separatorButtonGroup</string> - </attribute> - </widget> - </item> - <item row="0" column="2"> - <widget class="QRadioButton" name="tabRadioButton"> - <property name="text"> - <string>Tab</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">separatorButtonGroup</string> - </attribute> - </widget> - </item> - <item row="0" column="3"> - <spacer name="separatorSpacer0"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item row ="5" column="0"> - <widget class="QLabel" name="fileFormatLabel"> - <property name="text"> - <string>File format</string> - </property> - </widget> - </item> - <item row="5" column="1" colspan="3"> - <widget class="QComboBox" name="fileFormatComboBox"> - <item> - <property name="text"> - <string>Custom format (*.dat)</string> - </property> - </item> - <item> - <property name="text"> - <string>3 column (*.dat)</string> - </property> - </item> - <item> - <property name="text"> - <string>ANSTO, MotoFit, 4 column (*.txt)</string> - </property> - </item> - <item> - <property name="text"> - <string>ILL Cosmos (*.mft)</string> - </property> - </item> - <property name="font"> - <font> - <bold>true</bold> - </font> - </property> - </widget> + <item> + <widget class="QCheckBox" name="titleCheckBox"> + <property name="text"> + <string>Title</string> + </property> + </widget> </item> - <item row="5" column="4"> - <spacer name="customSaveSpacer5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> + <item> + <widget class="QGroupBox" name="separatorGroup"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="title"> + <string>Separator</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1,1"> + <property name="spacing"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + <item> + <widget class="QRadioButton" name="commaRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> <size> - <width>20</width> - <height>20</height> + <width>0</width> + <height>0</height> </size> - </property> - </spacer> + </property> + <property name="text"> + <string>Comma</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <attribute name="buttonGroup"> + <string notr="true">separatorButtonGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="spaceRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Space</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">separatorButtonGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="tabRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Tab</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">separatorButtonGroup</string> + </attribute> + </widget> + </item> + </layout> + </widget> </item> - <item row="6" column="0" colspan="4"> - <widget class="QPushButton" name="saveButton"> - <property name="text"> - <string>Save</string> - </property> - </widget> - </item> - <item row="6" column="4"> - <spacer name="customSaveSpacer6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> + </layout> + </widget> + </item> + <item> + <widget class="QComboBox" name="fileFormatComboBox"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <item> + <property name="text"> + <string>Custom format (*.dat)</string> + </property> + </item> + <item> + <property name="text"> + <string>3 column (*.dat)</string> + </property> + </item> + <item> + <property name="text"> + <string>ANSTO, MotoFit, 4 column (*.txt)</string> + </property> + </item> + <item> + <property name="text"> + <string>ILL Cosmos (*.mft)</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QPushButton" name="saveButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="text"> + <string>Save</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="autoSaveGroupBox"> + <property name="title"> + <string>Auto Save</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Prefixes To Save:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="autoSavePrefixesEdit"/> </item> - </layout> - </widget> - <tabstops/> - <customwidgets/> + </layout> + </widget> + </item> + </layout> + </widget> <resources/> <connections/> -<buttongroups> + <buttongroups> <buttongroup name="separatorButtonGroup"/> -</buttongroups> + </buttongroups> </ui> diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget2.ui b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget2.ui new file mode 100644 index 0000000000000000000000000000000000000000..76dee7ef9f779bd5893af61fe416622cb0bfbe0a --- /dev/null +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget2.ui @@ -0,0 +1,383 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ReflSaveTabWidget</class> + <widget class="QWidget" name="ReflSaveTabWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>943</width> + <height>609</height> + </rect> + </property> + <property name="windowTitle"> + <string>Save ASCII</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>10</number> + </property> + <property name="topMargin"> + <number>10</number> + </property> + <property name="rightMargin"> + <number>10</number> + </property> + <property name="bottomMargin"> + <number>10</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string>File Names and Location</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Save Path:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="savePathEdit"/> + </item> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>File Name Prefix:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="prefixEdit"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="customSaveGroup"> + <property name="title"> + <string>Custom Save</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>10</number> + </property> + <property name="topMargin"> + <number>20</number> + </property> + <property name="rightMargin"> + <number>10</number> + </property> + <property name="bottomMargin"> + <number>10</number> + </property> + <item> + <widget class="QGroupBox" name="workspaceList"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: 0px transparent; + border-left: 0px transparent; + border-right: 0px transparent; +}</string> + </property> + <property name="title"> + <string>List Of Workspaces</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="filterEdit"> + <property name="placeholderText"> + <string>Filter Workspaces</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="regexCheckBox"> + <property name="text"> + <string>Regex</string> + </property> + </widget> + </item> + <item> + <widget class="QListWidget" name="listOfWorkspaces"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="refreshButton"> + <property name="text"> + <string>Refresh</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="loggedParameterList"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: 0px transparent; + border-left: 0px transparent; + border-right: 0px transparent; +}</string> + </property> + <property name="title"> + <string>List Of Logged Parameters</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QListWidget" name="listOfLoggedParameters"> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="fileFormatGroup"> + <property name="styleSheet"> + <string notr="true">.QGroupBox { + border-bottom: 0px transparent; + border-left: 0px transparent; + border-right: 0px transparent; +}</string> + </property> + <property name="title"> + <string>File Format</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,2,0"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">.QGroupBox { \n border-bottom: 0px transparent;\n border-left: 0px transparent;\n border-right: 0px transparent;\n}</string> + </property> + <property name="title"> + <string>Custom Format Options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,1,1"> + <property name="leftMargin"> + <number>6</number> + </property> + <item> + <widget class="QCheckBox" name="qResolutionCheckBox"> + <property name="text"> + <string>Q resolution</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="titleCheckBox"> + <property name="text"> + <string>Title</string> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="separatorGroup"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="title"> + <string>Separator</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1,1"> + <property name="spacing"> + <number>6</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + <item> + <widget class="QRadioButton" name="commaRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Comma</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="spaceRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Space</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="tabRadioButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Tab</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QComboBox" name="fileFormatComboBox"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <item> + <property name="text"> + <string>Custom format (*.dat)</string> + </property> + </item> + <item> + <property name="text"> + <string>3 column (*.dat)</string> + </property> + </item> + <item> + <property name="text"> + <string>ANSTO, MotoFit, 4 column (*.txt)</string> + </property> + </item> + <item> + <property name="text"> + <string>ILL Cosmos (*.mft)</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QPushButton" name="saveButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="text"> + <string>Save</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Auto Save</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Prefixes To Save:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit"/> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h index 46fb7c774c43dc96dac8477ae0eda3345954a6a6..dec5ef8b6bd5817514f6837979653c40e10485a1 100644 --- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h +++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/DataProcessorMainPresenter.h @@ -75,7 +75,8 @@ public: /// Handle data reduction paused/resumed confirmation virtual void confirmReductionPaused() const {} virtual void confirmReductionResumed() const {} - virtual void completedReductionSuccessfully(GroupData const&) {}; + virtual void completedGroupReductionSuccessfully(GroupData const&, std::string const&) {}; + virtual void completedRowReductionSuccessfully(GroupData const&, std::vector<std::string> const&) {}; }; } } diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h index 25dd31fe3c2078531cf681c922919d13b0ab80bb..f1baa14e59f9fbbfed82dd0c7d409222904fb912 100644 --- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h +++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h @@ -213,7 +213,12 @@ protected: // Plotting virtual void plotRow(); virtual void plotGroup(); - virtual void completedReductionSuccessfully(GroupData const& groupData); + virtual void + completedRowReductionSuccessfully(GroupData const &groupData, + std::vector<std::string> const &workspaceName); + virtual void + completedGroupReductionSuccessfully(GroupData const &groupData, + std::string const &workspaceName); void plotWorkspaces(const QOrderedSet<QString> &workspaces); // Get the name of a post-processed workspace QString getPostprocessedWorkspaceName(const GroupData &groupData); @@ -224,7 +229,6 @@ protected slots: void issueNotFoundWarning(QString const &granule, QSet<QString> const &missingWorkspaces); - private: void applyDefaultOptions(std::map<QString, QVariant> &options); void setPropertiesFromKeyValueString(Mantid::API::IAlgorithm_sptr alg, diff --git a/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp b/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp index 44c27d46c4a34ba9aadea7d430fb233c24ef2246..234009348ca67ee4cd573385139940815db404ed 100644 --- a/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp +++ b/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp @@ -406,8 +406,19 @@ void GenericDataProcessorPresenter::nextRow() { // Skip reducing rows that are already processed if (!isProcessed(m_rowItem.first, groupIndex)) { startAsyncRowReduceThread(&m_rowItem, groupIndex); - return; + + auto prefixes = m_processor.prefixes(); + std::vector<std::string> workspaceNames; + workspaceNames.reserve(prefixes.size()); + std::transform(prefixes.cbegin(), prefixes.cend(), + std::back_inserter(workspaceNames), + [this](QString const &prefix) -> std::string { + return getReducedWorkspaceName(m_rowItem.second, prefix) + .toStdString(); + }); + completedRowReductionSuccessfully(m_groupData, workspaceNames); } + return; } else { m_group_queue.pop(); // Set next action flag @@ -415,19 +426,27 @@ void GenericDataProcessorPresenter::nextRow() { // Skip post-processing groups that are already processed or only contain a // single row - if (!isProcessed(groupIndex) && m_groupData.size() > 1) { - startAsyncGroupReduceThread(m_groupData, groupIndex); - completedReductionSuccessfully(m_groupData); - return; + if (!isProcessed(groupIndex)) { + if (m_groupData.size() > 1) { + startAsyncGroupReduceThread(m_groupData, groupIndex); + auto postprocessedWorkspace = + getPostprocessedWorkspaceName(m_groupData).toStdString(); + completedGroupReductionSuccessfully(m_groupData, + postprocessedWorkspace); + return; + } } - } - // Row / group skipped, perform next action - doNextAction(); + // Row / group skipped, perform next action + doNextAction(); + } } -void GenericDataProcessorPresenter::completedReductionSuccessfully( - GroupData const &) {} +void GenericDataProcessorPresenter::completedGroupReductionSuccessfully( + GroupData const &, std::string const &) {} + +void GenericDataProcessorPresenter::completedRowReductionSuccessfully( + GroupData const &, std::vector<std::string> const &) {} /** Process a new group @@ -449,12 +468,26 @@ void GenericDataProcessorPresenter::nextGroup() { m_rowItem = rqueue.front(); rqueue.pop(); // Skip reducing rows that are already processed - if (!isProcessed(m_rowItem.first, m_group_queue.front().first)) + if (!isProcessed(m_rowItem.first, m_group_queue.front().first)) { startAsyncRowReduceThread(&m_rowItem, m_group_queue.front().first); - else + + auto prefixes = m_processor.prefixes(); + auto workspaceNames = std::vector<std::string>(); + workspaceNames.reserve(prefixes.size()); + std::transform(prefixes.cbegin(), prefixes.cend(), + std::back_inserter(workspaceNames), + [this](QString const &prefix) -> std::string { + return getReducedWorkspaceName(m_rowItem.second, prefix) + .toStdString(); + }); + completedRowReductionSuccessfully(m_groupData, workspaceNames); + + } else { doNextAction(); + } } else { - // If "Output Notebook" checkbox is checked then create an ipython notebook + // If "Output Notebook" checkbox is checked then create an ipython + // notebook if (m_view->getEnableNotebook()) saveNotebook(m_selectedData); endReduction(); @@ -588,8 +621,10 @@ Workspace_sptr GenericDataProcessorPresenter::prepareRunWorkspace( auto const outputName = preprocessingListToString(runs, preprocessor.prefix()); - /* Ideally, this should be executed as a child algorithm to keep the ADS tidy, - * but that doesn't preserve history nicely, so we'll just take care of tidying + /* Ideally, this should be executed as a child algorithm to keep the ADS + * tidy, + * but that doesn't preserve history nicely, so we'll just take care of + * tidying * up in the event of failure. */ IAlgorithm_sptr alg = @@ -627,12 +662,14 @@ Workspace_sptr GenericDataProcessorPresenter::prepareRunWorkspace( alg->execute(); if (runIt != --runs.end()) { - // After the first execution we replace the LHS with the previous output + // After the first execution we replace the LHS with the previous + // output setAlgorithmProperty(alg.get(), preprocessor.lhsProperty(), outputName); } } } catch (...) { - // If we're unable to create the full workspace, discard the partial version + // If we're unable to create the full workspace, discard the partial + // version removeWorkspace(outputName); // We've tidied up, now re-throw. throw; @@ -1017,7 +1054,8 @@ void GenericDataProcessorPresenter::notify(DataProcessorPresenter::Flag flag) { pause(); break; } - // Not having a 'default' case is deliberate. gcc issues a warning if there's + // Not having a 'default' case is deliberate. gcc issues a warning if + // there's // a flag we aren't handling. } @@ -1366,7 +1404,8 @@ void GenericDataProcessorPresenter::plotWorkspaces( void GenericDataProcessorPresenter::showOptionsDialog() { auto options = new QtDataProcessorOptionsDialog(m_view, m_view->getPresenter()); - // By default the dialog is only destroyed when ReflMainView is and so they'll + // By default the dialog is only destroyed when ReflMainView is and so + // they'll // stack up. // This way, they'll be deallocated as soon as they've been closed. options->setAttribute(Qt::WA_DeleteOnClose, true);