Skip to content

Commit

Permalink
Refs #5421 Adding Stretch interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Sep 11, 2013
1 parent 0c5a3ac commit 1b077dc
Show file tree
Hide file tree
Showing 8 changed files with 339 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set ( SRC_FILES
src/SANSDiagnostics.cpp
src/SANSPlotSpecial.cpp
src/SANSRunWindow.cpp
src/Stretch.cpp
src/Transmission.cpp
src/MantidEV.cpp
src/MantidEVWorker.cpp
Expand Down Expand Up @@ -79,6 +80,7 @@ set ( INC_FILES
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 Down Expand Up @@ -122,6 +124,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.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/StepScan.h
Expand All @@ -137,7 +140,8 @@ set ( UI_FILES inc/MantidQtCustomInterfaces/ConvertToEnergy.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
Expand Up @@ -24,7 +24,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dataSelector">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsInput">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -54,7 +54,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dataSelector_2">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsResolution">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef MANTIDQTCUSTOMINTERFACES_STRETCH_H_
#define MANTIDQTCUSTOMINTERFACES_STRETCH_H_

#include "ui_Stretch.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
namespace CustomInterfaces
{
class DLLExport Stretch : public IndirectBayesTab
{
Q_OBJECT

public:
Stretch(QWidget * parent = 0);

private:
virtual void help();
virtual void validate();
virtual void run();

/// Plot of the input
QwtPlot* m_plot;
/// Tree of the properties
QtTreePropertyBrowser* m_propTree;
/// Internal list of the properties
QMap<QString, QtProperty*> m_properties;
/// Double manager to create properties
QtDoublePropertyManager* m_dblManager;
//The ui form
Ui::Stretch m_uiForm;

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

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Stretch</class>
<widget class="QWidget" name="Stretch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>950</width>
<height>615</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lblSample">
<property name="text">
<string>Sample: </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsSample">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="loadLabelText" stdset="0">
<string>Plot</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblRes">
<property name="text">
<string>Resolution: </string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="MantidQt::MantidWidgets::DataSelector" name="dsResolution">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoLoad">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="gbOptions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QComboBox" name="cbMode">
<item>
<property name="text">
<string>Fit</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblBackground">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Background: </string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="chkElasticPeak">
<property name="text">
<string>Elastic Peak</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cbBackground">
<item>
<property name="text">
<string>Flat</string>
</property>
</item>
<item>
<property name="text">
<string>Sloped</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Mode</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
<zorder>cbBackground</zorder>
<zorder>lblBackground</zorder>
<zorder>chkElasticPeak</zorder>
<zorder>cbMode</zorder>
<zorder>lblMode</zorder>
<zorder>layoutWidget</zorder>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="treeSpace"/>
</item>
<item>
<layout class="QVBoxLayout" name="plotSpace"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_44">
<item>
<widget class="QCheckBox" name="ckVerbose">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Verbose</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<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="ckPlot">
<property name="text">
<string>Plot Result</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_18">
<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="ckSave">
<property name="text">
<string>Save Result</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MantidQt::MantidWidgets::DataSelector</class>
<extends>QWidget</extends>
<header>MantidQtMantidWidgets/DataSelector.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
3 changes: 3 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/IndirectBayes.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MantidQtCustomInterfaces/IndirectBayes.h"
#include "MantidQtCustomInterfaces/Quasi.h"
#include "MantidQtCustomInterfaces/ResNorm.h"
#include "MantidQtCustomInterfaces/Stretch.h"

//Add this class to the list of specialised dialogs in this namespace
namespace MantidQt
Expand All @@ -16,9 +17,11 @@ using namespace MantidQt::CustomInterfaces;
IndirectBayes::IndirectBayes(QWidget *parent) : UserSubWindow(parent)
{
m_uiForm.setupUi(this);

//insert each tab into the interface on creation
m_bayesTabs.insert(std::make_pair(RES_NORM, new ResNorm(m_uiForm.indirectBayesTabs->widget(RES_NORM))));
m_bayesTabs.insert(std::make_pair(QUASI, new Quasi(m_uiForm.indirectBayesTabs->widget(QUASI))));
m_bayesTabs.insert(std::make_pair(STRETCH, new Stretch(m_uiForm.indirectBayesTabs->widget(STRETCH))));
}

void IndirectBayes::initLayout()
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/Quasi.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "MantidQtCustomInterfaces/Quasi.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
Expand Down
5 changes: 2 additions & 3 deletions Code/Mantid/MantidQt/CustomInterfaces/src/ResNorm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "MantidQtCustomInterfaces/ResNorm.h"
#include "MantidQtCustomInterfaces/IndirectBayesTab.h"

namespace MantidQt
{
Expand All @@ -15,11 +14,11 @@ namespace MantidQt
m_uiForm.treeSpace->addWidget(m_propTree);
m_properties["EMin"] = m_dblManager->addProperty("EMin");
m_properties["EMax"] = m_dblManager->addProperty("EMax");
m_properties["Binning"] = m_dblManager->addProperty("Binning");
m_properties["VanBinning"] = m_dblManager->addProperty("Van Binning");

m_dblManager->setDecimals(m_properties["EMin"], NUM_DECIMALS);
m_dblManager->setDecimals(m_properties["EMax"], NUM_DECIMALS);
m_dblManager->setDecimals(m_properties["Binning"], NUM_DECIMALS);
m_dblManager->setDecimals(m_properties["VanBinning"], NUM_DECIMALS);

m_propTree->addProperty(m_properties["EMin"]);
m_propTree->addProperty(m_properties["EMax"]);
Expand Down

0 comments on commit 1b077dc

Please sign in to comment.