- Timestamp:
- Dec 12, 2008 5:13:10 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:
- 3aae6b6
- Parents:
- 2d107b8
- Location:
- sansview/perspectives/fitting
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
ra92d51b rf39511b 25 25 26 26 27 class FitPage1D(wx. Panel):27 class FitPage1D(wx.ScrolledWindow): 28 28 """ 29 29 FitPanel class contains fields allowing to display results when … … 40 40 41 41 def __init__(self, parent,data, *args, **kwargs): 42 wx. Panel.__init__(self, parent, *args, **kwargs)42 wx.ScrolledWindow.__init__(self, parent, *args, **kwargs) 43 43 """ 44 44 Initialization of the Panel 45 45 """ 46 self.scroll = wx.ScrolledWindow(self)46 #self.scroll = wx.ScrolledWindow(self) 47 47 48 48 self.manager = None … … 58 58 59 59 60 self.DataSource =wx.StaticText(self .scroll, -1,str(data.name))61 62 self.modelbox = wx.ComboBox(self .scroll, -1)60 self.DataSource =wx.StaticText(self, -1,str(data.name)) 61 62 self.modelbox = wx.ComboBox(self, -1) 63 63 id = wx.NewId() 64 self.btFit =wx.Button(self .scroll,id,'Fit')64 self.btFit =wx.Button(self,id,'Fit') 65 65 self.btFit.Bind(wx.EVT_BUTTON, self.onFit,id=id) 66 66 self.btFit.SetToolTipString("Perform fit.") 67 self.static_line_1 = wx.StaticLine(self .scroll, -1)67 self.static_line_1 = wx.StaticLine(self, -1) 68 68 69 69 self.vbox.Add(self.sizer3) … … 75 75 76 76 id = wx.NewId() 77 self.btClose =wx.Button(self .scroll,id,'Close')77 self.btClose =wx.Button(self,id,'Close') 78 78 self.btClose.Bind(wx.EVT_BUTTON, self.onClose,id=id) 79 79 self.btClose.SetToolTipString("Close page.") 80 80 ix = 0 81 81 iy = 1 82 self.sizer3.Add(wx.StaticText(self .scroll, -1, 'Data Source Name : '),(iy,ix),\82 self.sizer3.Add(wx.StaticText(self, -1, 'Data Source Name : '),(iy,ix),\ 83 83 (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 84 84 ix += 1 … … 88 88 ix = 0 89 89 iy += 1 90 self.sizer3.Add(wx.StaticText(self .scroll,-1,'Model'),(iy,ix),(1,1)\90 self.sizer3.Add(wx.StaticText(self,-1,'Model'),(iy,ix),(1,1)\ 91 91 , wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 92 92 ix += 1 … … 96 96 iy = 1 97 97 #set maximum range for x in linear scale 98 self.text4_3 = wx.StaticText(self .scroll, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT)98 self.text4_3 = wx.StaticText(self, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT) 99 99 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 100 100 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 101 101 ix += 1 102 self.sizer4.Add(wx.StaticText(self .scroll, -1, 'Min'),(iy, ix),(1,1),\102 self.sizer4.Add(wx.StaticText(self, -1, 'Min'),(iy, ix),(1,1),\ 103 103 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 104 104 ix += 2 105 self.sizer4.Add(wx.StaticText(self .scroll, -1, 'Max'),(iy, ix),(1,1),\105 self.sizer4.Add(wx.StaticText(self, -1, 'Max'),(iy, ix),(1,1),\ 106 106 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 107 107 ix = 0 108 108 iy += 1 109 self.sizer4.Add(wx.StaticText(self .scroll, -1, 'x range'),(iy, ix),(1,1),\109 self.sizer4.Add(wx.StaticText(self, -1, 'x range'),(iy, ix),(1,1),\ 110 110 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 111 111 ix += 1 112 self.xmin = wx.TextCtrl(self .scroll, -1,size=(_BOX_WIDTH,20))112 self.xmin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 113 113 self.xmin.SetValue(format_number(numpy.min(data.x))) 114 114 self.xmin.SetToolTipString("Minimun value of x in linear scale.") … … 120 120 121 121 ix += 2 122 self.xmax = wx.TextCtrl(self .scroll, -1,size=(_BOX_WIDTH,20))122 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 123 123 self.xmax.SetValue(format_number(numpy.max(data.x))) 124 124 self.xmax.SetToolTipString("Maximum value of x in linear scale.") … … 133 133 ix = 0 134 134 iy = 1 135 self.smear= wx.CheckBox(self .scroll, -1, "Fit with Smear", (10, 10))136 wx.EVT_CHECKBOX(self .scroll, self.smear.GetId(), self.onSmear)135 self.smear= wx.CheckBox(self, -1, "Fit with Smear", (10, 10)) 136 wx.EVT_CHECKBOX(self, self.smear.GetId(), self.onSmear) 137 137 self.sizer1.Add(self.smear,(iy,ix),(1,1),\ 138 138 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 139 139 iy+=1 140 self.text1_1 = wx.StaticText(self .scroll, -1, 'Chi2/dof', style=wx.ALIGN_LEFT)140 self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT) 141 141 #self.sizer1.Add(self.text1_1,1) 142 142 self.sizer1.Add(self.text1_1,(iy,ix),(1,1),\ 143 143 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 144 144 ix += 1 145 self.tcChi = wx.TextCtrl(self .scroll, -1,size=(_BOX_WIDTH,20))145 self.tcChi = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 146 146 self.tcChi.SetToolTipString("Chi^2 over degrees of freedom.") 147 147 #self.sizer1.Add(self.tcChi, 1, wx.R | wx.BOTTOM , 5) … … 167 167 self.model_list_box={} 168 168 self.data = data 169 self.vbox.Layout()170 169 170 """ 171 171 bs = wx.BoxSizer(wx.VERTICAL) 172 172 bs.Add(self.scroll, 1, wx.EXPAND) … … 174 174 self.scroll.SetSizer(self.vbox) 175 175 self.scroll.SetScrollbars(20,20,55,40) 176 width,height = self.GetSize() 177 176 #width,height = self.GetSize() 177 """ 178 self.vbox.Layout() 179 self.vbox.Fit(self) 180 self.SetSizer(self.vbox) 181 self.SetScrollbars(20,20,55,40) 182 178 183 self.Centre() 179 184 self.Layout() 180 185 self.GrandParent.GetSizer().Layout() 181 print self.GetSize() 182 print self.scroll.GetSize() 186 183 187 184 188 … … 287 291 if name ==event.GetString(): 288 292 try: 289 evt = ModelEventbox(model=item(),name=name) 293 self.model=item() 294 evt = ModelEventbox(model=self.model,name=name) 290 295 wx.PostEvent(self.event_owner, evt) 296 #self.model= item() 297 #self.set_panel(self.model) 291 298 except: 292 299 raise #ValueError,"model.name is not equal to model class name" … … 301 308 flag=self.checkFitRange() 302 309 if flag==True and self.model!=None: 303 print"fit page",self.xmin.GetValue(),self.xmax.GetValue()310 #print"fit page",self.xmin.GetValue(),self.xmax.GetValue() 304 311 self.manager.redraw_model(float(self.xmin.GetValue())\ 305 312 ,float(self.xmax.GetValue())) … … 374 381 iq=1 375 382 if len(disp_list)>0: 376 disp = wx.StaticText(self .scroll, -1, 'Dispersion')383 disp = wx.StaticText(self, -1, 'Dispersion') 377 384 self.sizer5.Add(disp,( iq, ip),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 378 385 ip += 1 379 values = wx.StaticText(self .scroll, -1, 'Values')386 values = wx.StaticText(self, -1, 'Values') 380 387 self.sizer5.Add(values,( iq, ip),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 381 388 … … 383 390 iy = 1 384 391 ix = 0 385 self.cb1 = wx.CheckBox(self .scroll, -1,'Parameters', (10, 10))386 wx.EVT_CHECKBOX(self .scroll, self.cb1.GetId(), self.select_all_param)392 self.cb1 = wx.CheckBox(self, -1,'Parameters', (10, 10)) 393 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 387 394 self.sizer2.Add(self.cb1,(iy, ix),(1,1),\ 388 395 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 389 396 ix +=1 390 self.text2_2 = wx.StaticText(self .scroll, -1, 'Values')397 self.text2_2 = wx.StaticText(self, -1, 'Values') 391 398 self.sizer2.Add(self.text2_2,(iy, ix),(1,1),\ 392 399 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 393 400 ix +=2 394 self.text2_3 = wx.StaticText(self .scroll, -1, 'Errors')401 self.text2_3 = wx.StaticText(self, -1, 'Errors') 395 402 self.sizer2.Add(self.text2_3,(iy, ix),(1,1),\ 396 403 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 397 404 self.text2_3.Hide() 398 405 ix +=1 399 self.text2_4 = wx.StaticText(self .scroll, -1, 'Units')406 self.text2_4 = wx.StaticText(self, -1, 'Units') 400 407 self.sizer2.Add(self.text2_4,(iy, ix),(1,1),\ 401 408 wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 407 414 ix = 0 408 415 409 cb = wx.CheckBox(self .scroll, -1, item, (10, 10))416 cb = wx.CheckBox(self, -1, item, (10, 10)) 410 417 cb.SetValue(False) 411 418 self.sizer2.Add( cb,( iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 412 wx.EVT_CHECKBOX(self .scroll, cb.GetId(), self.select_param)419 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) 413 420 414 421 ix += 1 415 422 value= self.model.getParam(item) 416 ctl1 = wx.TextCtrl(self .scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)423 ctl1 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 417 424 ctl1.SetValue(str (format_number(value))) 418 425 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 420 427 self.sizer2.Add(ctl1, (iy,ix),(1,1), wx.EXPAND) 421 428 ix += 1 422 text2=wx.StaticText(self .scroll, -1, '+/-')429 text2=wx.StaticText(self, -1, '+/-') 423 430 self.sizer2.Add(text2,(iy, ix),(1,1),\ 424 431 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 425 432 text2.Hide() 426 433 ix += 1 427 ctl2 = wx.TextCtrl(self .scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)434 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 428 435 self.sizer2.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 429 436 ctl2.Hide() … … 431 438 # Units 432 439 try: 433 units = wx.StaticText(self .scroll, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)440 units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT) 434 441 except: 435 units = wx.StaticText(self .scroll, -1, "", style=wx.ALIGN_LEFT)442 units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT) 436 443 self.sizer2.Add(units, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 437 444 else: 438 445 ip = 0 439 446 iq += 1 440 cb = wx.CheckBox(self .scroll, -1, item, (10, 10))447 cb = wx.CheckBox(self, -1, item, (10, 10)) 441 448 cb.SetValue(False) 442 449 self.sizer5.Add( cb,( iq, ip),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 443 wx.EVT_CHECKBOX(self .scroll, cb.GetId(), self.select_param)450 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) 444 451 445 452 ip += 1 446 453 value= self.model.getParam(item) 447 ctl1 = wx.TextCtrl(self .scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)454 ctl1 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 448 455 ctl1.SetValue(str (format_number(value))) 449 456 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) -
sansview/perspectives/fitting/fitpage2D.py
r57668f8 rf39511b 25 25 26 26 27 class FitPage2D(wx. Panel):27 class FitPage2D(wx.ScrolledWindow): 28 28 """ 29 29 FitPanel class contains fields allowing to display results when … … 40 40 41 41 def __init__(self, parent,data, *args, **kwargs): 42 wx. Panel.__init__(self, parent, *args, **kwargs)42 wx.ScrolledWindow.__init__(self, parent, *args, **kwargs) 43 43 """ 44 44 Initialization of the Panel … … 185 185 self.vbox.Fit(self) 186 186 self.SetSizer(self.vbox) 187 self.SetScrollbars(20,20,55,40) 187 188 self.Centre() 188 189 -
sansview/perspectives/fitting/fitpanel.py
rb2c3225 rf39511b 43 43 self.fit_page_name=None 44 44 self.draw_model_name=None 45 self.page_name="Model View" 45 #model page info 46 self.model_page_number=None 47 self.page_name=None 48 self.model_page=None 49 #updating the panel 46 50 self.nb.Update() 47 51 self.SetSizer(self.sizer) … … 95 99 return panel 96 100 101 def _help_add_model_page(self,model,description,page_title): 102 from modelpage import ModelPage 103 panel = ModelPage(self.nb,model, -1) 104 panel.set_manager(self.manager) 105 panel.set_owner(self.event_owner) 106 self.nb.AddPage(page=panel,text=page_title,select=True) 107 panel.populate_box( self.model_list_box) 108 self.draw_model_name=page_title 109 self.model_page_number=self.nb.GetSelection() 110 self.model_page=self.nb.GetPage(self.nb.GetSelection()) 111 97 112 98 113 def add_model_page(self,model,description,page_title): … … 103 118 @param page_title: the name of the page 104 119 """ 105 if page_title !=self.draw_model_name or self.draw_model_name ==None: 106 self.onClose() 120 if self.draw_model_name ==None: 121 # or self.draw_model_name !=page_title: 122 #print "removing the prevois model page ",self.model_page, self.model_page_number 123 #self.onClose(self.model_page, self.model_page_number) 124 self._help_add_model_page(model,description,page_title) 125 else: 126 if self.draw_model_name !=page_title: 127 self.onClose(self.model_page, self.model_page_number) 128 #print "removing the prevois model page ",self.model_page, self.model_page_number 129 self._help_add_model_page(model,description,page_title) 130 """ 131 if self.draw_model_name ==None : 132 107 133 from modelpage import ModelPage 108 134 panel = ModelPage(self.nb,model, -1) … … 112 138 panel.populate_box( self.model_list_box) 113 139 self.draw_model_name=page_title 140 self.model_page_number = self.nb.GetPage(self.nb.GetSelection()) 141 print "model page",self.model_page_number,self.nb.GetSelection() 114 142 else: 115 143 for i in range(self.nb.GetPageCount()): … … 118 146 page.set_page(model,description) 119 147 break 148 """ 120 149 121 150 … … 150 179 return self.nb.GetPage(self.nb.GetSelection()) 151 180 152 def onClose(self ):181 def onClose(self, page=None,page_number=None): 153 182 """ 154 183 close the current page except the simpage. remove each check box link to the model 155 184 selected on that page. remove its reference into page_finder (fitting module) 156 185 """ 186 if page!=None and page_number!=None: 187 page.Destroy() 188 self.nb.RemovePage(page_number) 189 self.model_page_number=None 190 self.model_page=None 191 return 157 192 try: 158 193 sim_page = self.nb.GetPage(0) … … 179 214 except: 180 215 raise 181 print "fitpanel", self.draw_model_name216 #print "fitpanel", self.draw_model_name 182 217 183 218 def set_model_list(self,dict): -
sansview/perspectives/fitting/fitting.py
rb2c3225 rf39511b 58 58 #menu for model 59 59 menu2 = wx.Menu() 60 id4 = wx.NewId() 61 menu2.AppendCheckItem(id4, "model view 2D") 62 wx.EVT_MENU(owner, id4, self.on_draw_model2D) 63 60 64 61 self.menu_mng.populate_menu(menu2, owner) 65 62 id2 = wx.NewId() … … 351 348 result=self.fitter.fit() 352 349 #self._single_fit_completed(result,pars,current_pg,qmin,qmax) 353 print "single_fit: result",result.fitness,result.pvec,result.stderr350 #print "single_fit: result",result.fitness,result.pvec,result.stderr 354 351 #self._single_fit_completed(result,pars,page,qmin,qmax) 355 352 self._single_fit_completed(result,pars,page_fitted,qmin,qmax,ymin,ymax) … … 577 574 578 575 model=evt.model() 579 name="Model View"580 print "mon menu",model.name576 #name="Model View" 577 #print "mon menu",model.name 581 578 description=model.description 582 #self.fit_panel.add_model_page(model,description, model.name)583 self.fit_panel.add_model_page(model,description,name)579 #self.fit_panel.add_model_page(model,description,name) 580 584 581 self.draw_model(model,self.enable_model2D) 585 582 586 def draw_model(self,model, enable2D=False):583 def draw_model(self,model,description=None, enable2D=False,qmin=None, qmax=None): 587 584 """ 588 585 draw model with default data value 589 586 """ 590 x = numpy.arange(0.001, 1.0, 0.001) 591 xlen = len(x) 592 y = numpy.zeros(xlen) 593 if not enable2D: 594 for i in range(xlen): 595 y[i] = model.run(x[i]) 596 597 try: 598 new_plot = Theory1D(x, y) 599 new_plot.name = model.name 600 #new_plot.name = "Model" 601 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 602 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 603 604 new_plot.group_id ="Fitness" 605 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model 1D")) 606 607 except: 608 raise 587 self.fit_panel.add_model_page(model,model.description,model.name) 588 #x = numpy.arange(0.001, 1.0, 0.001) 589 #y = numpy.arange(0.001, 1.0, 0.001) 590 x = numpy.arange(-0.05, 0.05, 0.001) 591 y = numpy.arange(-0.05, 0.05, 0.001) 592 print "went here ",enable2D 593 if enable2D: 594 data=numpy.zeros([len(x),len(y)]) 595 for i in range(len(y)): 596 for j in range(len(x)): 597 data[i][j]=model.runXY([j,i]) 598 theory = Theory2D(data) 599 theory.group_id =str(model.name)+" 2D" 600 theory.xmin=-0.05 601 theory.xmax= 0.05 602 theory.ymin= -0.05 603 theory.ymax= 0.05 604 wx.PostEvent(self.parent, NewPlotEvent(plot=theory, title="Analytical model 2D")) 609 605 else: 610 for i in range(xlen): 611 y[i] = model.run(x[i]) 612 613 try: 614 new_plot = Theory1D(x, y) 615 new_plot.name = model.name 616 #new_plot.name = "Model" 617 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 618 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 619 620 new_plot.group_id ="Fitness" 621 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model 1D")) 622 623 except: 624 raise 606 x = numpy.arange(0.001, 1.0, 0.001) 607 xlen= len(x) 608 y = numpy.zeros(xlen) 609 if not enable2D: 610 for i in range(xlen): 611 y[i] = model.run(x[i]) 612 613 try: 614 new_plot = Theory1D(x, y) 615 #new_plot.name = model.name 616 new_plot.name = "Model" 617 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 618 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 619 620 new_plot.group_id ="Fitness" 621 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model 1D")) 622 623 except: 624 raise 625 else: 626 for i in range(xlen): 627 y[i] = model.run(x[i]) 628 629 try: 630 new_plot = Theory1D(x, y) 631 new_plot.name = model.name 632 #new_plot.name = "Model" 633 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 634 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 635 636 new_plot.group_id ="Fitness" 637 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model 1D")) 638 639 except: 640 raise 625 641 def on_draw_model2D(self, event): 626 642 """ -
sansview/perspectives/fitting/modelpage.py
rb2c3225 rf39511b 25 25 26 26 27 class ModelPage(wx. Panel):27 class ModelPage(wx.ScrolledWindow): 28 28 """ 29 29 FitPanel class contains fields allowing to display results when … … 40 40 41 41 def __init__(self, parent,model, *args, **kwargs): 42 wx. Panel.__init__(self, parent, *args, **kwargs)42 wx.ScrolledWindow.__init__(self, parent, *args, **kwargs) 43 43 """ 44 44 Initialization of the Panel 45 45 """ 46 #self.scroll = wx.ScrolledWindow(self) 46 47 self.manager = None 47 48 self.parent = parent … … 78 79 ix += 1 79 80 self.sizer3.Add(self.modelbox,(iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 81 ix = 0 82 iy += 1 83 self.model_view= wx.CheckBox(self, -1, "View in 2D", (10, 10)) 84 wx.EVT_CHECKBOX(self, self.model_view.GetId(), self.onModel2D) 85 self.sizer3.Add(self.model_view,(iy,ix),(1,1),\ 86 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 80 87 # contains link between model ,all its parameters, and panel organization 81 88 self.parameters=[] … … 85 92 self.model=model 86 93 try: 87 print"init modelpage",model.name94 #print"init modelpage",model.name 88 95 self.set_panel(model) 89 96 except: … … 100 107 self.vbox.Layout() 101 108 self.vbox.Fit(self) 109 102 110 self.SetSizer(self.vbox) 111 self.SetScrollbars(20,20,55,40) 103 112 self.Centre() 104 113 … … 122 131 """ 123 132 self.manager = manager 124 133 def onModel2D(self, event): 134 135 if self.model_view.GetValue()==True: 136 print "2D model" 137 self.manager.draw_model(self.model, 138 description=None, enable2D=True,qmin=None, qmax=None) 125 139 def populate_box(self, dict): 126 140 """ … … 167 181 if hasattr(items, "name"): 168 182 name = items.name 169 print "fitpage: _on_select_model model name",name ,event.GetString()183 #print "fitpage: _on_select_model model name",name ,event.GetString() 170 184 if name ==event.GetString(): 171 185 model=items 172 print "fitpage: _on_select_model model name",name ,event.GetString()186 #print "fitpage: _on_select_model model name",name ,event.GetString() 173 187 self.model= model 188 self.set_panel(model) 174 189 self.manager.draw_model(model) 175 self.set_panel(model)190 176 191 def set_model_name(self,name): 177 192 """ … … 233 248 234 249 disp_list.sort() 235 print "went here",self.model.name,model.description250 #print "went here",self.model.name,model.description 236 251 iy = 1 237 252 ix = 0 -
sansview/perspectives/fitting/models.py
ra92d51b rf39511b 104 104 from sans.models.DABModel import DABModel 105 105 self.indep_model.append(DABModel ) 106 107 from sans.models.GuinierModel import GuinierModel 108 self.indep_model.append(GuinierModel ) 106 109 107 110 from sans.models.DebyeModel import DebyeModel
Note: See TracChangeset
for help on using the changeset viewer.