Ignore:
Timestamp:
Nov 7, 2017 1:08:01 PM (6 years ago)
Author:
krzywon
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
a657de3
Parents:
5fba4c4
Message:

Return P(r) window to a single tab. Added a button to remove current data set from data list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    r7f5196e rbcf1215  
    3030# TODO: Remove data 
    3131# TODO: Modify plot references, don't just send new 
    32 # TODO: Explorer button - link to PR from AW 
    3332# TODO: Update help with batch capabilities 
    34 # TODO: Window should not be fixed size 
    3533# TODO: Easy way to scroll through results - no tabs in window(?) - 'spreadsheet' 
    3634# TODO: Method to export results in some meaningful way 
     
    135133        self.calculateAllButton.clicked.connect(self.startThreadAll) 
    136134        self.calculateThisButton.clicked.connect(self.startThread) 
     135        self.removeButton.clicked.connect(self.removeData) 
    137136        self.helpButton.clicked.connect(self.help) 
    138137        self.estimateBgd.toggled.connect(self.toggleBgd) 
     
    207206 
    208207        # Main Buttons 
     208        self.mapper.addMapping(self.removeButton, WIDGETS.W_REMOVE) 
    209209        self.mapper.addMapping(self.calculateAllButton, WIDGETS.W_CALCULATE_ALL) 
    210210        self.mapper.addMapping(self.calculateThisButton, 
     
    266266        Enable buttons when data is present, else disable them 
    267267        """ 
     268        self.removeButton.setEnabled(self.logic.data_is_loaded) 
    268269        self.explorerButton.setEnabled(self.logic.data_is_loaded) 
    269270        self.calculateAllButton.setEnabled(self.logic.data_is_loaded) 
     
    273274        """ 
    274275        Append a new file name to the data combobox 
    275         :param data: Data1D object 
     276        :param filename: data filename 
     277        :param data_ref: QStandardItem reference for data set to be added 
    276278        """ 
    277279        qt_item = QtCore.QString.fromUtf8(filename) 
     
    292294        variant_ref = self.dataList.itemData(self.dataList.currentIndex()) 
    293295        self.setCurrentData(variant_ref.toPyObject()) 
     296 
     297    def removeData(self): 
     298        """Remove the existing data reference from the P(r) Persepective""" 
     299        self._data_list.pop(self._data) 
     300        self.pr_plot_list.pop(self._data) 
     301        self.data_plot_list.pop(self._data) 
     302        self.dataList.removeItem(self.dataList.currentIndex()) 
     303        self.dataList.setCurrentIndex(0) 
    294304 
    295305    ###################################################################### 
     
    552562                           QtGui.QStandardItem(str(pr.iq0(out)))) 
    553563        self.model.setItem(WIDGETS.W_BACKGROUND_INPUT, 
    554                            QtGui.QStandardItem("{:.3f}".format(pr.background))) 
     564                           QtGui.QStandardItem("{:.3f}".format(pr.est_bck))) 
    555565        self.model.setItem(WIDGETS.W_BACKGROUND_OUTPUT, 
    556566                           QtGui.QStandardItem(str(pr.background))) 
Note: See TracChangeset for help on using the changeset viewer.