Changeset c13b8cc in sasview for sansview/perspectives/fitting/fitpage.py
- Timestamp:
- Nov 13, 2009 12:13:13 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:
- 4026380
- Parents:
- 35c9d31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
rc69b6d5 rc13b8cc 367 367 368 368 ix = 3 369 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style= wx.TE_PROCESS_ENTER)369 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 370 370 371 371 self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 377 377 kill_focus_callback = self._onparamRangeEnter, 378 378 text_enter_callback = self._onparamRangeEnter, 379 #mouse_up_callback = self._onparamRangeEnter,380 379 set_focus_callback = self._onparamRangeEnter) 381 380 … … 387 386 kill_focus_callback = self._onparamRangeEnter, 388 387 text_enter_callback = self._onparamRangeEnter, 389 #mouse_up_callback = self._onparamRangeEnter,390 388 set_focus_callback = self._onparamRangeEnter) 391 389 self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 470 468 471 469 ix = 3 472 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style= wx.TE_PROCESS_ENTER)470 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 473 471 474 472 self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 479 477 kill_focus_callback = self._onparamRangeEnter, 480 478 text_enter_callback = self._onparamRangeEnter, 481 #mouse_up_callback = self._onparamRangeEnter,482 479 set_focus_callback = self._onparamRangeEnter) 483 480 … … 490 487 kill_focus_callback = self._onparamRangeEnter, 491 488 text_enter_callback = self._onparamRangeEnter, 492 #mouse_up_callback = self._onparamRangeEnter,493 489 set_focus_callback = self._onparamRangeEnter) 494 490 self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 567 563 wx.PostEvent(self.parent, StatusEvent(status=\ 568 564 " Selected Distribution: Gaussian")) 569 ix =0 565 ix =0 570 566 iy +=1 571 567 #self.sizer4_4.Layout() … … 582 578 from sans.guiframe.utils import check_value 583 579 self.select_param(event =None) 584 flag = check_value( self.qmin, self.qmax) 580 #make sure all parameter values are updated. 581 flag = self._update_paramv_on_fit() #check_value( self.qmin, self.qmax) 585 582 586 583 if not flag: … … 597 594 self._clear_Err_on_Fit() 598 595 599 # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0]. 600 #ToDo: Fix this. 596 # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0]. 601 597 self.qmin_x = float(self.qmin.GetValue()) 602 self.qmax_x = float( self.qmax.GetValue())598 self.qmax_x = float( self.qmax.GetValue()) 603 599 self.manager._reset_schedule_problem( value=0) 604 600 self.manager.schedule_for_fit( value=1,page=self,fitproblem =None) … … 707 703 Check validity of value enter in the parameters range field 708 704 """ 709 is_modified = False705 is_modified = True 710 706 tcrtl= event.GetEventObject() 711 707 if tcrtl.GetValue().lstrip().rstrip()!="": … … 713 709 value = float(tcrtl.GetValue()) 714 710 tcrtl.SetBackgroundColour(wx.WHITE) 711 tcrtl.Refresh() 715 712 except: 716 713 tcrtl.SetBackgroundColour("pink") 714 tcrtl.Refresh() 717 715 return 718 716 else: 719 717 tcrtl.SetBackgroundColour(wx.WHITE) 720 718 self.save_current_state() 721 #is_modified = True719 is_modified = False 722 720 723 if notis_modified:721 if is_modified: 724 722 self._onparamEnter_helper() 725 ## new state posted 723 ## new state posted 726 724 if self.state_change: 727 725 #self._undo.Enable(True) … … 798 796 799 797 """ 798 if out == None: 799 return 800 800 #format chi2 801 801 chi2 = format_number(chisqr) 802 802 803 803 self.tcChi.SetLabel(chi2) 804 params = {}804 805 805 is_modified = False 806 806 has_error = False 807 807 808 try: 808 809 n = self.disp_box.GetCurrentSelection() … … 817 818 #set the panel when fit result are float not list 818 819 if out.__class__== numpy.float64: 819 #print "float64"820 820 self.param_toFit[0][2].SetValue(format_number(out)) 821 821 self.param_toFit[0][2].Refresh() … … 851 851 i = 0 852 852 #Set the panel when fit result are list 853 for item in self.param_toFit: 853 for item in self.param_toFit: 854 854 ## reset error value to initial state 855 855 if item[3].IsShown(): … … 857 857 if item[4].IsShown(): 858 858 item[4].Hide() 859 860 if ( out != None ) andlen(out)<=len(self.param_toFit) and i < len(out):859 860 if len(out)<=len(self.param_toFit) and i < len(out): 861 861 item[2].SetValue(format_number(self.model.getParam(item[1]))) 862 item[2].Refresh() 863 862 item[2].Refresh() 864 863 for ind in range(len(out)): 865 864 866 865 if item[1] == p_name[ind]: 867 866 break 867 868 868 869 869 if(cov !=None) and len(cov)<=len(self.param_toFit) and i < len(cov): … … 1226 1226 text2.Hide() 1227 1227 ix += 1 1228 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style= wx.TE_PROCESS_ENTER)1228 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 1229 1229 sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 1230 1230 ctl2.Hide() … … 1234 1234 kill_focus_callback = self._onparamRangeEnter, 1235 1235 text_enter_callback = self._onparamRangeEnter, 1236 #mouse_up_callback = self._onparamRangeEnter,1237 1236 set_focus_callback = self._onparamRangeEnter) 1238 1237 … … 1244 1243 kill_focus_callback = self._onparamRangeEnter, 1245 1244 text_enter_callback = self._onparamRangeEnter, 1246 #mouse_up_callback = self._onparamRangeEnter,1247 1245 set_focus_callback = self._onparamRangeEnter) 1248 1246 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 1291 1289 for item in self.model.orientation_params: 1292 1290 if not item in self.disp_list: 1293 1291 ##prepare a spot to store min max 1292 if not self.model.details.has_key(item): 1293 self.model.details [item] = ["",None,None] 1294 1294 1295 iy += 1 1295 1296 ix = 0 … … 1324 1325 text2.Hide() 1325 1326 ix += 1 1326 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style= wx.TE_PROCESS_ENTER)1327 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0) 1327 1328 1328 1329 sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 1334 1335 kill_focus_callback = self._onparamRangeEnter, 1335 1336 text_enter_callback = self._onparamRangeEnter, 1336 #mouse_up_callback = self._onparamRangeEnter,1337 1337 set_focus_callback = self._onparamRangeEnter) 1338 1338 … … 1349 1349 kill_focus_callback = self._onparamRangeEnter, 1350 1350 text_enter_callback = self._onparamRangeEnter, 1351 #mouse_up_callback = self._onparamRangeEnter,1352 1351 set_focus_callback = self._onparamRangeEnter) 1353 1352 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
Note: See TracChangeset
for help on using the changeset viewer.