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 ...@@ -24,6 +24,7 @@ Improvements
frequencies and intensities. 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. - :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. - 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 Bug Fixes
######### #########
......
...@@ -30,6 +30,7 @@ set( ...@@ -30,6 +30,7 @@ set(
IndirectDataTablePresenter.cpp IndirectDataTablePresenter.cpp
IndirectDataValidationHelper.cpp IndirectDataValidationHelper.cpp
IndirectDiffractionReduction.cpp IndirectDiffractionReduction.cpp
IndirectDockWidgetArea.cpp
IndirectEditResultsDialog.cpp IndirectEditResultsDialog.cpp
IndirectFitAnalysisTab.cpp IndirectFitAnalysisTab.cpp
IndirectFitData.cpp IndirectFitData.cpp
...@@ -155,6 +156,7 @@ set( ...@@ -155,6 +156,7 @@ set(
IndirectDataReduction.h IndirectDataReduction.h
IndirectDataReductionTab.h IndirectDataReductionTab.h
IndirectDataTablePresenter.h IndirectDataTablePresenter.h
IndirectDockWidgetArea.h
IndirectDiffractionReduction.h IndirectDiffractionReduction.h
IndirectEditResultsDialog.h IndirectEditResultsDialog.h
IndirectFitAnalysisTab.h IndirectFitAnalysisTab.h
...@@ -216,7 +218,6 @@ set( ...@@ -216,7 +218,6 @@ set(
ApplyAbsorptionCorrections.ui ApplyAbsorptionCorrections.ui
CalculatePaalmanPings.ui CalculatePaalmanPings.ui
ContainerSubtraction.ui ContainerSubtraction.ui
ConvFit.ui
ConvFitAddWorkspaceDialog.ui ConvFitAddWorkspaceDialog.ui
DensityOfStates.ui DensityOfStates.ui
Elwin.ui Elwin.ui
...@@ -227,10 +228,12 @@ set( ...@@ -227,10 +228,12 @@ set(
IndirectDataAnalysis.ui IndirectDataAnalysis.ui
IndirectDataReduction.ui IndirectDataReduction.ui
IndirectDiffractionReduction.ui IndirectDiffractionReduction.ui
IndirectDockWidgetArea.ui
IndirectEditResultsDialog.ui IndirectEditResultsDialog.ui
IndirectFitDataView.ui IndirectFitDataView.ui
IndirectFitOutputOptions.ui IndirectFitOutputOptions.ui
IndirectFitPreviewPlot.ui IndirectFitPreviewPlot.ui
IndirectFitTab.ui
IndirectInterfaceSettings.ui IndirectInterfaceSettings.ui
IndirectInstrumentConfig.ui IndirectInstrumentConfig.ui
IndirectLoadILL.ui IndirectLoadILL.ui
...@@ -247,10 +250,7 @@ set( ...@@ -247,10 +250,7 @@ set(
IndirectTransmission.ui IndirectTransmission.ui
IndirectTransmissionCalc.ui IndirectTransmissionCalc.ui
Iqt.ui Iqt.ui
IqtFit.ui
JumpFit.ui
JumpFitAddWorkspaceDialog.ui JumpFitAddWorkspaceDialog.ui
MSDFit.ui
Quasi.ui Quasi.ui
ResNorm.ui ResNorm.ui
Stretch.ui Stretch.ui
...@@ -332,6 +332,7 @@ set( ...@@ -332,6 +332,7 @@ set(
IndirectFitData.cpp IndirectFitData.cpp
IndirectFitDataPresenter.cpp IndirectFitDataPresenter.cpp
IndirectFitDataView.cpp IndirectFitDataView.cpp
IndirectDockWidgetArea.cpp
IndirectFitOutputOptionsModel.cpp IndirectFitOutputOptionsModel.cpp
IndirectFitOutputOptionsPresenter.cpp IndirectFitOutputOptionsPresenter.cpp
IndirectFitOutputOptionsView.cpp IndirectFitOutputOptionsView.cpp
...@@ -426,6 +427,7 @@ set( ...@@ -426,6 +427,7 @@ set(
IndirectDataReductionTab.h IndirectDataReductionTab.h
IndirectDataTablePresenter.h IndirectDataTablePresenter.h
IndirectDiffractionReduction.h IndirectDiffractionReduction.h
IndirectDockWidgetArea.h
IndirectEditResultsDialog.h IndirectEditResultsDialog.h
IndirectFitAnalysisTab.h IndirectFitAnalysisTab.h
IndirectFitDataPresenter.h IndirectFitDataPresenter.h
...@@ -505,7 +507,6 @@ set( ...@@ -505,7 +507,6 @@ set(
ApplyAbsorptionCorrections.ui ApplyAbsorptionCorrections.ui
CalculatePaalmanPings.ui CalculatePaalmanPings.ui
ContainerSubtraction.ui ContainerSubtraction.ui
ConvFit.ui
ConvFitAddWorkspaceDialog.ui ConvFitAddWorkspaceDialog.ui
DensityOfStates.ui DensityOfStates.ui
Elwin.ui Elwin.ui
...@@ -519,10 +520,12 @@ set( ...@@ -519,10 +520,12 @@ set(
IndirectDataAnalysis.ui IndirectDataAnalysis.ui
IndirectDataReduction.ui IndirectDataReduction.ui
IndirectDiffractionReduction.ui IndirectDiffractionReduction.ui
IndirectDockWidgetArea.ui
IndirectEditResultsDialog.ui IndirectEditResultsDialog.ui
IndirectFitDataView.ui IndirectFitDataView.ui
IndirectFitOutputOptions.ui IndirectFitOutputOptions.ui
IndirectFitPreviewPlot.ui IndirectFitPreviewPlot.ui
IndirectFitTab.ui
IndirectInstrumentConfig.ui IndirectInstrumentConfig.ui
IndirectInterfaceSettings.ui IndirectInterfaceSettings.ui
IndirectLoadILL.ui IndirectLoadILL.ui
...@@ -539,10 +542,7 @@ set( ...@@ -539,10 +542,7 @@ set(
IndirectTransmission.ui IndirectTransmission.ui
IndirectTransmissionCalc.ui IndirectTransmissionCalc.ui
Iqt.ui Iqt.ui
IqtFit.ui
JumpFit.ui
JumpFitAddWorkspaceDialog.ui JumpFitAddWorkspaceDialog.ui
MSDFit.ui
Quasi.ui Quasi.ui
ResNorm.ui ResNorm.ui
Stretch.ui Stretch.ui
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "ConvFit.h" #include "ConvFit.h"
#include "ConvFitDataPresenter.h" #include "ConvFitDataPresenter.h"
#include "IndirectFitPlotView.h"
#include "IndirectFunctionBrowser/ConvTemplateBrowser.h" #include "IndirectFunctionBrowser/ConvTemplateBrowser.h"
#include "MantidQtWidgets/Common/UserInputValidator.h" #include "MantidQtWidgets/Common/UserInputValidator.h"
...@@ -36,17 +37,17 @@ namespace IDA { ...@@ -36,17 +37,17 @@ namespace IDA {
ConvFit::ConvFit(QWidget *parent) ConvFit::ConvFit(QWidget *parent)
: IndirectFitAnalysisTab(new ConvFitModel, parent), : IndirectFitAnalysisTab(new ConvFitModel, parent),
m_uiForm(new Ui::ConvFit) { m_uiForm(new Ui::IndirectFitTab) {
m_uiForm->setupUi(parent); m_uiForm->setupUi(parent);
m_convFittingModel = dynamic_cast<ConvFitModel *>(fittingModel()); m_convFittingModel = dynamic_cast<ConvFitModel *>(fittingModel());
setPlotView(m_uiForm->pvFitPlotView); setPlotView(m_uiForm->dockArea->m_fitPlotView);
setSpectrumSelectionView(m_uiForm->svSpectrumView); setSpectrumSelectionView(m_uiForm->svSpectrumView);
setOutputOptionsView(m_uiForm->ovOutputOptionsView); setOutputOptionsView(m_uiForm->ovOutputOptionsView);
m_uiForm->fitPropertyBrowser->setFunctionTemplateBrowser( m_uiForm->dockArea->m_fitPropertyBrowser->setFunctionTemplateBrowser(
new ConvTemplateBrowser); new ConvTemplateBrowser);
setFitPropertyBrowser(m_uiForm->fitPropertyBrowser); setFitPropertyBrowser(m_uiForm->dockArea->m_fitPropertyBrowser);
auto dataPresenter = std::make_unique<ConvFitDataPresenter>( auto dataPresenter = std::make_unique<ConvFitDataPresenter>(
m_convFittingModel, m_uiForm->fitDataView); m_convFittingModel, m_uiForm->dockArea->m_fitDataView);
connect( connect(
dataPresenter.get(), dataPresenter.get(),
SIGNAL( SIGNAL(
...@@ -56,7 +57,6 @@ ConvFit::ConvFit(QWidget *parent) ...@@ -56,7 +57,6 @@ ConvFit::ConvFit(QWidget *parent)
setFitDataPresenter(std::move(dataPresenter)); setFitDataPresenter(std::move(dataPresenter));
setEditResultVisible(true); setEditResultVisible(true);
setStartAndEndHidden(false);
} }
void ConvFit::setupFitTab() { void ConvFit::setupFitTab() {
...@@ -116,14 +116,10 @@ void ConvFit::setModelResolution(const std::string &resolutionName, ...@@ -116,14 +116,10 @@ void ConvFit::setModelResolution(const std::string &resolutionName,
TableDatasetIndex index) { TableDatasetIndex index) {
m_convFittingModel->setResolution(resolutionName, index); m_convFittingModel->setResolution(resolutionName, index);
auto fitResolutions = m_convFittingModel->getResolutionsForFit(); auto fitResolutions = m_convFittingModel->getResolutionsForFit();
m_uiForm->fitPropertyBrowser->setModelResolution(fitResolutions); m_fitPropertyBrowser->setModelResolution(fitResolutions);
setModelFitFunction(); setModelFitFunction();
} }
void ConvFit::setStartAndEndHidden(bool hidden) {
m_uiForm->fitDataView->setStartAndEndHidden(hidden);
}
void ConvFit::fitFunctionChanged() { void ConvFit::fitFunctionChanged() {
m_convFittingModel->setFitTypeString(fitTypeString()); m_convFittingModel->setFitTypeString(fitTypeString());
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "MantidAPI/CompositeFunction.h" #include "MantidAPI/CompositeFunction.h"
#include "MantidAPI/MatrixWorkspace_fwd.h" #include "MantidAPI/MatrixWorkspace_fwd.h"
#include "ui_ConvFit.h" #include "ui_IndirectFitTab.h"
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
...@@ -43,11 +43,10 @@ private: ...@@ -43,11 +43,10 @@ private:
void setupFitTab() override; void setupFitTab() override;
void setupFit(Mantid::API::IAlgorithm_sptr fitAlgorithm) override; void setupFit(Mantid::API::IAlgorithm_sptr fitAlgorithm) override;
EstimationDataSelector getEstimationDataSelector() const override; EstimationDataSelector getEstimationDataSelector() const override;
void setStartAndEndHidden(bool hidden);
std::string fitTypeString() const; std::string fitTypeString() const;
std::unique_ptr<Ui::ConvFit> m_uiForm; std::unique_ptr<Ui::IndirectFitTab> m_uiForm;
// ShortHand Naming for fit functions // ShortHand Naming for fit functions
std::unordered_map<std::string, std::string> m_fitStrings; std::unordered_map<std::string, std::string> m_fitStrings;
ConvFitModel *m_convFittingModel; 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: ...@@ -28,7 +28,6 @@ public:
virtual bool isMultipleDataTabSelected() const = 0; virtual bool isMultipleDataTabSelected() const = 0;
virtual bool isResolutionHidden() const = 0; virtual bool isResolutionHidden() const = 0;
virtual void setResolutionHidden(bool hide) = 0; virtual void setResolutionHidden(bool hide) = 0;
virtual void setStartAndEndHidden(bool hidden) = 0;
virtual void disableMultipleDataTab() = 0; virtual void disableMultipleDataTab() = 0;
virtual std::string getSelectedSample() const = 0; virtual std::string getSelectedSample() const = 0;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>799</width> <width>1100</width>
<height>764</height> <height>1100</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <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( ...@@ -178,9 +178,6 @@ void IndirectFitAnalysisTab::setFitPropertyBrowser(
IndirectFitPropertyBrowser *browser) { IndirectFitPropertyBrowser *browser) {
browser->init(); browser->init();
m_fitPropertyBrowser = browser; m_fitPropertyBrowser = browser;
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
m_fitPropertyBrowser->setFeatures(QDockWidget::NoDockWidgetFeatures);
#endif