Changeset e54d2c32 in sasview for sansview/perspectives/fitting/fitting.py
- Timestamp:
- Apr 13, 2010 3:48:35 PM (15 years ago)
- 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:
- 90c9cdf
- Parents:
- e0072082
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r018a0bd re54d2c32 29 29 from sans.fit.AbstractFitEngine import Model 30 30 from sans.fit.AbstractFitEngine import FitAbort 31 31 from console import ConsoleUpdate 32 32 33 33 from fitproblem import FitProblem … … 462 462 type="stop")) 463 463 return 464 465 #Do the simultaneous fit 466 try: 467 ## If a thread is already started, stop it 468 #if self.calc_fit!= None and self.calc_fit.isrunning(): 469 # self.calc_fit.stop() 470 471 wx.PostEvent(self.parent, StatusEvent(status="Start the computation", 472 curr_thread=self.calc_fit,type="start")) 473 time.sleep(0.5) 474 wx.PostEvent(self.parent, StatusEvent(status="Computing...", 475 curr_thread=self.calc_fit,type="progress")) 476 time.sleep(0.5) 477 ## perform single fit 478 if fitproblem_count == 1: 479 #qmin, qmax= self.current_pg.get_range() 480 #print "went here fitproblem_count == 1",fitproblem_count == 1 481 calc_fit=FitThread(parent =self.parent, 482 fn= self.fitter, 483 cpage=self.current_pg, 484 pars= pars, 485 completefn= self._single_fit_completed, 486 updatefn=self._updateFit) 487 488 489 else: 490 ## Perform more than 1 fit at the time 491 calc_fit=FitThread(parent =self.parent, 492 fn= self.fitter, 493 completefn= self._simul_fit_completed, 494 updatefn=self._updateFit) 495 496 calc_fit.queue() 497 self.ready_fit(calc_fit=calc_fit) 498 499 except FitAbort: 500 print "in pluging" 501 except: 502 msg= "%s error: %s" % (engineType,sys.exc_value) 503 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 504 type="stop")) 505 return 506 464 ## If a thread is already started, stop it 465 #if self.calc_fit!= None and self.calc_fit.isrunning(): 466 # self.calc_fit.stop() 467 #Handler used for park engine displayed message 468 handler = ConsoleUpdate(parent=self.parent,improvement_delta=0.1) 469 ## perform single fit 470 if fitproblem_count == 1: 471 calc_fit=FitThread(parent =self.parent, 472 handler = handler, 473 fn= self.fitter, 474 cpage=self.current_pg, 475 pars= pars, 476 updatefn=handler.update_fit, 477 completefn= self._single_fit_completed) 478 else: 479 ## Perform more than 1 fit at the time 480 calc_fit=FitThread(parent=self.parent, 481 handler=handler, 482 fn= self.fitter, 483 completefn= self._simul_fit_completed, 484 updatefn=handler.update_fit) 485 486 calc_fit.queue() 487 self.ready_fit(calc_fit=calc_fit) 488 507 489 def ready_fit(self, calc_fit): 508 490 """ … … 740 722 data = self.create_fittable_data2D(data=plottable) 741 723 self.add_fit_page(data=data) 742 743 def _updateFit(self):744 """745 Is called when values of result are available746 """747 ##Sending a progess message to the status bar748 wx.PostEvent(self.parent, StatusEvent(status="Computing..."))749 724 750 725 def _single_fit_completed(self,result,pars,cpage, elapsed=None):
Note: See TracChangeset
for help on using the changeset viewer.