Ignore:
Timestamp:
Sep 7, 2018 5:57:38 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:
3fbd77b
Parents:
f3a19ad
Message:

shell parameters appear in P(Q) section correctly

File:
1 edited

Legend:

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

    rc7809a9 r70f4458  
    259259    model.header_tooltips = copy.copy(poly_header_error_tooltips) 
    260260 
    261 def addShellsToModel(parameters, model, index): 
    262     """ 
    263     Find out multishell parameters and update the model with the requested number of them 
     261def addShellsToModel(parameters, model, index, row_num=None): 
     262    """ 
     263    Find out multishell parameters and update the model with the requested number of them. 
     264    Inserts them after the row at row_num, if not None; otherwise, appends to end. 
     265    Returns a list of lists of QStandardItem objects. 
    264266    """ 
    265267    multishell_parameters = getIterParams(parameters) 
    266268 
     269    rows = [] 
    267270    for i in range(index): 
    268271        for par in multishell_parameters: 
     
    291294            item4 = QtGui.QStandardItem(str(par.limits[1])) 
    292295            item5 = QtGui.QStandardItem(par.units) 
    293             model.appendRow([item1, item2, item3, item4, item5]) 
     296            row = [item1, item2, item3, item4, item5] 
     297            rows.append(row) 
     298 
     299            if row_num is None: 
     300                model.appendRow(row) 
     301            else: 
     302                model.insertRow(row_num, row) 
     303                row_num += 1 
     304 
     305    return rows 
    294306 
    295307def calculateChi2(reference_data, current_data): 
Note: See TracChangeset for help on using the changeset viewer.