Changeset 264df67 in sasview
- Timestamp:
- Feb 9, 2009 4:41:37 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:
- 9dd69ec
- Parents:
- 869c368
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage1D.py
rfd25fb0 r264df67 455 455 456 456 457 458 def old_set_panel(self,model):459 """460 Build the panel from the model content461 @param model: the model selected in combo box for fitting purpose462 """463 self.sizer5.Clear(True)464 self.parameters = []465 self.param_toFit=[]466 self.model = model467 keys = self.model.getParamList()468 #print "fitpage1D : dispersion list",self.model.getDispParamList()469 keys.sort()470 ik=0471 im=1472 473 iy = 1474 ix = 0475 self.cb1 = wx.CheckBox(self, -1,"Select all", (10, 10))476 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param)477 self.sizer5.Add(self.cb1,(iy, ix),(1,1),\478 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)479 ix +=1480 self.text2_2 = wx.StaticText(self, -1, 'Values')481 self.sizer5.Add(self.text2_2,(iy, ix),(1,1),\482 wx.EXPAND|wx.ADJUST_MINSIZE, 0)483 ix +=2484 self.text2_3 = wx.StaticText(self, -1, 'Errors')485 self.sizer5.Add(self.text2_3,(iy, ix),(1,1),\486 wx.EXPAND|wx.ADJUST_MINSIZE, 0)487 self.text2_3.Hide()488 ix +=1489 self.text2_4 = wx.StaticText(self, -1, 'Units')490 self.sizer5.Add(self.text2_4,(iy, ix),(1,1),\491 wx.EXPAND|wx.ADJUST_MINSIZE, 0)492 self.text2_4.Hide()493 disp_list=self.model.getDispParamList()494 for item in keys:495 if not item in disp_list:496 iy += 1497 ix = 0498 499 cb = wx.CheckBox(self, -1, item, (10, 10))500 cb.SetValue(False)501 self.sizer5.Add( cb,( iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)502 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)503 504 ix += 1505 value= self.model.getParam(item)506 ctl1 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)507 ctl1.SetValue(str (format_number(value)))508 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)509 ctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter)510 self.sizer5.Add(ctl1, (iy,ix),(1,1), wx.EXPAND)511 512 ix += 1513 text2=wx.StaticText(self, -1, '+/-')514 self.sizer5.Add(text2,(iy, ix),(1,1),\515 wx.EXPAND|wx.ADJUST_MINSIZE, 0)516 text2.Hide()517 ix += 1518 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)519 self.sizer5.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)520 ctl2.Hide()521 ix +=1522 # Units523 try:524 units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)525 except:526 units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT)527 self.sizer5.Add(units, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)528 """529 else:530 if not item in fixed:531 ip = 0532 iq += 1533 cb = wx.CheckBox(self, -1, item, (10, 10))534 cb.SetValue(False)535 self.sizer5.Add( cb,( iq, ip),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)536 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)537 538 ip += 1539 value= self.model.getParam(item)540 ctl1 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)541 ctl1.SetValue(str (format_number(value)))542 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)543 ctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter)544 self.sizer5.Add(ctl1, (iq,ip),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)545 else:546 ik = 0547 text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT)548 self.sizer6.Add(text,( im, ik),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)549 550 ik += 1551 value= self.model.getParam(item)552 Tctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)553 Tctl.SetValue(str (format_number(value)))554 Tctl.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)555 Tctl.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter)556 self.sizer6.Add(Tctl, (im,ik),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)557 self.fixed_param.append([item, Tctl])558 im += 1559 #save data560 """561 self.parameters.append([cb,ctl1,text2,ctl2])562 563 iy+=1564 self.sizer5.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)565 566 #Display units text on panel567 for item in keys:568 if self.model.details[item][0]!='':569 self.text2_4.Show()570 break571 else:572 self.text2_4.Hide()573 574 #(Disable or )Enable fit button575 """576 if not (len(self.param_toFit ) >0):577 self.xmin.Enable()578 self.xmax.Enable()579 else:580 self.xmin.Enable()581 self.xmax.Enable()582 """583 584 self.compute_chisqr()585 self.vbox.Layout()586 self.SetScrollbars(20,20,55,40)587 self.Layout()588 self.GrandParent.GetSizer().Layout()589 590 591 592 457 def _onparamEnter(self,event): 593 458 """ -
sansview/perspectives/fitting/fitting.py
rd0eac66 r264df67 134 134 #index number to create random model name 135 135 self.index_model = 0 136 self.index_theory= 0 136 137 self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 137 138 … … 536 537 name = evt.name 537 538 539 print "name fitting", name 538 540 sim_page=self.fit_panel.GetPage(1) 539 541 current_pg = self.fit_panel.get_current_page() … … 543 545 try: 544 546 metadata=self.page_finder[current_pg].get_data() 547 #M_name=model.name+"= "+name+"("+metadata.group_id+")" 548 M_name=model.name+"= "+name+"("+metadata.id+")" 549 except: 545 550 M_name=model.name+"= "+name+"("+metadata.group_id+")" 546 except: 547 M_name=model.name+"= "+name 548 #model.name="M"+str(self.index_model) 551 model.name="M"+str(self.index_model) 549 552 self.index_model += 1 550 553 # save model name … … 590 593 theory.name = model.name 591 594 theory.group_id = data.group_id 592 theory.id = "Model" 595 if hasattr(data, "id"): 596 import string 597 if string.find("Model",data.id )!=None: 598 #allow plotting on the same panel 599 theory.id =str(data.id )+" "+str(self.index_theory) 600 self.index_theory +=1 601 else: 602 theory.id = "Model" 603 593 604 x_name, x_units = data.get_xaxis() 594 605 y_name, y_units = data.get_yaxis()
Note: See TracChangeset
for help on using the changeset viewer.