Changeset 60132ef in sasview
- Timestamp:
- Apr 15, 2009 3:35:39 PM (16 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:
- dcd330b
- Parents:
- 6063b16
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r998b6b8 r60132ef 1 1 2 import sys 2 import sys, os 3 3 import wx 4 4 import numpy … … 57 57 ## list of orientation parameters 58 58 self.orientation_params=[] 59 self.orientation_params_disp=[] 59 60 if self.model !=None: 60 61 self.disp_list= self.model.getDispParamList() … … 76 77 self.saved_states={} 77 78 self.slicerpop = wx.Menu() 78 79 ## Default locations 80 self._default_save_location = os.getcwd() 79 81 ## save initial state on context menu 80 82 self.onSave(event=None) … … 263 265 self.disp_cb_dict[p].SetValue(False) 264 266 return 265 267 try: 268 self._default_save_location = os.path.dirname(path) 269 except: 270 pass 266 271 try: 267 272 values,weights = self.read_file(path) … … 289 294 #TODO: refactor model to clean this up? 290 295 self._disp_obj_dict[p] = disp_model 291 296 print "dispersity------>",p 292 297 # Set the new model as the dispersion object for the selected parameter 293 298 self.model.set_dispersion(p, disp_model) … … 432 437 if hasattr(self,"cb1"): 433 438 self.state.cb1= self.cb1.GetValue() 434 print "save current state ",self.state.cb1439 435 440 if hasattr(self,"enable_disp"): 436 441 self.state.enable_disp= self.enable_disp.GetValue() … … 447 452 self.state.fittable_param=[] 448 453 self.state.fixed_param=[] 454 449 455 self._copy_parameters_state(self.parameters, self.state.parameters) 450 456 self._copy_parameters_state(self.fittable_param, self.state.fittable_param) … … 501 507 """ 502 508 import os 503 dlg = wx.FileDialog(self, "Choose a weight file", os.getcwd(), "", "*.*", wx.OPEN) 509 dlg = wx.FileDialog(self, "Choose a weight file", 510 self._default_save_location , "", "*.*", wx.OPEN) 504 511 path = None 505 512 if dlg.ShowModal() == wx.ID_OK: … … 1183 1190 draw sizer with array dispersity parameters 1184 1191 """ 1192 self.orientation_params_disp=[] 1185 1193 self.sizer4_4.Clear(True) 1186 1194 ix=0 -
sansview/perspectives/fitting/fitpage.py
r998b6b8 r60132ef 62 62 for item in self.parameters: 63 63 if event.type =="scipy": 64 item[5].SetValue( format_number(""))64 item[5].SetValue("") 65 65 item[5].Hide() 66 item[6].SetValue( format_number(""))66 item[6].SetValue("") 67 67 item[6].Hide() 68 68 self.text2_min.Hide() … … 200 200 self.fittable_param=[] 201 201 self.fixed_param=[] 202 self.orientation_params=[] 202 self.orientation_params_disp=[] 203 203 204 self.sizer4_4.Clear(True) 204 205 … … 357 358 self.fittable_param.append([cb,name1,ctl1,text2, 358 359 ctl2, None, None,None]) 359 self.orientation_params .append([cb,name1,ctl1,text2,360 self.orientation_params_disp.append([cb,name1,ctl1,text2, 360 361 ctl2, None, None,None]) 361 362 elif p=="npts": … … 377 378 self.fixed_param.append([None,name2, Tctl,None,None, 378 379 None, None,None]) 379 self.orientation_params .append([None,name2, Tctl,None,None,380 self.orientation_params_disp.append([None,name2, Tctl,None,None, 380 381 None, None,None]) 381 382 elif p=="nsigmas": … … 399 400 self.fixed_param.append([None,name3, Tctl 400 401 ,None,None, None, None,None]) 401 self.orientation_params .append([None,name3, Tctl402 self.orientation_params_disp.append([None,name3, Tctl 402 403 ,None,None, None, None,None]) 403 404 … … 711 712 item[0].SetValue(False) 712 713 self.param_toFit=[] 714 713 715 self.save_current_state() 714 716 … … 760 762 self.fixed_param=[] 761 763 self.orientation_params=[] 764 self.orientation_params_disp=[] 762 765 763 766 if model ==None: … … 853 856 ix += 1 854 857 ctl3 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 855 ctl3.SetValue( format_number(param_min))858 ctl3.SetValue(str(param_min)) 856 859 ctl3.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 857 860 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 866 869 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 867 870 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 868 ctl4.SetValue( format_number(param_max))871 ctl4.SetValue(str(param_max)) 869 872 ctl4.Hide() 870 873 … … 934 937 ix += 1 935 938 ctl3 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 936 ctl3.SetValue( format_number(param_min))939 ctl3.SetValue(param_min) 937 940 ctl3.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 938 941 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 951 954 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 952 955 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 953 ctl4.SetValue( format_number(param_max))956 ctl4.SetValue(param_max) 954 957 ctl4.Hide() 955 958 if self.data.__class__.__name__ =="Data2D": -
sansview/perspectives/fitting/modelpage.py
raa1e9a72 r60132ef 122 122 self.fittable_param=[] 123 123 self.fixed_param=[] 124 self.orientation_params =[]124 self.orientation_params_disp=[] 125 125 126 126 self.sizer4_4.Clear(True) … … 231 231 self.fittable_param.append([None,name1,ctl1,None, 232 232 None, None, None,None]) 233 self.orientation_params .append([None,name1,ctl1,None,233 self.orientation_params_disp.append([None,name1,ctl1,None, 234 234 None, None, None,None]) 235 235 elif p=="npts": … … 247 247 self.fixed_param.append([None,name2, Tctl1,None,None, 248 248 None, None,None]) 249 self.orientation_params .append([None,name2, Tctl1,None,None,249 self.orientation_params_disp.append([None,name2, Tctl1,None,None, 250 250 None, None,None]) 251 251 elif p=="nsigmas": … … 266 266 self.fixed_param.append([None,name3, Tctl2, 267 267 None,None, None, None,None]) 268 self.orientation_params .append([None,name3, Tctl2,268 self.orientation_params_disp.append([None,name3, Tctl2, 269 269 None,None, None, None,None]) 270 270 … … 291 291 self._draw_model() 292 292 self.model_view.Disable() 293 for item in self.orientation_params: 294 if item[2]!=None: 295 item[2].Enable() 293 294 if len(self.orientation_params)>0: 295 for item in self.orientation_params: 296 if item[2]!=None: 297 item[2].Enable() 298 if len(self.orientation_params_disp)>0: 299 for item in self.orientation_params_disp: 300 if item[2]!=None: 301 item[2].Enable() 296 302 297 303 … … 417 423 self.fixed_param=[] 418 424 self.orientation_params=[] 419 425 self.orientation_params_disp=[] 420 426 if model ==None: 421 427 ##no model avaiable to draw sizer -
sansview/perspectives/fitting/pagestate.py
r998b6b8 r60132ef 40 40 #panel objects 41 41 self.fittable_param =[] 42 ## orientation parameters 43 self.orientation_params=[] 42 44 #list of dispersion paramaters 43 45 self.disp_list =[] … … 86 88 obj.fixed_param = copy.deepcopy(self.fixed_param) 87 89 obj.fittable_param = copy.deepcopy(self.fittable_param) 90 obj.orientation_params = copy.deepcopy(self.orientation_params) 88 91 obj.enable_disp = copy.deepcopy(self.enable_disp) 89 92 obj.enable_smearer = copy.deepcopy(self.enable_smearer)
Note: See TracChangeset
for help on using the changeset viewer.