Changeset 72ecbdf2 in sasview for src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
- Timestamp:
- May 2, 2018 8:59:34 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:
- b0ba43e
- Parents:
- 6da860a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r6da860a r72ecbdf2 79 79 self.estimationThread = None 80 80 self.estimationThreadNT = None 81 self.isCalculating = False 81 82 82 83 # Mapping for all data items … … 167 168 self.calculateAllButton.clicked.connect(self.startThreadAll) 168 169 self.calculateThisButton.clicked.connect(self.startThread) 170 self.stopButton.clicked.connect(self.stopCalculation) 169 171 self.removeButton.clicked.connect(self.removeData) 170 172 self.helpButton.clicked.connect(self.help) … … 301 303 """ 302 304 self.calculateAllButton.setEnabled(len(self._dataList) > 1 303 and not self.isBatch) 305 and not self.isBatch 306 and not self.isCalculating) 304 307 self.calculateThisButton.setEnabled(self.logic.data_is_loaded 305 and not self.isBatch) 308 and not self.isBatch 309 and not self.isCalculating) 306 310 self.removeButton.setEnabled(self.logic.data_is_loaded) 307 311 self.explorerButton.setEnabled(self.logic.data_is_loaded) 312 self.stopButton.setVisible(self.isCalculating) 308 313 self.regConstantSuggestionButton.setEnabled( 309 314 self.logic.data_is_loaded and … … 413 418 self.batchResultsWindow.setupTable(self.batchResults) 414 419 self.batchResultsWindow.show() 420 421 def stopCalculation(self): 422 """ 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() 429 # Show any batch calculations that successfully completed 430 if self.isBatch and self.batchResultsWindow is not None: 431 self.showBatchOutput() 432 self.isBatch = False 433 self.isCalculating = False 434 self.updateGuiValues() 415 435 416 436 ###################################################################### … … 571 591 572 592 def startThreadAll(self): 593 self.isCalculating = True 573 594 self.isBatch = True 574 595 self.batchComplete = [] … … 592 613 else: 593 614 # If no data sets left, end batch calculation 615 self.isCalculating = False 594 616 self.batchComplete = [] 595 617 self.calculateAllButton.setText("Calculate All") … … 604 626 605 627 # Set data before running the calculations 628 self.isCalculating = True 629 self.enableButtons() 606 630 self.updateCalculator() 607 631 # Disable calculation buttons to prevent thread interference 608 self.calculateAllButton.setEnabled(False)609 self.calculateThisButton.setEnabled(False)610 632 611 633 # If a thread is already started, stop it … … 744 766 # Udpate internals and GUI 745 767 self.updateDataList(self._data) 746 self.updateGuiValues()747 768 if self.isBatch: 748 769 self.batchComplete.append(self.dataList.currentIndex()) 749 770 self.startNextBatchItem() 771 else: 772 self.isCalculating = False 773 self.updateGuiValues() 750 774 751 775 def _threadError(self, error):
Note: See TracChangeset
for help on using the changeset viewer.