Unverified Commit b2b8f9b2 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Merge pull request #28718 from mantidproject/added_dockable_tabs_to_workbench_data_analysis

parents a3d090d9 1f0c43fb
......@@ -24,6 +24,7 @@ Improvements
frequencies and intensities.
- :ref:`CalculateMonteCarloAbsorption <algm-CalculateMonteCarloAbsorption>` will now work also for ILL fixed window scan reduced data, in which case the correction will be calculated for elastic wavelength.
- The centre parameter has been added to delta function in the ConvFit tab of Indirect Data Analysis.
- Added docking and undocking to the plot window and function browser window for the fit tabs in Indirect Data Analysis on workbench.
Bug Fixes
#########
......
......@@ -30,6 +30,7 @@ set(
IndirectDataTablePresenter.cpp
IndirectDataValidationHelper.cpp
IndirectDiffractionReduction.cpp
IndirectDockWidgetArea.cpp
IndirectEditResultsDialog.cpp
IndirectFitAnalysisTab.cpp
IndirectFitData.cpp
......@@ -155,6 +156,7 @@ set(
IndirectDataReduction.h
IndirectDataReductionTab.h
IndirectDataTablePresenter.h
IndirectDockWidgetArea.h
IndirectDiffractionReduction.h
IndirectEditResultsDialog.h
IndirectFitAnalysisTab.h
......@@ -216,7 +218,6 @@ set(
ApplyAbsorptionCorrections.ui
CalculatePaalmanPings.ui
ContainerSubtraction.ui
ConvFit.ui
ConvFitAddWorkspaceDialog.ui
DensityOfStates.ui
Elwin.ui
......@@ -227,10 +228,12 @@ set(
IndirectDataAnalysis.ui
IndirectDataReduction.ui
IndirectDiffractionReduction.ui
IndirectDockWidgetArea.ui
IndirectEditResultsDialog.ui
IndirectFitDataView.ui
IndirectFitOutputOptions.ui
IndirectFitPreviewPlot.ui
IndirectFitTab.ui
IndirectInterfaceSettings.ui
IndirectInstrumentConfig.ui
IndirectLoadILL.ui
......@@ -247,10 +250,7 @@ set(
IndirectTransmission.ui
IndirectTransmissionCalc.ui
Iqt.ui
IqtFit.ui
JumpFit.ui
JumpFitAddWorkspaceDialog.ui
MSDFit.ui
Quasi.ui
ResNorm.ui
Stretch.ui
......@@ -332,6 +332,7 @@ set(
IndirectFitData.cpp
IndirectFitDataPresenter.cpp
IndirectFitDataView.cpp
IndirectDockWidgetArea.cpp
IndirectFitOutputOptionsModel.cpp
IndirectFitOutputOptionsPresenter.cpp
IndirectFitOutputOptionsView.cpp
......@@ -426,6 +427,7 @@ set(
IndirectDataReductionTab.h
IndirectDataTablePresenter.h
IndirectDiffractionReduction.h
IndirectDockWidgetArea.h
IndirectEditResultsDialog.h
IndirectFitAnalysisTab.h
IndirectFitDataPresenter.h
......@@ -505,7 +507,6 @@ set(
ApplyAbsorptionCorrections.ui
CalculatePaalmanPings.ui
ContainerSubtraction.ui
ConvFit.ui
ConvFitAddWorkspaceDialog.ui
DensityOfStates.ui
Elwin.ui
......@@ -519,10 +520,12 @@ set(
IndirectDataAnalysis.ui
IndirectDataReduction.ui
IndirectDiffractionReduction.ui
IndirectDockWidgetArea.ui
IndirectEditResultsDialog.ui
IndirectFitDataView.ui
IndirectFitOutputOptions.ui
IndirectFitPreviewPlot.ui
IndirectFitTab.ui
IndirectInstrumentConfig.ui
IndirectInterfaceSettings.ui
IndirectLoadILL.ui
......@@ -539,10 +542,7 @@ set(
IndirectTransmission.ui
IndirectTransmissionCalc.ui
Iqt.ui
IqtFit.ui
JumpFit.ui
JumpFitAddWorkspaceDialog.ui
MSDFit.ui
Quasi.ui
ResNorm.ui
Stretch.ui
......
......@@ -6,6 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "ConvFit.h"
#include "ConvFitDataPresenter.h"
#include "IndirectFitPlotView.h"
#include "IndirectFunctionBrowser/ConvTemplateBrowser.h"
#include "MantidQtWidgets/Common/UserInputValidator.h"
......@@ -36,17 +37,17 @@ namespace IDA {
ConvFit::ConvFit(QWidget *parent)
: IndirectFitAnalysisTab(new ConvFitModel, parent),
m_uiForm(new Ui::ConvFit) {
m_uiForm(new Ui::IndirectFitTab) {
m_uiForm->setupUi(parent);
m_convFittingModel = dynamic_cast<ConvFitModel *>(fittingModel());
setPlotView(m_uiForm->pvFitPlotView);
setPlotView(m_uiForm->dockArea->m_fitPlotView);
setSpectrumSelectionView(m_uiForm->svSpectrumView);
setOutputOptionsView(m_uiForm->ovOutputOptionsView);
m_uiForm->fitPropertyBrowser->setFunctionTemplateBrowser(
m_uiForm->dockArea->m_fitPropertyBrowser->setFunctionTemplateBrowser(
new ConvTemplateBrowser);
setFitPropertyBrowser(m_uiForm->fitPropertyBrowser);
setFitPropertyBrowser(m_uiForm->dockArea->m_fitPropertyBrowser);
auto dataPresenter = std::make_unique<ConvFitDataPresenter>(
m_convFittingModel, m_uiForm->fitDataView);
m_convFittingModel, m_uiForm->dockArea->m_fitDataView);
connect(
dataPresenter.get(),
SIGNAL(
......@@ -56,7 +57,6 @@ ConvFit::ConvFit(QWidget *parent)
setFitDataPresenter(std::move(dataPresenter));
setEditResultVisible(true);
setStartAndEndHidden(false);
}
void ConvFit::setupFitTab() {
......@@ -116,14 +116,10 @@ void ConvFit::setModelResolution(const std::string &resolutionName,
TableDatasetIndex index) {
m_convFittingModel->setResolution(resolutionName, index);
auto fitResolutions = m_convFittingModel->getResolutionsForFit();
m_uiForm->fitPropertyBrowser->setModelResolution(fitResolutions);
m_fitPropertyBrowser->setModelResolution(fitResolutions);
setModelFitFunction();
}
void ConvFit::setStartAndEndHidden(bool hidden) {
m_uiForm->fitDataView->setStartAndEndHidden(hidden);
}
void ConvFit::fitFunctionChanged() {
m_convFittingModel->setFitTypeString(fitTypeString());
}
......
......@@ -13,7 +13,7 @@
#include "MantidAPI/CompositeFunction.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "ui_ConvFit.h"
#include "ui_IndirectFitTab.h"
namespace MantidQt {
namespace CustomInterfaces {
......@@ -43,11 +43,10 @@ private:
void setupFitTab() override;
void setupFit(Mantid::API::IAlgorithm_sptr fitAlgorithm) override;
EstimationDataSelector getEstimationDataSelector() const override;
void setStartAndEndHidden(bool hidden);
std::string fitTypeString() const;
std::unique_ptr<Ui::ConvFit> m_uiForm;
std::unique_ptr<Ui::IndirectFitTab> m_uiForm;
// ShortHand Naming for fit functions
std::unordered_map<std::string, std::string> m_fitStrings;
ConvFitModel *m_convFittingModel;
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConvFit</class>
<widget class="QWidget" name="ConvFit">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>801</width>
<height>734</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectFitDataView" name="fitDataView" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="loPlotArea" stretch="1,1">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectFitPropertyBrowser" name="fitPropertyBrowser">
<widget class="QWidget" name="dockWidgetContents_2"/>
</widget>
</item>
<item>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectFitPlotView" name="pvFitPlotView" native="true"/>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<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>
<layout class="QHBoxLayout" name="loSpectrumView" stretch="0">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectSpectrumSelectionView" name="svSpectrumView" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="gbRun">
<property name="title">
<string>Run</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pbRun">
<property name="text">
<string>Run</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectFitOutputOptionsView" name="ovOutputOptionsView" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectSpectrumSelectionView</class>
<extends>QWidget</extends>
<header>IndirectSpectrumSelectionView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectFitPropertyBrowser</class>
<extends>QDockWidget</extends>
<header>IndirectFitPropertyBrowser.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectFitPlotView</class>
<extends>QWidget</extends>
<header>IndirectFitPlotView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectFitDataView</class>
<extends>QWidget</extends>
<header>IndirectFitDataView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectFitOutputOptionsView</class>
<extends>QWidget</extends>
<header>IndirectFitOutputOptionsView.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -28,7 +28,6 @@ public:
virtual bool isMultipleDataTabSelected() const = 0;
virtual bool isResolutionHidden() const = 0;
virtual void setResolutionHidden(bool hide) = 0;
virtual void setStartAndEndHidden(bool hidden) = 0;
virtual void disableMultipleDataTab() = 0;
virtual std::string getSelectedSample() const = 0;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>764</height>
<width>1100</width>
<height>1100</height>
</rect>
</property>
<property name="sizePolicy">
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "IndirectDockWidgetArea.h"
namespace MantidQt {
namespace CustomInterfaces {
namespace IDA {
IndirectDockWidgetArea::IndirectDockWidgetArea(QWidget *parent)
: QMainWindow(parent), m_uiForm(new Ui::IndirectDockWidgetArea) {
m_uiForm->setupUi(this);
QMainWindow::setWindowFlags(Qt::Widget);
setDockOptions(QMainWindow::AnimatedDocks);
m_fitPropertyBrowser = new IndirectFitPropertyBrowser();
m_fitPropertyBrowser->setFeatures(QDockWidget::DockWidgetFloatable |
QDockWidget::DockWidgetMovable);
QDockWidget *plotViewArea = new QDockWidget();
plotViewArea->setWindowTitle("Mini plots");
m_fitPlotView = new IndirectFitPlotView();
plotViewArea->setWidget(m_fitPlotView);
plotViewArea->setFeatures(QDockWidget::DockWidgetFloatable |
QDockWidget::DockWidgetMovable);
addDockWidget(Qt::BottomDockWidgetArea, m_fitPropertyBrowser);
addDockWidget(Qt::BottomDockWidgetArea, plotViewArea);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
resizeDocks({m_fitPropertyBrowser, plotViewArea}, {20, 20}, Qt::Horizontal);
#endif
m_fitDataView = m_uiForm->fitDataView;
}
} // namespace IDA
} // namespace CustomInterfaces
} // namespace MantidQt
\ No newline at end of file
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "IndirectFitDataView.h"
#include "IndirectFitPlotView.h"
#include "IndirectFitPropertyBrowser.h"
#include "ui_IndirectDockWidgetArea.h"
#include <QMainWindow>
#include <QObject>
#include <QWidget>
namespace MantidQt {
namespace CustomInterfaces {
namespace IDA {
class IndirectDockWidgetArea : public QMainWindow {
Q_OBJECT
public:
IndirectDockWidgetArea(QWidget *parent = nullptr);
virtual ~IndirectDockWidgetArea(){};
std::unique_ptr<Ui::IndirectDockWidgetArea> m_uiForm;
IndirectFitPropertyBrowser *m_fitPropertyBrowser;
IndirectFitDataView *m_fitDataView;
IndirectFitPlotView *m_fitPlotView;
};
} // namespace IDA
} // namespace CustomInterfaces
} // namespace MantidQt
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IndirectDockWidgetArea</class>
<widget class="QMainWindow" name="IndirectDockWidgetArea">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<height>443</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="MantidQt::CustomInterfaces::IDA::IndirectFitDataView" name="fitDataView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>MantidQt::CustomInterfaces::IDA::IndirectFitDataView</class>
<extends>QWidget</extends>
<header>IndirectFitDataView.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -178,9 +178,6 @@ void IndirectFitAnalysisTab::setFitPropertyBrowser(
IndirectFitPropertyBrowser *browser) {
browser->init();
m_fitPropertyBrowser = browser;
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
m_fitPropertyBrowser->setFeatures(QDockWidget::NoDockWidgetFeatures);
#endif
}
void IndirectFitAnalysisTab::loadSettings(const QSettings &settings) {
......
......@@ -83,6 +83,7 @@ protected:
void setEditResultVisible(bool visible);
std::unique_ptr<IndirectFitDataPresenter> m_dataPresenter;
std::unique_ptr<IndirectFitPlotPresenter> m_plotPresenter;
IndirectFitPropertyBrowser *m_fitPropertyBrowser{nullptr};
signals:
void functionChanged();
......@@ -160,7 +161,6 @@ private:
std::unique_ptr<IndirectFittingModel> m_fittingModel;
std::unique_ptr<IndirectSpectrumSelectionPresenter> m_spectrumPresenter;
std::unique_ptr<IndirectFitOutputOptionsPresenter> m_outOptionsPresenter;
IndirectFitPropertyBrowser *m_fitPropertyBrowser{nullptr};
Mantid::API::IAlgorithm_sptr m_fittingAlgorithm;
TableDatasetIndex m_currentTableDatasetIndex;
WorkspaceIndex m_singleFitWorkspaceIndex;
......
......@@ -23,9 +23,16 @@ namespace IDA {
IndirectFitDataView::IndirectFitDataView(QWidget *parent)
: IIndirectFitDataView(parent), m_dataForm(new Ui::IndirectFitDataForm) {
m_dataForm->setupUi(this);
cbParameterType = m_dataForm->cbParameterType;
cbParameter = m_dataForm->cbParameter;
lbParameter = m_dataForm->lbParameter;
lbParameterType = m_dataForm->lbParameterType;
cbParameterType->hide();
cbParameter->hide();
lbParameter->hide();
lbParameterType->hide();
m_dataForm->dsResolution->hide();
m_dataForm->lbResolution->hide();
m_dataForm->wgtStartEnd->hide();
m_dataForm->dsbStartX->setRange(-1e100, 1e100);
m_dataForm->dsbEndX->setRange(-1e100, 1e100);
......@@ -195,10 +202,6 @@ void IndirectFitDataView::emitViewSelected(int index) {
emit multipleDataViewSelected();
}
void IndirectFitDataView::setStartAndEndHidden(bool hidden) {
m_dataForm->wgtStartEnd->setHidden(hidden);
}
} // namespace IDA
} // namespace CustomInterfaces
} // namespace MantidQt
......@@ -29,7 +29,6 @@ public:
virtual bool isMultipleDataTabSelected() const override;
bool isResolutionHidden() const override;
void setResolutionHidden(bool hide) override;
void setStartAndEndHidden(bool hidden) override;
void disableMultipleDataTab() override;
virtual std::string getSelectedSample() const override;
......@@ -52,6 +51,10 @@ public:
UserInputValidator &validate(UserInputValidator &validator) override;
void setXRange(std::pair<double, double> const &range) override;
QComboBox *cbParameterType;
QComboBox *cbParameter;
QLabel *lbParameter;
QLabel *lbParameterType;
public slots:
void displayWarning(const std::string &warning) override;
......
......@@ -7,11 +7,11 @@
<x>0</x>
<y>0</y>
<width>617</width>
<height>313</height>
<height>112</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
......@@ -43,7 +43,7 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="0" column="1" colspan="2">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsSample" native="true">
<property name="autoLoad" stdset="0">
<bool>true</bool>
......@@ -56,14 +56,27 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QLabel" name="lbResolution">
<property name="text">
<string>Resolution</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="1" column="1" colspan="2">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsResolution" native="true">
<property name="autoLoad" stdset="0">