Changeset e2f7b92 in sasview
- Timestamp:
- Nov 8, 2009 1:49:46 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:
- c985bef
- Parents:
- eacf1d66
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
rb421b1a re2f7b92 1443 1443 self.disp_list =self.model.getDispParamList() 1444 1444 self.state.disp_list = self.disp_list 1445 self.sizer4_4.Layout()1445 #self.sizer4_4.Layout() 1446 1446 self.Layout() 1447 self.SetScrollbars(20,20,25,65)1448 self.Refresh()1447 #self.SetScrollbars(20,20,25,65) 1448 #self.Refresh() 1449 1449 1450 1450 … … 1578 1578 #draw the model with the current dispersity 1579 1579 self._draw_model() 1580 self.sizer4_4.Layout()1581 self.sizer4.Layout()1580 #self.sizer4_4.Layout() 1581 #self.sizer4.Layout() 1582 1582 self.Layout() 1583 1583 #self.Refresh() … … 1625 1625 from sans.models.dispersion_models import GaussianDispersion, ArrayDispersion 1626 1626 if len(self.disp_cb_dict)==0: 1627 self.save_current_state() 1627 1628 self.sizer4_4.Clear(True) 1628 self.sizer4_4.Layout()1629 self.sizer4.Layout()1629 #self.sizer4_4.Layout() 1630 #self.sizer4.Layout() 1630 1631 self.Layout() 1631 self.Refresh()1632 self.SetScrollbars(20,20,25,65)1632 #self.Refresh() 1633 #self.SetScrollbars(20,20,25,65) 1633 1634 return 1634 1635 if (len(self.disp_cb_dict)>0) : … … 1647 1648 ## save state into 1648 1649 self.save_current_state() 1649 self.sizer4_4.Layout()1650 self.sizer4.Layout()1650 #self.sizer4_4.Layout() 1651 #self.sizer4.Layout() 1651 1652 self.Layout() 1652 self.SetScrollbars(20,20,25,65)1653 self.Refresh()1653 #self.SetScrollbars(20,20,25,65) 1654 #self.Refresh() 1654 1655 1655 1656 … … 1678 1679 wx.PostEvent(self.parent, event) 1679 1680 1680 self.sizer4_4.Layout()1681 self.sizer4.Layout()1682 self.Layout()1681 #self.sizer4_4.Layout() 1682 #self.sizer4.Layout() 1683 #self.Layout() 1683 1684 self.SetScrollbars(20,20,25,65) 1684 self.Refresh()1685 #self.Refresh() 1685 1686 1686 1687 def _set_sizer_arraydispersion(self): … … 1749 1750 iy +=1 1750 1751 self.sizer4_4.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 1751 self.sizer4_4.Layout() 1752 self.sizer4.Layout() 1753 self.SetScrollbars(20,20,25,65) 1752 #self.sizer4_4.Layout() 1753 #self.sizer4.Layout() 1754 self.Layout() 1755 #self.SetScrollbars(20,20,25,65) 1754 1756 ## save state into 1755 1757 -
sansview/perspectives/fitting/fitpage.py
reacf1d66 re2f7b92 375 375 ix = 4 376 376 ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, 377 kill_focus_callback = self._on _paramRangeEnter,378 set_focus_callback = self._on _paramRangeEnter)377 kill_focus_callback = self._onparamRangeEnter, 378 set_focus_callback = self._onparamRangeEnter) 379 379 380 380 self.sizer4_4.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 383 383 ix = 5 384 384 ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, 385 kill_focus_callback = self._on _paramRangeEnter,386 set_focus_callback = self._on _paramRangeEnter)385 kill_focus_callback = self._onparamRangeEnter, 386 set_focus_callback = self._onparamRangeEnter) 387 387 self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 388 388 … … 485 485 set_focus_callback = self._onparamRangeEnter) 486 486 self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 487 if param_max==None or not numpy.isfinite(param_max):488 ctl4.SetValue("")489 else:490 ctl4.SetValue(str(param_max))491 487 ctl4.Hide() 492 488 #if self.data.__class__.__name__ =="Data2D": … … 565 561 ix =0 566 562 iy +=1 567 self.sizer4_4.Layout()568 self.sizer4.Layout()563 #self.sizer4_4.Layout() 564 #self.sizer4.Layout() 569 565 self.Layout() 570 self.SetScrollbars(20,20,25,65)571 self.Refresh()566 #self.SetScrollbars(20,20,25,65) 567 #self.Refresh() 572 568 573 569 … … 671 667 wx.PostEvent(self.parent, event) 672 668 673 674 def _onparamRangeEnter(self, event): 675 """ 676 Check validity of value enter in the parameters range field 677 """ 678 tcrtl= event.GetEventObject() 679 if tcrtl.GetValue().lstrip().rstrip()!="": 680 681 try: 682 value = float(tcrtl.GetValue()) 683 tcrtl.SetBackgroundColour(wx.WHITE) 684 tcrtl.Refresh() 685 except: 686 tcrtl.SetBackgroundColour("pink") 687 tcrtl.Refresh() 688 return 689 else: 690 tcrtl.SetBackgroundColour(wx.WHITE) 691 tcrtl.Refresh() 692 self._onparamEnter_helper() 693 694 ##compute chisqr for range change 695 temp_smearer = None 696 if self.enable_smearer.GetValue(): 697 msg="" 698 temp_smearer= self.smearer 699 ##Calculate chi2 700 701 self.compute_chisqr(smearer= temp_smearer) 702 ## new state posted 703 if self.state_change: 704 #self._undo.Enable(True) 705 event = PageInfoEvent(page = self) 706 wx.PostEvent(self.parent, event) 707 self.state_change= False 708 709 669 710 670 def _onparamEnter(self,event): 711 671 """ … … 733 693 return 734 694 735 ### Same as _onparamRangeEnter but smear and chi^2 calculations are removed 736 ### and _onparamEnter_helper is not used, which causing mess sizer display 737 def _on_paramRangeEnter(self, event): 695 696 def _onparamRangeEnter(self, event): 738 697 """ 739 698 Check validity of value enter in the parameters range field … … 744 703 value = float(tcrtl.GetValue()) 745 704 tcrtl.SetBackgroundColour(wx.WHITE) 746 tcrtl.Refresh()747 705 except: 748 706 tcrtl.SetBackgroundColour("pink") … … 751 709 else: 752 710 tcrtl.SetBackgroundColour(wx.WHITE) 753 tcrtl.Refresh() 754 self._onparamEnter_helper() 755 711 712 is_modified = False 713 if self.model !=None: 714 # Flag to register when a parameter has changed. 715 is_modified =self._check_value_enter( self.fittable_param ,is_modified) 716 is_modified =self._check_value_enter( self.fixed_param ,is_modified) 717 is_modified =self._check_value_enter( self.parameters ,is_modified) 718 719 #self._onparamEnter_helper() 720 tcrtl.Refresh() 756 721 ## new state posted 757 if self.state_change: 722 if is_modified: 723 #self._undo.Enable(True) 724 self.save_current_state() 758 725 #self._undo.Enable(True) 759 726 event = PageInfoEvent(page = self) … … 1245 1212 ix += 1 1246 1213 ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, 1247 kill_focus_callback = self._on _paramRangeEnter,1248 set_focus_callback = self._on _paramRangeEnter)1214 kill_focus_callback = self._onparamRangeEnter, 1215 set_focus_callback = self._onparamRangeEnter) 1249 1216 1250 1217 sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 1253 1220 ix += 1 1254 1221 ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, 1255 kill_focus_callback = self._on _paramRangeEnter,1256 set_focus_callback = self._on _paramRangeEnter)1222 kill_focus_callback = self._onparamRangeEnter, 1223 set_focus_callback = self._onparamRangeEnter) 1257 1224 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 1258 1225 … … 1334 1301 ix += 1 1335 1302 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 1336 ctl2.SetValue(str(format_number(fit_errs)))1303 1337 1304 sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 1338 1305 ctl2.Hide() 1339 if self.data.__class__.__name__ !="Data2D": 1340 ctl2.Hide() 1341 else: 1342 1343 if not text2.IsShown(): 1344 text2.Show(True) 1345 ctl2.Show(True) 1306 1346 1307 1347 1308 #param_min, param_max= self.model.details[item][1:]
Note: See TracChangeset
for help on using the changeset viewer.