Changeset 6b39d58 in sasview for fittingview/src/sans/perspectives/fitting/basepage.py
- Timestamp:
- Oct 19, 2011 7:58:14 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:
- 5cf5f51
- Parents:
- 3912db5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r166f2f8 r6b39d58 2593 2593 msg = "Applying loaded %s distribution: %s" % (name, path) 2594 2594 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 2595 2595 self._set_array_disp_model(name=name, disp=disp, 2596 values=values, weights=weights) 2597 return basename 2598 2599 def _set_array_disp_model(self, name=None, disp=None, 2600 values=[], weights=[]): 2601 """ 2602 Set array dispersion model 2603 2604 :param name: name of the parameter for the dispersion to be set 2605 :param disp: the polydisperion object 2606 """ 2596 2607 disp.set_weights(values, weights) 2597 2608 self._disp_obj_dict[name] = disp … … 2620 2631 self.state.model._persistency_dict[name.split('.')[0]] = \ 2621 2632 [values,weights] 2622 return basename2623 2633 2634 2624 2635 def _del_array_values(self, name=None): 2625 2636 """ … … 3034 3045 self._get_paste_helper(self.str_parameters, 3035 3046 self.orientation_params, context) 3047 3036 3048 return True 3037 3049 return None … … 3124 3136 :param value: the values for parameter ctrols 3125 3137 """ 3138 is_array = False 3126 3139 if len(value[1]) > 0: 3127 3140 # Only for dispersion func.s … … 3140 3153 if len(pd_vals) > 0 and len(pd_vals) > 0: 3141 3154 if len(pd_vals) == len(pd_weights): 3142 disp_model.set_weights(pd_vals, 3143 pd_weights) 3144 self.values[name] = pd_vals 3145 self.weights[name] = pd_weights 3146 # disable the fixed items for array 3147 item[0].SetValue(False) 3148 item[0].Enable(False) 3149 item[2].Enable(False) 3150 item[3].Show(False) 3151 item[4].Show(False) 3152 item[5].SetValue('') 3153 item[5].Enable(False) 3154 item[6].SetValue('') 3155 item[6].Enable(False) 3155 self._set_disp_array_cb(item=item) 3156 self._set_array_disp_model(name=name, 3157 disp=disp_model, 3158 values=pd_vals, 3159 weights=pd_weights) 3160 is_array = True 3156 3161 except: 3157 3162 pass 3158 self._disp_obj_dict[name] = disp_model3159 self.model.set_dispersion(name,3160 disp_model)3161 self.state._disp_obj_dict[name] = \3162 disp_model3163 self.model.set_dispersion(param_name, disp_model)3164 state.values = self.values3165 state.weights = self.weights3166 self.model._persistency_dict[param_name] = \3167 [state.values, state.weights]3168 3169 3163 if not is_array: 3164 self._disp_obj_dict[name] = disp_model 3165 self.model.set_dispersion(name, 3166 disp_model) 3167 self.state._disp_obj_dict[name] = \ 3168 disp_model 3169 self.model.set_dispersion(param_name, disp_model) 3170 self.state.values = self.values 3171 self.state.weights = self.weights 3172 self.model._persistency_dict[param_name] = \ 3173 [state.values, state.weights] 3174 3170 3175 except: 3171 3176 pass 3177 3178 def _set_disp_array_cb(self, item): 3179 """ 3180 Set cb for array disp 3181 """ 3182 item[0].SetValue(False) 3183 item[0].Enable(False) 3184 item[2].Enable(False) 3185 item[3].Show(False) 3186 item[4].Show(False) 3187 item[5].SetValue('') 3188 item[5].Enable(False) 3189 item[6].SetValue('') 3190 item[6].Enable(False) 3191 3192
Note: See TracChangeset
for help on using the changeset viewer.