Changeset 64b9e61 in sasview


Ignore:
Timestamp:
Nov 16, 2018 9:40:14 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
442a9ae
Parents:
09e0c32
Message:

Thread guards for C&S batch fitting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    r09e0c32 r64b9e61  
    2323    """ 
    2424    fitCompleteSignal = QtCore.pyqtSignal(tuple) 
     25    batchCompleteSignal = QtCore.pyqtSignal(tuple) 
     26    fitFailedSignal = QtCore.pyqtSignal(tuple) 
     27 
    2528    def __init__(self, parent=None): 
    2629        super(ConstraintWidget, self).__init__() 
     
    6063        Set up various widget states 
    6164        """ 
     65        # disable special cases until properly defined 
     66        self.label.setVisible(False) 
     67        self.cbCases.setVisible(False) 
     68 
    6269        labels = ['FitPage', 'Model', 'Data', 'Mnemonic'] 
    6370        # tab widget - headers 
     
    8087        self.tblConstraints.setEnabled(False) 
    8188        header = self.tblConstraints.horizontalHeaderItem(0) 
    82         header.setToolTip("Double click to edit.") 
     89        header.setToolTip("Double click a row below to edit the constraint.") 
    8390 
    8491        self.tblConstraints.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) 
     
    105112        # Internal signals 
    106113        self.fitCompleteSignal.connect(self.fitComplete) 
     114        self.batchCompleteSignal.connect(self.batchComplete) 
     115        self.fitFailedSignal.connect(self.fitFailed) 
    107116 
    108117        # External signals 
     
    171180        try: 
    172181            for tab in tabs_to_fit: 
     182                if not self.isTabImportable(tab): continue 
    173183                tab_object = ObjectLibrary.getObject(tab) 
    174184                if tab_object is None: 
     
    229239 
    230240        #disable the Fit button 
     241        self.cmdFit.setStyleSheet('QPushButton {color: red;}') 
    231242        self.cmdFit.setText('Running...') 
    232243        self.parent.communicate.statusBarUpdateSignal.emit('Fitting started...') 
     
    334345        """ 
    335346        #re-enable the Fit button 
     347        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    336348        self.cmdFit.setText("Fit") 
    337349        self.cmdFit.setEnabled(True) 
     
    370382    def onBatchFitComplete(self, result): 
    371383        """ 
     384        Send the fit complete signal to main thread 
     385        """ 
     386        self.batchCompleteSignal.emit(result) 
     387 
     388    def batchComplete(self, result): 
     389        """ 
    372390        Respond to the successful batch fit complete signal 
    373391        """ 
    374392        #re-enable the Fit button 
     393        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    375394        self.cmdFit.setText("Fit") 
    376395        self.cmdFit.setEnabled(True) 
     
    395414    def onFitFailed(self, reason): 
    396415        """ 
     416        Send the fit failed signal to main thread 
     417        """ 
     418        self.fitFailedSignal.emit(result) 
     419 
     420    def fitFailed(self, reason): 
     421        """ 
    397422        Respond to fitting failure. 
    398423        """ 
    399424        #re-enable the Fit button 
     425        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    400426        self.cmdFit.setText("Fit") 
    401427        self.cmdFit.setEnabled(True) 
Note: See TracChangeset for help on using the changeset viewer.