Ignore:
File:
1 edited

Legend:

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

    raed0532 r305114c  
    1313import webbrowser 
    1414 
     15from sas.qtgui.Perspectives.Fitting import FittingUtilities 
    1516import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1617ALLOWED_OPERATORS = ['=','<','>','>=','<='] 
     
    3233        self.operator = '=' 
    3334 
     35        self.warning = self.lblWarning.text() 
    3436        self.setupData() 
     37        self.setupSignals() 
    3538        self.setupWidgets() 
    36         self.setupSignals() 
    3739        self.setupTooltip() 
    38  
    39         self.setFixedSize(self.minimumSizeHint()) 
    4040 
    4141        # Default focus is on OK 
     
    101101        # Find out the signal source 
    102102        source = self.sender().objectName() 
     103        param1 = self.cbParam1.currentText() 
     104        param2 = self.cbParam2.currentText() 
    103105        if source == "cbParam1": 
    104             self.txtParam.setText(self.tab_names[0] + ":" + self.cbParam1.currentText()) 
     106            self.txtParam.setText(self.tab_names[0] + ":" + param1) 
    105107        else: 
    106             self.txtConstraint.setText(self.tab_names[1] + "." + self.cbParam2.currentText()) 
     108            self.txtConstraint.setText(self.tab_names[1] + "." + param2) 
     109        # Check if any of the parameters are polydisperse 
     110        params_list = [param1, param2] 
     111        all_pars = [tab.model_parameters for tab in self.tabs] 
     112        is2Ds = [tab.is2D for tab in self.tabs] 
     113        txt = "" 
     114        for pars, is2D in zip(all_pars, is2Ds): 
     115            if any([FittingUtilities.isParamPolydisperse(p, pars, is2D) for p in params_list]): 
     116                # no parameters are pd - reset the text to not show the warning 
     117                txt = self.warning 
     118        self.lblWarning.setText(txt) 
     119 
    107120 
    108121    def onOperatorChange(self, index): 
Note: See TracChangeset for help on using the changeset viewer.