Changeset 88ada06 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Sep 7, 2018 4:57:51 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
a758043
Parents:
04ce9ac
Message:

support fixed-choice shell parameters (e.g. spherical_sld.shape[n])

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

Legend:

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

    r04ce9ac r88ada06  
    271271    model.header_tooltips = copy.copy(poly_header_error_tooltips) 
    272272 
    273 def addShellsToModel(parameters, model, index): 
     273def addShellsToModel(parameters, model, view, index): 
    274274    """ 
    275275    Find out multishell parameters and update the model with the requested number of them 
     
    294294                    item1_3 = QtGui.QStandardItem(str(p.limits[0])) 
    295295                    item1_4 = QtGui.QStandardItem(str(p.limits[1])) 
    296                     item1_5 = QtGui.QStandardItem(p.units) 
     296                    item1_5 = QtGui.QStandardItem(str(p.units)) 
    297297                    poly_item.appendRow([item1_1, item1_2, item1_3, item1_4, item1_5]) 
    298298                    break 
     
    302302            item3 = QtGui.QStandardItem(str(par.limits[0])) 
    303303            item4 = QtGui.QStandardItem(str(par.limits[1])) 
    304             item5 = QtGui.QStandardItem(par.units) 
    305             model.appendRow([item1, item2, item3, item4, item5]) 
     304            item5 = QtGui.QStandardItem(str(par.units)) 
     305            item5.setEditable(False) 
     306 
     307            # Check if fixed-choice (returns combobox, if so, also makes some items uneditable) 
     308            row = [item1, item2, item3, item4, item5] 
     309            cbox = createFixedChoiceComboBox(par, row) 
     310 
     311            # Append to the model and use the combobox, if required 
     312            model.appendRow(row) 
     313            if cbox is not None: 
     314                view.setIndexWidget(item2.index(), cbox) 
    306315 
    307316def calculateChi2(reference_data, current_data): 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r04f775d r88ada06  
    27092709            self._model_model.removeRows(last_row, remove_rows) 
    27102710 
    2711         FittingUtilities.addShellsToModel(self.model_parameters, self._model_model, index) 
     2711        FittingUtilities.addShellsToModel( 
     2712                self.model_parameters, 
     2713                self._model_model, 
     2714                self.lstParams, 
     2715                index) 
     2716 
    27122717        self.current_shell_displayed = index 
    27132718 
Note: See TracChangeset for help on using the changeset viewer.