Changeset 706667b in sasview for fittingview/src/sans
- Timestamp:
- Oct 4, 2011 9:42:17 PM (13 years ago)
- 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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 31469d50
- Parents:
- 1cff677
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r68a921f r706667b 2884 2884 try: 2885 2885 if item[7].__class__.__name__ == 'ComboBox': 2886 disfunc = item[7].GetLabel()2886 disfunc = str(item[7].GetValue()) 2887 2887 except: 2888 disfunc = ''2889 2888 pass 2889 2890 2890 # 2D 2891 2891 if self.data.__class__.__name__== "Data2D": … … 2898 2898 name = item[1] 2899 2899 value = item[2].GetValue() 2900 else: 2901 disfunc = '' 2900 2902 2901 # add to the content 2903 2902 if disfunc != '': 2903 2904 2904 disfunc = ',' + disfunc 2905 content += name + ',' + value + disfunc + ':' 2905 # TODO: to support array func for copy/paste 2906 if disfunc.count('array') == 0: 2907 content += name + ',' + value + disfunc + ':' 2906 2908 2907 2909 return content … … 2950 2952 value = item[1] 2951 2953 # Transfer the text to content[dictionary] 2952 context[name] = value2954 context[name] = [value] 2953 2955 # ToDo: PlugIn this poly disp function for pasting 2954 if len(line) == 3:2956 try: 2955 2957 poly_func = item[2] 2956 e lse:2958 except: 2957 2959 poly_func = None 2960 context[name].append(poly_func) 2961 2958 2962 # Do it if params exist 2959 2963 if self.parameters != []: … … 2964 2968 # go through the fittables 2965 2969 self._get_paste_helper(self.fittable_param, 2966 self.orientation_params_disp, context) 2970 self.orientation_params_disp, 2971 context) 2967 2972 2968 2973 # go through the fixed params … … 2990 2995 name = item[1] 2991 2996 if name in content.keys(): 2992 item[2].SetValue(content[name]) 2993 # 1D 2997 2998 if name.count('.') > 0: 2999 try: 3000 float(content[name][0]) 3001 except: 3002 continue 3003 item[2].SetValue(content[name][0]) 3004 if item[2].__class__.__name__ == "ComboBox": 3005 if self.model.fun_list.has_key(content[name][0]): 3006 fun_val = self.model.fun_list[content[name][0]] 3007 self.model.setParam(name,fun_val) 3008 3009 poly_func = content[name][1] 3010 if poly_func: 3011 try: 3012 item[7].SetValue(poly_func) 3013 selection = item[7].GetCurrentSelection() 3014 param_name = item[7].Name.split('.')[0] 3015 disp_name = item[7].GetValue() 3016 dispersity= item[7].GetClientData(selection) 3017 disp_model = dispersity() 3018 #disp_model = self._disp_obj_dict[name] 3019 self.model.set_dispersion(param_name, disp_model) 3020 self.state._disp_obj_dict[param_name]= disp_model 3021 except: 3022 pass 3023 # 1D 2994 3024 else: 2995 3025 ## for 1D all parameters except orientation … … 2999 3029 # Avoid changing combox content which needs special care 3000 3030 value = content[name] 3001 item[2].SetValue(value) 3031 if name.count('.') > 0: 3032 try: 3033 float(value[0]) 3034 except: 3035 continue 3036 item[2].SetValue(value[0]) 3002 3037 if item[2].__class__.__name__ == "ComboBox": 3003 if self.model.fun_list.has_key(value ):3004 fun_val = self.model.fun_list[value ]3038 if self.model.fun_list.has_key(value[0]): 3039 fun_val = self.model.fun_list[value[0]] 3005 3040 self.model.setParam(name,fun_val) 3006 3041 # save state 3007 3042 #self._copy_parameters_state(self.str_parameters, 3008 3043 # self.state.str_parameters) 3009 3044 if value[1]: 3045 try: 3046 item[7].SetValue(value[1]) 3047 selection = item[7].GetCurrentSelection() 3048 param_name = item[7].Name.split('.')[0] 3049 disp_name = item[7].GetValue() 3050 dispersity= item[7].GetClientData(selection) 3051 disp_model = dispersity() 3052 self.model.set_dispersion(param_name, disp_model) 3053 self.state._disp_obj_dict[param_name]= disp_model 3054 except: 3055 pass
Note: See TracChangeset
for help on using the changeset viewer.