Ignore:
Timestamp:
Jan 9, 2018 3:44:55 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
a3c94b54
Parents:
6b0c2f6
Message:

More functionality for single model constraints SASVIEW-843

File:
1 edited

Legend:

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

    r6b0c2f6 r2109350  
    3636        switch M1 <-> M2 
    3737        """ 
     38        # Switch parameters 
    3839        self.params[1], self.params[0] = self.params[0], self.params[1] 
     40        # Try to swap parameter names in the line edit 
     41        current_text = self.txtConstraint.text() 
     42        new_text = current_text.replace(self.params[0], self.params[1]) 
     43        self.txtConstraint.setText(new_text) 
     44        # Update labels and tooltips 
    3945        self.setupLabels() 
    4046        self.setupTooltip() 
     
    8894        # 2. ensure the text contains parameter name 
    8995        parameter_string_start = constraint_text.find(param_str) 
    90         has_parameter_name = (parameter_string_start > -1) 
    91         if not has_parameter_name: 
     96        if parameter_string_start < 0: 
    9297            return False 
    9398        parameter_string_end = parameter_string_start + len(param_str) 
    9499 
    95         # 3. parameter name should be a separate word, but can have "()[]*+-/" around 
     100        # 3. parameter name should be a separate word, but can have "()[]*+-/ " around 
    96101        valid_neighbours = "()[]*+-/ " 
    97102        has_only_parameter = False 
Note: See TracChangeset for help on using the changeset viewer.