- Timestamp:
- Jan 20, 2010 1:55:37 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:
- 97603c0
- Parents:
- 6d20b46
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fit_thread.py
r785c8233 r662da312 155 155 except : 156 156 #Stop on exception during fitting. Todo: need to put some mssg and reset progress bar. 157 msg= " Fit Error occurred... %s"%sys.exc_value158 wx.PostEvent(self.parent, StatusEvent(status= msg,type="stop"))159 #raise157 #msg= " Fit Error occurred... %s"%sys.exc_value 158 #wx.PostEvent(self.parent, StatusEvent(status= msg,type="stop")) 159 raise 160 160 -
sansview/perspectives/fitting/fitting.py
r2db1d66 r662da312 453 453 self.current_pg= page 454 454 except: 455 msg= "%s error: %s" % (engineType,sys.exc_value) 456 wx.PostEvent(self.parent, StatusEvent(status= msg )) 457 return 455 raise 456 #msg= "%s error: %s" % (engineType,sys.exc_value) 457 #wx.PostEvent(self.parent, StatusEvent(status= msg )) 458 #return 458 459 459 460 #Do the simultaneous fit 460 461 try: 461 462 ## If a thread is already started, stop it 462 if self.calc_fit!= None and self.calc_fit.isrunning(): 463 return 464 self.calc_fit.stop() 463 #if self.calc_fit!= None and self.calc_fit.isrunning(): 464 # self.calc_fit.stop() 465 465 466 466 wx.PostEvent(self.parent, StatusEvent(status="Start the computation", … … 471 471 time.sleep(0.5) 472 472 ## perform single fit 473 if self._fit_engine=="scipy":473 if fitproblem_count == 1: 474 474 #qmin, qmax= self.current_pg.get_range() 475 self.calc_fit=FitThread(parent =self.parent, 475 print "went here fitproblem_count == 1",fitproblem_count == 1 476 calc_fit=FitThread(parent =self.parent, 476 477 fn= self.fitter, 477 478 cpage=self.current_pg, … … 479 480 completefn= self._single_fit_completed, 480 481 updatefn=self._updateFit) 482 481 483 482 484 else: 483 485 ## Perform more than 1 fit at the time 484 self.calc_fit=FitThread(parent =self.parent,486 calc_fit=FitThread(parent =self.parent, 485 487 fn= self.fitter, 486 488 completefn= self._simul_fit_completed, 487 489 updatefn=self._updateFit) 488 490 489 self.calc_fit.queue()490 self.ready_fit( )491 calc_fit.queue() 492 self.ready_fit(calc_fit=calc_fit) 491 493 492 494 except FitAbort: 493 495 print "in pluging" 494 496 except: 495 msg= "%s error: %s" % (engineType,sys.exc_value) 496 wx.PostEvent(self.parent, StatusEvent(status= msg ,type="stop")) 497 return 498 499 def ready_fit(self): 497 raise 498 # msg= "%s error: %s" % (engineType,sys.exc_value) 499 # wx.PostEvent(self.parent, StatusEvent(status= msg ,type="stop")) 500 # return 501 502 def ready_fit(self, calc_fit): 500 503 """ 501 504 Ready for another fit 502 505 """ 503 506 if self.fitproblem_count != None and self.fitproblem_count > 1: 504 self.calc_fit.ready(2.5)507 calc_fit.ready(2.5) 505 508 506 509 else: … … 626 629 self.fitter.set_data(data=metadata,Uid=self.fit_id, 627 630 smearer=smearer,qmin= qmin,qmax=qmax ) 628 631 print "self.fitter.set_data" 629 632 self.fitter.select_problem_for_fit(Uid= self.fit_id, 630 633 value= value.get_scheduled()) 631 634 value.clear_model_param() 632 635 except: 633 msg= title +" error: %s" % sys.exc_value 634 wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 635 return 636 raise 637 #msg= title +" error: %s" % sys.exc_value 638 #wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 639 #return 636 640 637 641 def _onSelect(self,event): … … 775 779 """ 776 780 except: 777 msg= "Single Fit completed but Following error occurred:%s"% sys.exc_value 778 wx.PostEvent(self.parent, StatusEvent(status=msg,type="stop")) 779 return 781 raise 782 #msg= "Single Fit completed but Following error occurred:%s"% sys.exc_value 783 #wx.PostEvent(self.parent, StatusEvent(status=msg,type="stop")) 784 #return 780 785 781 786 … … 827 832 page.onsetValues(result.fitness, small_param_name,small_out,small_cov) 828 833 except: 829 msg= "Simultaneous Fit completed" 830 msg +=" but Following error occurred:%s"%sys.exc_value 831 wx.PostEvent(self.parent, StatusEvent(status=msg,type="stop")) 832 return 834 raise 835 #msg= "Simultaneous Fit completed" 836 #msg +=" but Following error occurred:%s"%sys.exc_value 837 #wx.PostEvent(self.parent, StatusEvent(status=msg,type="stop")) 838 #return 833 839 834 840
Note: See TracChangeset
for help on using the changeset viewer.