Changeset 784e2fa in sasview for sansview/perspectives/fitting


Ignore:
Timestamp:
Apr 23, 2010 12:29:25 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0b57a57
Parents:
479eced
Message:

make sur the fitpage is close when removing data1D from the graph

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpanel.py

    r286bb6c r784e2fa  
    186186            close a fit page when its data is completely remove from the graph 
    187187        """ 
     188        if deleted_data is None: 
     189            return 
    188190        for index in range(self.GetPageCount()): 
    189191            selected_page = self.GetPage(index)  
    190192            if hasattr(selected_page,"get_data"): 
    191193                data = selected_page.get_data() 
     194                if data is None: 
     195                    #the fitpanel exists and only the initial fit page is open  
     196                    #with no selected data 
     197                    return 
    192198                if data.name == deleted_data.name: 
    193199                    self._close_helper(selected_page) 
  • sansview/perspectives/fitting/fitting.py

    r1350c87 r784e2fa  
    618618        """ 
    619619            request fitpanel to close a given page when its unique data is removed  
    620             from the plot 
     620            from the plot. close fitpage only when the a loaded data is removed 
    621621        """     
    622         self.fit_panel.close_page_with_data(event.data)  
     622        if event is None or event.data is None: 
     623            return 
     624        
     625        if hasattr(event.data,"is_data"): 
     626            if not event.data.is_data or event.data.__class__.__name__=="Data1D": 
     627                self.fit_panel.close_page_with_data(event.data)  
    623628         
    624629    def _add_page_onmenu(self, name,fitproblem=None): 
     
    697702            self.fitter.set_data(data=metadata,Uid=self.fit_id, 
    698703                                 smearer=smearer,qmin= qmin,qmax=qmax ) 
    699             #print "self.fitter.set_data" 
     704            
    700705            self.fitter.select_problem_for_fit(Uid= self.fit_id, 
    701706                                               value= value.get_scheduled()) 
Note: See TracChangeset for help on using the changeset viewer.