Changeset 8aa3c4d in sasview


Ignore:
Timestamp:
Nov 29, 2018 7:45:44 AM (2 weeks ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI_ordering
Children:
cdf8f00
Parents:
376a939
Message:

Initial commit of the dataset ordering functionality TRAC#933

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rce67f35 r8aa3c4d  
    4949from sas.qtgui.Perspectives.Fitting.MultiConstraint import MultiConstraint 
    5050from sas.qtgui.Perspectives.Fitting.ReportPageLogic import ReportPageLogic 
     51from sas.qtgui.Perspectives.Fitting.OrderWidget import OrderWidget 
    5152 
    5253TAB_MAGNETISM = 4 
    5354TAB_POLY = 3 
     55TAB_ORDERING = 5 
    5456CATEGORY_DEFAULT = "Choose category..." 
    5557MODEL_DEFAULT = "Choose model..." 
     
    210212                logic = FittingLogic(data=GuiUtils.dataFromItem(data_item)) 
    211213                self._logic.append(logic) 
     214            # update the ordering tab 
     215            self.order_widget.updateData(self.all_data) 
    212216 
    213217        # Overwrite data type descriptor 
     
    324328        self.tabResolution.setLayout(layout) 
    325329 
     330        # Order widget 
     331        layout = QtWidgets.QGridLayout() 
     332        # pass all data items to access multiple datasets 
     333        self.order_widget = OrderWidget(self, self.all_data) 
     334        layout.addWidget(self.order_widget) 
     335        self.tabOrder.setLayout(layout) 
     336 
    326337        # Define bold font for use in various controls 
    327338        self.boldFont = QtGui.QFont() 
     
    412423        # Delegates for custom editing and display 
    413424        self.lstMagnetic.setItemDelegate(MagnetismViewDelegate(self)) 
     425        # Initial status of the ordering tab - invisible 
     426        self.tabFitting.removeTab(TAB_ORDERING) 
    414427 
    415428    def initializeCategoryCombo(self): 
     
    500513        """ Enable/disable chain fitting """ 
    501514        self.is_chain_fitting = isChecked 
     515        # show/hide the ordering tab 
     516        if isChecked: 
     517            self.tabFitting.insertTab(TAB_ORDERING, self.tabOrder, "Order") 
     518        else: 
     519            self.tabFitting.removeTab(TAB_ORDERING) 
    502520 
    503521    def toggle2D(self, isChecked): 
     
    17561774 
    17571775        fitters = [] 
    1758         for fit_index in self.all_data: 
     1776        # order datasets if chain fit 
     1777        order = self.all_data 
     1778        if self.is_chain_fitting: 
     1779            order = self.order_widget.ordering() 
     1780        for fit_index in order: 
    17591781            fitter_single = Fit() if fitter is None else fitter 
    17601782            data = GuiUtils.dataFromItem(fit_index) 
  • src/sas/qtgui/Perspectives/Fitting/UI/FittingWidgetUI.ui

    r0d2629f r8aa3c4d  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>651</width> 
    10     <height>540</height> 
     9    <width>540</width> 
     10    <height>600</height> 
    1111   </rect> 
    1212  </property> 
     
    428428      </layout> 
    429429     </widget> 
     430     <widget class="QWidget" name="tabOrder"> 
     431      <attribute name="title"> 
     432       <string>Order</string> 
     433      </attribute> 
     434     </widget> 
    430435    </widget> 
    431436   </item> 
Note: See TracChangeset for help on using the changeset viewer.