Changeset 68c96d3 in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Mar 1, 2017 5:17:07 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:
6f7f652
Parents:
f46f6dc
Message:

fix the data passing to fitting

File:
1 edited

Legend:

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

    rf46f6dc r68c96d3  
    7373        return True 
    7474 
    75     def setData(self, data=None): 
     75    def setData(self, data_item=None): 
    7676        """ 
    7777        Assign new dataset to the fitting instance 
    7878        """ 
    79         assert(data is not None) 
     79        assert(data_item is not None) 
    8080 
    81         # find an unassigned tab. 
    82         # if none, open a new tab. 
    83         tab_to_send = None 
    84         for tab in self.tabs: 
    85             if tab.acceptsData(): 
    86                 tab_to_send = tab 
    87                 break 
    88         # send data 
    89         if tab_to_send is None: 
    90             self.addFit(data) 
     81        # Find an unassigned tab. 
     82        # If none, open a new tab. 
     83        available_tabs = list(map(lambda tab:tab.acceptsData(), self.tabs)) 
     84 
     85        if True in available_tabs: 
     86            self.tabs[available_tabs.index(True)].data = data_item 
    9187        else: 
    92             tab_to_send.data = data 
    93         pass 
     88            self.addFit(data_item) 
     89 
    9490 
    9591if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.