Skip to content

Commit

Permalink
Added new Sassena UI skeleton
Browse files Browse the repository at this point in the history
Refs #10443
  • Loading branch information
DanNixon committed Oct 28, 2014
1 parent 524ed8c commit f29fc50
Show file tree
Hide file tree
Showing 7 changed files with 321 additions and 23 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Expand Up @@ -25,6 +25,7 @@ set ( SRC_FILES
src/IndirectMolDyn.cpp
src/IndirectMoments.cpp
src/IndirectNeutron.cpp
src/IndirectSassena.cpp
src/IndirectSimulation.cpp
src/IndirectSimulationTab.cpp
src/IndirectSqw.cpp
Expand Down Expand Up @@ -100,6 +101,7 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/IndirectMolDyn.h
inc/MantidQtCustomInterfaces/IndirectMoments.h
inc/MantidQtCustomInterfaces/IndirectNeutron.h
inc/MantidQtCustomInterfaces/IndirectSassena.h
inc/MantidQtCustomInterfaces/IndirectSimulation.h
inc/MantidQtCustomInterfaces/IndirectSimulationTab.h
inc/MantidQtCustomInterfaces/IndirectSqw.h
Expand Down Expand Up @@ -180,6 +182,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h
inc/MantidQtCustomInterfaces/IndirectNeutron.h
inc/MantidQtCustomInterfaces/IndirectMolDyn.h
inc/MantidQtCustomInterfaces/IndirectMoments.h
inc/MantidQtCustomInterfaces/IndirectSassena.h
inc/MantidQtCustomInterfaces/IndirectSimulation.h
inc/MantidQtCustomInterfaces/IndirectSimulationTab.h
inc/MantidQtCustomInterfaces/IndirectSqw.h
Expand Down Expand Up @@ -225,6 +228,7 @@ set ( UI_FILES inc/MantidQtCustomInterfaces/CreateMDWorkspace.ui
inc/MantidQtCustomInterfaces/IndirectLoadAscii.ui
inc/MantidQtCustomInterfaces/IndirectNeutron.ui
inc/MantidQtCustomInterfaces/IndirectMolDyn.ui
inc/MantidQtCustomInterfaces/IndirectSassena.ui
inc/MantidQtCustomInterfaces/IndirectSimulation.ui
inc/MantidQtCustomInterfaces/JumpFit.ui
inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui
Expand Down
@@ -0,0 +1,32 @@
#ifndef MANTIDQTCUSTOMINTERFACES_INDIRECTSASSENA_H_
#define MANTIDQTCUSTOMINTERFACES_INDIRECTSASSENA_H_

#include "ui_IndirectSassena.h"
#include "MantidQtCustomInterfaces/IndirectSimulationTab.h"

namespace MantidQt
{
namespace CustomInterfaces
{
class DLLExport IndirectSassena : public IndirectSimulationTab
{
Q_OBJECT

public:
IndirectSassena(QWidget * parent = 0);

QString help() { return "IndirectSassena"; };
bool validate();
void run();
/// Load default settings into the interface
void loadSettings(const QSettings& settings);

private:
// The ui form
Ui::IndirectSassena m_uiForm;

};
} // namespace CustomInterfaces
} // namespace MantidQt

#endif //MANTIDQTCUSTOMINTERFACES_INDIRECTSASSENA_H_
@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IndirectSassena</class>
<widget class="QWidget" name="IndirectSassena">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>444</width>
<height>251</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="gbInputFile">
<property name="title">
<string>Input File</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="mwInputFile" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="label" stdset="0">
<string/>
</property>
<property name="fileExtensions" stdset="0">
<stringlist>
<string>.h5</string>
<string>.hd5</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblSample">
<property name="text">
<string>Sample File:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gbOptions">
<property name="title">
<string>GroupBox</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lblTimeUnit">
<property name="text">
<string>Time Unit:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="sbTimeUnit">
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="cbSortQ">
<property name="text">
<string>Sort by Q Vectors</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="gbOutput">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Output Options</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="chkVerbose">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Verbose</string>
</property>
</widget>
</item>
<item>
<spacer name="spOutput1">
<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="QLabel" name="lblPlot">
<property name="text">
<string>Plot Result: </string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbPlot">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Spectrum</string>
</property>
</item>
<item>
<property name="text">
<string>Contour</string>
</property>
</item>
<item>
<property name="text">
<string>Both</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="spOutput2">
<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="QCheckBox" name="chkSave">
<property name="text">
<string>Save Result</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MantidQt::MantidWidgets::MWRunFiles</class>
<extends>QWidget</extends>
<header>MantidQtMantidWidgets/MWRunFiles.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mwInputFile</tabstop>
<tabstop>sbTimeUnit</tabstop>
<tabstop>cbSortQ</tabstop>
<tabstop>chkVerbose</tabstop>
<tabstop>cbPlot</tabstop>
<tabstop>chkSave</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Expand Up @@ -15,8 +15,8 @@ namespace MantidQt
{
namespace CustomInterfaces
{
/**
This class defines the Indirect Simulation interface. It handles the creation of the interface window and
/**
This class defines the Indirect Simulation interface. It handles the creation of the interface window and
handles the interaction between the child tabs on the window.
@author Samuel Jackson, STFC
Expand All @@ -39,7 +39,7 @@ namespace MantidQt
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>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/

class DLLExport IndirectSimulation : public MantidQt::API::UserSubWindow
Expand All @@ -52,22 +52,22 @@ namespace MantidQt
enum TabChoice
{
MOLDYN,
SASSENA,
};

public: // public constructor, destructor and functions
/// Default Constructor
IndirectSimulation(QWidget *parent = 0);
///Destructor
/// Destructor
~IndirectSimulation();
/// Interface name
static std::string name() { return "Simulation"; }
// This interface's categories.
/// This interface's categories.
static QString categoryInfo() { return "Indirect"; }
/// Setup tab UI
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
Expand All @@ -86,11 +86,12 @@ namespace MantidQt
void handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf);

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

};
}
}
Expand Down
Expand Up @@ -31,6 +31,11 @@
<string>MolDyn</string>
</attribute>
</widget>
<widget class="QWidget" name="sassena">
<attribute name="title">
<string>Sassena</string>
</attribute>
</widget>
</widget>
</item>
<item>
Expand Down
47 changes: 47 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/IndirectSassena.cpp
@@ -0,0 +1,47 @@
#include "MantidQtCustomInterfaces/IndirectSassena.h"

#include <QFileInfo>
#include <QString>

namespace MantidQt
{
namespace CustomInterfaces
{
IndirectSassena::IndirectSassena(QWidget * parent) :
IndirectSimulationTab(parent)
{
m_uiForm.setupUi(parent);
}

/**
* Validate the form to check the program can be run.
*
* @return :: Whether the form was valid
*/
bool IndirectSassena::validate()
{
//TODO

return true;
}

/**
* TODO
*/
void IndirectSassena::run()
{
}

/**
* Set the data selectors to use the default save directory
* when browsing for input files.
*
* @param settings :: The settings to loading into the interface
*/
void IndirectSassena::loadSettings(const QSettings& settings)
{
m_uiForm.mwInputFile->readSettings(settings.group());
}

} // namespace CustomInterfaces
} // namespace MantidQt

0 comments on commit f29fc50

Please sign in to comment.