Ignore:
Timestamp:
Nov 14, 2018 5:43:28 AM (5 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:
ecc5d043
Parents:
e5ae812
Message:

Added Edit to single page constraint SASVIEW-1043

File:
1 edited

Legend:

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

    r305114c rbaeac95  
    2020    Logic class for interacting with MultiConstrainedUI view 
    2121    """ 
    22     def __init__(self, parent=None, params=None): 
     22    def __init__(self, parent=None, params=None, constraint=None): 
    2323        """ 
    2424        parent: ConstraintWidget object 
     
    3131        self.params = params 
    3232        self.parent = parent 
     33        self.function = None 
     34 
     35        self.input_constraint = constraint 
     36        if self.input_constraint is not None: 
     37            variable = constraint.value 
     38            #variable = func[func.index('.')+1:] 
     39            self.function = constraint.func 
     40            self.params.append(variable) 
     41            self.model_name = constraint.value_ex 
     42        else: 
     43            self.model_name = self.params[1] 
    3344 
    3445        self.setupLabels() 
     
    3647 
    3748        # Set param text control to the second parameter passed 
    38         self.txtConstraint.setText(self.params[1]) 
    39  
     49        if self.input_constraint is None: 
     50            self.txtConstraint.setText(self.params[1]) 
     51        else: 
     52            self.txtConstraint.setText(self.function) 
    4053        self.cmdOK.clicked.connect(self.accept) 
    4154        self.cmdHelp.clicked.connect(self.onHelp) 
     
    5265        # Switch parameters 
    5366        self.params[1], self.params[0] = self.params[0], self.params[1] 
     67        # change fully qualified param name (e.g. M1.sld -> M1.sld_solvent) 
     68        self.model_name = self.model_name.replace(self.params[0], self.params[1]) 
    5469        # Try to swap parameter names in the line edit 
    5570        current_text = self.txtConstraint.text() 
     
    6479        Setup labels based on current parameters 
    6580        """ 
    66         l1 = self.params[0] 
    67         l2 = self.params[1] 
     81        l1 = str(self.params[0]) 
     82        l2 = str(self.params[1]) 
    6883        self.txtParam1.setText(l1) 
    6984        self.txtParam1_2.setText(l1) 
     
    99114            return False 
    100115 
    101         param_str = str(self.params[1]) 
    102         constraint_text = constraint_text.strip() 
     116        param_str = self.model_name 
    103117 
    104118        # 1. just the parameter 
Note: See TracChangeset for help on using the changeset viewer.