diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp index eb52973ab7e0b47ef23ca00cd1374556c71a0dcb..cbf38d3a5a2a887a4a0cbcbd6e00a617391e2735 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp @@ -30,10 +30,13 @@ void ExperimentPresenter::notifySettingsChanged() { void ExperimentPresenter::notifySummationTypeChanged() { notifySettingsChanged(); - if (m_model.summationType() == SummationType::SumInQ) + if (m_model.summationType() == SummationType::SumInQ) { m_view->enableReductionType(); - else + m_view->enableIncludePartialBins(); + } else { m_view->disableReductionType(); + m_view->disableIncludePartialBins(); + } } void ExperimentPresenter::notifyNewPerAngleDefaultsRequested() { diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.cpp index a9d548b5ba07de99774e843a7a963d3087d920fe..44b7741f22bcf52f357880ee7a7531624ac6a9d1 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.cpp @@ -94,6 +94,8 @@ void ExperimentView::initLayout() { connect(m_deleteShortcut.get(), SIGNAL(activated()), this, SLOT(onRemovePerThetaDefaultsRequested())); initOptionsTable(); + initFloodControls(); + auto blacklist = std::vector<std::string>({"InputWorkspaces", "OutputWorkspace"}); MantidWidgets::AlgorithmHintStrategy strategy("Stitch1DMany", blacklist); @@ -108,6 +110,8 @@ void ExperimentView::initLayout() { SLOT(summationTypeChanged(int))); connect(m_ui.addPerAngleOptionsButton, SIGNAL(clicked()), this, SLOT(onNewPerThetaDefaultsRowRequested())); + connect(m_ui.floodCorComboBox, SIGNAL(currentIndexChanged(const QString &)), + this, SLOT(floodCorComboBoxChanged(const QString &))); } void ExperimentView::initializeTableItems(QTableWidget &table) { @@ -141,6 +145,11 @@ void ExperimentView::initOptionsTable() { table->setMinimumHeight(totalRowHeight + header->height() + padding); } +void ExperimentView::initFloodControls() { + m_ui.floodWorkspaceWsSelector->setOptional(true); + m_ui.floodWorkspaceWsSelector->setWorkspaceTypes({"Workspace2D"}); +} + void ExperimentView::connectSettingsChange(QLineEdit &edit) { connect(&edit, SIGNAL(textChanged(QString const &)), this, SLOT(onSettingsChanged())); @@ -191,6 +200,11 @@ void ExperimentView::registerExperimentSettingsWidgets( registerSettingWidget(stitchOptionsLineEdit(), "Params", alg); registerSettingWidget(*m_ui.reductionTypeComboBox, "ReductionType", alg); registerSettingWidget(*m_ui.summationTypeComboBox, "SummationType", alg); + registerSettingWidget(*m_ui.includePartialBinsCheckBox, "IncludePartialBins", + alg); + registerSettingWidget(*m_ui.floodCorComboBox, "FloodCorrection", alg); + registerSettingWidget(*m_ui.floodWorkspaceWsSelector, "FloodWorkspace", alg); + registerSettingWidget(*m_ui.debugCheckBox, "Debug", alg); } void ExperimentView::summationTypeChanged(int reductionTypeIndex) { @@ -206,6 +220,14 @@ void ExperimentView::disableReductionType() { m_ui.reductionTypeComboBox->setEnabled(false); } +void ExperimentView::enableIncludePartialBins() { + m_ui.includePartialBinsCheckBox->setEnabled(true); +} + +void ExperimentView::disableIncludePartialBins() { + m_ui.includePartialBinsCheckBox->setEnabled(false); +} + template <typename Widget> void ExperimentView::registerSettingWidget(Widget &widget, std::string const &propertyName, @@ -367,6 +389,12 @@ void ExperimentView::removePerThetaDefaultsRow(int rowIndex) { m_ui.optionsTable->removeRow(rowIndex); } +void ExperimentView::floodCorComboBoxChanged(const QString &text) { + auto const showWorkspaceSelector = text == "Workspace"; + m_ui.floodWorkspaceWsSelector->setVisible(showWorkspaceSelector); + m_ui.floodWorkspaceWsSelectorLabel->setVisible(showWorkspaceSelector); +} + std::string ExperimentView::getText(QLineEdit const &lineEdit) const { return lineEdit.text().toStdString(); } @@ -459,6 +487,22 @@ double ExperimentView::getCPp() const { return m_ui.CPpEdit->value(); } void ExperimentView::setCPp(double cPp) { m_ui.CPpEdit->setValue(cPp); } +std::string ExperimentView::getFloodCorrectionType() const { + return getText(*m_ui.floodCorComboBox); +} + +void ExperimentView::setFloodCorrectionType(std::string const &type) { + setSelected(*m_ui.floodCorComboBox, type); +} + +std::string ExperimentView::getFloodWorkspace() const { + return getText(*m_ui.floodWorkspaceWsSelector); +} + +void ExperimentView::setFloodWorkspace(std::string const &workspace) { + setSelected(*m_ui.floodWorkspaceWsSelector, workspace); +} + std::string ExperimentView::getAnalysisMode() const { return getText(*m_ui.analysisModeComboBox); } @@ -479,6 +523,22 @@ std::string ExperimentView::getReductionType() const { return getText(*m_ui.reductionTypeComboBox); } +bool ExperimentView::getIncludePartialBins() const { + return m_ui.includePartialBinsCheckBox->isChecked(); +} + +void ExperimentView::setIncludePartialBins(bool enable) { + setChecked(*m_ui.includePartialBinsCheckBox, enable); +} + +bool ExperimentView::getDebugOption() const { + return m_ui.debugCheckBox->isChecked(); +} + +void ExperimentView::setDebugOption(bool enable) { + setChecked(*m_ui.debugCheckBox, enable); +} + void ExperimentView::setReductionType(std::string const &reductionType) { return setSelected(*m_ui.reductionTypeComboBox, reductionType); } diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.h index bbddbdd834c9f8fc6052dc4da48416a5fbc6df51..1eddcbad51a15e00dbd1884c310f0d5b82c7dd55 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentView.h @@ -40,6 +40,16 @@ public: std::string getReductionType() const override; void setReductionType(std::string const &reductionType) override; + void enableReductionType() override; + void disableReductionType() override; + + bool getIncludePartialBins() const override; + void setIncludePartialBins(bool enable) override; + void enableIncludePartialBins() override; + void disableIncludePartialBins() override; + + bool getDebugOption() const override; + void setDebugOption(bool enable) override; std::vector<std::array<std::string, 8>> getPerAngleOptions() const override; void showPerAngleOptionsAsInvalid(int row, int column) override; @@ -66,6 +76,11 @@ public: double getCPp() const override; void setCPp(double cPp) override; + std::string getFloodCorrectionType() const override; + void setFloodCorrectionType(std::string const &correction) override; + std::string getFloodWorkspace() const override; + void setFloodWorkspace(std::string const &workspace) override; + std::string getStitchOptions() const override; void setStitchOptions(std::string const &stitchOptions) override; @@ -79,9 +94,6 @@ public: void disableAll() override; void enableAll() override; - void enableReductionType() override; - void disableReductionType() override; - void enablePolarizationCorrections() override; void disablePolarizationCorrections() override; void enablePolarizationCorrectionInputs() override; @@ -89,6 +101,7 @@ public: void addPerThetaDefaultsRow() override; void removePerThetaDefaultsRow(int rowIndex) override; + public slots: /// Adds another row to the per-angle options table void summationTypeChanged(int reductionTypeIndex); @@ -97,6 +110,9 @@ public slots: void onSettingsChanged(); void onPerAngleDefaultsChanged(int row, int column); +private slots: + void floodCorComboBoxChanged(const QString &text); + private: void initializeTableItems(QTableWidget &table); void initializeTableRow(QTableWidget &table, int row); @@ -107,6 +123,7 @@ private: /// Initialise the interface void initLayout(); void initOptionsTable(); + void initFloodControls(); void registerSettingsWidgets(Mantid::API::IAlgorithm_sptr alg); void registerExperimentSettingsWidgets(Mantid::API::IAlgorithm_sptr alg); void setToolTipAsPropertyDocumentation(QWidget &widget, diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui index 28670ceba5f23241074aa95f7249c5280cec7f4a..69f0335f7fb70b35e958b6934e8bae25a4b80a10 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui @@ -40,7 +40,7 @@ <number>5</number> </property> <item> - <layout class="QGridLayout" name="expSettingsGrid" rowstretch="1,1,1,1,1,1,1,1,0,0,0,0" columnstretch="1,1,1,1"> + <layout class="QGridLayout" name="expSettingsGrid" rowstretch="1,1,1,1,1,1,1,1,0,0,0,0,0" columnstretch="1,1,1,1"> <property name="leftMargin"> <number>10</number> </property> @@ -53,6 +53,62 @@ <property name="bottomMargin"> <number>10</number> </property> + <item row="1" column="0"> + <widget class="QLabel" name="summationTypeLabel"> + <property name="minimumSize"> + <size> + <width>117</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>SummationType</string> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QDoubleSpinBox" name="CRhoEdit"> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="startOverlapLabel"> + <property name="text"> + <string>TransRunStartOverlap</string> + </property> + </widget> + </item> + <item row="9" column="3"> + <widget class="QDoubleSpinBox" name="CAlphaEdit"> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QDoubleSpinBox" name="startOverlapEdit"> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + </widget> + </item> <item row="8" column="0"> <widget class="QLabel" name="polCorrLabel"> <property name="minimumSize"> @@ -66,13 +122,97 @@ </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="perAngleTableLabel"> + <item row="0" column="2"> + <widget class="QLabel" name="debugLabel"> <property name="text"> - <string>Per-angle defaults</string> + <string>Debug</string> </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </widget> + </item> + <item row="10" column="3"> + <widget class="QDoubleSpinBox" name="CPpEdit"> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QCheckBox" name="debugCheckBox"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="7" column="2"> + <widget class="QLabel" name="endOverlapLabel"> + <property name="minimumSize"> + <size> + <width>117</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>TransRunEndOverlap</string> + </property> + </widget> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="CRhoLabel"> + <property name="text"> + <string>CRho</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="summationTypeComboBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>SumInLambda</string> + </property> + </item> + <item> + <property name="text"> + <string>SumInQ</string> + </property> + </item> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="analysisModeLabel"> + <property name="text"> + <string>AnalysisMode</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QPushButton" name="addPerAngleOptionsButton"> + <property name="toolTip"> + <string>Add another row to the per-angle options table</string> + </property> + <property name="whatsThis"> + <string>Adds another row to the per-angle options table so that additional angles can be added</string> + </property> + <property name="text"> + <string>Add row</string> + </property> + </widget> + </item> + <item row="7" column="3"> + <widget class="QDoubleSpinBox" name="endOverlapEdit"> + <property name="decimals"> + <number>5</number> </property> </widget> </item> @@ -180,81 +320,82 @@ </column> </widget> </item> - <item row="7" column="2"> - <widget class="QLabel" name="endOverlapLabel"> - <property name="minimumSize"> - <size> - <width>117</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>TransRunEndOverlap</string> - </property> - </widget> - </item> - <item row="10" column="0"> - <widget class="QLabel" name="CApLabel"> - <property name="text"> - <string>CAp</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="summationTypeComboBox"> + <item row="0" column="1"> + <widget class="QComboBox" name="analysisModeComboBox"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <item> <property name="text"> - <string>SumInLambda</string> + <string>PointDetectorAnalysis</string> </property> </item> <item> <property name="text"> - <string>SumInQ</string> + <string>MultiDetectorAnalysis</string> </property> </item> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="summationTypeLabel"> - <property name="minimumSize"> - <size> - <width>117</width> - <height>0</height> - </size> + <item row="3" column="0"> + <widget class="QLabel" name="perAngleTableLabel"> + <property name="text"> + <string>Per-angle defaults</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> </property> + </widget> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="CApLabel"> <property name="text"> - <string>SummationType</string> + <string>CAp</string> </property> </widget> </item> - <item row="11" column="0"> + <item row="10" column="1"> + <widget class="QDoubleSpinBox" name="CApEdit"> + <property name="decimals"> + <number>5</number> + </property> + <property name="maximum"> + <double>100000.000000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item row="12" column="0"> <widget class="QLabel" name="stitchLabel"> <property name="text"> <string>Stitch1DMany</string> </property> </widget> </item> - <item row="9" column="2"> - <widget class="QLabel" name="CAlphaLabel"> - <property name="minimumSize"> - <size> - <width>117</width> - <height>0</height> - </size> + <item row="2" column="2"> + <widget class="QLabel" name="includePartialBinsLabel"> + <property name="text"> + <string>IncludePartialBins</string> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QCheckBox" name="includePartialBinsCheckBox"> + <property name="enabled"> + <bool>false</bool> </property> <property name="text"> - <string>CAlpha</string> + <string/> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QLabel" name="reductionTypeLabel"> + <item row="9" column="2"> + <widget class="QLabel" name="CAlphaLabel"> <property name="minimumSize"> <size> <width>117</width> @@ -262,7 +403,7 @@ </size> </property> <property name="text"> - <string>ReductionType</string> + <string>CAlpha</string> </property> </widget> </item> @@ -296,13 +437,6 @@ </item> </widget> </item> - <item row="7" column="0"> - <widget class="QLabel" name="startOverlapLabel"> - <property name="text"> - <string>TransRunStartOverlap</string> - </property> - </widget> - </item> <item row="10" column="2"> <widget class="QLabel" name="CPpLabel"> <property name="minimumSize"> @@ -316,148 +450,76 @@ </property> </widget> </item> - <item row="9" column="0"> - <widget class="QLabel" name="CRhoLabel"> + <item row="11" column="3"> + <widget class="MantidQt::MantidWidgets::WorkspaceSelector" name="floodWorkspaceWsSelector" native="true"/> + </item> + <item row="11" column="2"> + <widget class="QLabel" name="floodWorkspaceWsSelectorLabel"> <property name="text"> - <string>CRho</string> + <string>Flood Workspace</string> </property> </widget> </item> - <item row="1" column="3"> - <widget class="QComboBox" name="reductionTypeComboBox"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="11" column="0"> + <widget class="QLabel" name="floodCorLabel"> + <property name="text"> + <string>Flood Correction</string> </property> + </widget> + </item> + <item row="11" column="1"> + <widget class="QComboBox" name="floodCorComboBox"> <item> <property name="text"> - <string>Normal</string> - </property> - </item> - <item> - <property name="text"> - <string>DivergentBeam</string> + <string>Workspace</string> </property> </item> <item> <property name="text"> - <string>NonFlatSample</string> + <string>ParameterFile</string> </property> </item> </widget> </item> - <item row="6" column="1"> - <widget class="QPushButton" name="addPerAngleOptionsButton"> - <property name="toolTip"> - <string>Add another row to the per-angle options table</string> - </property> - <property name="whatsThis"> - <string>Adds another row to the per-angle options table so that additional angles can be added</string> + <item row="2" column="0"> + <widget class="QLabel" name="reductionTypeLabel"> + <property name="minimumSize"> + <size> + <width>117</width> + <height>0</height> + </size> </property> <property name="text"> - <string>Add row</string> + <string>ReductionType</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="analysisModeComboBox"> + <item row="2" column="1"> + <widget class="QComboBox" name="reductionTypeComboBox"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <item> <property name="text"> - <string>PointDetectorAnalysis</string> + <string>Normal</string> </property> </item> <item> <property name="text"> - <string>MultiDetectorAnalysis</string> + <string>DivergentBeam</string> + </property> + </item> + <item> + <property name="text"> + <string>NonFlatSample</string> </property> </item> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="analysisModeLabel"> - <property name="text"> - <string>AnalysisMode</string> - </property> - </widget> - </item> - <item row="7" column="1"> - <widget class="QDoubleSpinBox" name="startOverlapEdit"> - <property name="decimals"> - <number>5</number> - </property> - <property name="maximum"> - <double>100000.000000000000000</double> - </property> - </widget> - </item> - <item row="7" column="3"> - <widget class="QDoubleSpinBox" name="endOverlapEdit"> - <property name="decimals"> - <number>5</number> - </property> - </widget> - </item> - <item row="9" column="1"> - <widget class="QDoubleSpinBox" name="CRhoEdit"> - <property name="decimals"> - <number>5</number> - </property> - <property name="maximum"> - <double>100000.000000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - <item row="9" column="3"> - <widget class="QDoubleSpinBox" name="CAlphaEdit"> - <property name="decimals"> - <number>5</number> - </property> - <property name="maximum"> - <double>100000.000000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - <item row="10" column="1"> - <widget class="QDoubleSpinBox" name="CApEdit"> - <property name="decimals"> - <number>5</number> - </property> - <property name="maximum"> - <double>100000.000000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - <item row="10" column="3"> - <widget class="QDoubleSpinBox" name="CPpEdit"> - <property name="decimals"> - <number>5</number> - </property> - <property name="maximum"> - <double>100000.000000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> </widget> </item> </layout> @@ -490,6 +552,13 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>MantidQt::MantidWidgets::WorkspaceSelector</class> + <extends>QComboBox</extends> + <header>MantidQtWidgets/Common/WorkspaceSelector.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/IExperimentView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/IExperimentView.h index 301e7e53e99c9adb3a69df105fe75f705e185abf..9e0df97574b5f1ab8cd4a14867c8e1aa5f6bcc8d 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/IExperimentView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/IExperimentView.h @@ -52,6 +52,14 @@ public: virtual void enableReductionType() = 0; virtual void disableReductionType() = 0; + virtual bool getIncludePartialBins() const = 0; + virtual void setIncludePartialBins(bool enable) = 0; + virtual void enableIncludePartialBins() = 0; + virtual void disableIncludePartialBins() = 0; + + virtual bool getDebugOption() const = 0; + virtual void setDebugOption(bool enable) = 0; + virtual std::vector<std::array<std::string, 8>> getPerAngleOptions() const = 0; virtual void showPerAngleOptionsAsInvalid(int row, int column) = 0; @@ -83,6 +91,11 @@ public: virtual double getCPp() const = 0; virtual void setCPp(double cPp) = 0; + virtual std::string getFloodCorrectionType() const = 0; + virtual void setFloodCorrectionType(std::string const &correction) = 0; + virtual std::string getFloodWorkspace() const = 0; + virtual void setFloodWorkspace(std::string const &workspace) = 0; + virtual std::string getStitchOptions() const = 0; virtual void setStitchOptions(std::string const &stitchOptions) = 0; diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h index 668c4066b8a9ed20921ffc696555c548f5e75ad9..d7b38df06840d962f017012d32a8af0f8861b24f 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h @@ -79,20 +79,22 @@ public: verifyAndClear(); } - void testReductionTypeDisabledWhenChangeToSumInLambda() { + void testSumInQWidgetsDisabledWhenChangeToSumInLambda() { auto presenter = makePresenter(); EXPECT_CALL(m_view, disableReductionType()).Times(1); + EXPECT_CALL(m_view, disableIncludePartialBins()).Times(1); presenter.notifySummationTypeChanged(); verifyAndClear(); } - void testReductionTypeEnbledWhenChangeToSumInQ() { + void testSumInQWidgetsEnbledWhenChangeToSumInQ() { auto presenter = makePresenter(); expectViewReturnsSumInQDefaults(); EXPECT_CALL(m_view, enableReductionType()).Times(1); + EXPECT_CALL(m_view, enableIncludePartialBins()).Times(1); presenter.notifySummationTypeChanged(); verifyAndClear(); diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/MockExperimentView.h b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/MockExperimentView.h index 43a97ce2b34cbc5d8466ab7fed1e5649ed369875..dcfb788fd756ea6e091800a797a5c0783dde24bf 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/MockExperimentView.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/MockExperimentView.h @@ -35,6 +35,12 @@ public: MOCK_METHOD1(setReductionType, void(std::string const &)); MOCK_METHOD0(enableReductionType, void()); MOCK_METHOD0(disableReductionType, void()); + MOCK_CONST_METHOD0(getIncludePartialBins, bool()); + MOCK_METHOD1(setIncludePartialBins, void(bool)); + MOCK_METHOD0(enableIncludePartialBins, void()); + MOCK_METHOD0(disableIncludePartialBins, void()); + MOCK_CONST_METHOD0(getDebugOption, bool()); + MOCK_METHOD1(setDebugOption, void(bool)); MOCK_CONST_METHOD0(getPerAngleOptions, std::vector<std::array<std::string, 8>>()); MOCK_METHOD2(showPerAngleOptionsAsInvalid, void(int row, int column)); @@ -62,6 +68,10 @@ public: MOCK_METHOD1(setCAp, void(double)); MOCK_CONST_METHOD0(getCPp, double()); MOCK_METHOD1(setCPp, void(double)); + MOCK_CONST_METHOD0(getFloodCorrectionType, std::string()); + MOCK_METHOD1(setFloodCorrectionType, void(std::string const &)); + MOCK_CONST_METHOD0(getFloodWorkspace, std::string()); + MOCK_METHOD1(setFloodWorkspace, void(std::string const &)); MOCK_CONST_METHOD0(getStitchOptions, std::string()); MOCK_METHOD1(setStitchOptions, void(std::string const &)); MOCK_METHOD2(showOptionLoadErrors,