- Timestamp:
- Apr 2, 2009 4:38:56 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:
- 87a43fe
- Parents:
- b03deea
- Location:
- sansview/perspectives/fitting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r77e23a2 rdcf29d7 811 811 else: 812 812 self.model= form_factor() 813 self.page_info.model= self.model 813 814 814 815 … … 922 923 model_disp = wx.StaticText(self, -1, 'No PolyDispersity for this model') 923 924 self.sizer4_4.Add(model_disp,( iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 925 self.sizer4_4.Layout() 924 926 self.sizer4.Layout() 927 925 928 self.SetScrollbars(20,20,200,100) 926 929 return … … 1007 1010 self.qmin.SetToolTipString("Minimun value of Q in linear scale.") 1008 1011 self.qmin.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 1012 self.qmin.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 1009 1013 self.qmin.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter) 1010 1014 … … 1013 1017 self.qmax.SetToolTipString("Maximum value of Q in linear scale.") 1014 1018 self.qmax.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 1019 self.qmax.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 1015 1020 self.qmax.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter) 1016 1021 … … 1037 1042 self.sizer5.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10) 1038 1043 self.sizer5.Layout() 1044 self.Layout() 1039 1045 self.SetScrollbars(20,20,200,100) 1040 1046 -
sansview/perspectives/fitting/fitpage.py
r77e23a2 rdcf29d7 38 38 ## if no dispersity parameters is avaible 39 39 self.text_disp_1=None 40 ## default fitengine type 41 self.engine_type = "scipy" 40 42 41 43 self._fill_datainfo_sizer() … … 53 55 @param event: FitterTypeEvent containing the name of the current engine 54 56 """ 57 self.engine_type = event.type 58 55 59 if len(self.parameters)==0: 56 60 return … … 748 752 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 749 753 self.text2_4.Hide() 750 754 if self.engine_type=="park": 755 self.text2_max.Show(True) 756 self.text2_min.Show(True) 751 757 752 758 for item in keys: … … 801 807 ctl4.SetValue(format_number(param_max)) 802 808 ctl4.Hide() 803 809 810 if self.engine_type=="park": 811 ctl3.Show(True) 812 ctl4.Show(True) 813 804 814 ix +=1 805 815 # Units -
sansview/perspectives/fitting/fitpanel.py
r77e23a2 rdcf29d7 139 139 return self.sim_page 140 140 141 def add_fit_page( self,data ):141 def add_fit_page( self,data, page_info=None ): 142 142 """ 143 143 Add a fitting page on the notebook contained by fitpanel … … 149 149 except: 150 150 name = 'Fit' 151 from pageInfo import PageInfo 152 myinfo = PageInfo( self, data=data ) 153 myinfo.model_list_box = self.model_list_box.get_list() 154 myinfo.event_owner = self.event_owner 155 myinfo.manager = self.manager 151 if page_info==None: 152 from pageInfo import PageInfo 153 myinfo = PageInfo( self, data=data ) 154 myinfo.model_list_box = self.model_list_box.get_list() 155 myinfo.event_owner = self.event_owner 156 myinfo.manager = self.manager 157 else: 158 myinfo = page_info 156 159 157 160 if not name in self.fit_page_name : 158 159 161 from fitpage import FitPage 160 162 panel = FitPage(parent= self, page_info=myinfo, name=name ) … … 162 164 panel.window_name= "fitpage" 163 165 self.AddPage(page=panel,caption=name,select=True) 164 #panel.populate_box( self.model_list_box)165 166 self.fit_page_name.append(name) 166 167 … … 170 171 171 172 172 def add_model_page(self,model,page_title, qmin=0, qmax=0.1, npts=50, topmenu=False): 173 def add_model_page(self,model,page_title, qmin=0, qmax=0.1, 174 npts=50, topmenu=False,page_info=None): 173 175 """ 174 176 Add a model page only one to display any model selected from the menu or the page combo box. … … 177 179 @param model: the model for which paramters will be changed 178 180 @param page_title: the name of the page 179 @param page_ title: [Coder: fill your description!]181 @param page_info: contains info about the state of the page 180 182 @param qmin: mimimum Q 181 183 @param qmax: maximum Q … … 184 186 if topmenu==True: 185 187 if self.draw_model_name ==None: 186 self._help_add_model_page(model,page_title, qmin=qmin, qmax=qmax, npts=npts) 188 self._help_add_model_page(model,page_title, 189 qmin=qmin, qmax=qmax, npts=npts, page_info=page_info) 187 190 else: 188 191 self.model_page.select_model(model, page_title) 189 192 else: 190 self._create_model_page(model,page_title, qmin=qmin, qmax=qmax, npts=npts) 191 192 def _help_add_model_page(self,model,page_title, qmin=0, qmax=0.1, npts=50): 193 if self.draw_model_name ==None: 194 self._create_model_page(model,page_title, qmin=qmin, qmax=qmax, 195 npts=npts, page_info=page_info) 196 197 198 def _help_add_model_page(self,model,page_title, qmin=0, 199 qmax=0.1, npts=50,page_info=None): 193 200 """ 194 201 #TODO: fill in description … … 198 205 @param npts: number of Q points 199 206 """ 200 self._create_model_page(model,page_title,qmin=qmin, qmax=qmax, npts=npts) 207 self._create_model_page(model,page_title,qmin=qmin, qmax=qmax, 208 npts=npts,page_info= page_info) 201 209 # We just created a model page, we are ready to plot the model 202 210 #self.manager.draw_model(model, model.name) … … 204 212 self.manager.draw_model(model) 205 213 206 def _create_model_page(self,model,page_title, qmin, qmax, npts ):214 def _create_model_page(self,model,page_title, qmin, qmax, npts,page_info=None): 207 215 """ 208 216 adding model page occurs here 209 217 """ 210 211 ## storing page info 212 from pageInfo import PageInfo 213 myinfo = PageInfo( self, model ) 214 myinfo.model_list_box = self.model_list_box.get_list() 215 myinfo.event_owner = self.event_owner 216 myinfo.manager = self.manager 217 218 ## creating object that contaning info about model 219 if page_info==None: 220 from pageInfo import PageInfo 221 myinfo = PageInfo( self, model=model) 222 myinfo.model_list_box = self.model_list_box.get_list() 223 myinfo.event_owner = self.event_owner 224 myinfo.manager = self.manager 225 else: 226 myinfo = page_info 227 218 228 from modelpage import ModelPage 219 229 panel = ModelPage(self,myinfo,page_title) -
sansview/perspectives/fitting/fitting.py
r77e23a2 rdcf29d7 451 451 Add name of a closed page of fitpanel in a menu 452 452 """ 453 if len(self.closed_page_dict)>0: 454 for k , value in self.closed_page_dict.iteritems(): 455 if not name in value: 456 # Post paramters 457 event_id = wx.NewId() 458 self.menu1.Append(event_id, name, "Show %s fit panel" % name) 459 self.closed_page_dict[event_id ]= [page_info, fitproblem] 460 else: 461 event_id= k 462 self.closed_page_dict[k ]= [page_info, fitproblem] 463 else: 453 list = self.menu1.GetMenuItems() 454 for item in list: 455 if name == item.GetItemLabel(): 456 self.closed_page_dict[name][1:] = page_info, fitproblem 457 458 if not name in self.closed_page_dict.keys(): 459 # Post paramters 464 460 event_id = wx.NewId() 465 461 self.menu1.Append(event_id, name, "Show %s fit panel" % name) 466 self.closed_page_dict[ event_id ]= [page_info, fitproblem]467 wx.EVT_MENU(self.parent,event_id, self._open_closed_page)462 self.closed_page_dict[name]= [event_id,page_info, fitproblem] 463 wx.EVT_MENU(self.parent,event_id, self._open_closed_page) 468 464 469 465 … … 472 468 reopen a closed page 473 469 """ 474 if event.GetId() in self.closed_page_dict.keys(): 475 page_info,fitproblem = self.closed_page_dict[ event.GetId() ] 470 for value in self.closed_page_dict.values(): 471 if event.GetId() in value: 472 id, page_info,fitproblem = value 473 476 474 if page_info.page_name !="Model Page": 477 page = self.fit_panel.add_fit_page(page_info.data) 475 page = self.fit_panel.add_fit_page(data= page_info.data, 476 page_info=page_info) 478 477 if fitproblem != None: 479 478 self.page_finder[page]=fitproblem 480 479 else: 481 480 model= page_info.model 482 self.fit_panel.add_model_page(model,model.name,topmenu=False) 481 self.fit_panel.add_model_page(model,model.name,topmenu=False, 482 page_info=page_info) 483 break 484 483 485 484 486 def _reset_schedule_problem(self, value=0): -
sansview/perspectives/fitting/modelpage.py
r77e23a2 rdcf29d7 87 87 self.npts.SetToolTipString("Number of point to plot.") 88 88 self.npts.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 89 self.npts.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 89 90 self.npts.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter) 90 91 -
sansview/perspectives/fitting/pageInfo.py
r59a7f2d rdcf29d7 78 78 obj = PageInfo( self.parent,model= model ) 79 79 obj.data = copy.deepcopy(self.data) 80 80 obj.model_list_box = copy.deepcopy(self.model_list_box) 81 obj.manager = self.manager 82 obj.event_owner = self.event_owner 81 83 return obj 82 84
Note: See TracChangeset
for help on using the changeset viewer.