- Timestamp:
- May 4, 2018 10:10:43 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:
- 3c6ecd9
- Parents:
- 72ecbdf2
- Location:
- src/sas/qtgui/Perspectives/Inversion
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/DMaxExplorerWidget.py
r72ecbdf2 rb0ba43e 81 81 82 82 def setupModel(self): 83 self.model.blockSignals(True) 83 84 self.model.setItem(W.NPTS, QtGui.QStandardItem(str(self.nfunc))) 85 self.model.blockSignals(False) 86 self.model.blockSignals(True) 84 87 self.model.setItem(W.DMIN, QtGui.QStandardItem("{:.1f}".format(0.9*self.pr_state.d_max))) 88 self.model.blockSignals(False) 89 self.model.blockSignals(True) 85 90 self.model.setItem(W.DMAX, QtGui.QStandardItem("{:.1f}".format(1.1*self.pr_state.d_max))) 91 self.model.blockSignals(False) 92 self.model.blockSignals(True) 86 93 self.model.setItem(W.VARIABLE, QtGui.QStandardItem( "ϲ/dof")) 94 self.model.blockSignals(False) 87 95 88 96 def setupMapper(self): -
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r72ecbdf2 rb0ba43e 309 309 and not self.isCalculating) 310 310 self.removeButton.setEnabled(self.logic.data_is_loaded) 311 self.explorerButton.setEnabled(self.logic.data_is_loaded) 311 self.explorerButton.setEnabled(self.logic.data_is_loaded 312 and np.all(self.logic.data.dy != 0)) 312 313 self.stopButton.setVisible(self.isCalculating) 313 314 self.regConstantSuggestionButton.setEnabled( … … 421 422 def stopCalculation(self): 422 423 """ Stop all threads, return to the base state and update GUI """ 423 if self.calcThread: 424 self.calcThread.stop() 425 if self.estimationThread: 426 self.estimationThread.stop() 427 if self.estimationThreadNT: 428 self.estimationThreadNT.stop() 424 self.stopCalcThread() 425 self.stopEstimationThread() 426 self.stopEstimateNTThread() 429 427 # Show any batch calculations that successfully completed 430 428 if self.isBatch and self.batchResultsWindow is not None: … … 631 629 # Disable calculation buttons to prevent thread interference 632 630 633 # If athread is already started, stop it634 if self.calcThread is not None and self.calcThread.isrunning():635 self.calcThread.stop() 631 # If the thread is already started, stop it 632 self.stopCalcThread() 633 636 634 pr = self._calculator.clone() 637 635 nfunc = self.getNFunc() … … 643 641 self.calcThread.ready(2.5) 644 642 643 def stopCalcThread(self): 644 """ Stops a thread if it exists and is running """ 645 if self.calcThread is not None and self.calcThread.isrunning(): 646 self.calcThread.stop() 647 645 648 def performEstimateNT(self): 646 649 """ … … 652 655 653 656 # If a thread is already started, stop it 654 if (self.estimationThreadNT is not None and 655 self.estimationThreadNT.isrunning()): 656 self.estimationThreadNT.stop() 657 self.stopEstimateNTThread() 658 657 659 pr = self._calculator.clone() 658 660 # Skip the slit settings for the estimation … … 669 671 self.estimationThreadNT.ready(2.5) 670 672 673 def stopEstimateNTThread(self): 674 if (self.estimationThreadNT is not None and 675 self.estimationThreadNT.isrunning()): 676 self.estimationThreadNT.stop() 677 671 678 def performEstimate(self): 672 679 """ … … 676 683 677 684 # If a thread is already started, stop it 678 if (self.estimationThread is not None and 679 self.estimationThread.isrunning()): 680 self.estimationThread.stop() 685 self.stopEstimationThread() 686 681 687 self.estimationThread = EstimatePr(self._calculator.clone(), 682 688 self.getNFunc(), … … 686 692 self.estimationThread.queue() 687 693 self.estimationThread.ready(2.5) 694 695 def stopEstimationThread(self): 696 """ Stop the estimation thread if it exists and is running """ 697 if (self.estimationThread is not None and 698 self.estimationThread.isrunning()): 699 self.estimationThread.stop() 688 700 689 701 ###################################################################### … … 778 790 """ 779 791 logger.error(error) 792 if self.isBatch: 793 self.startNextBatchItem() 794 else: 795 self.stopCalculation()
Note: See TracChangeset
for help on using the changeset viewer.