-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/feature/8545_gui_to_slice_data'
- Loading branch information
Showing
8 changed files
with
517 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSEventSlicing.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ |
244 changes: 244 additions & 0 deletions
244
Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSEventSlicing.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>&Apply</string> | ||
</property> | ||
<property name="default"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="closePb"> | ||
<property name="text"> | ||
<string>&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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.