- Timestamp:
- Aug 1, 2017 5:12:36 AM (7 years ago)
- Branches:
- 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
- Children:
- 985ad94
- Parents:
- 0d13814
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FitThread.py
rdc5ef15 r7adc2a8 74 74 list_reset_flag) 75 75 result = map(map_apply, inputs) 76 77 self.complete(result=result, 78 batch_inputs=self.batch_inputs, 79 batch_outputs=self.batch_outputs, 80 page_id=self.page_id, 81 pars=self.pars, 82 elapsed=time.time() - self.starttime) 83 84 return result[0], time.time()-self.starttime 76 results = (result[0], time.time()-self.starttime) 77 if self.handler: 78 self.completefn(results) 79 else: 80 return (results) 85 81 86 82 except KeyboardInterrupt, msg: … … 96 92 self.handler.stop(msg=msg) 97 93 except Exception as ex: 94 # print "ERROR IN FIT THREAD: ", traceback.format_exc() 98 95 if self.handler is not None: 99 96 self.handler.error(msg=traceback.format_exc()) -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r0d13814 r7adc2a8 27 27 from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI 28 28 from sas.qtgui.Perspectives.Fitting.FitThread import FitThread 29 from sas.qtgui.Perspectives.Fitting.ConsoleUpdate import ConsoleUpdate 30 29 31 from sas.qtgui.Perspectives.Fitting.ModelThread import Calc1D 30 32 from sas.qtgui.Perspectives.Fitting.ModelThread import Calc2D … … 45 47 46 48 DEFAULT_POLYDISP_FUNCTION = 'gaussian' 49 50 USING_TWISTED = True 47 51 48 52 class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI): … … 636 640 list_page_id = [page_id] 637 641 #--------------------------------- 642 if USING_TWISTED: 643 handler = None 644 updater = None 645 else: 646 handler = ConsoleUpdate(parent=self.parent, 647 manager=self, 648 improvement_delta=0.1) 649 updater = handler.update_fit 638 650 639 651 # Parameterize the fitter … … 653 665 batch_outputs=batch_outputs, 654 666 page_id=list_page_id, 655 updatefn=self.updateFit, 656 completefn=None) 657 658 # start the trhrhread 659 calc_thread = threads.deferToThread(calc_fit.compute) 660 calc_thread.addCallback(self.fitComplete) 661 calc_thread.addErrback(self.fitFailed) 667 updatefn=updater, 668 completefn=self.fitComplete) 669 670 if USING_TWISTED: 671 # start the trhrhread with twisted 672 calc_thread = threads.deferToThread(calc_fit.compute) 673 calc_thread.addCallback(self.fitComplete) 674 calc_thread.addErrback(self.fitFailed) 675 else: 676 # Use the old python threads + Queue 677 calc_fit.queue() 678 calc_fit.ready(2.5) 679 662 680 663 681 #disable the Fit button 664 self.cmdFit.setText(' Calculating...')682 self.cmdFit.setText('Running...') 665 683 self.communicate.statusBarUpdateSignal.emit('Fitting started...') 666 684 self.cmdFit.setEnabled(False)
Note: See TracChangeset
for help on using the changeset viewer.