diff --git a/docs/source/release/v3.12.0/diffraction.rst b/docs/source/release/v3.12.0/diffraction.rst index 79174ecb3939e6ada94c7ff15821a054b6fecc3b..967c8a6e5b59a730b92dd8230123218c22cd310a 100644 --- a/docs/source/release/v3.12.0/diffraction.rst +++ b/docs/source/release/v3.12.0/diffraction.rst @@ -37,4 +37,10 @@ Single Crystal Diffraction Imaging ------- +Features Removed +---------------- + +* The "Test the Curve Fit widget" graphical interface has been removed, it was a test harness for developers and was not intended to be exposed during earlier releases. + + :ref:`Release 3.12.0 <v3.12.0>` diff --git a/qt/scientific_interfaces/DynamicPDF/CMakeLists.txt b/qt/scientific_interfaces/DynamicPDF/CMakeLists.txt index 69868204e1b1d9d3cf017b0baaa9791b2024dc3e..44b0c90ddc870dbf622dedd3d738145d57a67375 100644 --- a/qt/scientific_interfaces/DynamicPDF/CMakeLists.txt +++ b/qt/scientific_interfaces/DynamicPDF/CMakeLists.txt @@ -5,7 +5,6 @@ set ( SRC_FILES DPDFFitOptionsBrowser.cpp DPDFFourierTransform.cpp DPDFInputDataControl.cpp - DisplayCurveFitTest.cpp SliceSelector.cpp ) @@ -19,12 +18,10 @@ set ( INC_FILES DPDFFitOptionsBrowser.h DPDFFourierTransform.h DPDFInputDataControl.h - DisplayCurveFitTest.h SliceSelector.h ) -set ( MOC_FILES - DisplayCurveFitTest.h +set ( MOC_FILES DPDFBackgroundRemover.h DPDFDisplayControl.h DPDFFitControl.h @@ -34,8 +31,8 @@ set ( MOC_FILES SliceSelector.h ) -set ( UI_FILES - DisplayCurveFitTest.ui + +set ( UI_FILES DPDFBackgroundRemover.ui DPDFFitControl.ui DPDFFourierTransform.ui diff --git a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.cpp b/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.cpp deleted file mode 100644 index 542dab3e167a3f8fab629c0850e4be8ed9d8709e..0000000000000000000000000000000000000000 --- a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "DisplayCurveFitTest.h" -// includes for workspace handling -#include "MantidAPI/AnalysisDataService.h" -#include "MantidAPI/MatrixWorkspace.h" -// includes for interface functionality -#include "MantidQtWidgets/LegacyQwt/DisplayCurveFit.h" -#include "MantidQtWidgets/LegacyQwt/RangeSelector.h" - -namespace { -Mantid::Kernel::Logger g_log("DynamicPDF"); -} - -namespace MantidQt { -namespace CustomInterfaces { -namespace DynamicPDF { - -// Add this class to the list of specialised dialogs in this namespace only if -// compiling in Debug mode -//#ifndef NDEBUG -DECLARE_SUBWINDOW(DisplayCurveFitTest) -//#endif - -using curveType = MantidQt::MantidWidgets::DisplayCurveFit::curveType; -using dcRange = MantidQt::MantidWidgets::DisplayCurveFit::dcRange; - -// ++++++++++++++++++++++++++++ -// +++++ Public Members +++++ -// ++++++++++++++++++++++++++++ - -/// Constructor -DisplayCurveFitTest::DisplayCurveFitTest(QWidget *parent) - : UserSubWindow{parent} {} - -DisplayCurveFitTest::~DisplayCurveFitTest() {} - -/** - * @brief Initialize the widgets defined within the form generated in - * Qt-Designer. Also, defined the SIGNALS to SLOTS connections. - */ -void DisplayCurveFitTest::initLayout() { - m_uiForm.setupUi(this); - connect(m_uiForm.dataSelector, SIGNAL(dataReady(const QString &)), this, - SLOT(loadSpectra(const QString &))); -} - -// +++++++++++++++++++++++++++ -// +++++ Private Slots +++++ -// +++++++++++++++++++++++++++ - -/** - * @brief The test proper that loads the fit curves to be - * displayed and the two ranges. - * @param workspaceName the name of the workspace containing - * the data of the curves to be displayed. - */ -void DisplayCurveFitTest::loadSpectra(const QString &workspaceName) { - auto workspace = Mantid::API::AnalysisDataService::Instance() - .retrieveWS<Mantid::API::MatrixWorkspace>( - workspaceName.toStdString()); - if (!workspace) { - auto title = QString::fromStdString(this->name()); - auto error = - QString::fromStdString("Workspace must be of type MatrixWorkspace"); - QMessageBox::warning(this, title, error); - return; - } - if (workspace->getNumberHistograms() < 4) { - auto title = QString::fromStdString(this->name()); - auto error = QString("Not enough number of histograms in the workspace"); - QMessageBox::warning(this, title, error); - return; - } - m_uiForm.displayFit->addSpectrum(curveType::data, workspace, 0); - auto curveRange = m_uiForm.displayFit->getCurveRange(curveType::data); - static bool firstPass{TRUE}; - - // Set up the range selector for the fit - m_uiForm.displayFit->addRangeSelector(dcRange::fit); - auto rangeSelectorFit = m_uiForm.displayFit->m_rangeSelector.at(dcRange::fit); - if (firstPass || m_uiForm.updateRangeSelectors->isChecked()) { - rangeSelectorFit->setRange(curveRange.first, curveRange.second); - rangeSelectorFit->setMinimum(1.05 * curveRange.first); - rangeSelectorFit->setMaximum(0.95 * curveRange.second); - } - - // Set up the range evaluate range selector - m_uiForm.displayFit->addRangeSelector(dcRange::evaluate); - auto rangeSelectorEvaluate = - m_uiForm.displayFit->m_rangeSelector.at(dcRange::evaluate); - if (firstPass || m_uiForm.updateRangeSelectors->isChecked()) { - rangeSelectorEvaluate->setRange(curveRange.first, curveRange.second); - rangeSelectorEvaluate->setMinimum(curveRange.first); - rangeSelectorEvaluate->setMaximum(curveRange.second); - } - - m_uiForm.displayFit->addSpectrum(curveType::fit, workspace, 1); - m_uiForm.displayFit->addSpectrum(curveType::residuals, workspace, 2); - m_uiForm.displayFit->addSpectrum(curveType::guess, workspace, 3); - - m_uiForm.displayFit->addResidualsZeroline(); - firstPass = FALSE; -} - -} // namespace MantidQt -} // namespace CustomInterfaces -} // namespace DynamicPDF diff --git a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.h b/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.h deleted file mode 100644 index 86e5d8ed7c48fb3f29481bbdcbbe9d4a7140b424..0000000000000000000000000000000000000000 --- a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef MANTIDQTCUSTOMINTERFACES_DYNAMICPDF_DISPLAYCURVEFITTEST_H_ -#define MANTIDQTCUSTOMINTERFACES_DYNAMICPDF_DISPLAYCURVEFITTEST_H_ - -// includes for interace functionailty -#include "DllConfig.h" -#include "MantidQtWidgets/Common/UserSubWindow.h" -#include "ui_DisplayCurveFitTest.h" - -namespace MantidQt { -namespace CustomInterfaces { -namespace DynamicPDF { - -/** An interface whose only purpose is to test widget DisplayCurveFit - The interface is visible in MantidPlot only when compiled in Debug mode. - - @date 2016-02-22 - - Copyright © 2012 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge - National Laboratory & European Spallation Source - - This file is part of Mantid. - - Mantid is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Mantid is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - File change history is stored at: <https://github.com/mantidproject/mantid> - Code Documentation is available at: <http://doxygen.mantidproject.org> -*/ -class MANTIDQT_DYNAMICPDF_DLL DisplayCurveFitTest - : public MantidQt::API::UserSubWindow { - Q_OBJECT - -public: - /// The name of the interface as registered into the factory - static std::string name() { return "Test the DisplayCurveFit widget"; } - // This interface's categories. - static QString categoryInfo() { return "DynamicPDF"; } - - DisplayCurveFitTest(QWidget *parent = nullptr); - ~DisplayCurveFitTest() override; - -private slots: - void loadSpectra(const QString &workspaceName); - -private: - void initLayout() override; - /// The object containing the widgets defined in the form created in Qt - /// Designer - Ui::DisplayCurveFitTest m_uiForm; - -}; // class DisplayCurveFitTest -} // namespace CustomInterfaces -} // namespace DynamicPDF -} // namespace MantidQt -#endif // MANTIDQTCUSTOMINTERFACES_DYNAMICPDF_DISPLAYCURVEFITTEST_H_ diff --git a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.ui b/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.ui deleted file mode 100644 index b88a6e54bc845f60c557fbf95deee141757016c2..0000000000000000000000000000000000000000 --- a/qt/scientific_interfaces/DynamicPDF/DisplayCurveFitTest.ui +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>DisplayCurveFitTest</class> - <widget class="QMainWindow" name="DisplayCurveFitTest"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>613</width> - <height>740</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Dynamic PDF - Test DisplayCurveFit</string> - </property> - <widget class="QWidget" name="centralwidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="MantidQt::MantidWidgets::DataSelector" name="dataSelector"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="MantidQt::MantidWidgets::DisplayCurveFit" name="displayFit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>1</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QCheckBox" name="updateRangeSelectors"> - <property name="text"> - <string>Update range selectors?</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </widget> - <customwidgets> - <customwidget> - <class>MantidQt::MantidWidgets::DataSelector</class> - <extends>QWidget</extends> - <header>MantidQtWidgets/Common/DataSelector.h</header> - </customwidget> - <customwidget> - <class>MantidQt::MantidWidgets::DisplayCurveFit</class> - <extends>QWidget</extends> - <header>MantidQtWidgets/LegacyQwt/DisplayCurveFit.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui>