From 374617a00b4e5b3061cb10fe116b5c33e32c106d Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 16 Mar 2015 16:27:23 +0000 Subject: [PATCH] Refactoring and add remaining UI options Refs #10903 --- .../MantidQt/CustomInterfaces/CMakeLists.txt | 8 +- .../Indirect/AbsCorr.h | 34 --- .../Indirect/AbsorptionCorrections.h | 34 +++ .../{AbsCorr.ui => AbsorptionCorrections.ui} | 207 ++++++++++++- .../Indirect/IndirectDataAnalysis.h | 3 +- .../Indirect/IndirectDataAnalysis.ui | 286 +++++++++--------- ...{AbsCorr.cpp => AbsorptionCorrections.cpp} | 19 +- .../src/Indirect/IndirectDataAnalysis.cpp | 2 + 8 files changed, 393 insertions(+), 200 deletions(-) delete mode 100644 Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h create mode 100644 Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h rename Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/{AbsCorr.ui => AbsorptionCorrections.ui} (58%) rename Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/{AbsCorr.cpp => AbsorptionCorrections.cpp} (55%) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt b/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt index b49be8467c42..1526855475ab 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt +++ b/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt @@ -2,7 +2,7 @@ set ( SRC_FILES src/DataComparison.cpp src/DirectConvertToEnergy.cpp src/Homer.cpp - src/Indirect/AbsCorr.cpp + src/Indirect/AbsorptionCorrections.cpp src/Indirect/ApplyCorr.cpp src/Indirect/CalcCorr.cpp src/Indirect/ConvFit.cpp @@ -85,7 +85,7 @@ set ( INC_FILES inc/MantidQtCustomInterfaces/DllConfig.h inc/MantidQtCustomInterfaces/Homer.h inc/MantidQtCustomInterfaces/Indirect/IDATab.h - inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h + inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h inc/MantidQtCustomInterfaces/Indirect/ApplyCorr.h inc/MantidQtCustomInterfaces/Indirect/CalcCorr.h inc/MantidQtCustomInterfaces/Indirect/ConvFit.h @@ -175,7 +175,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h inc/MantidQtCustomInterfaces/DirectConvertToEnergy.h inc/MantidQtCustomInterfaces/Homer.h inc/MantidQtCustomInterfaces/Indirect/IDATab.h - inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h + inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h inc/MantidQtCustomInterfaces/Indirect/ApplyCorr.h inc/MantidQtCustomInterfaces/Indirect/CalcCorr.h inc/MantidQtCustomInterfaces/Indirect/ConvFit.h @@ -244,7 +244,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h set ( UI_FILES inc/MantidQtCustomInterfaces/AddWorkspace.ui inc/MantidQtCustomInterfaces/DataComparison.ui inc/MantidQtCustomInterfaces/DirectConvertToEnergy.ui - inc/MantidQtCustomInterfaces/Indirect/AbsCorr.ui + inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.ui inc/MantidQtCustomInterfaces/Indirect/ApplyCorr.ui inc/MantidQtCustomInterfaces/Indirect/CalcCorr.ui inc/MantidQtCustomInterfaces/Indirect/ConvFit.ui diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h deleted file mode 100644 index 8c5cef8610d4..000000000000 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef MANTIDQTCUSTOMINTERFACESIDA_ABSCORR_H_ -#define MANTIDQTCUSTOMINTERFACESIDA_ABSCORR_H_ - -#include "ui_AbsCorr.h" -#include "IDATab.h" - -namespace MantidQt -{ -namespace CustomInterfaces -{ -namespace IDA -{ - class DLLExport AbsCorr : public IDATab - { - Q_OBJECT - - public: - CalcCorr(QWidget * parent = 0); - - private: - virtual void setup(); - virtual void run(); - virtual bool validate(); - virtual void loadSettings(const QSettings & settings); - - private: - Ui::CalcCorr m_uiForm; - - }; -} // namespace IDA -} // namespace CustomInterfaces -} // namespace MantidQt - -#endif /* MANTIDQTCUSTOMINTERFACESIDA_ABSCORR_H_ */ diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h new file mode 100644 index 000000000000..d1ead78f082e --- /dev/null +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h @@ -0,0 +1,34 @@ +#ifndef MANTIDQTCUSTOMINTERFACESIDA_ABSORPTIONCORRECTIONS_H_ +#define MANTIDQTCUSTOMINTERFACESIDA_ABSORPTIONCORRECTIONS_H_ + +#include "ui_AbsorptionCorrections.h" +#include "IDATab.h" + +namespace MantidQt +{ +namespace CustomInterfaces +{ +namespace IDA +{ + class DLLExport AbsorptionCorrections : public IDATab + { + Q_OBJECT + + public: + AbsorptionCorrections(QWidget * parent = 0); + + private: + virtual void setup(); + virtual void run(); + virtual bool validate(); + virtual void loadSettings(const QSettings & settings); + + private: + Ui::AbsorptionCorrections m_uiForm; + + }; +} // namespace IDA +} // namespace CustomInterfaces +} // namespace MantidQt + +#endif /* MANTIDQTCUSTOMINTERFACESIDA_ABSORPTIONCORRECTIONS_H_ */ diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.ui similarity index 58% rename from Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.ui rename to Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.ui index 95cce14509bf..3351dcc1e199 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsCorr.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.ui @@ -1,19 +1,19 @@ - AbsCorr - + AbsorptionCorrections + 0 0 594 - 456 + 697 - Form + Absoprtion Corrections - + @@ -140,9 +140,180 @@ - - - + + 0 + + + + + 0 + + + + + Sample Height: + + + + + + + Sample Width: + + + + + + + Sample Thickness: + + + + + + + Element Size: + + + + + + + cm + + + 0.100000000000000 + + + + + + + cm + + + 0.100000000000000 + + + + + + + cm + + + 0.100000000000000 + + + + + + + 0.100000000000000 + + + + + + + + + 0 + + + + + Can Inner Radius: + + + + + + + Sample Inner Radius: + + + + + + + Sample Outer Radius: + + + + + + + Can Outer Radius: + + + + + + + cm + + + 0.100000000000000 + + + + + + + cm + + + 0.100000000000000 + + + + + + + cm + + + 0.100000000000000 + + + + + + + cm + + + 0.100000000000000 + + + + + + + + + 0 + + + + + Sample Radius: + + + + + + + cm + + + 0.100000000000000 + + + + + @@ -164,7 +335,7 @@ - A^-3 + A^-3 0.100000000000000 @@ -182,7 +353,14 @@ - + + + + 0 + 0 + + + @@ -197,7 +375,14 @@ - + + + + 0 + 0 + + + diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.h index 79115a03c214..5ddb491ba822 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.h @@ -31,7 +31,8 @@ namespace IDA FURY_FIT, CONV_FIT, CALC_CORR, - APPLY_CORR + APPLY_CORR, + ABSORPTION_CORRECTIONS }; // Number of decimal places in property browsers. diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.ui index bd992c015b9e..d5dee6ffa715 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectDataAnalysis.ui @@ -14,153 +14,157 @@ Indirect Data Analysis - - - - - true - - - QTabWidget::Rounded - - - 0 - - - - Elwin - - - - - MSD Fit - - - - - Fury - - - - - FuryFit - - - - - ConvFit - - - - - Calculate Corrections - - - - - Apply Corrections - - - - - - - - - - true - - - - 0 - 0 - - - - Open interface help page in your web browser. - - - - 25 - 25 - - - - ? - + + + + + true + + + QTabWidget::Rounded + + + 0 + + + + Elwin + + + + + MSD Fit + + + + + Fury + - - - - - true - - - - 0 - 0 - - - - Export a Python script for the algorithms run on this tab. - - - - 30 - 25 - - - - Py - + + + FuryFit + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Run - + + + ConvFit + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Manage Directories - + + + Calculate Corrections + - - - - + + + Apply Corrections + + + + + Absorption Corrections + + + + + + + + + + true + + + + 0 + 0 + + + + + 25 + 25 + + + + Open interface help page in your web browser. + + + ? + + + + + + + true + + + + 0 + 0 + + + + + 30 + 25 + + + + Export a Python script for the algorithms run on this tab. + + + Py + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Run + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Manage Directories + + + + + + - twIDATabs pbHelp diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsCorr.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsorptionCorrections.cpp similarity index 55% rename from Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsCorr.cpp rename to Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsorptionCorrections.cpp index fab7cb62f166..7aa7002dc023 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsCorr.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/AbsorptionCorrections.cpp @@ -1,9 +1,9 @@ -#include "MantidQtCustomInterfaces/Indirect/AbsCorr.h" +#include "MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h" #include "MantidQtCustomInterfaces/UserInputValidator.h" namespace { - Mantid::Kernel::Logger g_log("AbsCorr"); + Mantid::Kernel::Logger g_log("AbsorptionCorrections"); } namespace MantidQt @@ -12,18 +12,18 @@ namespace CustomInterfaces { namespace IDA { - AbsCorr::AbsCorr(QWidget * parent) : - IDATab(parent), m_dblVal(NULL), m_posDblVal(NULL) + AbsorptionCorrections::AbsorptionCorrections(QWidget * parent) : + IDATab(parent) { m_uiForm.setupUi(parent); } - void AbsCorr::setup() + void AbsorptionCorrections::setup() { //TODO } - void AbsCorr::run() + void AbsorptionCorrections::run() { //TODO @@ -31,7 +31,7 @@ namespace IDA m_pythonExportWsName = ""; } - bool AbsCorr::validate() + bool AbsorptionCorrections::validate() { UserInputValidator uiv; @@ -43,11 +43,12 @@ namespace IDA showMessageBox(error); } - return error.isAllInputValid(); + return uiv.isAllInputValid(); } - void AbsCorr::loadSettings(const QSettings & settings) + void AbsorptionCorrections::loadSettings(const QSettings & settings) { + UNUSED_ARG(settings); //TODO } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp index fccc4b5d9b65..98c151995772 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp @@ -11,6 +11,7 @@ #include "MantidQtCustomInterfaces/Indirect/ConvFit.h" #include "MantidQtCustomInterfaces/Indirect/CalcCorr.h" #include "MantidQtCustomInterfaces/Indirect/ApplyCorr.h" +#include "MantidQtCustomInterfaces/Indirect/AbsorptionCorrections.h" #include "MantidQtAPI/HelpWindow.h" #include "MantidQtAPI/ManageUserDirectories.h" @@ -51,6 +52,7 @@ namespace IDA m_tabs.insert(std::make_pair(CONV_FIT, new ConvFit(m_uiForm.twIDATabs->widget(CONV_FIT)))); m_tabs.insert(std::make_pair(CALC_CORR, new CalcCorr(m_uiForm.twIDATabs->widget(CALC_CORR)))); m_tabs.insert(std::make_pair(APPLY_CORR, new ApplyCorr(m_uiForm.twIDATabs->widget(APPLY_CORR)))); + m_tabs.insert(std::make_pair(ABSORPTION_CORRECTIONS, new AbsorptionCorrections(m_uiForm.twIDATabs->widget(ABSORPTION_CORRECTIONS)))); } /**