Changeset 0122b8a in sasview for sansview


Ignore:
Timestamp:
Apr 28, 2009 7:17:06 PM (16 years ago)
Author:
Jae Cho <jhjcho@…>
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:
34a0c17
Parents:
c097f02
Message:

revert to enable stop fit for scipy l-s

File:
1 edited

Legend:

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

    r43d00c4 r0122b8a  
    1717## event to know the selected fit engine 
    1818(FitterTypeEvent, EVT_FITTER_TYPE)   = wx.lib.newevent.NewEvent() 
    19 (FitStopEvent, EVT_FIT_STOP)   = wx.lib.newevent.NewEvent() 
    2019_BOX_WIDTH = 76 
    2120 
     
    5857        ## to update the panel according to the fit engine type selected 
    5958        self.Bind(EVT_FITTER_TYPE,self._on_engine_change) 
    60         self.Bind(EVT_FIT_STOP,self._on_fit_complete) 
    6159     
    62     def _on_fit_complete(self, event): 
    63         """ 
    64             When fit is complete ,reset the fit button label. 
    65         """ 
    66         #self.btFit.SetLabel("Fit") 
    67         #self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 
    68         #self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._onFit,id=self.btFit.GetId()) 
    69         pass 
    70          
    71          
     60     
    7261    def _on_engine_change(self, event): 
    7362        """ 
     
    491480        self.manager.onFit() 
    492481        ## allow stopping the fit  
    493         #if self.engine_type=="scipy": 
    494         #    self.btFit.SetLabel("Stop") 
    495         #    self.btFit.Unbind(event=wx.EVT_BUTTON, id= self.btFit.GetId()) 
    496         #    self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._StopFit, id=self.btFit.GetId()) 
    497         #else: 
    498         #    self.btFit.SetLabel("Fit") 
    499         #    self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._onFit, id=self.btFit.GetId()) 
     482        if self.engine_type=="scipy": 
     483            self.btFit.SetLabel("Stop") 
     484            self.btFit.Unbind(event=wx.EVT_BUTTON, id= self.btFit.GetId()) 
     485            self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._StopFit, id=self.btFit.GetId()) 
     486        else: 
     487            self.btFit.SetLabel("Fit") 
     488            self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._onFit, id=self.btFit.GetId()) 
    500489        self.btFit.SetFocus()     
    501490        self.sizer5.Layout() 
     
    509498        if self.engine_type=="scipy": 
    510499            self.manager.stop_fit() 
    511         self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 
    512         self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._onFit,id=self.btFit.GetId()) 
    513         
    514              
     500            self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 
     501            self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._onFit,id=self.btFit.GetId()) 
     502        else: 
     503            self.btFit.Unbind(event=wx.EVT_BUTTON, id=self.btFit.GetId()) 
     504            self.btFit.Bind(event= wx.EVT_BUTTON, handler=self._onFit, id=self.btFit.GetId()) 
    515505        self.btFit.SetFocus()     
    516506        self.sizer5.Layout() 
Note: See TracChangeset for help on using the changeset viewer.