Ignore:
Timestamp:
Jan 17, 2018 4:53:35 AM (6 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:
2d466e4
Parents:
be8f4b0
Message:

Editable moniker field, updating the model below.
Improved table behaviour

File:
1 edited

Legend:

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

    rbe8f4b0 r47d7d2d  
    566566        # widget.params[0] is the parameter we're constraining 
    567567        constraint.param = mc_widget.params[0] 
     568        # Function should have the model name preamble 
     569        #model_name = self.kernel_module.name 
     570        #constraint.func = model_name + ":" + c_text 
    568571        constraint.func = c_text 
    569572 
     
    741744        e.g. [('sld','5*sld_solvent')] 
    742745        """ 
    743         model_name = self.modelName() 
    744         self.kernel_module.name = model_name 
     746        model_name = self.kernel_module.name 
    745747        param_number = self._model_model.rowCount() 
    746748        def preamble(s): 
     
    812814            model = None 
    813815        self.respondToModelStructure(model=model, structure_factor=structure) 
     816 
     817    def replaceConstraintName(self, old_name, new_name=""): 
     818        """ 
     819        Replace names of models in defined constraints 
     820        """ 
     821        param_number = self._model_model.rowCount() 
     822        # loop over parameters 
     823        for row in range(param_number): 
     824            if self.rowHasConstraint(row): 
     825                func = self._model_model.item(row, 1).child(0).data().func 
     826                if old_name in func: 
     827                    new_func = func.replace(old_name, new_name) 
     828                    self._model_model.item(row, 1).child(0).data().func = new_func 
     829 
     830        pass 
    814831 
    815832    def respondToModelStructure(self, model=None, structure_factor=None): 
Note: See TracChangeset for help on using the changeset viewer.