Ignore:
Timestamp:
Nov 7, 2017 11:08:01 AM (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.

Location:
src/sas/qtgui/Perspectives/Inversion
Files:
3 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))) 
  • src/sas/qtgui/Perspectives/Inversion/InversionUtils.py

    rc00a28ff rbcf1215  
    2727                'W_SIGMA_POS_FRACTION', 
    2828                # bottom buttons 
     29                'W_REMOVE', 
    2930                'W_CALCULATE_ALL', 
    3031                'W_CALCULATE_VISIBLE', 
  • src/sas/qtgui/Perspectives/Inversion/UI/TabbedInversionUI.ui

    rc00a28ff rbcf1215  
    88    <y>0</y> 
    99    <width>458</width> 
    10     <height>500</height> 
     10    <height>679</height> 
    1111   </rect> 
    1212  </property> 
    1313  <property name="sizePolicy"> 
    14    <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> 
     14   <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> 
    1515    <horstretch>0</horstretch> 
    1616    <verstretch>0</verstretch> 
     
    2020   <size> 
    2121    <width>458</width> 
    22     <height>500</height> 
     22    <height>679</height> 
    2323   </size> 
    2424  </property> 
    2525  <property name="maximumSize"> 
    2626   <size> 
    27     <width>458</width> 
    28     <height>500</height> 
     27    <width>16777215</width> 
     28    <height>16777215</height> 
    2929   </size> 
    3030  </property> 
     
    3333  </property> 
    3434  <layout class="QGridLayout" name="gridLayout_7"> 
    35    <item row="3" column="0"> 
     35   <item row="4" column="0"> 
    3636    <layout class="QHBoxLayout" name="horizontalLayout_8"> 
    3737     <property name="sizeConstraint"> 
    3838      <enum>QLayout::SetDefaultConstraint</enum> 
    3939     </property> 
     40     <item> 
     41      <widget class="QPushButton" name="removeButton"> 
     42       <property name="text"> 
     43        <string>Remove</string> 
     44       </property> 
     45      </widget> 
     46     </item> 
    4047     <item> 
    4148      <widget class="QPushButton" name="calculateThisButton"> 
     
    8996    </layout> 
    9097   </item> 
    91    <item row="2" column="0"> 
     98   <item row="3" column="0"> 
    9299    <spacer name="verticalSpacer"> 
    93100     <property name="orientation"> 
     
    102109    </spacer> 
    103110   </item> 
    104    <item row="1" column="0"> 
     111   <item row="1" column="0" rowspan="2"> 
    105112    <widget class="QTabWidget" name="PrTabWidget"> 
    106113     <property name="sizePolicy"> 
     
    123130       <string>P(r) Parameters</string> 
    124131      </attribute> 
    125       <layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,1,1,0"> 
     132      <layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,1,1,0,0"> 
    126133       <item> 
    127134        <widget class="QGroupBox" name="dataSourceGroupBox"> 
     
    396403        </widget> 
    397404       </item> 
    398       </layout> 
    399      </widget> 
    400      <widget class="QWidget" name="tabOptions"> 
    401       <attribute name="title"> 
    402        <string>Outputs</string> 
    403       </attribute> 
    404       <layout class="QGridLayout" name="gridLayout_6"> 
    405        <item row="0" column="0"> 
     405       <item> 
    406406        <widget class="QGroupBox" name="outputsGroupBox"> 
    407407         <property name="title"> 
     
    578578         </layout> 
    579579        </widget> 
    580        </item> 
    581        <item row="1" column="0"> 
    582         <spacer name="verticalSpacer_2"> 
    583          <property name="orientation"> 
    584           <enum>Qt::Vertical</enum> 
    585          </property> 
    586          <property name="sizeHint" stdset="0"> 
    587           <size> 
    588            <width>20</width> 
    589            <height>40</height> 
    590           </size> 
    591          </property> 
    592         </spacer> 
    593580       </item> 
    594581      </layout> 
Note: See TracChangeset for help on using the changeset viewer.