Changeset 5223602 in sasview


Ignore:
Timestamp:
Oct 10, 2016 3:19:50 PM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b61bd57
Parents:
3bec50a
git-author:
Piotr Rozyczko <rozyczko@…> (10/10/16 15:18:48)
git-committer:
Piotr Rozyczko <rozyczko@…> (10/10/16 15:19:50)
Message:

Enable copy/paste of constraints. Also for dispersity. Fixed #682

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r3bec50a r5223602  
    30383038        """ 
    30393039        content = '' 
     3040        bound_hi = '' 
     3041        bound_lo = '' 
    30403042        # go through the str params 
    30413043        for item in param: 
     
    30693071                    value = item[2].GetValue() 
    30703072 
     3073            # Bounds 
     3074            try: 
     3075                bound_lo = item[5].GetValue() 
     3076                bound_hi = item[6].GetValue() 
     3077            except Exception: 
     3078                # harmless - need to just pass 
     3079                pass 
     3080 
    30713081            # add to the content 
    30723082            if disfunc != '': 
     
    30843094            except Exception: 
    30853095                logging.error(traceback.format_exc()) 
    3086             content += name + ',' + str(check) + ',' + value + disfunc + ':' 
     3096            content += name + ',' + str(check) + ',' +\ 
     3097                    value + disfunc + ',' + bound_lo + ',' +\ 
     3098                    bound_hi + ':' 
    30873099 
    30883100        return content 
     
    31353147                # Transfer the text to content[dictionary] 
    31363148                context[name] = [check, value] 
     3149 
     3150                # limits 
     3151                limit_lo = item[3] 
     3152                context[name].append(limit_lo) 
     3153                limit_hi = item[4] 
     3154                context[name].append(limit_hi) 
     3155 
    31373156            # ToDo: PlugIn this poly disp function for pasting 
    31383157            try: 
    3139                 poly_func = item[3] 
     3158                poly_func = item[5] 
    31403159                context[name].append(poly_func) 
    31413160                try: 
    31423161                    # take the vals and weights for  array 
    3143                     array_values = item[4].split(' ') 
    3144                     array_weights = item[5].split(' ') 
     3162                    array_values = item[6].split(' ') 
     3163                    array_weights = item[7].split(' ') 
    31453164                    val = [float(a_val) for a_val in array_values[1:]] 
    31463165                    weit = [float(a_weit) for a_weit in array_weights[1:]] 
     
    31903209                name = item[1] 
    31913210                if name in content.keys(): 
    3192                     check = content[name][0] 
    3193                     pd = content[name][1] 
     3211                    values = content[name] 
     3212                    check = values[0] 
     3213                    pd = values[1] 
     3214 
    31943215                    if name.count('.') > 0: 
    31953216                        # If this is parameter.width, then pd may be a floating 
     
    32143235                            fun_val = self.model.fun_list[content[name][1]] 
    32153236                            self.model.setParam(name, fun_val) 
     3237                    try: 
     3238                        item[5].SetValue(str(values[-3])) 
     3239                        item[6].SetValue(str(values[-2])) 
     3240                    except Exception: 
     3241                        # passing as harmless non-update 
     3242                        pass 
    32163243 
    32173244                    value = content[name][1:] 
     
    32583285                                self.model.setParam(name, fun_val) 
    32593286                                # save state 
     3287                        try: 
     3288                            item[5].SetValue(str(value[-3])) 
     3289                            item[6].SetValue(str(value[-2])) 
     3290                        except Exception: 
     3291                            # passing as harmless non-update 
     3292                            pass 
     3293 
    32603294                        self._paste_poly_help(item, value) 
    32613295                        if check == 'True': 
     
    32923326        """ 
    32933327        # Do nothing if not setting polydispersity 
    3294         if len(value[1]) == 0: 
     3328        if len(value[3]) == 0: 
    32953329            return 
    32963330 
Note: See TracChangeset for help on using the changeset viewer.