Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/8545_gui_to_slice_data'
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Dec 5, 2013
2 parents ce9aab6 + b934baf commit f14717b
Show file tree
Hide file tree
Showing 8 changed files with 517 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set ( SRC_FILES
src/SANSDiagnostics.cpp
src/SANSPlotSpecial.cpp
src/SANSRunWindow.cpp
src/SANSEventSlicing.cpp
src/Stretch.cpp
src/Transmission.cpp
src/MantidEV.cpp
Expand Down Expand Up @@ -88,6 +89,7 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
inc/MantidQtCustomInterfaces/SANSRunWindow.h
inc/MantidQtCustomInterfaces/SANSEventSlicing.h
inc/MantidQtCustomInterfaces/Stretch.h
inc/MantidQtCustomInterfaces/Transmission.h
inc/MantidQtCustomInterfaces/MantidEV.h
Expand Down Expand Up @@ -136,6 +138,7 @@ set ( MOC_FILES inc/MantidQtCustomInterfaces/Background.h
inc/MantidQtCustomInterfaces/SANSAddFiles.h
inc/MantidQtCustomInterfaces/SANSPlotSpecial.h
inc/MantidQtCustomInterfaces/SANSRunWindow.h
inc/MantidQtCustomInterfaces/SANSEventSlicing.h
inc/MantidQtCustomInterfaces/SANSDiagnostics.h
inc/MantidQtCustomInterfaces/Stretch.h
inc/MantidQtCustomInterfaces/Transmission.h
Expand All @@ -158,6 +161,7 @@ set ( UI_FILES inc/MantidQtCustomInterfaces/ConvertToEnergy.ui
inc/MantidQtCustomInterfaces/ResNorm.ui
inc/MantidQtCustomInterfaces/SANSPlotSpecial.ui
inc/MantidQtCustomInterfaces/SANSRunWindow.ui
inc/MantidQtCustomInterfaces/SANSEventSlicing.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,59 @@
#ifndef MANTIDQTCUSTOMINTERFACES_SANSEVENTSLICING_H_
#define MANTIDQTCUSTOMINTERFACES_SANSEVENTSLICING_H_

#include "ui_SANSEventSlicing.h"
#include "MantidQtAPI/UserSubWindow.h"
#include <QString>

namespace MantidQt
{
namespace CustomInterfaces
{

class SANSEventSlicing : public API::UserSubWindow
{
Q_OBJECT

public:
/// Default Constructor
SANSEventSlicing(QWidget *parent=0);
/// Destructor
virtual ~SANSEventSlicing();

static std::string name(){return "SANS ISIS Slicing";}
static QString categoryInfo() {return "SANS";}

private:
///A reference to a logger
static Mantid::Kernel::Logger & g_log;

struct ChargeAndTime{
QString charge;
QString time;
};

void initLayout();

ChargeAndTime getFullChargeAndTime(const QString & name_ws);
QString createSliceEventCode(const QString & name_ws, const QString & start, const QString & stop);
ChargeAndTime runSliceEvent(const QString & code2run);
void checkPythonOutput(const QString & result);
ChargeAndTime values2ChargeAndTime(const QString & input);
void raiseWarning(QString title, QString message);

protected:
virtual void showEvent(QShowEvent*);
private slots:

/// Apply the slice for the SANS data, and update the view with the last sliced data.
void doApplySlice();
void onChangeWorkspace(const QString & newWs);

private:
Ui::SANSEventSlicing ui;
};

}
}

#endif //MANTIDQTCUSTOMINTERFACES_SANSEVENTSLICING_H_
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SANSEventSlicing</class>
<widget class="QWidget" name="SANSEventSlicing">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>322</width>
<height>216</height>
</rect>
</property>
<property name="windowTitle">
<string>SANS Time Slicing</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="run_label">
<property name="text">
<string>Run:</string>
</property>
</widget>
</item>
<item>
<widget class="MantidQt::MantidWidgets::WorkspaceSelector" name="run_opt">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="WorkspaceTypes" stdset="0">
<stringlist>
<string>EventWorkspace</string>
</stringlist>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Experiment duration:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="time_label">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>[s]</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Charge:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sliced_label">
<property name="text">
<string>sliced</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>/</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="total_label">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>[uC]</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Slice From:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="startDouble"/>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>to</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="stopDouble"/>
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_3">
<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="applyPb">
<property name="text">
<string>&amp;Apply</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closePb">
<property name="text">
<string>&amp;Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MantidQt::MantidWidgets::WorkspaceSelector</class>
<extends>QComboBox</extends>
<header>MantidQtMantidWidgets/WorkspaceSelector.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>closePb</sender>
<signal>clicked()</signal>
<receiver>SANSEventSlicing</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>255</x>
<y>186</y>
</hint>
<hint type="destinationlabel">
<x>223</x>
<y>209</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ private slots:
void transSelectorChanged(int );
void loadTransmissionSettings();

void handleSlicePushButton();

private:
/// used to specify the range of validation to do
enum ValCheck
Expand Down Expand Up @@ -350,6 +352,8 @@ private slots:
static Mantid::Kernel::Logger & g_log;
static Mantid::Kernel::Logger & g_centreFinderLog;

UserSubWindow * slicingWindow;

};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label_15">
<widget class="QPushButton" name="slicePb">
<property name="text">
<string>Slice Events:</string>
<string>Time slicing:</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit f14717b

Please sign in to comment.