Changes in src/sas/sasgui/perspectives/fitting/basepage.py [55db501:f22b43c] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r55db501 rf22b43c 142 142 self.theory_qmin_x = None 143 143 self.theory_qmax_x = None 144 self.cb1 = None145 144 self.btEditMask = None 146 145 self.btFit = None … … 281 280 num=self.npts_x, endpoint=True) 282 281 self.data = Data1D(x=x) 283 #self.data.xaxis('\\rm{Q}', "A^{-1}") 284 self.data.xaxis('\\rm{X}', "") 285 #self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 286 self.data.yaxis('\\rm{Y}', "") 282 self.data.xaxis('\\rm{Q}', "A^{-1}") 283 self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 287 284 self.data.is_data = False 288 285 self.data.id = str(self.uid) + " data" … … 309 306 num=self.npts_x, endpoint=True, base=10.0) 310 307 self.data = Data1D(x=x) 311 #self.data.xaxis('\\rm{Q}', "A^{-1}") 312 #self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 313 self.data.xaxis('\\rm{X}', "") 314 self.data.yaxis('\\rm{Y}', "") 308 self.data.xaxis('\\rm{Q}', "A^{-1}") 309 self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 315 310 self.data.is_data = False 316 311 self.data.id = str(self.uid) + " data" … … 1127 1122 # set data, etc. from the state 1128 1123 # reset page between theory and fitting from bookmarking 1129 #if state.data == None:1130 # data = None1131 #else:1132 1124 data = state.data 1133 1125 … … 1155 1147 self.disp_cb_dict = state.disp_cb_dict 1156 1148 self.disp_list = state.disp_list 1157 1158 ## set the state of the radio box1159 #self.shape_rbutton.SetValue(state.shape_rbutton)1160 #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton)1161 #self.struct_rbutton.SetValue(state.struct_rbutton)1162 #self.plugin_rbutton.SetValue(state.plugin_rbutton)1163 1149 1164 1150 ## fill model combobox … … 1221 1207 else: 1222 1208 self.model_view.SetLabel("1D Mode") 1223 1224 ## set the select all check box to the a given state1225 self.cb1.SetValue(state.cb1)1226 1209 1227 1210 ## reset state of checkbox,textcrtl and regular parameters value … … 1354 1337 logging.error(traceback.format_exc()) 1355 1338 1356 # Make sure the check box updated when all checked1357 if self.cb1.GetValue():1358 self.select_all_param(None)1359 1360 1339 def _selectDlg(self): 1361 1340 """ … … 1418 1397 self.state.npts = self.npts_x 1419 1398 1420 def _onparamEnter_helper(self, is_modified =False):1399 def _onparamEnter_helper(self, is_modified=False): 1421 1400 """ 1422 1401 check if values entered by the user are changed and valid to replot … … 1460 1439 self.fitrange = False 1461 1440 1462 if not self.data.is_data:1463 is_modified = True1464 1465 1441 ## if any value is modify draw model with new value 1466 1442 if not self.fitrange: … … 1478 1454 self._draw_model() 1479 1455 self.Refresh() 1456 1457 #logging.info("is_modified flag set to %g",is_modified) 1480 1458 return is_modified 1481 1459 … … 2499 2477 item[2].Enable() 2500 2478 2501 # Make sure the check box updated when all checked 2502 if self.cb1.GetValue(): 2503 #self.select_all_param(None) 2504 self.get_all_checked_params() 2479 # Make sure the check box updated 2480 self.get_all_checked_params() 2505 2481 2506 2482 # update params … … 3077 3053 """ 3078 3054 content = '' 3079 bound_hi = ''3080 bound_lo = ''3081 3055 # go through the str params 3082 3056 for item in param: … … 3110 3084 value = item[2].GetValue() 3111 3085 3112 # Bounds3113 try:3114 bound_lo = item[5].GetValue()3115 bound_hi = item[6].GetValue()3116 except Exception:3117 # harmless - need to just pass3118 pass3119 3120 3086 # add to the content 3121 3087 if disfunc != '': … … 3133 3099 except Exception: 3134 3100 logging.error(traceback.format_exc()) 3135 content += name + ',' + str(check) + ',' +\ 3136 value + disfunc + ',' + bound_lo + ',' +\ 3137 bound_hi + ':' 3101 content += name + ',' + str(check) + ',' + value + disfunc + ':' 3138 3102 3139 3103 return content … … 3186 3150 # Transfer the text to content[dictionary] 3187 3151 context[name] = [check, value] 3188 3189 # limits3190 limit_lo = item[3]3191 context[name].append(limit_lo)3192 limit_hi = item[4]3193 context[name].append(limit_hi)3194 3195 3152 # ToDo: PlugIn this poly disp function for pasting 3196 3153 try: 3197 poly_func = item[ 5]3154 poly_func = item[3] 3198 3155 context[name].append(poly_func) 3199 3156 try: 3200 3157 # take the vals and weights for array 3201 array_values = item[ 6].split(' ')3202 array_weights = item[ 7].split(' ')3158 array_values = item[4].split(' ') 3159 array_weights = item[5].split(' ') 3203 3160 val = [float(a_val) for a_val in array_values[1:]] 3204 3161 weit = [float(a_weit) for a_weit in array_weights[1:]] … … 3248 3205 name = item[1] 3249 3206 if name in content.keys(): 3250 values = content[name] 3251 check = values[0] 3252 pd = values[1] 3253 3207 check = content[name][0] 3208 pd = content[name][1] 3254 3209 if name.count('.') > 0: 3255 3210 # If this is parameter.width, then pd may be a floating … … 3274 3229 fun_val = self.model.fun_list[content[name][1]] 3275 3230 self.model.setParam(name, fun_val) 3276 try:3277 item[5].SetValue(str(values[-3]))3278 item[6].SetValue(str(values[-2]))3279 except Exception:3280 # passing as harmless non-update3281 pass3282 3231 3283 3232 value = content[name][1:] … … 3324 3273 self.model.setParam(name, fun_val) 3325 3274 # save state 3326 try:3327 item[5].SetValue(str(value[-3]))3328 item[6].SetValue(str(value[-2]))3329 except Exception:3330 # passing as harmless non-update3331 pass3332 3333 3275 self._paste_poly_help(item, value) 3334 3276 if check == 'True': … … 3365 3307 """ 3366 3308 # Do nothing if not setting polydispersity 3367 if len(value[ 3]) == 0:3309 if len(value[1]) == 0: 3368 3310 return 3369 3311 … … 3681 3623 call back for model selection if implemented 3682 3624 """ 3683 def select_all_param(self, event):3684 """3685 set to true or false all checkBox if implemented3686 """3687 3625 def get_weight_flag(self): 3688 3626 """
Note: See TracChangeset
for help on using the changeset viewer.