Changeset c660493 in sasview for sansview/perspectives


Ignore:
Timestamp:
Nov 5, 2009 6:20:19 PM (15 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:
58fe6c8
Parents:
c99a6c5
Message:

removed extra sizer resets and fixed bugs on mac

File:
1 edited

Legend:

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

    rcf76ca74 rc660493  
    8282        # the type of optimizer selected, park or scipy 
    8383        self.fitter  = None 
     84        #let fit ready 
     85        self.fitproblem_count = None 
    8486        #Flag to let the plug-in know that it is running stand alone 
    8587        self.standalone=True 
     
    190192                    the fitting option is not allowed 
    191193        """ 
    192         self.graph = graph 
    193         fitOption = "Select data for fitting" 
    194         fitOpenHint =  "Dialog with fitting parameters " 
    195          
     194        #TODO: clean this up so that the string are not copied  
     195        #      multiple times. 
     196        self.graph=graph 
     197        
    196198        for item in graph.plottables: 
    197199            if item.__class__.__name__ is "Data2D": 
     
    434436            self._on_change_engine(engine='park') 
    435437             
     438        self.fitproblem_count = fitproblem_count   
     439           
    436440        from sans.fit.Fitting import Fit 
    437441        self.fitter= Fit(self._fit_engine) 
     
    489493                                       completefn= self._simul_fit_completed, 
    490494                                       updatefn=self._updateFit) 
    491  
     495             
    492496            self.calc_fit.queue() 
    493             if fitproblem_count > 1: 
    494                         #Mac crashes on this. 
    495                 self.calc_fit.ready(2.5) 
    496             else: 
    497                 time.sleep(0.5) 
    498          
     497            self.ready_fit() 
     498             
    499499        except FitAbort: 
    500500            print "in pluging" 
     
    503503            wx.PostEvent(self.parent, StatusEvent(status= msg ,type="stop")) 
    504504            return  
    505             
     505    def ready_fit(self): 
     506        """ 
     507        Ready for another fit 
     508        """ 
     509        if self.fitproblem_count != None and self.fitproblem_count > 1: 
     510            self.calc_fit.ready(2.5) 
     511             
     512        else: 
     513            time.sleep(0.4) 
     514              
    506515    def onCalculateSld(self, event): 
    507516        """ 
     
    978987        wx.PostEvent(self.parent, StatusEvent(status="Plot \ 
    979988        #updating ... ",type="update")) 
    980         self.calc_thread.ready(0.01) 
     989        self.ready_fit() 
     990        #self.calc_thread.ready(0.01) 
    981991     
    982992     
     
    11061116        wx.PostEvent(self.parent, StatusEvent(status="Plot \ 
    11071117        #updating ... ",type="update")) 
    1108         self.calc_thread.ready(0.01) 
     1118        self.ready_fit() 
     1119        #self.calc_thread.ready(0.01) 
    11091120         
    11101121         
Note: See TracChangeset for help on using the changeset viewer.