Changeset d48cc19 in sasview for src/sas/qtgui/Utilities/GuiUtils.py


Ignore:
Timestamp:
May 2, 2017 9:04:48 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
02ddfb4
Parents:
0a6e097
Message:

Compute/Show? Plot button logic: SASVIEW-271
Unit tests for plotting in fitting: SASVIEW-501

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    r83eb5208 rd48cc19  
    229229    # New plot requested from the GUI manager 
    230230    # Old "NewPlotEvent" 
    231     plotRequestedSignal = QtCore.pyqtSignal(str) 
     231    plotRequestedSignal = QtCore.pyqtSignal(list) 
    232232 
    233233    # Plot update requested from a perspective 
     
    323323    item.appendRow(object_item) 
    324324 
     325def plotsFromFilename(filename, model_item): 
     326    """ 
     327    Returns the list of plots for the item with text=filename in the model 
     328    """ 
     329    assert isinstance(model_item, QtGui.QStandardItemModel) 
     330    assert isinstance(filename, basestring) 
     331 
     332    plot_data = [] 
     333    # Iterate over model looking for named items 
     334    for index in range(model_item.rowCount()): 
     335        item = model_item.item(index) 
     336        if str(item.text()) == filename: 
     337            # TODO: assure item type is correct (either data1/2D or Plotter) 
     338            plot_data.append(item.child(0).data().toPyObject()) 
     339        # Going 1 level deeper only 
     340        for index_2 in range(item.rowCount()): 
     341            item_2 = item.child(index_2) 
     342            if item_2 and item_2.isCheckable(): 
     343                # TODO: assure item type is correct (either data1/2D or Plotter) 
     344                plot_data.append(item_2.child(0).data().toPyObject()) 
     345 
     346    return plot_data 
    325347 
    326348def plotsFromCheckedItems(model_item): 
Note: See TracChangeset for help on using the changeset viewer.