Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/5421_IDA_bayes_interface'
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Oct 28, 2013
2 parents 7582d89 + 6bb77d4 commit c43a8c5
Show file tree
Hide file tree
Showing 21 changed files with 2,937 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def PyInit(self):
self.declareProperty(name='ResType',defaultValue='Res',validator=StringListValidator(['Res','Data']), doc='Format of Resolution file')
self.declareProperty(name='ResNumber',defaultValue='',validator=StringMandatoryValidator(), doc='Resolution run number')
self.declareProperty(name='ResNormInputType',defaultValue='File',validator=StringListValidator(['File','Workspace']), doc='Origin of ResNorm input - File (*_red.nxs) or Workspace')
self.declareProperty(name='ResNormNumber',defaultValue='',validator=StringMandatoryValidator(), doc='ResNorm run number')
self.declareProperty(name='ResNormNumber',defaultValue='', doc='ResNorm run number')
self.declareProperty(name='BackgroundOption',defaultValue='Sloping',validator=StringListValidator(['Sloping','Flat','Zero']), doc='Form of background to fit')
self.declareProperty(name='ElasticOption',defaultValue=True, doc='Include elastic peak in fit')
self.declareProperty(name='FixWidth',defaultValue=False, doc='Fix one of the widths')
Expand Down
32 changes: 27 additions & 5 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,35 @@ set ( SRC_FILES
src/IDATab.cpp
src/IO_MuonGrouping.cpp
src/Indirect.cpp
src/IndirectBayes.cpp
src/IndirectBayesTab.cpp
src/IndirectDataAnalysis.cpp
src/IndirectDiffractionReduction.cpp
src/IndirectLoadAscii.cpp
src/IndirectLoadAsciiTab.cpp
src/IndirectNeutron.cpp
src/IndirectMolDyn.cpp
src/JumpFit.cpp
src/MSDFit.cpp
src/MuonAnalysis.cpp
src/MuonAnalysisFitDataTab.cpp
src/MuonAnalysisOptionTab.cpp
src/MuonAnalysisResultTableTab.cpp
src/QtWorkspaceMementoModel.cpp
src/Quasi.cpp
src/ResNorm.cpp
src/SANSAddFiles.cpp
src/SANSDiagnostics.cpp
src/SANSPlotSpecial.cpp
src/SANSRunWindow.cpp
src/Stretch.cpp
src/Transmission.cpp
src/MantidEV.cpp
src/MantidEVWorker.cpp
src/StepScan.cpp
src/background.cpp
src/deltaECalc.cpp
src/UserInputValidator.cpp
src/UserInputValidator.cpp
src/WorkspaceInADS.cpp
src/WorkspaceMemento.cpp
src/RawFileMemento.cpp
Expand All @@ -61,22 +67,28 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/IDATab.h
inc/MantidQtCustomInterfaces/IO_MuonGrouping.h
inc/MantidQtCustomInterfaces/Indirect.h
inc/MantidQtCustomInterfaces/IndirectBayes.h
inc/MantidQtCustomInterfaces/IndirectBayesTab.h
inc/MantidQtCustomInterfaces/IndirectDataAnalysis.h
inc/MantidQtCustomInterfaces/IndirectDiffractionReduction.h
inc/MantidQtCustomInterfaces/IndirectLoadAscii.h
inc/MantidQtCustomInterfaces/IndirectLoadAsciiTab.h
inc/MantidQtCustomInterfaces/IndirectNeutron.h
inc/MantidQtCustomInterfaces/IndirectMolDyn.h
inc/MantidQtCustomInterfaces/JumpFit.h
inc/MantidQtCustomInterfaces/MSDFit.h
inc/MantidQtCustomInterfaces/MuonAnalysis.h
inc/MantidQtCustomInterfaces/MuonAnalysisFitDataTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisResultTableTab.h
inc/MantidQtCustomInterfaces/QtWorkspaceMementoModel.h
inc/MantidQtCustomInterfaces/Quasi.h
inc/MantidQtCustomInterfaces/ResNorm.h
inc/MantidQtCustomInterfaces/SANSAddFiles.h
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
inc/MantidQtCustomInterfaces/SANSRunWindow.h
inc/MantidQtCustomInterfaces/Stretch.h
inc/MantidQtCustomInterfaces/Transmission.h
inc/MantidQtCustomInterfaces/MantidEV.h
inc/MantidQtCustomInterfaces/MantidEVWorker.h
Expand All @@ -85,7 +97,7 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/WorkspaceMemento.h
inc/MantidQtCustomInterfaces/RawFileMemento.h
inc/MantidQtCustomInterfaces/WorkspaceInADS.h
inc/MantidQtCustomInterfaces/UserInputValidator.h
inc/MantidQtCustomInterfaces/UserInputValidator.h
inc/MantidQtCustomInterfaces/deltaECalc.h
)

Expand All @@ -100,43 +112,53 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h
inc/MantidQtCustomInterfaces/CreateMDWorkspace.h
inc/MantidQtCustomInterfaces/CreateMDWorkspaceAlgDialog.h
inc/MantidQtCustomInterfaces/Elwin.h

inc/MantidQtCustomInterfaces/Fury.h
inc/MantidQtCustomInterfaces/FuryFit.h
inc/MantidQtCustomInterfaces/Homer.h
inc/MantidQtCustomInterfaces/IDATab.h
inc/MantidQtCustomInterfaces/Indirect.h
inc/MantidQtCustomInterfaces/IndirectBayes.h
inc/MantidQtCustomInterfaces/IndirectBayesTab.h
inc/MantidQtCustomInterfaces/IndirectDataAnalysis.h
inc/MantidQtCustomInterfaces/IndirectDiffractionReduction.h
inc/MantidQtCustomInterfaces/IndirectLoadAscii.h
inc/MantidQtCustomInterfaces/IndirectLoadAsciiTab.h
inc/MantidQtCustomInterfaces/IndirectNeutron.h
inc/MantidQtCustomInterfaces/IndirectMolDyn.h
inc/MantidQtCustomInterfaces/JumpFit.h
inc/MantidQtCustomInterfaces/MSDFit.h
inc/MantidQtCustomInterfaces/MuonAnalysis.h
inc/MantidQtCustomInterfaces/MuonAnalysisFitDataTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisResultTableTab.h
inc/MantidQtCustomInterfaces/Quasi.h
inc/MantidQtCustomInterfaces/ResNorm.h
inc/MantidQtCustomInterfaces/SANSAddFiles.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
inc/MantidQtCustomInterfaces/SANSRunWindow.h
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/Stretch.h
inc/MantidQtCustomInterfaces/Transmission.h
inc/MantidQtCustomInterfaces/MantidEV.h
inc/MantidQtCustomInterfaces/MantidEV.h
inc/MantidQtCustomInterfaces/StepScan.h
)

set ( UI_FILES inc/MantidQtCustomInterfaces/ConvertToEnergy.ui
inc/MantidQtCustomInterfaces/CreateMDWorkspace.ui
inc/MantidQtCustomInterfaces/CreateMDWorkspaceAlgDialog.ui
inc/MantidQtCustomInterfaces/IndirectBayes.ui
inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui
inc/MantidQtCustomInterfaces/IndirectDiffractionReduction.ui
inc/MantidQtCustomInterfaces/IndirectLoadAscii.ui
inc/MantidQtCustomInterfaces/IndirectNeutron.ui
inc/MantidQtCustomInterfaces/IndirectMolDyn.ui
inc/MantidQtCustomInterfaces/JumpFit.ui
inc/MantidQtCustomInterfaces/MuonAnalysis.ui
inc/MantidQtCustomInterfaces/Quasi.ui
inc/MantidQtCustomInterfaces/ResNorm.ui
inc/MantidQtCustomInterfaces/SANSPlotSpecial.ui
inc/MantidQtCustomInterfaces/SANSRunWindow.ui
inc/MantidQtCustomInterfaces/SANSRunWindow.ui
inc/MantidQtCustomInterfaces/Stretch.ui
inc/MantidQtCustomInterfaces/MantidEV.ui
inc/MantidQtCustomInterfaces/StepScan.ui
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#ifndef MANTIDQTCUSTOMINTERFACES_INDIRECTBAYES_H_
#define MANTIDQTCUSTOMINTERFACES_INDIRECTBAYES_H_

//----------------------
// Includes
//----------------------
#include "ui_IndirectBayes.h"
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

#include <Poco/NObserver.h>
#include "MantidKernel/ConfigService.h"

namespace MantidQt
{
namespace CustomInterfaces
{
/**
This class defines the Indirect Bayes interface. It handles the creation of the interface window and
handles the interaction between the child tabs on the window.
@author Samuel Jackson, STFC
Copyright &copy; 2010 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 <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 DLLExport IndirectBayes : public MantidQt::API::UserSubWindow
{
Q_OBJECT

public: //public constants and enums

/// Enumeration for the index of each tab
enum TabChoice
{
RES_NORM,
QUASI,
STRETCH,
JUMP_FIT
};

public: // public constructor, destructor and functions
/// Default Constructor
IndirectBayes(QWidget *parent = 0);
///Destructor
~IndirectBayes();
/// Interface name
static std::string name() { return "Indirect Bayes"; }
// This interface's categories.
static QString categoryInfo() { return "Indirect"; }
virtual void initLayout();

private slots:
// Run the appropriate action depending based on the selected tab

/// Slot for clicking on the run button
void runClicked();
/// Slot for clicking on the hlep button
void helpClicked();
/// Slot for clicking on the manage directories button
void manageUserDirectories();
/// Slot showing a message box to the user
void showMessageBox(const QString& message);

private:
/// Called upon a close event.
virtual void closeEvent(QCloseEvent*);
/// handle POCO event
void handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf);
/// Load default interface settings for each tab
void loadSettings();

/// Map of tabs indexed by position on the window
std::map<unsigned int, IndirectBayesTab*> m_bayesTabs;
/// Change Observer for ConfigService (monitors user directories)
Poco::NObserver<IndirectBayes, Mantid::Kernel::ConfigValChangeNotification> m_changeObserver;
///Main interface window
Ui::IndirectBayes m_uiForm;
};
}
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IndirectBayes</class>
<widget class="QWidget" name="IndirectBayes">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>899</width>
<height>686</height>
</rect>
</property>
<property name="windowTitle">
<string>Indirect Bayes</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="indirectBayesTabs">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="resNorm">
<attribute name="title">
<string>ResNorm</string>
</attribute>
</widget>
<widget class="QWidget" name="Quasi">
<attribute name="title">
<string>Quasi</string>
</attribute>
</widget>
<widget class="QWidget" name="Stretch">
<attribute name="title">
<string>Stretch</string>
</attribute>
</widget>
<widget class="QWidget" name="JumpFit">
<attribute name="title">
<string>JumpFit</string>
</attribute>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_bottom">
<item>
<widget class="QPushButton" name="pbHelp">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>?</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<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_11">
<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="pbManageDirs">
<property name="text">
<string>Manage Directories</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

0 comments on commit c43a8c5

Please sign in to comment.