Skip to content

Commit

Permalink
Minor modifications for merge data. Refs #11289.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Mar 30, 2015
1 parent de5fa60 commit 1f1ffe7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
Expand Up @@ -13,8 +13,8 @@
import mantid
IMPORT_MANTID = True
except ImportError as e:
#sys.path.append('/home/wzz/Mantid_Project/Mantid2/Code/release/bin')
sys.path.append('/home/wzz/Mantid/Code/debug/bin')
sys.path.append('/home/wzz/Mantid_Project/Mantid2/Code/release/bin')
#sys.path.append('/home/wzz/Mantid/Code/debug/bin')
sys.path.append('/Users/wzz/Mantid/Code/debug/bin')
try:
import mantid
Expand Down
19 changes: 18 additions & 1 deletion Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py
Expand Up @@ -120,6 +120,9 @@ def __init__(self, parent=None):
self.connect(self.ui.pushButton_mergeScans, QtCore.SIGNAL('clicked()'),
self.doMergeScans)

self.connect(self.ui.pushButton_view2D, QtCore.SIGNAL('clicked()'),
self.doMergeScanView2D)

# Define signal-event handling


Expand Down Expand Up @@ -462,7 +465,21 @@ def doMergeScans(self):
self._plotMergedReducedData(mindex, label)

return


def doMergeScanView2D(self):
"""
"""
# TODO : ASAP

# Highlight button color
self.ui.pushButton_view2D.setStyleSheet('QPushButton {background-color: #A3C1DA; color: red;}')

# Plot 2D


return



def doPlot2Theta(self):
""" Rebin the data and plot in 2theta
Expand Down
51 changes: 25 additions & 26 deletions Code/Mantid/scripts/HFIRPowderReduction/testGUI_MergeRuns.py
Expand Up @@ -29,24 +29,28 @@
# (20) Tab-Advanced Setup: Auto fill Server Address
# (21) Test using Local Data Storage
#
# Use cases to test in this script
# 1. Load a set of scans in an experiment;
# > plot merged result as default.
# 2. PushButton 'View 2D': color fill plot on all individual experiments;
# 3. PushButton 'View Merged': 1D plot for previously merged;
# 4. Mode 'Show scan number' alog with 'View 2D';
# > Show to user which scan is at the mouse;
# 5. Right click mouse to get a submenu for 'include/exclude' (disable one)
# 6. Select or deselect a run from GUI and re-merge;
#
# Note: step 4, 5 and 6 should be referred to PlotData.MainAppNDim.py
#
###############################################################################

""" Test main """
import sys

import HfirPDReductionGUI
from PyQt4 import QtGui


# Globals
LINUX = 1
OSX = 2



##########

def qapp():
if QtGui.QApplication.instance():
_app = QtGui.QApplication.instance()
Expand All @@ -55,7 +59,14 @@ def qapp():
return _app

app = qapp()
reducer = HfirPDReductionGUI.MainWindow() #the main ui class in this file is called MainWindow
reducer.show()

""" END OF COMMON CODES """


#-------------------------------------------------------------------------------
""" Determine OS """

import sys
osname = sys.platform
Expand All @@ -68,10 +79,12 @@ def qapp():
else:
raise NotImplementedError("OS %s is not supported." % (osname))

reducer = HfirPDReductionGUI.MainWindow() #the main ui class in this file is called MainWindow
reducer.show()
#-------------------------------------------------------------------------------

# example: 'http://neutron.ornl.gov/user_data/hb2a/exp400/Datafiles/HB2A_exp0400_scan0001.dat'
#
# Test case: Experiment 231, Scan 1 to 10
#
print "Set to exp 231, scan 1"
reducer.ui.lineEdit_expNo.setText('231')
reducer.ui.lineEdit_scanStart.setText('1')
Expand All @@ -92,22 +105,8 @@ def qapp():
# load and reduce data
reducer.doMergeScans()

# try:
# reducer.doLoadData()
# except Exception as e:
# print e
# raise e
#
# try:
# reducer.doPlotDspacing()
# except Exception as e:
# print e
#
# try:
# reducer.doPlotQ()
# except Exception as e:
# print e
#
# Skip if there is something wrong

#-------------------------------------------------------------------------------
""" Common Codes """
app.exec_()

0 comments on commit 1f1ffe7

Please sign in to comment.