diff --git a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py index d1184d739879..0be5fe4e9a05 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py @@ -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 diff --git a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py index 5acf9c4ac1e2..6c2c2ab83cd4 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py @@ -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 @@ -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 diff --git a/Code/Mantid/scripts/HFIRPowderReduction/testGUI_MergeRuns.py b/Code/Mantid/scripts/HFIRPowderReduction/testGUI_MergeRuns.py index 0b57f215840a..eefb031243f5 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/testGUI_MergeRuns.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/testGUI_MergeRuns.py @@ -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() @@ -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 @@ -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') @@ -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_()