diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Symmetrise.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Symmetrise.py index 722432d7e584..a7874877fb8c 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Symmetrise.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/Symmetrise.py @@ -13,10 +13,10 @@ class Symmetrise(PythonAlgorithm): def category(self): return "Workflow\\MIDAS;PythonAlgorithms" - def PyInit(self): - self.setOptionalMessage("Takes an asymmetric S(Q,w) and makes it symmetric") - self.setWikiSummary("Takes an asymmetric S(Q,w) and makes it symmetric") + def summary(self): + return "Takes an asymmetric S(Q,w) and makes it symmetric" + def PyInit(self): self.declareProperty(WorkspaceProperty("Sample", "", Direction.Input), doc='Sample to run with') self.declareProperty('XCut', 0.0, doc='X cut off value') diff --git a/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt b/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt index 8bfa3c243c24..8907caa89dc3 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt +++ b/Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt @@ -4,7 +4,7 @@ set ( SRC_FILES src/ConvFit.cpp src/CreateMDWorkspace.cpp src/CreateMDWorkspaceAlgDialog.cpp - src/DirectConvertToEnergy.cpp + src/DirectConvertToEnergy.cpp src/Elwin.cpp src/EventNexusFileMemento.cpp src/Fury.cpp @@ -13,12 +13,12 @@ set ( SRC_FILES src/IDATab.cpp src/IndirectBayes.cpp src/IndirectBayesTab.cpp - src/IndirectCalibration.cpp - src/IndirectConvertToEnergy.cpp + src/IndirectCalibration.cpp + src/IndirectConvertToEnergy.cpp src/IndirectDataAnalysis.cpp - src/IndirectDataReduction.cpp - src/IndirectDataReductionTab.cpp - src/IndirectDiagnostics.cpp + src/IndirectDataReduction.cpp + src/IndirectDataReductionTab.cpp + src/IndirectDiagnostics.cpp src/IndirectDiffractionReduction.cpp src/IndirectLoadAscii.cpp src/IndirectLoadAsciiTab.cpp @@ -27,8 +27,9 @@ set ( SRC_FILES src/IndirectNeutron.cpp src/IndirectSimulation.cpp src/IndirectSimulationTab.cpp - src/IndirectSqw.cpp - src/IndirectTransmission.cpp + src/IndirectSqw.cpp + src/IndirectSymmetrise.cpp + src/IndirectTransmission.cpp src/JumpFit.cpp src/MSDFit.cpp src/MantidEV.cpp @@ -75,7 +76,7 @@ set ( INC_FILES inc/MantidQtCustomInterfaces/ConvFit.h inc/MantidQtCustomInterfaces/CreateMDWorkspace.h inc/MantidQtCustomInterfaces/CreateMDWorkspaceAlgDialog.h - inc/MantidQtCustomInterfaces/DirectConvertToEnergy.h + inc/MantidQtCustomInterfaces/DirectConvertToEnergy.h inc/MantidQtCustomInterfaces/DllConfig.h inc/MantidQtCustomInterfaces/Elwin.h inc/MantidQtCustomInterfaces/EventNexusFileMemento.h @@ -85,11 +86,11 @@ set ( INC_FILES inc/MantidQtCustomInterfaces/IDATab.h inc/MantidQtCustomInterfaces/IndirectBayes.h inc/MantidQtCustomInterfaces/IndirectBayesTab.h - inc/MantidQtCustomInterfaces/IndirectCalibration.h - inc/MantidQtCustomInterfaces/IndirectConvertToEnergy.h + inc/MantidQtCustomInterfaces/IndirectCalibration.h + inc/MantidQtCustomInterfaces/IndirectConvertToEnergy.h inc/MantidQtCustomInterfaces/IndirectDataAnalysis.h - inc/MantidQtCustomInterfaces/IndirectDataReduction.h - inc/MantidQtCustomInterfaces/IndirectDataReductionTab.h + inc/MantidQtCustomInterfaces/IndirectDataReduction.h + inc/MantidQtCustomInterfaces/IndirectDataReductionTab.h inc/MantidQtCustomInterfaces/IndirectDiagnostics.h inc/MantidQtCustomInterfaces/IndirectDiffractionReduction.h inc/MantidQtCustomInterfaces/IndirectLoadAscii.h @@ -100,7 +101,8 @@ set ( INC_FILES inc/MantidQtCustomInterfaces/IndirectSimulation.h inc/MantidQtCustomInterfaces/IndirectSimulationTab.h inc/MantidQtCustomInterfaces/IndirectSqw.h - inc/MantidQtCustomInterfaces/IndirectTransmission.h + inc/MantidQtCustomInterfaces/IndirectSymmetrise.h + inc/MantidQtCustomInterfaces/IndirectTransmission.h inc/MantidQtCustomInterfaces/JumpFit.h inc/MantidQtCustomInterfaces/MSDFit.h inc/MantidQtCustomInterfaces/MantidEV.h @@ -175,6 +177,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h inc/MantidQtCustomInterfaces/IndirectSimulation.h inc/MantidQtCustomInterfaces/IndirectSimulationTab.h inc/MantidQtCustomInterfaces/IndirectSqw.h + inc/MantidQtCustomInterfaces/IndirectSymmetrise.h inc/MantidQtCustomInterfaces/IndirectTransmission.h inc/MantidQtCustomInterfaces/JumpFit.h inc/MantidQtCustomInterfaces/MSDFit.h diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.h index 3806e24b16f9..53514feebbbb 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.h @@ -113,6 +113,7 @@ namespace MantidQt IndirectDataReductionTab* m_tab_calibration; IndirectDataReductionTab* m_tab_trans; IndirectDataReductionTab* m_tab_moments; + IndirectDataReductionTab* m_tab_symmetrise; Poco::NObserver m_changeObserver; ///< Poco observer for changes in user directory settings QString m_dataDir; ///< default data search directory diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui index 36818279961e..f747e684f5e0 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui @@ -6,7 +6,7 @@ 0 0 - 621 + 672 761 @@ -1513,16 +1513,12 @@ Later steps in the process (saving, renaming) will not be done. Time Slice - + - - - - - - - - + + + + @@ -1739,6 +1735,128 @@ Later steps in the process (saving, renaming) will not be done. + + + Symmetrise + + + + + + Input + + + + + + + 0 + 0 + + + + false + + + + + + + + + + Symmetrise + + + + 6 + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Output + + + + 6 + + + + + true + + + Verbose + + + + + + + Qt::Horizontal + + + + 165 + 20 + + + + + + + + Plot Result + + + + + + + Qt::Horizontal + + + + 164 + 20 + + + + + + + + Save Result + + + + + + + + S(Q, w) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectSymmetrise.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectSymmetrise.h new file mode 100644 index 000000000000..8ca2db7e1540 --- /dev/null +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectSymmetrise.h @@ -0,0 +1,76 @@ +#ifndef MANTIDQTCUSTOMINTERFACES_INDIRECTSYMMETRISE_H_ +#define MANTIDQTCUSTOMINTERFACES_INDIRECTSYMMETRISE_H_ + +#include "MantidQtCustomInterfaces/IndirectDataReductionTab.h" + +#include "MantidAPI/MatrixWorkspace.h" +#include "MantidKernel/System.h" + +// Suppress a warning coming out of code that isn't ours +#if defined(__INTEL_COMPILER) + #pragma warning disable 1125 +#elif defined(__GNUC__) + #if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 6 ) + #pragma GCC diagnostic push + #endif + #pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif +#include +#if defined(__INTEL_COMPILER) + #pragma warning enable 1125 +#elif defined(__GNUC__) + #if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 6 ) + #pragma GCC diagnostic pop + #endif +#endif + +namespace MantidQt +{ +namespace CustomInterfaces +{ + /** IndirectSymmetrise + + @author Dan Nixon + @date 23/07/2014 + + Copyright © 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory + + 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 . + + File change history is stored at: + Code Documentation is available at: + */ + class DLLExport IndirectSymmetrise : public IndirectDataReductionTab + { + Q_OBJECT + + public: + IndirectSymmetrise(Ui::IndirectDataReduction& uiForm, QWidget * parent = 0); + virtual ~IndirectSymmetrise(); + + virtual void setup(); + virtual void run(); + virtual bool validate(); + + private slots: + void plotRawInput(); + void updateRangeSelector(QtProperty *prop, double value); + + }; +} // namespace CustomInterfaces +} // namespace Mantid + +#endif //MANTIDQTCUSTOMINTERFACES_INDIRECTSYMMETRISE_H_ diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp index 4f2fe9195e69..bcbd8721f4a3 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp @@ -13,6 +13,7 @@ #include "MantidQtCustomInterfaces/IndirectDiagnostics.h" #include "MantidQtCustomInterfaces/IndirectMoments.h" #include "MantidQtCustomInterfaces/IndirectSqw.h" +#include "MantidQtCustomInterfaces/IndirectSymmetrise.h" #include "MantidQtCustomInterfaces/IndirectTransmission.h" #include @@ -105,6 +106,8 @@ void IndirectDataReduction::runClicked() m_tab_diagnostics->runTab(); else if ( tabName == "S(Q, w)" ) m_tab_sqw->runTab(); + else if ( tabName == "Symmetrise" ) + m_tab_symmetrise->runTab(); else if (tabName == "Transmission") m_tab_trans->runTab(); else if(tabName == "Moments") @@ -124,6 +127,7 @@ void IndirectDataReduction::initLayout() m_tab_calibration = new IndirectCalibration(m_uiForm, this); m_tab_trans = new IndirectTransmission(m_uiForm, this); m_tab_moments = new IndirectMoments(m_uiForm, this); + m_tab_symmetrise = new IndirectSymmetrise(m_uiForm, this); // Assume we get a incompatiable instrument to start with m_uiForm.pbRun->setEnabled(false); @@ -133,14 +137,14 @@ void IndirectDataReduction::initLayout() // signal/slot connections to respond to changes in instrument selection combo boxes connect(m_uiForm.cbInst, SIGNAL(instrumentSelectionChanged(const QString&)), this, SLOT(userSelectInstrument(const QString&))); - // connect "?" (Help) Button + // Connect "?" (Help) Button connect(m_uiForm.pbHelp, SIGNAL(clicked()), this, SLOT(helpClicked())); - // connect the "Run" button + // Connect the "Run" button connect(m_uiForm.pbRun, SIGNAL(clicked()), this, SLOT(runClicked())); - // connect the "Manage User Directories" Button + // Connect the "Manage User Directories" Button connect(m_uiForm.pbManageDirectories, SIGNAL(clicked()), this, SLOT(openDirectoryDialog())); - // ignals for tabs running Python + // Signals for tabs running Python connect(m_tab_convert_to_energy, SIGNAL(runAsPythonScript(const QString&, bool)), this, SIGNAL(runAsPythonScript(const QString&, bool))); connect(m_tab_sqw, SIGNAL(runAsPythonScript(const QString&, bool)), this, SIGNAL(runAsPythonScript(const QString&, bool))); connect(m_tab_calibration, SIGNAL(runAsPythonScript(const QString&, bool)), this, SIGNAL(runAsPythonScript(const QString&, bool))); @@ -148,13 +152,14 @@ void IndirectDataReduction::initLayout() connect(m_tab_trans, SIGNAL(runAsPythonScript(const QString&, bool)), this, SIGNAL(runAsPythonScript(const QString&, bool))); connect(m_tab_moments, SIGNAL(runAsPythonScript(const QString&, bool)), this, SIGNAL(runAsPythonScript(const QString&, bool))); - // ignals for tabs showing mesage boxes + // Signals for tabs showing mesage boxes connect(m_tab_convert_to_energy, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); connect(m_tab_sqw, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); connect(m_tab_calibration, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); connect(m_tab_diagnostics, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); connect(m_tab_trans, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); connect(m_tab_moments, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); + connect(m_tab_symmetrise, SIGNAL(showMessageBox(const QString&)), this, SLOT(showMessageBox(const QString&))); // Run any tab setup code m_tab_convert_to_energy->setupTab(); @@ -163,6 +168,7 @@ void IndirectDataReduction::initLayout() m_tab_calibration->setupTab(); m_tab_trans->setupTab(); m_tab_moments->setupTab(); + m_tab_symmetrise->setupTab(); } /** diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectSymmetrise.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectSymmetrise.cpp new file mode 100644 index 000000000000..99750711a15d --- /dev/null +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectSymmetrise.cpp @@ -0,0 +1,96 @@ +#include "MantidQtCustomInterfaces/IndirectSymmetrise.h" + +#include "MantidAPI/MatrixWorkspace.h" +#include "MantidKernel/Logger.h" +#include "MantidQtCustomInterfaces/UserInputValidator.h" + +#include + +namespace +{ + Mantid::Kernel::Logger g_log("IndirectSymmetrise"); +} + +namespace MantidQt +{ +namespace CustomInterfaces +{ + //---------------------------------------------------------------------------------------------- + /** Constructor + */ + IndirectSymmetrise::IndirectSymmetrise(Ui::IndirectDataReduction& uiForm, QWidget * parent) : + IndirectDataReductionTab(uiForm, parent) + { + // Property Tree + m_propTrees["SymmPropTree"] = new QtTreePropertyBrowser(); + m_uiForm.symm_properties->addWidget(m_propTrees["SymmPropTree"]); + + // Editor Factories + DoubleEditorFactory *doubleEditorFactory = new DoubleEditorFactory(); + m_propTrees["SymmPropTree"]->setFactoryForManager(m_dblManager, doubleEditorFactory); + + // Create Properties + m_properties["XCut"] = m_dblManager->addProperty("X Cut"); + /* m_dblManager->setMinimum(m_properties["XCut"], 0); */ + m_propTrees["SymmPropTree"]->addProperty(m_properties["XCut"]); + + // Raw plot + m_plots["SymmRawPlot"] = new QwtPlot(m_parentWidget); + m_curves["SymmRawPlot"] = new QwtPlotCurve(); + + m_rangeSelectors["SlicePeak"] = new MantidWidgets::RangeSelector(m_plots["SymmRawPlot"]); + m_rangeSelectors["SliceBackground"] = new MantidWidgets::RangeSelector(m_plots["SymmRawPlot"]); + + m_plots["SymmRawPlot"]->setAxisFont(QwtPlot::xBottom, parent->font()); + m_plots["SymmRawPlot"]->setAxisFont(QwtPlot::yLeft, parent->font()); + m_plots["SymmRawPlot"]->setCanvasBackground(Qt::white); + m_uiForm.symm_plot->addWidget(m_plots["SymmRawPlot"]); + + // Refresh the plot windows + /* m_plots["SymmRawPlot"]->replot(); */ + + // SIGNAL/SLOT CONNECTIONS + + /* // Update properties when a range selector is changed */ + /* connect(m_rangeSelectors["SlicePeak"], SIGNAL(minValueChanged(double)), this, SLOT(sliceMinChanged(double))); */ + /* connect(m_rangeSelectors["SlicePeak"], SIGNAL(maxValueChanged(double)), this, SLOT(sliceMaxChanged(double))); */ + /* connect(m_rangeSelectors["SliceBackground"], SIGNAL(minValueChanged(double)), this, SLOT(sliceMinChanged(double))); */ + /* connect(m_rangeSelectors["SliceBackground"], SIGNAL(maxValueChanged(double)), this, SLOT(sliceMaxChanged(double))); */ + /* // Update range selctors when a property is changed */ + /* connect(m_dblManager, SIGNAL(valueChanged(QtProperty*, double)), this, SLOT(sliceUpdateRS(QtProperty*, double))); */ + } + + //---------------------------------------------------------------------------------------------- + /** Destructor + */ + IndirectSymmetrise::~IndirectSymmetrise() + { + } + + void IndirectSymmetrise::setup() + { + } + + void IndirectSymmetrise::run() + { + //TODO + } + + bool IndirectSymmetrise::validate() + { + //TODO + return false; + } + + void IndirectSymmetrise::plotRawInput() + { + //TODO + } + + void IndirectSymmetrise::updateRangeSelector(QtProperty *prop, double value) + { + //TODO + } + +} // namespace CustomInterfaces +} // namespace Mantid