Skip to content

Commit

Permalink
Refs #5421 Adding skeleton code for Indirect Bayes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Sep 11, 2013
1 parent c74b177 commit b96976c
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ 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/MSDFit.cpp
Expand All @@ -23,6 +25,7 @@ set ( SRC_FILES
src/MuonAnalysisOptionTab.cpp
src/MuonAnalysisResultTableTab.cpp
src/QtWorkspaceMementoModel.cpp
src/ResNorm.cpp
src/SANSAddFiles.cpp
src/SANSDiagnostics.cpp
src/SANSPlotSpecial.cpp
Expand All @@ -33,7 +36,7 @@ set ( SRC_FILES
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 @@ -58,6 +61,8 @@ 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/MSDFit.h
Expand All @@ -67,6 +72,7 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisResultTableTab.h
inc/MantidQtCustomInterfaces/QtWorkspaceMementoModel.h
inc/MantidQtCustomInterfaces/ResNorm.h
inc/MantidQtCustomInterfaces/SANSAddFiles.h
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
Expand All @@ -79,7 +85,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 @@ -99,19 +105,22 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.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/MSDFit.h
inc/MantidQtCustomInterfaces/MuonAnalysis.h
inc/MantidQtCustomInterfaces/MuonAnalysisFitDataTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h
inc/MantidQtCustomInterfaces/MuonAnalysisResultTableTab.h
inc/MantidQtCustomInterfaces/ResNorm.h
inc/MantidQtCustomInterfaces/SANSAddFiles.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
inc/MantidQtCustomInterfaces/SANSRunWindow.h
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/Transmission.h
inc/MantidQtCustomInterfaces/MantidEV.h
inc/MantidQtCustomInterfaces/MantidEV.h
inc/MantidQtCustomInterfaces/StepScan.h
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#ifndef MANTIDQTCUSTOMINTERFACES_INDIRECTBAYES_H_
#define MANTIDQTCUSTOMINTERFACES_INDIRECTBAYES_H_

//----------------------
// Includes
//----------------------
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.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 © 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 IndiectBayes : public MantidQt::API::UserSubWindow
{
Q_OBJECT

public: //public constants and enums
enum TabChoice
{
RES_NORM,
QUASI,
STRETCH,
JUMP_FIT
};

public: // public constructor, destructor and functions
/// Default Constructor
IndiectBayes(QWidget *parent = 0);
///Destructor
~IndiectBayes();
/// Interface name
static std::string name() { return "Indirect Bayes"; }

private:
std::map<unsigned int, IndirectBayesTab*> m_bayesTabs;
};

}
}

#endif //MANTIDQTCUSTOMINTERFACES_INDIRECTBAYES_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef MANTID_CUSTOMINTERFACES_INDIRECTBAYESTAB_H_
#define MANTID_CUSTOMINTERFACES_INDIRECTBAYESTAB_H_

#include "MantidKernel/System.h"
#include <QWidget>

namespace MantidQt
{
namespace CustomInterfaces
{
/**
This class defines a abstract base class for the different tabs of the Indirect Bayes interface.
Any joint functionality shared between each of the tabs should be implemented here as well as defining
shared member functions.
@author Samuel Jackson, STFC
Copyright &copy; 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 <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 IndirectBayesTab : public QWidget
{
Q_OBJECT

public:
IndirectBayesTab(QWidget * parent = 0);
~IndirectBayesTab();

virtual void validate() = 0;
virtual void run() = 0;

};
} // namespace CustomInterfaces
} // namespace Mantid

#endif MANTID_CUSTOMINTERFACES_INDIRECTBAYESTAB_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef MANTIDQTCUSTOMINTERFACESIDA_RESNORM_H_
#define MANTIDQTCUSTOMINTERFACESIDA_RESNORM_H_

#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
namespace CustomInterfaces
{
class ResNorm : public IndirectBayesTab
{
Q_OBJECT

public:
ResNorm(QWidget * parent = 0);

private:
virtual void validate();
virtual void run();
};
} // namespace CustomInterfaces
} // namespace MantidQt

#endif MANTIDQTCUSTOMINTERFACESIDA_RESNORM_H_
19 changes: 19 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/IndirectBayes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "MantidQtCustomInterfaces/IndirectBayes.h"
#include "MantidQtCustomInterfaces/ResNorm.h"

//Add this class to the list of specialised dialogs in this namespace
namespace MantidQt
{
namespace CustomInterfaces
{
DECLARE_SUBWINDOW(IndirectBayes);
}
}

using namespace MantidQt::CustomInterfaces;

IndirectBayes::IndirectBayes(QWidget *parent)
{
//insert each tab into the interface on creation
m_bayesTabs.insert(std::make_pair(RES_NORM, new ResNorm(this)));
}
23 changes: 23 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/IndirectBayesTab.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
namespace CustomInterfaces
{

//----------------------------------------------------------------------------------------------
/** Constructor
*/
IndirectBayesTab::IndirectBayesTab(Ui::ConvertToEnergy& uiForm, QWidget * parent) : QWidget(parent),
m_uiForm(uiForm)
{
}

//----------------------------------------------------------------------------------------------
/** Destructor
*/
IndirectBayesTab::~IndirectBayesTab(QWidget* parent)
{
}

} // namespace MantidQt
20 changes: 20 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/ResNorm.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "MantidQtCustomInterfaces/ResNorm.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
namespace CustomInterfaces
{
ResNorm::ResNorm(QWidget * parent) : IndirectBayesTab(parent)
{}

virtual void validate()
{

}
virtual void run()
{

}
} // namespace CustomInterfaces
} // namespace MantidQt

0 comments on commit b96976c

Please sign in to comment.