Changeset 77e23a2 in sasview for sansview/perspectives/fitting/fitpage.py
- Timestamp:
- Apr 2, 2009 12:28:34 PM (15 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:
- 7fff5cd
- Parents:
- 05f14dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r376916c r77e23a2 9 9 from sans.guicomm.events import StatusEvent 10 10 from sans.guiframe.utils import format_number 11 11 12 (ModelEventbox, EVT_MODEL_BOX) = wx.lib.newevent.NewEvent() 13 (FitterTypeEvent, EVT_FITTER_TYPE) = wx.lib.newevent.NewEvent() 12 14 _BOX_WIDTH = 80 13 15 … … 43 45 self.page_info.model= self.model 44 46 self._on_select_model(event=None) 45 46 47 self.Bind(EVT_FITTER_TYPE,self._on_engine_change) 48 49 50 def _on_engine_change(self, event): 51 """ 52 get an event containing the current name of the fit engine type 53 @param event: FitterTypeEvent containing the name of the current engine 54 """ 55 if len(self.parameters)==0: 56 return 57 for item in self.parameters: 58 if event.type =="scipy": 59 item[5].SetValue(format_number("")) 60 item[5].Hide() 61 item[6].SetValue(format_number("")) 62 item[6].Hide() 63 self.text2_min.Hide() 64 self.text2_max.Hide() 65 else: 66 item[5].Show(True) 67 item[6].Show(True) 68 self.text2_min.Show(True) 69 self.text2_max.Show(True) 70 71 self.sizer3.Layout() 72 self.SetScrollbars(20,20,200,100) 73 74 47 75 def _on_display_description(self, event): 48 76 """ … … 261 289 ctl1.SetValue(str (format_number(value))) 262 290 ctl1.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 291 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 263 292 ctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 264 293 self.sizer4_4.Add(ctl1, (iy,ix),(1,1),wx.EXPAND) … … 286 315 Tctl.SetValue(str (format_number(value))) 287 316 Tctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 317 Tctl.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 288 318 Tctl.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 289 319 self.sizer4_4.Add(Tctl, (iy,ix),(1,1), … … 300 330 Tctl.SetValue(str (format_number(value))) 301 331 Tctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 332 Tctl.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 302 333 Tctl.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 303 334 self.sizer4_4.Add(Tctl, (iy,ix),(1,1), … … 344 375 self.manager.set_fit_range(page= self,qmin= self.qmin_x, qmax= self.qmax_x) 345 376 #single fit 346 #self.manager.on_single_fit(qmin=self.qmin_x,qmax=self.qmax_x)347 377 self.manager.onFit() 348 378 … … 373 403 when enter value on panel redraw model according to changed 374 404 """ 375 376 405 self._onparamEnter_helper() 377 406 self.compute_chisqr() … … 660 689 661 690 662 def set_model_param_sizer(self, model , engine_type="park"):691 def set_model_param_sizer(self, model): 663 692 """ 664 693 Build the panel from the model content … … 719 748 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 720 749 self.text2_4.Hide() 721 if engine_type == "park": 722 self.text2_max.Show(True) 723 self.text2_min.Show(True) 750 724 751 725 752 for item in keys: … … 739 766 style=wx.TE_PROCESS_ENTER) 740 767 741 ctl1.SetValue(str (format_number(value))) 768 ctl1.SetValue(format_number(value)) 769 ctl1.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 742 770 ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 743 771 ctl1.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) … … 755 783 ctl2.Hide() 756 784 785 param_min, param_max= self.model.details[item][1:] 757 786 ix += 1 758 787 ctl3 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 788 ctl3.SetValue(format_number(param_min)) 789 ctl3.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 759 790 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 760 791 ctl3.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 761 792 sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 762 793 ctl3.Hide() 763 794 764 795 ix += 1 765 796 ctl4 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 797 ctl4.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 766 798 ctl4.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) 767 799 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparamEnter) 768 800 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 801 ctl4.SetValue(format_number(param_max)) 769 802 ctl4.Hide() 770 if engine_type == "park": 771 ctl3.Show(True) 772 ctl4.Show(True) 773 803 774 804 ix +=1 775 805 # Units
Note: See TracChangeset
for help on using the changeset viewer.