Index: reduction/main.py
===================================================================
--- reduction/main.py	(revision 8d00d38f39b49a0ad0dd17596ff27e8c578769a1)
+++ reduction/main.py	(revision 9ba893386eb64e86d4e35fbc841eb480787b18f3)
@@ -3,5 +3,5 @@
 
 '''
-Created on 2015.3.7
+Created on 2018.3.7
 LILI YAN
 '''
@@ -14,5 +14,5 @@
 from xml.dom import minidom
 from canvas import *
-import reduction
+#import reduction
 import subprocess
 import math
@@ -40,4 +40,12 @@
         self.scrollArea2.setWidgetResizable(True)
         self.scrollArea2.setWidget(self.second)
+        self.scrollArea2.setMinimumHeight(150)
+
+        self.third = QtGui.QFrame(self)
+        self.third.setFrameShape(QtGui.QFrame.StyledPanel)
+        self.scrollArea3 = QtGui.QScrollArea()
+        self.scrollArea3.setWidgetResizable(True)
+        self.scrollArea3.setWidget(self.third)
+        self.scrollArea3.setMinimumHeight(150)
 
         self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal, self)
@@ -46,6 +54,12 @@
         self.splitter.setSizes([600, 500])
 
+        self.splitterH = QtGui.QSplitter(QtCore.Qt.Vertical, self)
+        self.splitterH.addWidget(self.splitter)
+        self.splitterH.addWidget(self.scrollArea3)
+        self.splitterH.setSizes([100, 100])
+
         self.firstGrid = QtGui.QGridLayout(self.first)
         self.secondGrid = QtGui.QGridLayout(self.second)
+        self.thirdGrid = QtGui.QGridLayout(self.third)
 
         self.settingText = QtGui.QLabel('Settings: ',self.first)
@@ -209,9 +223,20 @@
             '',
             )
+        self.canvas.setMinimumHeight(100)
         self.refPeakLabel = QtGui.QLabel('',self.second)
         self.refFwhmLabel = QtGui.QLabel('',self.second)
         self.dirPeakLabel = QtGui.QLabel('',self.second)
         self.dirFwhmLabel = QtGui.QLabel('',self.second)
-
+        
+        self.addButton = QtGui.QPushButton('Add')
+        self.addButton.setMaximumHeight(30)
+        self.addButton.clicked.connect(self.addLine)
+        self.removeButton = QtGui.QPushButton('Remove')
+        self.removeButton.setMaximumHeight(30)
+        self.removeButton.clicked.connect(self.removeLine)
+
+        self.tableData = TableData(self)
+        self.tableData.setMinimumHeight(150)
+        
         _nline = 0
         self.firstGrid.addWidget(self.logo, _nline, 0, 1, 4 , QtCore.Qt.AlignCenter)
@@ -308,6 +333,11 @@
         self.secondGrid.addWidget(self.refFwhmLabel, _nline, 0, 1, 1, QtCore.Qt.AlignCenter)
         self.secondGrid.addWidget(self.dirFwhmLabel, _nline, 1, 1, 1, QtCore.Qt.AlignCenter)
-
-        self.setCentralWidget(self.splitter)
+        _nline = 0
+        self.thirdGrid.addWidget(self.addButton, _nline, 0, 1, 1, QtCore.Qt.AlignCenter)
+        self.thirdGrid.addWidget(self.removeButton, _nline, 1, 1, 1, QtCore.Qt.AlignCenter)
+        _nline += 1
+        self.thirdGrid.addWidget(self.tableData, _nline, 0, 1,8)#, QtCore.Qt.AlignCenter)
+
+        self.setCentralWidget(self.splitterH)
         self.loadConfigure()
         self.setConfigure()
@@ -317,6 +347,25 @@
 
         #self.comboBoxChange()
-	self.canvas.ax.clear()
-	self.canvas.draw()
+        self.canvas.ax.clear()
+        self.canvas.draw()
+    
+    def addLine(self):
+        _data = None
+        for _row in range(int(self.tableData.dataModel.rowCount())):
+            _data = self.tableData.dataModel.data(self.tableData.dataModel.index(_row,0))
+            if _data == None:
+                #self.tableData.dataModel.setItem(_row, 0, QtGui.QStandardItem(str(_row+1)))
+                self.tableData.dataModel.setItem(_row, 0, QtGui.QStandardItem(str(self.sampleText.toPlainText())))
+                self.tableData.dataModel.setItem(_row, 2, QtGui.QStandardItem(str(self.directText.toPlainText())))
+                break
+            else:
+                pass
+            if _row == int(self.tableData.dataModel.rowCount())-1:
+                _addRow = int(self.tableData.dataModel.rowCount())
+                self.tableData.dataModel.insertRow(_addRow)
+
+    def removeLine(self):
+        rmRow = self.tableData.currentIndex().row()
+        self.tableData.dataModel.removeRow(rmRow)
 
     def setDefault(self):
@@ -407,5 +456,5 @@
             configure = self.getSetting()
             self.writeXml(configure)
-            reduction.FindROI()
+            #reduction.FindROI()
             _filename1 = './ref_roi.dat'
             _filename2 = './dir_roi.dat'
@@ -473,5 +522,5 @@
 	    self.canvas.ax.clear()
 	    self.canvas.draw()
-	    reduction.Reduction()
+	    #reduction.Reduction()
             self.comboBox.setCurrentIndex(2)
 	    self.comboBoxChange()
@@ -533,4 +582,5 @@
         _tmp=str(self.sampleText.toPlainText())
         if _tmp!="":
+            #configure['Sample'] = _tmp + '/detector.nxs'
             configure['Sample'] = _tmp + '/sample.nxs'
         else:
@@ -540,4 +590,5 @@
         _tmp=str(self.directText.toPlainText())
         if _tmp!="":
+            #configure['Direct'] = _tmp + '/detector.nxs'
             configure['Direct'] = _tmp + '/sample.nxs'
         else:
@@ -876,5 +927,42 @@
         self.setMask(QtGui.QRegion(self.rect(), QtGui.QRegion.Ellipse))
         QtGui.QToolButton.resizeEvent(self, event)
- 
+
+class TableData(QtGui.QTableView):
+    def __init__(self, parent):
+        super(TableData, self).__init__(parent=None)
+        self.parent = parent
+        self.setupUi(self)
+
+    def setupUi(self, Widget):
+        self.headerList = []
+        self.headerList.append("ref_run")
+        self.headerList.append("ref_pc")
+        self.headerList.append("ref_roi")
+        self.headerList.append("ref_bg_roi")
+        self.headerList.append("det_angle")
+        self.headerList.append("L2")
+        self.headerList.append("dir_run")
+        self.headerList.append("dir_pc")
+        self.headerList.append("dir_roi")
+        self.headerList.append("dir_bg_roi")
+
+        self.dataModel = QtGui.QStandardItemModel(3, 10)
+        self.dataModel.setHorizontalHeaderLabels(self.headerList)
+
+        #self.tableView = QTableView
+        self.setModel(self.dataModel)
+
+    def setModelData(self,row,data1,data2,data3,data4,data5,data6,data7,data8,data9,data10):
+        self.dataModel.setItem(row, 0, QStandardItem(data1))
+        self.dataModel.setItem(row, 1, QStandardItem(data2))
+        self.dataModel.setItem(row, 2, QStandardItem(data3))
+        self.dataModel.setItem(row, 3, QStandardItem(data4))
+        self.dataModel.setItem(row, 4, QStandardItem(data5))
+        self.dataModel.setItem(row, 5, QStandardItem(data6))
+        self.dataModel.setItem(row, 6, QStandardItem(data7))
+        self.dataModel.setItem(row, 7, QStandardItem(data8))
+        self.dataModel.setItem(0, 8, QStandardItem(data9))
+        self.dataModel.setItem(0, 9, QStandardItem(data10))
+
 def exit_handler(top):
     top.saveConfigure()
