Changeset 7adc2a8 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.